Files
docker-invoiceninja/docker/app/public/bundle.40842d53.js
2024-10-19 18:17:42 +00:00

3801 lines
6.3 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 Ndt=Object.defineProperty;var Odt=(n,e,t)=>e in n?Ndt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ia=(n,e,t)=>(Odt(n,typeof e!="symbol"?e+"":e,t),t);function h5e(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 Po=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function vfe(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 f5e={exports:{}},GU={},p5e={exports:{}},Jo={};/**
* @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 J5=Symbol.for("react.element"),Pdt=Symbol.for("react.portal"),Mdt=Symbol.for("react.fragment"),Fdt=Symbol.for("react.strict_mode"),Bdt=Symbol.for("react.profiler"),$dt=Symbol.for("react.provider"),Vdt=Symbol.for("react.context"),Hdt=Symbol.for("react.forward_ref"),Wdt=Symbol.for("react.suspense"),zdt=Symbol.for("react.memo"),Udt=Symbol.for("react.lazy"),rSe=Symbol.iterator;function jdt(n){return n===null||typeof n!="object"?null:(n=rSe&&n[rSe]||n["@@iterator"],typeof n=="function"?n:null)}var g5e={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m5e=Object.assign,_5e={};function lR(n,e,t){this.props=n,this.context=e,this.refs=_5e,this.updater=t||g5e}lR.prototype.isReactComponent={};lR.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")};lR.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function v5e(){}v5e.prototype=lR.prototype;function bfe(n,e,t){this.props=n,this.context=e,this.refs=_5e,this.updater=t||g5e}var yfe=bfe.prototype=new v5e;yfe.constructor=bfe;m5e(yfe,lR.prototype);yfe.isPureReactComponent=!0;var oSe=Array.isArray,b5e=Object.prototype.hasOwnProperty,Cfe={current:null},y5e={key:!0,ref:!0,__self:!0,__source:!0};function C5e(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)b5e.call(e,i)&&!y5e.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:J5,type:n,key:o,ref:s,props:r,_owner:Cfe.current}}function qdt(n,e){return{$$typeof:J5,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function wfe(n){return typeof n=="object"&&n!==null&&n.$$typeof===J5}function Gdt(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var sSe=/\/+/g;function xX(n,e){return typeof n=="object"&&n!==null&&n.key!=null?Gdt(""+n.key):e.toString(36)}function K7(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 J5:case Pdt:s=!0}}if(s)return s=n,r=r(s),n=i===""?"."+xX(s,0):i,oSe(r)?(t="",n!=null&&(t=n.replace(sSe,"$&/")+"/"),K7(r,e,t,"",function(c){return c})):r!=null&&(wfe(r)&&(r=qdt(r,t+(!r.key||s&&s.key===r.key?"":(""+r.key).replace(sSe,"$&/")+"/")+n)),e.push(r)),1;if(s=0,i=i===""?".":i+":",oSe(n))for(var a=0;a<n.length;a++){o=n[a];var l=i+xX(o,a);s+=K7(o,e,t,l,r)}else if(l=jdt(n),typeof l=="function")for(n=l.call(n),a=0;!(o=n.next()).done;)o=o.value,l=i+xX(o,a++),s+=K7(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 ZB(n,e,t){if(n==null)return n;var i=[],r=0;return K7(n,i,"","",function(o){return e.call(t,o,r++)}),i}function Kdt(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 Zh={current:null},Y7={transition:null},Ydt={ReactCurrentDispatcher:Zh,ReactCurrentBatchConfig:Y7,ReactCurrentOwner:Cfe};Jo.Children={map:ZB,forEach:function(n,e,t){ZB(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return ZB(n,function(){e++}),e},toArray:function(n){return ZB(n,function(e){return e})||[]},only:function(n){if(!wfe(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Jo.Component=lR;Jo.Fragment=Mdt;Jo.Profiler=Bdt;Jo.PureComponent=bfe;Jo.StrictMode=Fdt;Jo.Suspense=Wdt;Jo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ydt;Jo.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=m5e({},n.props),r=n.key,o=n.ref,s=n._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=Cfe.current),e.key!==void 0&&(r=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in e)b5e.call(e,l)&&!y5e.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:J5,type:n.type,key:r,ref:o,props:i,_owner:s}};Jo.createContext=function(n){return n={$$typeof:Vdt,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:$dt,_context:n},n.Consumer=n};Jo.createElement=C5e;Jo.createFactory=function(n){var e=C5e.bind(null,n);return e.type=n,e};Jo.createRef=function(){return{current:null}};Jo.forwardRef=function(n){return{$$typeof:Hdt,render:n}};Jo.isValidElement=wfe;Jo.lazy=function(n){return{$$typeof:Udt,_payload:{_status:-1,_result:n},_init:Kdt}};Jo.memo=function(n,e){return{$$typeof:zdt,type:n,compare:e===void 0?null:e}};Jo.startTransition=function(n){var e=Y7.transition;Y7.transition={};try{n()}finally{Y7.transition=e}};Jo.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Jo.useCallback=function(n,e){return Zh.current.useCallback(n,e)};Jo.useContext=function(n){return Zh.current.useContext(n)};Jo.useDebugValue=function(){};Jo.useDeferredValue=function(n){return Zh.current.useDeferredValue(n)};Jo.useEffect=function(n,e){return Zh.current.useEffect(n,e)};Jo.useId=function(){return Zh.current.useId()};Jo.useImperativeHandle=function(n,e,t){return Zh.current.useImperativeHandle(n,e,t)};Jo.useInsertionEffect=function(n,e){return Zh.current.useInsertionEffect(n,e)};Jo.useLayoutEffect=function(n,e){return Zh.current.useLayoutEffect(n,e)};Jo.useMemo=function(n,e){return Zh.current.useMemo(n,e)};Jo.useReducer=function(n,e,t){return Zh.current.useReducer(n,e,t)};Jo.useRef=function(n){return Zh.current.useRef(n)};Jo.useState=function(n){return Zh.current.useState(n)};Jo.useSyncExternalStore=function(n,e,t){return Zh.current.useSyncExternalStore(n,e,t)};Jo.useTransition=function(){return Zh.current.useTransition()};Jo.version="18.2.0";p5e.exports=Jo;var w=p5e.exports;const ce=nl(w),Lm=h5e({__proto__:null,default:ce},[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 Qdt=w,Xdt=Symbol.for("react.element"),Zdt=Symbol.for("react.fragment"),Jdt=Object.prototype.hasOwnProperty,eht=Qdt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tht={key:!0,ref:!0,__self:!0,__source:!0};function w5e(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)Jdt.call(e,i)&&!tht.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:Xdt,type:n,key:o,ref:s,props:r,_owner:eht.current}}GU.Fragment=Zdt;GU.jsx=w5e;GU.jsxs=w5e;f5e.exports=GU;var Sfe=f5e.exports;const St=Sfe.Fragment,p=Sfe.jsx,O=Sfe.jsxs,nht="/ar-cf628795.json",iht="/bg-69a3d78f.json",rht="/ca-d725c847.json",oht="/cs-493936e5.json",sht="/da-057e80df.json",aht="/de-c1d3022c.json",lht="/el-5a2b0654.json",cht="/en-68f3da56.json",uht="/en_GB-8c899e51.json",dht="/es-27312599.json",hht="/es_ES-1ff0bb2b.json",fht="/et-810116c9.json",pht="/fa-48845f3e.json",ght="/fi-1a8031c3.json",mht="/fr-128ff27e.json",_ht="/fr_CA-b6113a9f.json",vht="/fr_CH-6b939711.json",bht="/he-1d8c4c6a.json",yht="/hr-4f73ef58.json",Cht="/hu-c741aa3b.json",wht="/it-1456bdd9.json",Sht="/ja-111f1bb7.json",Eht="/km_KH-2724671e.json",xht="/lo_LA-efe1c4d1.json",Tht="/lt-71641084.json",kht="/lv_LV-3345cb4d.json",Iht="/mk_MK-23de1655.json",Lht="/nb_NO-f529bb60.json",Dht="/nl-d1ebe20e.json",Aht="/pl-9e7a7a49.json",Rht="/pt_BR-eb6a3735.json",Nht="/pt_PT-ee79b92f.json",Oht="/ro-6abee1f2.json",Pht="/ru_RU-f508344a.json",Mht="/sk-291cb150.json",Fht="/sl-161bd22f.json",Bht="/sq-02294f93.json",$ht="/sr-204b100e.json",Vht="/sv-2dff4f06.json",Hht="/th-c46d5fd5.json",Wht="/tr_TR-6086253c.json",zht="/vi-ca9300b5.json",Uht="/zh_TW-7c86123a.json";var S5e={exports:{}},E5e={};/**
* @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 ED=w;function jht(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var qht=typeof Object.is=="function"?Object.is:jht,Ght=ED.useState,Kht=ED.useEffect,Yht=ED.useLayoutEffect,Qht=ED.useDebugValue;function Xht(n,e){var t=e(),i=Ght({inst:{value:t,getSnapshot:e}}),r=i[0].inst,o=i[1];return Yht(function(){r.value=t,r.getSnapshot=e,TX(r)&&o({inst:r})},[n,t,e]),Kht(function(){return TX(r)&&o({inst:r}),n(function(){TX(r)&&o({inst:r})})},[n]),Qht(t),t}function TX(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!qht(n,t)}catch{return!0}}function Zht(n,e){return e()}var Jht=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Zht:Xht;E5e.useSyncExternalStore=ED.useSyncExternalStore!==void 0?ED.useSyncExternalStore:Jht;S5e.exports=E5e;var x5e=S5e.exports,T5e={exports:{}},k5e={};/**
* @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 KU=w,eft=x5e;function tft(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var nft=typeof Object.is=="function"?Object.is:tft,ift=eft.useSyncExternalStore,rft=KU.useRef,oft=KU.useEffect,sft=KU.useMemo,aft=KU.useDebugValue;k5e.useSyncExternalStoreWithSelector=function(n,e,t,i,r){var o=rft(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=sft(function(){function l(f){if(!c){if(c=!0,u=f,f=i(f),r!==void 0&&s.hasValue){var g=s.value;if(r(g,f))return d=g}return d=f}if(g=d,nft(u,f))return g;var m=i(f);return r!==void 0&&r(g,m)?g:(u=f,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=ift(n,o[0],o[1]);return oft(function(){s.hasValue=!0,s.value=a},[a]),aft(a),a};T5e.exports=k5e;var lft=T5e.exports,I5e={exports:{}},Sg={},L5e={exports:{}},D5e={};/**
* @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(W,q){var V=W.length;W.push(q);e:for(;0<V;){var re=V-1>>>1,oe=W[re];if(0<r(oe,q))W[re]=q,W[V]=oe,V=re;else break e}}function t(W){return W.length===0?null:W[0]}function i(W){if(W.length===0)return null;var q=W[0],V=W.pop();if(V!==q){W[0]=V;e:for(var re=0,oe=W.length,Q=oe>>>1;re<Q;){var Ne=2*(re+1)-1,Ve=W[Ne],Ye=Ne+1,ye=W[Ye];if(0>r(Ve,V))Ye<oe&&0>r(ye,Ve)?(W[re]=ye,W[Ye]=V,re=Ye):(W[re]=Ve,W[Ne]=V,re=Ne);else if(Ye<oe&&0>r(ye,V))W[re]=ye,W[Ye]=V,re=Ye;else break e}}return q}function r(W,q){var V=W.sortIndex-q.sortIndex;return V!==0?V:W.id-q.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,f=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,_=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(W){for(var q=t(c);q!==null;){if(q.callback===null)i(c);else if(q.startTime<=W)i(c),q.sortIndex=q.expirationTime,e(l,q);else break;q=t(c)}}function C(W){if(m=!1,y(W),!g)if(t(l)!==null)g=!0,U(E);else{var q=t(c);q!==null&&H(C,q.startTime-W)}}function E(W,q){g=!1,m&&(m=!1,_(L),L=-1),f=!0;var V=h;try{for(y(q),d=t(l);d!==null&&(!(d.expirationTime>q)||W&&!N());){var re=d.callback;if(typeof re=="function"){d.callback=null,h=d.priorityLevel;var oe=re(d.expirationTime<=q);q=n.unstable_now(),typeof oe=="function"?d.callback=oe:d===t(l)&&i(l),y(q)}else i(l);d=t(l)}if(d!==null)var Q=!0;else{var Ne=t(c);Ne!==null&&H(C,Ne.startTime-q),Q=!1}return Q}finally{d=null,h=V,f=!1}}var x=!1,k=null,L=-1,D=5,A=-1;function N(){return!(n.unstable_now()-A<D)}function P(){if(k!==null){var W=n.unstable_now();A=W;var q=!0;try{q=k(!0,W)}finally{q?M():(x=!1,k=null)}}else x=!1}var M;if(typeof b=="function")M=function(){b(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,F=B.port2;B.port1.onmessage=P,M=function(){F.postMessage(null)}}else M=function(){v(P,0)};function U(W){k=W,x||(x=!0,M())}function H(W,q){L=v(function(){W(n.unstable_now())},q)}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(W){W.callback=null},n.unstable_continueExecution=function(){g||f||(g=!0,U(E))},n.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<W?Math.floor(1e3/W):5},n.unstable_getCurrentPriorityLevel=function(){return h},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(W){switch(h){case 1:case 2:case 3:var q=3;break;default:q=h}var V=h;h=q;try{return W()}finally{h=V}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(W,q){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var V=h;h=W;try{return q()}finally{h=V}},n.unstable_scheduleCallback=function(W,q,V){var re=n.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?re+V:re):V=re,W){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=V+oe,W={id:u++,callback:q,priorityLevel:W,startTime:V,expirationTime:oe,sortIndex:-1},V>re?(W.sortIndex=V,e(c,W),t(l)===null&&W===t(c)&&(m?(_(L),L=-1):m=!0,H(C,V-re))):(W.sortIndex=oe,e(l,W),g||f||(g=!0,U(E))),W},n.unstable_shouldYield=N,n.unstable_wrapCallback=function(W){var q=h;return function(){var V=h;h=q;try{return W.apply(this,arguments)}finally{h=V}}}})(D5e);L5e.exports=D5e;var cft=L5e.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 A5e=w,ug=cft;function Pn(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 R5e=new Set,d4={};function kk(n,e){xD(n,e),xD(n+"Capture",e)}function xD(n,e){for(d4[n]=e,n=0;n<e.length;n++)R5e.add(e[n])}var o1=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jne=Object.prototype.hasOwnProperty,uft=/^[: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]*$/,aSe={},lSe={};function dft(n){return jne.call(lSe,n)?!0:jne.call(aSe,n)?!1:uft.test(n)?lSe[n]=!0:(aSe[n]=!0,!1)}function hft(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 fft(n,e,t,i){if(e===null||typeof e>"u"||hft(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 Jh(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 Od={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Od[n]=new Jh(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Od[e]=new Jh(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Od[n]=new Jh(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Od[n]=new Jh(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){Od[n]=new Jh(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Od[n]=new Jh(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Od[n]=new Jh(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Od[n]=new Jh(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Od[n]=new Jh(n,5,!1,n.toLowerCase(),null,!1,!1)});var Efe=/[\-:]([a-z])/g;function xfe(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(Efe,xfe);Od[e]=new Jh(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(Efe,xfe);Od[e]=new Jh(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(Efe,xfe);Od[e]=new Jh(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Od[n]=new Jh(n,1,!1,n.toLowerCase(),null,!1,!1)});Od.xlinkHref=new Jh("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Od[n]=new Jh(n,1,!1,n.toLowerCase(),null,!0,!0)});function Tfe(n,e,t,i){var r=Od.hasOwnProperty(e)?Od[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(fft(e,t,r,i)&&(t=null),i||r===null?dft(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 T1=A5e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,JB=Symbol.for("react.element"),R2=Symbol.for("react.portal"),N2=Symbol.for("react.fragment"),kfe=Symbol.for("react.strict_mode"),qne=Symbol.for("react.profiler"),N5e=Symbol.for("react.provider"),O5e=Symbol.for("react.context"),Ife=Symbol.for("react.forward_ref"),Gne=Symbol.for("react.suspense"),Kne=Symbol.for("react.suspense_list"),Lfe=Symbol.for("react.memo"),xC=Symbol.for("react.lazy"),P5e=Symbol.for("react.offscreen"),cSe=Symbol.iterator;function zN(n){return n===null||typeof n!="object"?null:(n=cSe&&n[cSe]||n["@@iterator"],typeof n=="function"?n:null)}var Bl=Object.assign,kX;function tP(n){if(kX===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);kX=e&&e[1]||""}return`
`+kX+n}var IX=!1;function LX(n,e){if(!n||IX)return"";IX=!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{IX=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?tP(n):""}function pft(n){switch(n.tag){case 5:return tP(n.type);case 16:return tP("Lazy");case 13:return tP("Suspense");case 19:return tP("SuspenseList");case 0:case 2:case 15:return n=LX(n.type,!1),n;case 11:return n=LX(n.type.render,!1),n;case 1:return n=LX(n.type,!0),n;default:return""}}function Yne(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 N2:return"Fragment";case R2:return"Portal";case qne:return"Profiler";case kfe:return"StrictMode";case Gne:return"Suspense";case Kne:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case O5e:return(n.displayName||"Context")+".Consumer";case N5e:return(n._context.displayName||"Context")+".Provider";case Ife:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Lfe:return e=n.displayName||null,e!==null?e:Yne(n.type)||"Memo";case xC:e=n._payload,n=n._init;try{return Yne(n(e))}catch{}}return null}function gft(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 Yne(e);case 8:return e===kfe?"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 eS(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function M5e(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function mft(n){var e=M5e(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 e8(n){n._valueTracker||(n._valueTracker=mft(n))}function F5e(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=M5e(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function IV(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 Qne(n,e){var t=e.checked;return Bl({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function uSe(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=eS(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 B5e(n,e){e=e.checked,e!=null&&Tfe(n,"checked",e,!1)}function Xne(n,e){B5e(n,e);var t=eS(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")?Zne(n,e.type,t):e.hasOwnProperty("defaultValue")&&Zne(n,e.type,eS(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function dSe(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 Zne(n,e,t){(e!=="number"||IV(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var nP=Array.isArray;function LL(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=""+eS(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 Jne(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Pn(91));return Bl({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function hSe(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Pn(92));if(nP(t)){if(1<t.length)throw Error(Pn(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:eS(t)}}function $5e(n,e){var t=eS(e.value),i=eS(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 fSe(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function V5e(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 eie(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?V5e(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var t8,H5e=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(t8=t8||document.createElement("div"),t8.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=t8.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function h4(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var VP={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},_ft=["Webkit","ms","Moz","O"];Object.keys(VP).forEach(function(n){_ft.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),VP[e]=VP[n]})});function W5e(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||VP.hasOwnProperty(n)&&VP[n]?(""+e).trim():e+"px"}function z5e(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=W5e(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var vft=Bl({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 tie(n,e){if(e){if(vft[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Pn(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Pn(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Pn(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Pn(62))}}function nie(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 iie=null;function Dfe(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var rie=null,DL=null,AL=null;function pSe(n){if(n=nF(n)){if(typeof rie!="function")throw Error(Pn(280));var e=n.stateNode;e&&(e=JU(e),rie(n.stateNode,n.type,e))}}function U5e(n){DL?AL?AL.push(n):AL=[n]:DL=n}function j5e(){if(DL){var n=DL,e=AL;if(AL=DL=null,pSe(n),e)for(n=0;n<e.length;n++)pSe(e[n])}}function q5e(n,e){return n(e)}function G5e(){}var DX=!1;function K5e(n,e,t){if(DX)return n(e,t);DX=!0;try{return q5e(n,e,t)}finally{DX=!1,(DL!==null||AL!==null)&&(G5e(),j5e())}}function f4(n,e){var t=n.stateNode;if(t===null)return null;var i=JU(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(Pn(231,e,typeof t));return t}var oie=!1;if(o1)try{var UN={};Object.defineProperty(UN,"passive",{get:function(){oie=!0}}),window.addEventListener("test",UN,UN),window.removeEventListener("test",UN,UN)}catch{oie=!1}function bft(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 HP=!1,LV=null,DV=!1,sie=null,yft={onError:function(n){HP=!0,LV=n}};function Cft(n,e,t,i,r,o,s,a,l){HP=!1,LV=null,bft.apply(yft,arguments)}function wft(n,e,t,i,r,o,s,a,l){if(Cft.apply(this,arguments),HP){if(HP){var c=LV;HP=!1,LV=null}else throw Error(Pn(198));DV||(DV=!0,sie=c)}}function Ik(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 Y5e(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 gSe(n){if(Ik(n)!==n)throw Error(Pn(188))}function Sft(n){var e=n.alternate;if(!e){if(e=Ik(n),e===null)throw Error(Pn(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 gSe(r),n;if(o===i)return gSe(r),e;o=o.sibling}throw Error(Pn(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(Pn(189))}}if(t.alternate!==i)throw Error(Pn(190))}if(t.tag!==3)throw Error(Pn(188));return t.stateNode.current===t?n:e}function Q5e(n){return n=Sft(n),n!==null?X5e(n):null}function X5e(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=X5e(n);if(e!==null)return e;n=n.sibling}return null}var Z5e=ug.unstable_scheduleCallback,mSe=ug.unstable_cancelCallback,Eft=ug.unstable_shouldYield,xft=ug.unstable_requestPaint,vc=ug.unstable_now,Tft=ug.unstable_getCurrentPriorityLevel,Afe=ug.unstable_ImmediatePriority,J5e=ug.unstable_UserBlockingPriority,AV=ug.unstable_NormalPriority,kft=ug.unstable_LowPriority,eFe=ug.unstable_IdlePriority,YU=null,Wb=null;function Ift(n){if(Wb&&typeof Wb.onCommitFiberRoot=="function")try{Wb.onCommitFiberRoot(YU,n,void 0,(n.current.flags&128)===128)}catch{}}var rv=Math.clz32?Math.clz32:Aft,Lft=Math.log,Dft=Math.LN2;function Aft(n){return n>>>=0,n===0?32:31-(Lft(n)/Dft|0)|0}var n8=64,i8=4194304;function iP(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 RV(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=iP(a):(o&=s,o!==0&&(i=iP(o)))}else s=t&~r,s!==0?i=iP(s):o!==0&&(i=iP(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-rv(e),r=1<<t,i|=n[t],e&=~r;return i}function Rft(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 Nft(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,o=n.pendingLanes;0<o;){var s=31-rv(o),a=1<<s,l=r[s];l===-1?(!(a&t)||a&i)&&(r[s]=Rft(a,e)):l<=e&&(n.expiredLanes|=a),o&=~a}}function aie(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function tFe(){var n=n8;return n8<<=1,!(n8&4194240)&&(n8=64),n}function AX(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function eF(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-rv(e),n[e]=t}function Oft(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-rv(t),o=1<<r;e[r]=0,i[r]=-1,n[r]=-1,t&=~o}}function Rfe(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-rv(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}var ua=0;function nFe(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var iFe,Nfe,rFe,oFe,sFe,lie=!1,r8=[],mw=null,_w=null,vw=null,p4=new Map,g4=new Map,PC=[],Pft="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 _Se(n,e){switch(n){case"focusin":case"focusout":mw=null;break;case"dragenter":case"dragleave":_w=null;break;case"mouseover":case"mouseout":vw=null;break;case"pointerover":case"pointerout":p4.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":g4.delete(e.pointerId)}}function jN(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=nF(e),e!==null&&Nfe(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function Mft(n,e,t,i,r){switch(e){case"focusin":return mw=jN(mw,n,e,t,i,r),!0;case"dragenter":return _w=jN(_w,n,e,t,i,r),!0;case"mouseover":return vw=jN(vw,n,e,t,i,r),!0;case"pointerover":var o=r.pointerId;return p4.set(o,jN(p4.get(o)||null,n,e,t,i,r)),!0;case"gotpointercapture":return o=r.pointerId,g4.set(o,jN(g4.get(o)||null,n,e,t,i,r)),!0}return!1}function aFe(n){var e=Dx(n.target);if(e!==null){var t=Ik(e);if(t!==null){if(e=t.tag,e===13){if(e=Y5e(t),e!==null){n.blockedOn=e,sFe(n.priority,function(){rFe(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 Q7(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=cie(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);iie=i,t.target.dispatchEvent(i),iie=null}else return e=nF(t),e!==null&&Nfe(e),n.blockedOn=t,!1;e.shift()}return!0}function vSe(n,e,t){Q7(n)&&t.delete(e)}function Fft(){lie=!1,mw!==null&&Q7(mw)&&(mw=null),_w!==null&&Q7(_w)&&(_w=null),vw!==null&&Q7(vw)&&(vw=null),p4.forEach(vSe),g4.forEach(vSe)}function qN(n,e){n.blockedOn===e&&(n.blockedOn=null,lie||(lie=!0,ug.unstable_scheduleCallback(ug.unstable_NormalPriority,Fft)))}function m4(n){function e(r){return qN(r,n)}if(0<r8.length){qN(r8[0],n);for(var t=1;t<r8.length;t++){var i=r8[t];i.blockedOn===n&&(i.blockedOn=null)}}for(mw!==null&&qN(mw,n),_w!==null&&qN(_w,n),vw!==null&&qN(vw,n),p4.forEach(e),g4.forEach(e),t=0;t<PC.length;t++)i=PC[t],i.blockedOn===n&&(i.blockedOn=null);for(;0<PC.length&&(t=PC[0],t.blockedOn===null);)aFe(t),t.blockedOn===null&&PC.shift()}var RL=T1.ReactCurrentBatchConfig,NV=!0;function Bft(n,e,t,i){var r=ua,o=RL.transition;RL.transition=null;try{ua=1,Ofe(n,e,t,i)}finally{ua=r,RL.transition=o}}function $ft(n,e,t,i){var r=ua,o=RL.transition;RL.transition=null;try{ua=4,Ofe(n,e,t,i)}finally{ua=r,RL.transition=o}}function Ofe(n,e,t,i){if(NV){var r=cie(n,e,t,i);if(r===null)HX(n,e,i,OV,t),_Se(n,i);else if(Mft(r,n,e,t,i))i.stopPropagation();else if(_Se(n,i),e&4&&-1<Pft.indexOf(n)){for(;r!==null;){var o=nF(r);if(o!==null&&iFe(o),o=cie(n,e,t,i),o===null&&HX(n,e,i,OV,t),o===r)break;r=o}r!==null&&i.stopPropagation()}else HX(n,e,i,null,t)}}var OV=null;function cie(n,e,t,i){if(OV=null,n=Dfe(i),n=Dx(n),n!==null)if(e=Ik(n),e===null)n=null;else if(t=e.tag,t===13){if(n=Y5e(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 OV=n,null}function lFe(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(Tft()){case Afe:return 1;case J5e:return 4;case AV:case kft:return 16;case eFe:return 536870912;default:return 16}default:return 16}}var qC=null,Pfe=null,X7=null;function cFe(){if(X7)return X7;var n,e=Pfe,t=e.length,i,r="value"in qC?qC.value:qC.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 X7=r.slice(n,1<i?1-i:void 0)}function Z7(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 o8(){return!0}function bSe(){return!1}function Eg(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)?o8:bSe,this.isPropagationStopped=bSe,this}return Bl(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=o8)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=o8)},persist:function(){},isPersistent:o8}),e}var cR={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mfe=Eg(cR),tF=Bl({},cR,{view:0,detail:0}),Vft=Eg(tF),RX,NX,GN,QU=Bl({},tF,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ffe,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!==GN&&(GN&&n.type==="mousemove"?(RX=n.screenX-GN.screenX,NX=n.screenY-GN.screenY):NX=RX=0,GN=n),RX)},movementY:function(n){return"movementY"in n?n.movementY:NX}}),ySe=Eg(QU),Hft=Bl({},QU,{dataTransfer:0}),Wft=Eg(Hft),zft=Bl({},tF,{relatedTarget:0}),OX=Eg(zft),Uft=Bl({},cR,{animationName:0,elapsedTime:0,pseudoElement:0}),jft=Eg(Uft),qft=Bl({},cR,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Gft=Eg(qft),Kft=Bl({},cR,{data:0}),CSe=Eg(Kft),Yft={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qft={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"},Xft={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zft(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=Xft[n])?!!e[n]:!1}function Ffe(){return Zft}var Jft=Bl({},tF,{key:function(n){if(n.key){var e=Yft[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Z7(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Qft[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ffe,charCode:function(n){return n.type==="keypress"?Z7(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Z7(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),ept=Eg(Jft),tpt=Bl({},QU,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wSe=Eg(tpt),npt=Bl({},tF,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ffe}),ipt=Eg(npt),rpt=Bl({},cR,{propertyName:0,elapsedTime:0,pseudoElement:0}),opt=Eg(rpt),spt=Bl({},QU,{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}),apt=Eg(spt),lpt=[9,13,27,32],Bfe=o1&&"CompositionEvent"in window,WP=null;o1&&"documentMode"in document&&(WP=document.documentMode);var cpt=o1&&"TextEvent"in window&&!WP,uFe=o1&&(!Bfe||WP&&8<WP&&11>=WP),SSe=String.fromCharCode(32),ESe=!1;function dFe(n,e){switch(n){case"keyup":return lpt.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hFe(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var O2=!1;function upt(n,e){switch(n){case"compositionend":return hFe(e);case"keypress":return e.which!==32?null:(ESe=!0,SSe);case"textInput":return n=e.data,n===SSe&&ESe?null:n;default:return null}}function dpt(n,e){if(O2)return n==="compositionend"||!Bfe&&dFe(n,e)?(n=cFe(),X7=Pfe=qC=null,O2=!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 uFe&&e.locale!=="ko"?null:e.data;default:return null}}var hpt={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 xSe(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!hpt[n.type]:e==="textarea"}function fFe(n,e,t,i){U5e(i),e=PV(e,"onChange"),0<e.length&&(t=new Mfe("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var zP=null,_4=null;function fpt(n){EFe(n,0)}function XU(n){var e=F2(n);if(F5e(e))return n}function ppt(n,e){if(n==="change")return e}var pFe=!1;if(o1){var PX;if(o1){var MX="oninput"in document;if(!MX){var TSe=document.createElement("div");TSe.setAttribute("oninput","return;"),MX=typeof TSe.oninput=="function"}PX=MX}else PX=!1;pFe=PX&&(!document.documentMode||9<document.documentMode)}function kSe(){zP&&(zP.detachEvent("onpropertychange",gFe),_4=zP=null)}function gFe(n){if(n.propertyName==="value"&&XU(_4)){var e=[];fFe(e,_4,n,Dfe(n)),K5e(fpt,e)}}function gpt(n,e,t){n==="focusin"?(kSe(),zP=e,_4=t,zP.attachEvent("onpropertychange",gFe)):n==="focusout"&&kSe()}function mpt(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return XU(_4)}function _pt(n,e){if(n==="click")return XU(e)}function vpt(n,e){if(n==="input"||n==="change")return XU(e)}function bpt(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var mv=typeof Object.is=="function"?Object.is:bpt;function v4(n,e){if(mv(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(!jne.call(e,r)||!mv(n[r],e[r]))return!1}return!0}function ISe(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function LSe(n,e){var t=ISe(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=ISe(t)}}function mFe(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?mFe(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function _Fe(){for(var n=window,e=IV();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=IV(n.document)}return e}function $fe(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 ypt(n){var e=_Fe(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&mFe(t.ownerDocument.documentElement,t)){if(i!==null&&$fe(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=LSe(t,o);var s=LSe(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 Cpt=o1&&"documentMode"in document&&11>=document.documentMode,P2=null,uie=null,UP=null,die=!1;function DSe(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;die||P2==null||P2!==IV(i)||(i=P2,"selectionStart"in i&&$fe(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}),UP&&v4(UP,i)||(UP=i,i=PV(uie,"onSelect"),0<i.length&&(e=new Mfe("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=P2)))}function s8(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var M2={animationend:s8("Animation","AnimationEnd"),animationiteration:s8("Animation","AnimationIteration"),animationstart:s8("Animation","AnimationStart"),transitionend:s8("Transition","TransitionEnd")},FX={},vFe={};o1&&(vFe=document.createElement("div").style,"AnimationEvent"in window||(delete M2.animationend.animation,delete M2.animationiteration.animation,delete M2.animationstart.animation),"TransitionEvent"in window||delete M2.transitionend.transition);function ZU(n){if(FX[n])return FX[n];if(!M2[n])return n;var e=M2[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in vFe)return FX[n]=e[t];return n}var bFe=ZU("animationend"),yFe=ZU("animationiteration"),CFe=ZU("animationstart"),wFe=ZU("transitionend"),SFe=new Map,ASe="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 VS(n,e){SFe.set(n,e),kk(e,[n])}for(var BX=0;BX<ASe.length;BX++){var $X=ASe[BX],wpt=$X.toLowerCase(),Spt=$X[0].toUpperCase()+$X.slice(1);VS(wpt,"on"+Spt)}VS(bFe,"onAnimationEnd");VS(yFe,"onAnimationIteration");VS(CFe,"onAnimationStart");VS("dblclick","onDoubleClick");VS("focusin","onFocus");VS("focusout","onBlur");VS(wFe,"onTransitionEnd");xD("onMouseEnter",["mouseout","mouseover"]);xD("onMouseLeave",["mouseout","mouseover"]);xD("onPointerEnter",["pointerout","pointerover"]);xD("onPointerLeave",["pointerout","pointerover"]);kk("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));kk("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));kk("onBeforeInput",["compositionend","keypress","textInput","paste"]);kk("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));kk("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));kk("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rP="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(" "),Ept=new Set("cancel close invalid load scroll toggle".split(" ").concat(rP));function RSe(n,e,t){var i=n.type||"unknown-event";n.currentTarget=t,wft(i,e,void 0,n),n.currentTarget=null}function EFe(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;RSe(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;RSe(r,a,c),o=l}}}if(DV)throw n=sie,DV=!1,sie=null,n}function sl(n,e){var t=e[mie];t===void 0&&(t=e[mie]=new Set);var i=n+"__bubble";t.has(i)||(xFe(e,n,2,!1),t.add(i))}function VX(n,e,t){var i=0;e&&(i|=4),xFe(t,n,i,e)}var a8="_reactListening"+Math.random().toString(36).slice(2);function b4(n){if(!n[a8]){n[a8]=!0,R5e.forEach(function(t){t!=="selectionchange"&&(Ept.has(t)||VX(t,!1,n),VX(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[a8]||(e[a8]=!0,VX("selectionchange",!1,e))}}function xFe(n,e,t,i){switch(lFe(e)){case 1:var r=Bft;break;case 4:r=$ft;break;default:r=Ofe}t=r.bind(null,e,t,n),r=void 0,!oie||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 HX(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=Dx(a),s===null)return;if(l=s.tag,l===5||l===6){i=o=s;continue e}a=a.parentNode}}i=i.return}K5e(function(){var c=o,u=Dfe(t),d=[];e:{var h=SFe.get(n);if(h!==void 0){var f=Mfe,g=n;switch(n){case"keypress":if(Z7(t)===0)break e;case"keydown":case"keyup":f=ept;break;case"focusin":g="focus",f=OX;break;case"focusout":g="blur",f=OX;break;case"beforeblur":case"afterblur":f=OX;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":f=ySe;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=Wft;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=ipt;break;case bFe:case yFe:case CFe:f=jft;break;case wFe:f=opt;break;case"scroll":f=Vft;break;case"wheel":f=apt;break;case"copy":case"cut":case"paste":f=Gft;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=wSe}var m=(e&4)!==0,v=!m&&n==="scroll",_=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,_!==null&&(C=f4(b,_),C!=null&&m.push(y4(b,C,y)))),v)break;b=b.return}0<m.length&&(h=new f(h,g,null,t,u),d.push({event:h,listeners:m}))}}if(!(e&7)){e:{if(h=n==="mouseover"||n==="pointerover",f=n==="mouseout"||n==="pointerout",h&&t!==iie&&(g=t.relatedTarget||t.fromElement)&&(Dx(g)||g[s1]))break e;if((f||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,f?(g=t.relatedTarget||t.toElement,f=c,g=g?Dx(g):null,g!==null&&(v=Ik(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(f=null,g=c),f!==g)){if(m=ySe,C="onMouseLeave",_="onMouseEnter",b="mouse",(n==="pointerout"||n==="pointerover")&&(m=wSe,C="onPointerLeave",_="onPointerEnter",b="pointer"),v=f==null?h:F2(f),y=g==null?h:F2(g),h=new m(C,b+"leave",f,t,u),h.target=v,h.relatedTarget=y,C=null,Dx(u)===c&&(m=new m(_,b+"enter",g,t,u),m.target=y,m.relatedTarget=v,C=m),v=C,f&&g)t:{for(m=f,_=g,b=0,y=m;y;y=LI(y))b++;for(y=0,C=_;C;C=LI(C))y++;for(;0<b-y;)m=LI(m),b--;for(;0<y-b;)_=LI(_),y--;for(;b--;){if(m===_||_!==null&&m===_.alternate)break t;m=LI(m),_=LI(_)}m=null}else m=null;f!==null&&NSe(d,h,f,m,!1),g!==null&&v!==null&&NSe(d,v,g,m,!0)}}e:{if(h=c?F2(c):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var E=ppt;else if(xSe(h))if(pFe)E=vpt;else{E=mpt;var x=gpt}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(E=_pt);if(E&&(E=E(n,c))){fFe(d,E,t,u);break e}x&&x(n,h,c),n==="focusout"&&(x=h._wrapperState)&&x.controlled&&h.type==="number"&&Zne(h,"number",h.value)}switch(x=c?F2(c):window,n){case"focusin":(xSe(x)||x.contentEditable==="true")&&(P2=x,uie=c,UP=null);break;case"focusout":UP=uie=P2=null;break;case"mousedown":die=!0;break;case"contextmenu":case"mouseup":case"dragend":die=!1,DSe(d,t,u);break;case"selectionchange":if(Cpt)break;case"keydown":case"keyup":DSe(d,t,u)}var k;if(Bfe)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 O2?dFe(n,t)&&(L="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(L="onCompositionStart");L&&(uFe&&t.locale!=="ko"&&(O2||L!=="onCompositionStart"?L==="onCompositionEnd"&&O2&&(k=cFe()):(qC=u,Pfe="value"in qC?qC.value:qC.textContent,O2=!0)),x=PV(c,L),0<x.length&&(L=new CSe(L,n,null,t,u),d.push({event:L,listeners:x}),k?L.data=k:(k=hFe(t),k!==null&&(L.data=k)))),(k=cpt?upt(n,t):dpt(n,t))&&(c=PV(c,"onBeforeInput"),0<c.length&&(u=new CSe("onBeforeInput","beforeinput",null,t,u),d.push({event:u,listeners:c}),u.data=k))}EFe(d,e)})}function y4(n,e,t){return{instance:n,listener:e,currentTarget:t}}function PV(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,o=r.stateNode;r.tag===5&&o!==null&&(r=o,o=f4(n,t),o!=null&&i.unshift(y4(n,o,r)),o=f4(n,e),o!=null&&i.push(y4(n,o,r))),n=n.return}return i}function LI(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function NSe(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=f4(t,o),l!=null&&s.unshift(y4(t,l,a))):r||(l=f4(t,o),l!=null&&s.push(y4(t,l,a)))),t=t.return}s.length!==0&&n.push({event:e,listeners:s})}var xpt=/\r\n?/g,Tpt=/\u0000|\uFFFD/g;function OSe(n){return(typeof n=="string"?n:""+n).replace(xpt,`
`).replace(Tpt,"")}function l8(n,e,t){if(e=OSe(e),OSe(n)!==e&&t)throw Error(Pn(425))}function MV(){}var hie=null,fie=null;function pie(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 gie=typeof setTimeout=="function"?setTimeout:void 0,kpt=typeof clearTimeout=="function"?clearTimeout:void 0,PSe=typeof Promise=="function"?Promise:void 0,Ipt=typeof queueMicrotask=="function"?queueMicrotask:typeof PSe<"u"?function(n){return PSe.resolve(null).then(n).catch(Lpt)}:gie;function Lpt(n){setTimeout(function(){throw n})}function WX(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),m4(e);return}i--}else t!=="$"&&t!=="$?"&&t!=="$!"||i++;t=r}while(t);m4(e)}function bw(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 MSe(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 uR=Math.random().toString(36).slice(2),db="__reactFiber$"+uR,C4="__reactProps$"+uR,s1="__reactContainer$"+uR,mie="__reactEvents$"+uR,Dpt="__reactListeners$"+uR,Apt="__reactHandles$"+uR;function Dx(n){var e=n[db];if(e)return e;for(var t=n.parentNode;t;){if(e=t[s1]||t[db]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=MSe(n);n!==null;){if(t=n[db])return t;n=MSe(n)}return e}n=t,t=n.parentNode}return null}function nF(n){return n=n[db]||n[s1],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function F2(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Pn(33))}function JU(n){return n[C4]||null}var _ie=[],B2=-1;function HS(n){return{current:n}}function fl(n){0>B2||(n.current=_ie[B2],_ie[B2]=null,B2--)}function Xa(n,e){B2++,_ie[B2]=n.current,n.current=e}var tS={},lh=HS(tS),Bf=HS(!1),ET=tS;function TD(n,e){var t=n.type.contextTypes;if(!t)return tS;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 $f(n){return n=n.childContextTypes,n!=null}function FV(){fl(Bf),fl(lh)}function FSe(n,e,t){if(lh.current!==tS)throw Error(Pn(168));Xa(lh,e),Xa(Bf,t)}function TFe(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(Pn(108,gft(n)||"Unknown",r));return Bl({},t,i)}function BV(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||tS,ET=lh.current,Xa(lh,n),Xa(Bf,Bf.current),!0}function BSe(n,e,t){var i=n.stateNode;if(!i)throw Error(Pn(169));t?(n=TFe(n,e,ET),i.__reactInternalMemoizedMergedChildContext=n,fl(Bf),fl(lh),Xa(lh,n)):fl(Bf),Xa(Bf,t)}var py=null,ej=!1,zX=!1;function kFe(n){py===null?py=[n]:py.push(n)}function Rpt(n){ej=!0,kFe(n)}function WS(){if(!zX&&py!==null){zX=!0;var n=0,e=ua;try{var t=py;for(ua=1;n<t.length;n++){var i=t[n];do i=i(!0);while(i!==null)}py=null,ej=!1}catch(r){throw py!==null&&(py=py.slice(n+1)),Z5e(Afe,WS),r}finally{ua=e,zX=!1}}return null}var $2=[],V2=0,$V=null,VV=0,am=[],lm=0,xT=null,ky=1,Iy="";function jE(n,e){$2[V2++]=VV,$2[V2++]=$V,$V=n,VV=e}function IFe(n,e,t){am[lm++]=ky,am[lm++]=Iy,am[lm++]=xT,xT=n;var i=ky;n=Iy;var r=32-rv(i)-1;i&=~(1<<r),t+=1;var o=32-rv(e)+r;if(30<o){var s=r-r%5;o=(i&(1<<s)-1).toString(32),i>>=s,r-=s,ky=1<<32-rv(e)+r|t<<r|i,Iy=o+n}else ky=1<<o|t<<r|i,Iy=n}function Vfe(n){n.return!==null&&(jE(n,1),IFe(n,1,0))}function Hfe(n){for(;n===$V;)$V=$2[--V2],$2[V2]=null,VV=$2[--V2],$2[V2]=null;for(;n===xT;)xT=am[--lm],am[lm]=null,Iy=am[--lm],am[lm]=null,ky=am[--lm],am[lm]=null}var tg=null,Up=null,wl=!1,M_=null;function LFe(n,e){var t=dm(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 $Se(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,tg=n,Up=bw(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,tg=n,Up=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=xT!==null?{id:ky,overflow:Iy}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=dm(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,tg=n,Up=null,!0):!1;default:return!1}}function vie(n){return(n.mode&1)!==0&&(n.flags&128)===0}function bie(n){if(wl){var e=Up;if(e){var t=e;if(!$Se(n,e)){if(vie(n))throw Error(Pn(418));e=bw(t.nextSibling);var i=tg;e&&$Se(n,e)?LFe(i,t):(n.flags=n.flags&-4097|2,wl=!1,tg=n)}}else{if(vie(n))throw Error(Pn(418));n.flags=n.flags&-4097|2,wl=!1,tg=n}}}function VSe(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;tg=n}function c8(n){if(n!==tg)return!1;if(!wl)return VSe(n),wl=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!pie(n.type,n.memoizedProps)),e&&(e=Up)){if(vie(n))throw DFe(),Error(Pn(418));for(;e;)LFe(n,e),e=bw(e.nextSibling)}if(VSe(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Pn(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Up=bw(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Up=null}}else Up=tg?bw(n.stateNode.nextSibling):null;return!0}function DFe(){for(var n=Up;n;)n=bw(n.nextSibling)}function kD(){Up=tg=null,wl=!1}function Wfe(n){M_===null?M_=[n]:M_.push(n)}var Npt=T1.ReactCurrentBatchConfig;function x_(n,e){if(n&&n.defaultProps){e=Bl({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var HV=HS(null),WV=null,H2=null,zfe=null;function Ufe(){zfe=H2=WV=null}function jfe(n){var e=HV.current;fl(HV),n._currentValue=e}function yie(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 NL(n,e){WV=n,zfe=H2=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Lf=!0),n.firstContext=null)}function Dm(n){var e=n._currentValue;if(zfe!==n)if(n={context:n,memoizedValue:e,next:null},H2===null){if(WV===null)throw Error(Pn(308));H2=n,WV.dependencies={lanes:0,firstContext:n}}else H2=H2.next=n;return e}var Ax=null;function qfe(n){Ax===null?Ax=[n]:Ax.push(n)}function AFe(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,qfe(e)):(t.next=r.next,r.next=t),e.interleaved=t,a1(n,i)}function a1(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 TC=!1;function Gfe(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function RFe(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 yw(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,ws&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,a1(n,t)}return r=i.interleaved,r===null?(e.next=e,qfe(i)):(e.next=r.next,r.next=e),i.interleaved=e,a1(n,t)}function J7(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,Rfe(n,t)}}function HSe(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 zV(n,e,t,i){var r=n.updateQueue;TC=!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,f=a.eventTime;if((i&h)===h){u!==null&&(u=u.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,m=a;switch(h=e,f=t,m.tag){case 1:if(g=m.payload,typeof g=="function"){d=g.call(f,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(f,d,h):g,h==null)break e;d=Bl({},d,h);break e;case 2:TC=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=f,l=d):u=u.next=f,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);kT|=s,n.lanes=s,n.memoizedState=d}}function WSe(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(Pn(191,r));r.call(i)}}}var NFe=new A5e.Component().refs;function Cie(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:Bl({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var tj={isMounted:function(n){return(n=n._reactInternals)?Ik(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var i=Vh(),r=ww(n),o=jy(i,r);o.payload=e,t!=null&&(o.callback=t),e=yw(n,o,r),e!==null&&(ov(e,n,r,i),J7(e,n,r))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=Vh(),r=ww(n),o=jy(i,r);o.tag=1,o.payload=e,t!=null&&(o.callback=t),e=yw(n,o,r),e!==null&&(ov(e,n,r,i),J7(e,n,r))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Vh(),i=ww(n),r=jy(t,i);r.tag=2,e!=null&&(r.callback=e),e=yw(n,r,i),e!==null&&(ov(e,n,i,t),J7(e,n,i))}};function zSe(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?!v4(t,i)||!v4(r,o):!0}function OFe(n,e,t){var i=!1,r=tS,o=e.contextType;return typeof o=="object"&&o!==null?o=Dm(o):(r=$f(e)?ET:lh.current,i=e.contextTypes,o=(i=i!=null)?TD(n,r):tS),e=new e(t,o),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=tj,n.stateNode=e,e._reactInternals=n,i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=o),e}function USe(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&&tj.enqueueReplaceState(e,e.state,null)}function wie(n,e,t,i){var r=n.stateNode;r.props=t,r.state=n.memoizedState,r.refs=NFe,Gfe(n);var o=e.contextType;typeof o=="object"&&o!==null?r.context=Dm(o):(o=$f(e)?ET:lh.current,r.context=TD(n,o)),r.state=n.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Cie(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&&tj.enqueueReplaceState(r,r.state,null),zV(n,t,r,i),r.state=n.memoizedState),typeof r.componentDidMount=="function"&&(n.flags|=4194308)}function KN(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(Pn(309));var i=t.stateNode}if(!i)throw Error(Pn(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===NFe&&(a=r.refs={}),s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof n!="string")throw Error(Pn(284));if(!t._owner)throw Error(Pn(290,n))}return n}function u8(n,e){throw n=Object.prototype.toString.call(e),Error(Pn(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function jSe(n){var e=n._init;return e(n._payload)}function PFe(n){function e(_,b){if(n){var y=_.deletions;y===null?(_.deletions=[b],_.flags|=16):y.push(b)}}function t(_,b){if(!n)return null;for(;b!==null;)e(_,b),b=b.sibling;return null}function i(_,b){for(_=new Map;b!==null;)b.key!==null?_.set(b.key,b):_.set(b.index,b),b=b.sibling;return _}function r(_,b){return _=Sw(_,b),_.index=0,_.sibling=null,_}function o(_,b,y){return _.index=y,n?(y=_.alternate,y!==null?(y=y.index,y<b?(_.flags|=2,b):y):(_.flags|=2,b)):(_.flags|=1048576,b)}function s(_){return n&&_.alternate===null&&(_.flags|=2),_}function a(_,b,y,C){return b===null||b.tag!==6?(b=QX(y,_.mode,C),b.return=_,b):(b=r(b,y),b.return=_,b)}function l(_,b,y,C){var E=y.type;return E===N2?u(_,b,y.props.children,C,y.key):b!==null&&(b.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===xC&&jSe(E)===b.type)?(C=r(b,y.props),C.ref=KN(_,b,y),C.return=_,C):(C=o$(y.type,y.key,y.props,null,_.mode,C),C.ref=KN(_,b,y),C.return=_,C)}function c(_,b,y,C){return b===null||b.tag!==4||b.stateNode.containerInfo!==y.containerInfo||b.stateNode.implementation!==y.implementation?(b=XX(y,_.mode,C),b.return=_,b):(b=r(b,y.children||[]),b.return=_,b)}function u(_,b,y,C,E){return b===null||b.tag!==7?(b=Jx(y,_.mode,C,E),b.return=_,b):(b=r(b,y),b.return=_,b)}function d(_,b,y){if(typeof b=="string"&&b!==""||typeof b=="number")return b=QX(""+b,_.mode,y),b.return=_,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case JB:return y=o$(b.type,b.key,b.props,null,_.mode,y),y.ref=KN(_,null,b),y.return=_,y;case R2:return b=XX(b,_.mode,y),b.return=_,b;case xC:var C=b._init;return d(_,C(b._payload),y)}if(nP(b)||zN(b))return b=Jx(b,_.mode,y,null),b.return=_,b;u8(_,b)}return null}function h(_,b,y,C){var E=b!==null?b.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:a(_,b,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case JB:return y.key===E?l(_,b,y,C):null;case R2:return y.key===E?c(_,b,y,C):null;case xC:return E=y._init,h(_,b,E(y._payload),C)}if(nP(y)||zN(y))return E!==null?null:u(_,b,y,C,null);u8(_,y)}return null}function f(_,b,y,C,E){if(typeof C=="string"&&C!==""||typeof C=="number")return _=_.get(y)||null,a(b,_,""+C,E);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case JB:return _=_.get(C.key===null?y:C.key)||null,l(b,_,C,E);case R2:return _=_.get(C.key===null?y:C.key)||null,c(b,_,C,E);case xC:var x=C._init;return f(_,b,y,x(C._payload),E)}if(nP(C)||zN(C))return _=_.get(y)||null,u(b,_,C,E,null);u8(b,C)}return null}function g(_,b,y,C){for(var E=null,x=null,k=b,L=b=0,D=null;k!==null&&L<y.length;L++){k.index>L?(D=k,k=null):D=k.sibling;var A=h(_,k,y[L],C);if(A===null){k===null&&(k=D);break}n&&k&&A.alternate===null&&e(_,k),b=o(A,b,L),x===null?E=A:x.sibling=A,x=A,k=D}if(L===y.length)return t(_,k),wl&&jE(_,L),E;if(k===null){for(;L<y.length;L++)k=d(_,y[L],C),k!==null&&(b=o(k,b,L),x===null?E=k:x.sibling=k,x=k);return wl&&jE(_,L),E}for(k=i(_,k);L<y.length;L++)D=f(k,_,L,y[L],C),D!==null&&(n&&D.alternate!==null&&k.delete(D.key===null?L:D.key),b=o(D,b,L),x===null?E=D:x.sibling=D,x=D);return n&&k.forEach(function(N){return e(_,N)}),wl&&jE(_,L),E}function m(_,b,y,C){var E=zN(y);if(typeof E!="function")throw Error(Pn(150));if(y=E.call(y),y==null)throw Error(Pn(151));for(var x=E=null,k=b,L=b=0,D=null,A=y.next();k!==null&&!A.done;L++,A=y.next()){k.index>L?(D=k,k=null):D=k.sibling;var N=h(_,k,A.value,C);if(N===null){k===null&&(k=D);break}n&&k&&N.alternate===null&&e(_,k),b=o(N,b,L),x===null?E=N:x.sibling=N,x=N,k=D}if(A.done)return t(_,k),wl&&jE(_,L),E;if(k===null){for(;!A.done;L++,A=y.next())A=d(_,A.value,C),A!==null&&(b=o(A,b,L),x===null?E=A:x.sibling=A,x=A);return wl&&jE(_,L),E}for(k=i(_,k);!A.done;L++,A=y.next())A=f(k,_,L,A.value,C),A!==null&&(n&&A.alternate!==null&&k.delete(A.key===null?L:A.key),b=o(A,b,L),x===null?E=A:x.sibling=A,x=A);return n&&k.forEach(function(P){return e(_,P)}),wl&&jE(_,L),E}function v(_,b,y,C){if(typeof y=="object"&&y!==null&&y.type===N2&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case JB:e:{for(var E=y.key,x=b;x!==null;){if(x.key===E){if(E=y.type,E===N2){if(x.tag===7){t(_,x.sibling),b=r(x,y.props.children),b.return=_,_=b;break e}}else if(x.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===xC&&jSe(E)===x.type){t(_,x.sibling),b=r(x,y.props),b.ref=KN(_,x,y),b.return=_,_=b;break e}t(_,x);break}else e(_,x);x=x.sibling}y.type===N2?(b=Jx(y.props.children,_.mode,C,y.key),b.return=_,_=b):(C=o$(y.type,y.key,y.props,null,_.mode,C),C.ref=KN(_,b,y),C.return=_,_=C)}return s(_);case R2:e:{for(x=y.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){t(_,b.sibling),b=r(b,y.children||[]),b.return=_,_=b;break e}else{t(_,b);break}else e(_,b);b=b.sibling}b=XX(y,_.mode,C),b.return=_,_=b}return s(_);case xC:return x=y._init,v(_,b,x(y._payload),C)}if(nP(y))return g(_,b,y,C);if(zN(y))return m(_,b,y,C);u8(_,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(t(_,b.sibling),b=r(b,y),b.return=_,_=b):(t(_,b),b=QX(y,_.mode,C),b.return=_,_=b),s(_)):t(_,b)}return v}var ID=PFe(!0),MFe=PFe(!1),iF={},zb=HS(iF),w4=HS(iF),S4=HS(iF);function Rx(n){if(n===iF)throw Error(Pn(174));return n}function Kfe(n,e){switch(Xa(S4,e),Xa(w4,n),Xa(zb,iF),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:eie(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=eie(e,n)}fl(zb),Xa(zb,e)}function LD(){fl(zb),fl(w4),fl(S4)}function FFe(n){Rx(S4.current);var e=Rx(zb.current),t=eie(e,n.type);e!==t&&(Xa(w4,n),Xa(zb,t))}function Yfe(n){w4.current===n&&(fl(zb),fl(w4))}var Al=HS(0);function UV(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 UX=[];function Qfe(){for(var n=0;n<UX.length;n++)UX[n]._workInProgressVersionPrimary=null;UX.length=0}var e$=T1.ReactCurrentDispatcher,jX=T1.ReactCurrentBatchConfig,TT=0,Ml=null,uu=null,$u=null,jV=!1,jP=!1,E4=0,Opt=0;function zd(){throw Error(Pn(321))}function Xfe(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!mv(n[t],e[t]))return!1;return!0}function Zfe(n,e,t,i,r,o){if(TT=o,Ml=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,e$.current=n===null||n.memoizedState===null?Bpt:$pt,n=t(i,r),jP){o=0;do{if(jP=!1,E4=0,25<=o)throw Error(Pn(301));o+=1,$u=uu=null,e.updateQueue=null,e$.current=Vpt,n=t(i,r)}while(jP)}if(e$.current=qV,e=uu!==null&&uu.next!==null,TT=0,$u=uu=Ml=null,jV=!1,e)throw Error(Pn(300));return n}function Jfe(){var n=E4!==0;return E4=0,n}function Yv(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $u===null?Ml.memoizedState=$u=n:$u=$u.next=n,$u}function Am(){if(uu===null){var n=Ml.alternate;n=n!==null?n.memoizedState:null}else n=uu.next;var e=$u===null?Ml.memoizedState:$u.next;if(e!==null)$u=e,uu=n;else{if(n===null)throw Error(Pn(310));uu=n,n={memoizedState:uu.memoizedState,baseState:uu.baseState,baseQueue:uu.baseQueue,queue:uu.queue,next:null},$u===null?Ml.memoizedState=$u=n:$u=$u.next=n}return $u}function x4(n,e){return typeof e=="function"?e(n):e}function qX(n){var e=Am(),t=e.queue;if(t===null)throw Error(Pn(311));t.lastRenderedReducer=n;var i=uu,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((TT&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,Ml.lanes|=u,kT|=u}c=c.next}while(c!==null&&c!==o);l===null?s=i:l.next=a,mv(i,e.memoizedState)||(Lf=!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,Ml.lanes|=o,kT|=o,r=r.next;while(r!==n)}else r===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function GX(n){var e=Am(),t=e.queue;if(t===null)throw Error(Pn(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);mv(o,e.memoizedState)||(Lf=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),t.lastRenderedState=o}return[o,i]}function BFe(){}function $Fe(n,e){var t=Ml,i=Am(),r=e(),o=!mv(i.memoizedState,r);if(o&&(i.memoizedState=r,Lf=!0),i=i.queue,epe(WFe.bind(null,t,i,n),[n]),i.getSnapshot!==e||o||$u!==null&&$u.memoizedState.tag&1){if(t.flags|=2048,T4(9,HFe.bind(null,t,i,r,e),void 0,null),qu===null)throw Error(Pn(349));TT&30||VFe(t,e,r)}return r}function VFe(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=Ml.updateQueue,e===null?(e={lastEffect:null,stores:null},Ml.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function HFe(n,e,t,i){e.value=t,e.getSnapshot=i,zFe(e)&&UFe(n)}function WFe(n,e,t){return t(function(){zFe(e)&&UFe(n)})}function zFe(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!mv(n,t)}catch{return!0}}function UFe(n){var e=a1(n,1);e!==null&&ov(e,n,1,-1)}function qSe(n){var e=Yv();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:x4,lastRenderedState:n},e.queue=n,n=n.dispatch=Fpt.bind(null,Ml,n),[e.memoizedState,n]}function T4(n,e,t,i){return n={tag:n,create:e,destroy:t,deps:i,next:null},e=Ml.updateQueue,e===null?(e={lastEffect:null,stores:null},Ml.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 jFe(){return Am().memoizedState}function t$(n,e,t,i){var r=Yv();Ml.flags|=n,r.memoizedState=T4(1|e,t,void 0,i===void 0?null:i)}function nj(n,e,t,i){var r=Am();i=i===void 0?null:i;var o=void 0;if(uu!==null){var s=uu.memoizedState;if(o=s.destroy,i!==null&&Xfe(i,s.deps)){r.memoizedState=T4(e,t,o,i);return}}Ml.flags|=n,r.memoizedState=T4(1|e,t,o,i)}function GSe(n,e){return t$(8390656,8,n,e)}function epe(n,e){return nj(2048,8,n,e)}function qFe(n,e){return nj(4,2,n,e)}function GFe(n,e){return nj(4,4,n,e)}function KFe(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 YFe(n,e,t){return t=t!=null?t.concat([n]):null,nj(4,4,KFe.bind(null,e,n),t)}function tpe(){}function QFe(n,e){var t=Am();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&Xfe(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function XFe(n,e){var t=Am();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&Xfe(e,i[1])?i[0]:(n=n(),t.memoizedState=[n,e],n)}function ZFe(n,e,t){return TT&21?(mv(t,e)||(t=tFe(),Ml.lanes|=t,kT|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Lf=!0),n.memoizedState=t)}function Ppt(n,e){var t=ua;ua=t!==0&&4>t?t:4,n(!0);var i=jX.transition;jX.transition={};try{n(!1),e()}finally{ua=t,jX.transition=i}}function JFe(){return Am().memoizedState}function Mpt(n,e,t){var i=ww(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},e6e(n))t6e(e,t);else if(t=AFe(n,e,t,i),t!==null){var r=Vh();ov(t,n,i,r),n6e(t,e,i)}}function Fpt(n,e,t){var i=ww(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(e6e(n))t6e(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,mv(a,s)){var l=e.interleaved;l===null?(r.next=r,qfe(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=AFe(n,e,r,i),t!==null&&(r=Vh(),ov(t,n,i,r),n6e(t,e,i))}}function e6e(n){var e=n.alternate;return n===Ml||e!==null&&e===Ml}function t6e(n,e){jP=jV=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function n6e(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Rfe(n,t)}}var qV={readContext:Dm,useCallback:zd,useContext:zd,useEffect:zd,useImperativeHandle:zd,useInsertionEffect:zd,useLayoutEffect:zd,useMemo:zd,useReducer:zd,useRef:zd,useState:zd,useDebugValue:zd,useDeferredValue:zd,useTransition:zd,useMutableSource:zd,useSyncExternalStore:zd,useId:zd,unstable_isNewReconciler:!1},Bpt={readContext:Dm,useCallback:function(n,e){return Yv().memoizedState=[n,e===void 0?null:e],n},useContext:Dm,useEffect:GSe,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,t$(4194308,4,KFe.bind(null,e,n),t)},useLayoutEffect:function(n,e){return t$(4194308,4,n,e)},useInsertionEffect:function(n,e){return t$(4,2,n,e)},useMemo:function(n,e){var t=Yv();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Yv();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=Mpt.bind(null,Ml,n),[i.memoizedState,n]},useRef:function(n){var e=Yv();return n={current:n},e.memoizedState=n},useState:qSe,useDebugValue:tpe,useDeferredValue:function(n){return Yv().memoizedState=n},useTransition:function(){var n=qSe(!1),e=n[0];return n=Ppt.bind(null,n[1]),Yv().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Ml,r=Yv();if(wl){if(t===void 0)throw Error(Pn(407));t=t()}else{if(t=e(),qu===null)throw Error(Pn(349));TT&30||VFe(i,e,t)}r.memoizedState=t;var o={value:t,getSnapshot:e};return r.queue=o,GSe(WFe.bind(null,i,o,n),[n]),i.flags|=2048,T4(9,HFe.bind(null,i,o,t,e),void 0,null),t},useId:function(){var n=Yv(),e=qu.identifierPrefix;if(wl){var t=Iy,i=ky;t=(i&~(1<<32-rv(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=E4++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=Opt++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},$pt={readContext:Dm,useCallback:QFe,useContext:Dm,useEffect:epe,useImperativeHandle:YFe,useInsertionEffect:qFe,useLayoutEffect:GFe,useMemo:XFe,useReducer:qX,useRef:jFe,useState:function(){return qX(x4)},useDebugValue:tpe,useDeferredValue:function(n){var e=Am();return ZFe(e,uu.memoizedState,n)},useTransition:function(){var n=qX(x4)[0],e=Am().memoizedState;return[n,e]},useMutableSource:BFe,useSyncExternalStore:$Fe,useId:JFe,unstable_isNewReconciler:!1},Vpt={readContext:Dm,useCallback:QFe,useContext:Dm,useEffect:epe,useImperativeHandle:YFe,useInsertionEffect:qFe,useLayoutEffect:GFe,useMemo:XFe,useReducer:GX,useRef:jFe,useState:function(){return GX(x4)},useDebugValue:tpe,useDeferredValue:function(n){var e=Am();return uu===null?e.memoizedState=n:ZFe(e,uu.memoizedState,n)},useTransition:function(){var n=GX(x4)[0],e=Am().memoizedState;return[n,e]},useMutableSource:BFe,useSyncExternalStore:$Fe,useId:JFe,unstable_isNewReconciler:!1};function DD(n,e){try{var t="",i=e;do t+=pft(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 KX(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function Sie(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var Hpt=typeof WeakMap=="function"?WeakMap:Map;function i6e(n,e,t){t=jy(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){KV||(KV=!0,Nie=i),Sie(n,e)},t}function r6e(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(){Sie(n,e)}}var o=n.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){Sie(n,e),typeof i!="function"&&(Cw===null?Cw=new Set([this]):Cw.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),t}function KSe(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new Hpt;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=tgt.bind(null,n,e,t),e.then(n,n))}function YSe(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 QSe(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,yw(t,e,1))),t.lanes|=1),n)}var Wpt=T1.ReactCurrentOwner,Lf=!1;function Dh(n,e,t,i){e.child=n===null?MFe(e,null,t,i):ID(e,n.child,t,i)}function XSe(n,e,t,i,r){t=t.render;var o=e.ref;return NL(e,r),i=Zfe(n,e,t,i,o,r),t=Jfe(),n!==null&&!Lf?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,l1(n,e,r)):(wl&&t&&Vfe(e),e.flags|=1,Dh(n,e,i,r),e.child)}function ZSe(n,e,t,i,r){if(n===null){var o=t.type;return typeof o=="function"&&!cpe(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=o,o6e(n,e,o,i,r)):(n=o$(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:v4,t(s,i)&&n.ref===e.ref)return l1(n,e,r)}return e.flags|=1,n=Sw(o,i),n.ref=e.ref,n.return=e,e.child=n}function o6e(n,e,t,i,r){if(n!==null){var o=n.memoizedProps;if(v4(o,i)&&n.ref===e.ref)if(Lf=!1,e.pendingProps=i=o,(n.lanes&r)!==0)n.flags&131072&&(Lf=!0);else return e.lanes=n.lanes,l1(n,e,r)}return Eie(n,e,t,i,r)}function s6e(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},Xa(z2,Np),Np|=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,Xa(z2,Np),Np|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=o!==null?o.baseLanes:t,Xa(z2,Np),Np|=i}else o!==null?(i=o.baseLanes|t,e.memoizedState=null):i=t,Xa(z2,Np),Np|=i;return Dh(n,e,r,t),e.child}function a6e(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Eie(n,e,t,i,r){var o=$f(t)?ET:lh.current;return o=TD(e,o),NL(e,r),t=Zfe(n,e,t,i,o,r),i=Jfe(),n!==null&&!Lf?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,l1(n,e,r)):(wl&&i&&Vfe(e),e.flags|=1,Dh(n,e,t,r),e.child)}function JSe(n,e,t,i,r){if($f(t)){var o=!0;BV(e)}else o=!1;if(NL(e,r),e.stateNode===null)n$(n,e),OFe(e,t,i),wie(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=Dm(c):(c=$f(t)?ET:lh.current,c=TD(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)&&USe(e,s,i,c),TC=!1;var h=e.memoizedState;s.state=h,zV(e,i,s,r),l=e.memoizedState,a!==i||h!==l||Bf.current||TC?(typeof u=="function"&&(Cie(e,t,u,i),l=e.memoizedState),(a=TC||zSe(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,RFe(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:x_(e.type,a),s.props=c,d=e.pendingProps,h=s.context,l=t.contextType,typeof l=="object"&&l!==null?l=Dm(l):(l=$f(t)?ET:lh.current,l=TD(e,l));var f=t.getDerivedStateFromProps;(u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||h!==l)&&USe(e,s,i,l),TC=!1,h=e.memoizedState,s.state=h,zV(e,i,s,r);var g=e.memoizedState;a!==d||h!==g||Bf.current||TC?(typeof f=="function"&&(Cie(e,t,f,i),g=e.memoizedState),(c=TC||zSe(e,t,c,i,h,g,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,g,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=g),s.props=i,s.state=g,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 xie(n,e,t,i,o,r)}function xie(n,e,t,i,r,o){a6e(n,e);var s=(e.flags&128)!==0;if(!i&&!s)return r&&BSe(e,t,!1),l1(n,e,o);i=e.stateNode,Wpt.current=e;var a=s&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&s?(e.child=ID(e,n.child,null,o),e.child=ID(e,null,a,o)):Dh(n,e,a,o),e.memoizedState=i.state,r&&BSe(e,t,!0),e.child}function l6e(n){var e=n.stateNode;e.pendingContext?FSe(n,e.pendingContext,e.pendingContext!==e.context):e.context&&FSe(n,e.context,!1),Kfe(n,e.containerInfo)}function eEe(n,e,t,i,r){return kD(),Wfe(r),e.flags|=256,Dh(n,e,t,i),e.child}var Tie={dehydrated:null,treeContext:null,retryLane:0};function kie(n){return{baseLanes:n,cachePool:null,transitions:null}}function c6e(n,e,t){var i=e.pendingProps,r=Al.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),Xa(Al,r&1),n===null)return bie(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=oj(s,i,0,null),n=Jx(n,i,t,null),o.return=e,n.return=e,o.sibling=n,e.child=o,e.child.memoizedState=kie(t),e.memoizedState=Tie,n):npe(e,s));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return zpt(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=Sw(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?o=Sw(a,o):(o=Jx(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?kie(t):{baseLanes:s.baseLanes|t,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=n.childLanes&~t,e.memoizedState=Tie,i}return o=n.child,n=o.sibling,i=Sw(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 npe(n,e){return e=oj({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function d8(n,e,t,i){return i!==null&&Wfe(i),ID(e,n.child,null,t),n=npe(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function zpt(n,e,t,i,r,o,s){if(t)return e.flags&256?(e.flags&=-257,i=KX(Error(Pn(422))),d8(n,e,s,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(o=i.fallback,r=e.mode,i=oj({mode:"visible",children:i.children},r,0,null),o=Jx(o,r,s,null),o.flags|=2,i.return=e,o.return=e,i.sibling=o,e.child=i,e.mode&1&&ID(e,n.child,null,s),e.child.memoizedState=kie(s),e.memoizedState=Tie,o);if(!(e.mode&1))return d8(n,e,s,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,o=Error(Pn(419)),i=KX(o,i,void 0),d8(n,e,s,i)}if(a=(s&n.childLanes)!==0,Lf||a){if(i=qu,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,a1(n,r),ov(i,n,r,-1))}return lpe(),i=KX(Error(Pn(421))),d8(n,e,s,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=ngt.bind(null,n),r._reactRetry=e,null):(n=o.treeContext,Up=bw(r.nextSibling),tg=e,wl=!0,M_=null,n!==null&&(am[lm++]=ky,am[lm++]=Iy,am[lm++]=xT,ky=n.id,Iy=n.overflow,xT=e),e=npe(e,i.children),e.flags|=4096,e)}function tEe(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),yie(n.return,e,t)}function YX(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 u6e(n,e,t){var i=e.pendingProps,r=i.revealOrder,o=i.tail;if(Dh(n,e,i.children,t),i=Al.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&&tEe(n,t,e);else if(n.tag===19)tEe(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(Xa(Al,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&&UV(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),YX(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&&UV(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}YX(e,!0,t,null,o);break;case"together":YX(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function n$(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function l1(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),kT|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Pn(153));if(e.child!==null){for(n=e.child,t=Sw(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Sw(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function Upt(n,e,t){switch(e.tag){case 3:l6e(e),kD();break;case 5:FFe(e);break;case 1:$f(e.type)&&BV(e);break;case 4:Kfe(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;Xa(HV,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(Xa(Al,Al.current&1),e.flags|=128,null):t&e.child.childLanes?c6e(n,e,t):(Xa(Al,Al.current&1),n=l1(n,e,t),n!==null?n.sibling:null);Xa(Al,Al.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return u6e(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Xa(Al,Al.current),i)break;return null;case 22:case 23:return e.lanes=0,s6e(n,e,t)}return l1(n,e,t)}var d6e,Iie,h6e,f6e;d6e=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}};Iie=function(){};h6e=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,Rx(zb.current);var o=null;switch(t){case"input":r=Qne(n,r),i=Qne(n,i),o=[];break;case"select":r=Bl({},r,{value:void 0}),i=Bl({},i,{value:void 0}),o=[];break;case"textarea":r=Jne(n,r),i=Jne(n,i),o=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=MV)}tie(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"&&(d4.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"&&(d4.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&sl("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)}};f6e=function(n,e,t,i){t!==i&&(e.flags|=4)};function YN(n,e){if(!wl)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 Ud(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 jpt(n,e,t){var i=e.pendingProps;switch(Hfe(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ud(e),null;case 1:return $f(e.type)&&FV(),Ud(e),null;case 3:return i=e.stateNode,LD(),fl(Bf),fl(lh),Qfe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(c8(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,M_!==null&&(Mie(M_),M_=null))),Iie(n,e),Ud(e),null;case 5:Yfe(e);var r=Rx(S4.current);if(t=e.type,n!==null&&e.stateNode!=null)h6e(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Pn(166));return Ud(e),null}if(n=Rx(zb.current),c8(e)){i=e.stateNode,t=e.type;var o=e.memoizedProps;switch(i[db]=e,i[C4]=o,n=(e.mode&1)!==0,t){case"dialog":sl("cancel",i),sl("close",i);break;case"iframe":case"object":case"embed":sl("load",i);break;case"video":case"audio":for(r=0;r<rP.length;r++)sl(rP[r],i);break;case"source":sl("error",i);break;case"img":case"image":case"link":sl("error",i),sl("load",i);break;case"details":sl("toggle",i);break;case"input":uSe(i,o),sl("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!o.multiple},sl("invalid",i);break;case"textarea":hSe(i,o),sl("invalid",i)}tie(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&&l8(i.textContent,a,n),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&l8(i.textContent,a,n),r=["children",""+a]):d4.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&sl("scroll",i)}switch(t){case"input":e8(i),dSe(i,o,!0);break;case"textarea":e8(i),fSe(i);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(i.onclick=MV)}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=V5e(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[db]=e,n[C4]=i,d6e(n,e,!1,!1),e.stateNode=n;e:{switch(s=nie(t,i),t){case"dialog":sl("cancel",n),sl("close",n),r=i;break;case"iframe":case"object":case"embed":sl("load",n),r=i;break;case"video":case"audio":for(r=0;r<rP.length;r++)sl(rP[r],n);r=i;break;case"source":sl("error",n),r=i;break;case"img":case"image":case"link":sl("error",n),sl("load",n),r=i;break;case"details":sl("toggle",n),r=i;break;case"input":uSe(n,i),r=Qne(n,i),sl("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=Bl({},i,{value:void 0}),sl("invalid",n);break;case"textarea":hSe(n,i),r=Jne(n,i),sl("invalid",n);break;default:r=i}tie(t,r),a=r;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?z5e(n,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&H5e(n,l)):o==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&h4(n,l):typeof l=="number"&&h4(n,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(d4.hasOwnProperty(o)?l!=null&&o==="onScroll"&&sl("scroll",n):l!=null&&Tfe(n,o,l,s))}switch(t){case"input":e8(n),dSe(n,i,!1);break;case"textarea":e8(n),fSe(n);break;case"option":i.value!=null&&n.setAttribute("value",""+eS(i.value));break;case"select":n.multiple=!!i.multiple,o=i.value,o!=null?LL(n,!!i.multiple,o,!1):i.defaultValue!=null&&LL(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=MV)}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 Ud(e),null;case 6:if(n&&e.stateNode!=null)f6e(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Pn(166));if(t=Rx(S4.current),Rx(zb.current),c8(e)){if(i=e.stateNode,t=e.memoizedProps,i[db]=e,(o=i.nodeValue!==t)&&(n=tg,n!==null))switch(n.tag){case 3:l8(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&l8(i.nodeValue,t,(n.mode&1)!==0)}o&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[db]=e,e.stateNode=i}return Ud(e),null;case 13:if(fl(Al),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(wl&&Up!==null&&e.mode&1&&!(e.flags&128))DFe(),kD(),e.flags|=98560,o=!1;else if(o=c8(e),i!==null&&i.dehydrated!==null){if(n===null){if(!o)throw Error(Pn(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Pn(317));o[db]=e}else kD(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ud(e),o=!1}else M_!==null&&(Mie(M_),M_=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||Al.current&1?mu===0&&(mu=3):lpe())),e.updateQueue!==null&&(e.flags|=4),Ud(e),null);case 4:return LD(),Iie(n,e),n===null&&b4(e.stateNode.containerInfo),Ud(e),null;case 10:return jfe(e.type._context),Ud(e),null;case 17:return $f(e.type)&&FV(),Ud(e),null;case 19:if(fl(Al),o=e.memoizedState,o===null)return Ud(e),null;if(i=(e.flags&128)!==0,s=o.rendering,s===null)if(i)YN(o,!1);else{if(mu!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(s=UV(n),s!==null){for(e.flags|=128,YN(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 Xa(Al,Al.current&1|2),e.child}n=n.sibling}o.tail!==null&&vc()>AD&&(e.flags|=128,i=!0,YN(o,!1),e.lanes=4194304)}else{if(!i)if(n=UV(s),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),YN(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!wl)return Ud(e),null}else 2*vc()-o.renderingStartTime>AD&&t!==1073741824&&(e.flags|=128,i=!0,YN(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=vc(),e.sibling=null,t=Al.current,Xa(Al,i?t&1|2:t&1),e):(Ud(e),null);case 22:case 23:return ape(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Np&1073741824&&(Ud(e),e.subtreeFlags&6&&(e.flags|=8192)):Ud(e),null;case 24:return null;case 25:return null}throw Error(Pn(156,e.tag))}function qpt(n,e){switch(Hfe(e),e.tag){case 1:return $f(e.type)&&FV(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return LD(),fl(Bf),fl(lh),Qfe(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return Yfe(e),null;case 13:if(fl(Al),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Pn(340));kD()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return fl(Al),null;case 4:return LD(),null;case 10:return jfe(e.type._context),null;case 22:case 23:return ape(),null;case 24:return null;default:return null}}var h8=!1,nh=!1,Gpt=typeof WeakSet=="function"?WeakSet:Set,Ni=null;function W2(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Ql(n,e,i)}else t.current=null}function Lie(n,e,t){try{t()}catch(i){Ql(n,e,i)}}var nEe=!1;function Kpt(n,e){if(hie=NV,n=_Fe(),$fe(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 f;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),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===n)break t;if(h===t&&++c===r&&(a=s),h===o&&++u===i&&(l=s),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(fie={focusedElem:n,selectionRange:t},NV=!1,Ni=e;Ni!==null;)if(e=Ni,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ni=n;else for(;Ni!==null;){e=Ni;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,_=e.stateNode,b=_.getSnapshotBeforeUpdate(e.elementType===e.type?m:x_(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(Pn(163))}}catch(C){Ql(e,e.return,C)}if(n=e.sibling,n!==null){n.return=e.return,Ni=n;break}Ni=e.return}return g=nEe,nEe=!1,g}function qP(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&&Lie(e,t,o)}r=r.next}while(r!==i)}}function ij(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 Die(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 p6e(n){var e=n.alternate;e!==null&&(n.alternate=null,p6e(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[db],delete e[C4],delete e[mie],delete e[Dpt],delete e[Apt])),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 g6e(n){return n.tag===5||n.tag===3||n.tag===4}function iEe(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||g6e(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 Aie(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=MV));else if(i!==4&&(n=n.child,n!==null))for(Aie(n,e,t),n=n.sibling;n!==null;)Aie(n,e,t),n=n.sibling}function Rie(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(Rie(n,e,t),n=n.sibling;n!==null;)Rie(n,e,t),n=n.sibling}var ad=null,I_=!1;function Z1(n,e,t){for(t=t.child;t!==null;)m6e(n,e,t),t=t.sibling}function m6e(n,e,t){if(Wb&&typeof Wb.onCommitFiberUnmount=="function")try{Wb.onCommitFiberUnmount(YU,t)}catch{}switch(t.tag){case 5:nh||W2(t,e);case 6:var i=ad,r=I_;ad=null,Z1(n,e,t),ad=i,I_=r,ad!==null&&(I_?(n=ad,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):ad.removeChild(t.stateNode));break;case 18:ad!==null&&(I_?(n=ad,t=t.stateNode,n.nodeType===8?WX(n.parentNode,t):n.nodeType===1&&WX(n,t),m4(n)):WX(ad,t.stateNode));break;case 4:i=ad,r=I_,ad=t.stateNode.containerInfo,I_=!0,Z1(n,e,t),ad=i,I_=r;break;case 0:case 11:case 14:case 15:if(!nh&&(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)&&Lie(t,e,s),r=r.next}while(r!==i)}Z1(n,e,t);break;case 1:if(!nh&&(W2(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Ql(t,e,a)}Z1(n,e,t);break;case 21:Z1(n,e,t);break;case 22:t.mode&1?(nh=(i=nh)||t.memoizedState!==null,Z1(n,e,t),nh=i):Z1(n,e,t);break;default:Z1(n,e,t)}}function rEe(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new Gpt),e.forEach(function(i){var r=igt.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function d_(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:ad=a.stateNode,I_=!1;break e;case 3:ad=a.stateNode.containerInfo,I_=!0;break e;case 4:ad=a.stateNode.containerInfo,I_=!0;break e}a=a.return}if(ad===null)throw Error(Pn(160));m6e(o,s,r),ad=null,I_=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(c){Ql(r,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)_6e(e,n),e=e.sibling}function _6e(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(d_(e,n),$v(n),i&4){try{qP(3,n,n.return),ij(3,n)}catch(m){Ql(n,n.return,m)}try{qP(5,n,n.return)}catch(m){Ql(n,n.return,m)}}break;case 1:d_(e,n),$v(n),i&512&&t!==null&&W2(t,t.return);break;case 5:if(d_(e,n),$v(n),i&512&&t!==null&&W2(t,t.return),n.flags&32){var r=n.stateNode;try{h4(r,"")}catch(m){Ql(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&&B5e(r,o),nie(a,s);var c=nie(a,o);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?z5e(r,d):u==="dangerouslySetInnerHTML"?H5e(r,d):u==="children"?h4(r,d):Tfe(r,u,d,c)}switch(a){case"input":Xne(r,o);break;case"textarea":$5e(r,o);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!o.multiple;var f=o.value;f!=null?LL(r,!!o.multiple,f,!1):h!==!!o.multiple&&(o.defaultValue!=null?LL(r,!!o.multiple,o.defaultValue,!0):LL(r,!!o.multiple,o.multiple?[]:"",!1))}r[C4]=o}catch(m){Ql(n,n.return,m)}}break;case 6:if(d_(e,n),$v(n),i&4){if(n.stateNode===null)throw Error(Pn(162));r=n.stateNode,o=n.memoizedProps;try{r.nodeValue=o}catch(m){Ql(n,n.return,m)}}break;case 3:if(d_(e,n),$v(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{m4(e.containerInfo)}catch(m){Ql(n,n.return,m)}break;case 4:d_(e,n),$v(n);break;case 13:d_(e,n),$v(n),r=n.child,r.flags&8192&&(o=r.memoizedState!==null,r.stateNode.isHidden=o,!o||r.alternate!==null&&r.alternate.memoizedState!==null||(ope=vc())),i&4&&rEe(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(nh=(c=nh)||u,d_(e,n),nh=c):d_(e,n),$v(n),i&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(Ni=n,u=n.child;u!==null;){for(d=Ni=u;Ni!==null;){switch(h=Ni,f=h.child,h.tag){case 0:case 11:case 14:case 15:qP(4,h,h.return);break;case 1:W2(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){i=h,t=h.return;try{e=i,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(m){Ql(i,t,m)}}break;case 5:W2(h,h.return);break;case 22:if(h.memoizedState!==null){sEe(d);continue}}f!==null?(f.return=h,Ni=f):sEe(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=W5e("display",s))}catch(m){Ql(n,n.return,m)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(m){Ql(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:d_(e,n),$v(n),i&4&&rEe(n);break;case 21:break;default:d_(e,n),$v(n)}}function $v(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(g6e(t)){var i=t;break e}t=t.return}throw Error(Pn(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(h4(r,""),i.flags&=-33);var o=iEe(n);Rie(n,o,r);break;case 3:case 4:var s=i.stateNode.containerInfo,a=iEe(n);Aie(n,a,s);break;default:throw Error(Pn(161))}}catch(l){Ql(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function Ypt(n,e,t){Ni=n,v6e(n)}function v6e(n,e,t){for(var i=(n.mode&1)!==0;Ni!==null;){var r=Ni,o=r.child;if(r.tag===22&&i){var s=r.memoizedState!==null||h8;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||nh;a=h8;var c=nh;if(h8=s,(nh=l)&&!c)for(Ni=r;Ni!==null;)s=Ni,l=s.child,s.tag===22&&s.memoizedState!==null?aEe(r):l!==null?(l.return=s,Ni=l):aEe(r);for(;o!==null;)Ni=o,v6e(o),o=o.sibling;Ni=r,h8=a,nh=c}oEe(n)}else r.subtreeFlags&8772&&o!==null?(o.return=r,Ni=o):oEe(n)}}function oEe(n){for(;Ni!==null;){var e=Ni;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:nh||ij(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!nh)if(t===null)i.componentDidMount();else{var r=e.elementType===e.type?t.memoizedProps:x_(e.type,t.memoizedProps);i.componentDidUpdate(r,t.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&WSe(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}WSe(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&&m4(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Pn(163))}nh||e.flags&512&&Die(e)}catch(h){Ql(e,e.return,h)}}if(e===n){Ni=null;break}if(t=e.sibling,t!==null){t.return=e.return,Ni=t;break}Ni=e.return}}function sEe(n){for(;Ni!==null;){var e=Ni;if(e===n){Ni=null;break}var t=e.sibling;if(t!==null){t.return=e.return,Ni=t;break}Ni=e.return}}function aEe(n){for(;Ni!==null;){var e=Ni;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{ij(4,e)}catch(l){Ql(e,t,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){Ql(e,r,l)}}var o=e.return;try{Die(e)}catch(l){Ql(e,o,l)}break;case 5:var s=e.return;try{Die(e)}catch(l){Ql(e,s,l)}}}catch(l){Ql(e,e.return,l)}if(e===n){Ni=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Ni=a;break}Ni=e.return}}var Qpt=Math.ceil,GV=T1.ReactCurrentDispatcher,ipe=T1.ReactCurrentOwner,ym=T1.ReactCurrentBatchConfig,ws=0,qu=null,Yc=null,Ld=0,Np=0,z2=HS(0),mu=0,k4=null,kT=0,rj=0,rpe=0,GP=null,yf=null,ope=0,AD=1/0,sy=null,KV=!1,Nie=null,Cw=null,f8=!1,GC=null,YV=0,KP=0,Oie=null,i$=-1,r$=0;function Vh(){return ws&6?vc():i$!==-1?i$:i$=vc()}function ww(n){return n.mode&1?ws&2&&Ld!==0?Ld&-Ld:Npt.transition!==null?(r$===0&&(r$=tFe()),r$):(n=ua,n!==0||(n=window.event,n=n===void 0?16:lFe(n.type)),n):1}function ov(n,e,t,i){if(50<KP)throw KP=0,Oie=null,Error(Pn(185));eF(n,t,i),(!(ws&2)||n!==qu)&&(n===qu&&(!(ws&2)&&(rj|=t),mu===4&&MC(n,Ld)),Vf(n,i),t===1&&ws===0&&!(e.mode&1)&&(AD=vc()+500,ej&&WS()))}function Vf(n,e){var t=n.callbackNode;Nft(n,e);var i=RV(n,n===qu?Ld:0);if(i===0)t!==null&&mSe(t),n.callbackNode=null,n.callbackPriority=0;else if(e=i&-i,n.callbackPriority!==e){if(t!=null&&mSe(t),e===1)n.tag===0?Rpt(lEe.bind(null,n)):kFe(lEe.bind(null,n)),Ipt(function(){!(ws&6)&&WS()}),t=null;else{switch(nFe(i)){case 1:t=Afe;break;case 4:t=J5e;break;case 16:t=AV;break;case 536870912:t=eFe;break;default:t=AV}t=T6e(t,b6e.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function b6e(n,e){if(i$=-1,r$=0,ws&6)throw Error(Pn(327));var t=n.callbackNode;if(OL()&&n.callbackNode!==t)return null;var i=RV(n,n===qu?Ld:0);if(i===0)return null;if(i&30||i&n.expiredLanes||e)e=QV(n,i);else{e=i;var r=ws;ws|=2;var o=C6e();(qu!==n||Ld!==e)&&(sy=null,AD=vc()+500,Zx(n,e));do try{Jpt();break}catch(a){y6e(n,a)}while(1);Ufe(),GV.current=o,ws=r,Yc!==null?e=0:(qu=null,Ld=0,e=mu)}if(e!==0){if(e===2&&(r=aie(n),r!==0&&(i=r,e=Pie(n,r))),e===1)throw t=k4,Zx(n,0),MC(n,i),Vf(n,vc()),t;if(e===6)MC(n,i);else{if(r=n.current.alternate,!(i&30)&&!Xpt(r)&&(e=QV(n,i),e===2&&(o=aie(n),o!==0&&(i=o,e=Pie(n,o))),e===1))throw t=k4,Zx(n,0),MC(n,i),Vf(n,vc()),t;switch(n.finishedWork=r,n.finishedLanes=i,e){case 0:case 1:throw Error(Pn(345));case 2:qE(n,yf,sy);break;case 3:if(MC(n,i),(i&130023424)===i&&(e=ope+500-vc(),10<e)){if(RV(n,0)!==0)break;if(r=n.suspendedLanes,(r&i)!==i){Vh(),n.pingedLanes|=n.suspendedLanes&r;break}n.timeoutHandle=gie(qE.bind(null,n,yf,sy),e);break}qE(n,yf,sy);break;case 4:if(MC(n,i),(i&4194240)===i)break;for(e=n.eventTimes,r=-1;0<i;){var s=31-rv(i);o=1<<s,s=e[s],s>r&&(r=s),i&=~o}if(i=r,i=vc()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Qpt(i/1960))-i,10<i){n.timeoutHandle=gie(qE.bind(null,n,yf,sy),i);break}qE(n,yf,sy);break;case 5:qE(n,yf,sy);break;default:throw Error(Pn(329))}}}return Vf(n,vc()),n.callbackNode===t?b6e.bind(null,n):null}function Pie(n,e){var t=GP;return n.current.memoizedState.isDehydrated&&(Zx(n,e).flags|=256),n=QV(n,e),n!==2&&(e=yf,yf=t,e!==null&&Mie(e)),n}function Mie(n){yf===null?yf=n:yf.push.apply(yf,n)}function Xpt(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(!mv(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 MC(n,e){for(e&=~rpe,e&=~rj,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-rv(e),i=1<<t;n[t]=-1,e&=~i}}function lEe(n){if(ws&6)throw Error(Pn(327));OL();var e=RV(n,0);if(!(e&1))return Vf(n,vc()),null;var t=QV(n,e);if(n.tag!==0&&t===2){var i=aie(n);i!==0&&(e=i,t=Pie(n,i))}if(t===1)throw t=k4,Zx(n,0),MC(n,e),Vf(n,vc()),t;if(t===6)throw Error(Pn(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,qE(n,yf,sy),Vf(n,vc()),null}function spe(n,e){var t=ws;ws|=1;try{return n(e)}finally{ws=t,ws===0&&(AD=vc()+500,ej&&WS())}}function IT(n){GC!==null&&GC.tag===0&&!(ws&6)&&OL();var e=ws;ws|=1;var t=ym.transition,i=ua;try{if(ym.transition=null,ua=1,n)return n()}finally{ua=i,ym.transition=t,ws=e,!(ws&6)&&WS()}}function ape(){Np=z2.current,fl(z2)}function Zx(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,kpt(t)),Yc!==null)for(t=Yc.return;t!==null;){var i=t;switch(Hfe(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&FV();break;case 3:LD(),fl(Bf),fl(lh),Qfe();break;case 5:Yfe(i);break;case 4:LD();break;case 13:fl(Al);break;case 19:fl(Al);break;case 10:jfe(i.type._context);break;case 22:case 23:ape()}t=t.return}if(qu=n,Yc=n=Sw(n.current,null),Ld=Np=e,mu=0,k4=null,rpe=rj=kT=0,yf=GP=null,Ax!==null){for(e=0;e<Ax.length;e++)if(t=Ax[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}Ax=null}return n}function y6e(n,e){do{var t=Yc;try{if(Ufe(),e$.current=qV,jV){for(var i=Ml.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}jV=!1}if(TT=0,$u=uu=Ml=null,jP=!1,E4=0,ipe.current=null,t===null||t.return===null){mu=1,k4=e,Yc=null;break}e:{var o=n,s=t.return,a=t,l=e;if(e=Ld,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 f=YSe(s);if(f!==null){f.flags&=-257,QSe(f,s,a,o,e),f.mode&1&&KSe(o,c,e),e=f,l=c;var g=e.updateQueue;if(g===null){var m=new Set;m.add(l),e.updateQueue=m}else g.add(l);break e}else{if(!(e&1)){KSe(o,c,e),lpe();break e}l=Error(Pn(426))}}else if(wl&&a.mode&1){var v=YSe(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),QSe(v,s,a,o,e),Wfe(DD(l,a));break e}}o=l=DD(l,a),mu!==4&&(mu=2),GP===null?GP=[o]:GP.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var _=i6e(o,l,e);HSe(o,_);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"&&(Cw===null||!Cw.has(y)))){o.flags|=65536,e&=-e,o.lanes|=e;var C=r6e(o,a,e);HSe(o,C);break e}}o=o.return}while(o!==null)}S6e(t)}catch(E){e=E,Yc===t&&t!==null&&(Yc=t=t.return);continue}break}while(1)}function C6e(){var n=GV.current;return GV.current=qV,n===null?qV:n}function lpe(){(mu===0||mu===3||mu===2)&&(mu=4),qu===null||!(kT&268435455)&&!(rj&268435455)||MC(qu,Ld)}function QV(n,e){var t=ws;ws|=2;var i=C6e();(qu!==n||Ld!==e)&&(sy=null,Zx(n,e));do try{Zpt();break}catch(r){y6e(n,r)}while(1);if(Ufe(),ws=t,GV.current=i,Yc!==null)throw Error(Pn(261));return qu=null,Ld=0,mu}function Zpt(){for(;Yc!==null;)w6e(Yc)}function Jpt(){for(;Yc!==null&&!Eft();)w6e(Yc)}function w6e(n){var e=x6e(n.alternate,n,Np);n.memoizedProps=n.pendingProps,e===null?S6e(n):Yc=e,ipe.current=null}function S6e(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=qpt(t,e),t!==null){t.flags&=32767,Yc=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{mu=6,Yc=null;return}}else if(t=jpt(t,e,Np),t!==null){Yc=t;return}if(e=e.sibling,e!==null){Yc=e;return}Yc=e=n}while(e!==null);mu===0&&(mu=5)}function qE(n,e,t){var i=ua,r=ym.transition;try{ym.transition=null,ua=1,egt(n,e,t,i)}finally{ym.transition=r,ua=i}return null}function egt(n,e,t,i){do OL();while(GC!==null);if(ws&6)throw Error(Pn(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(Pn(177));n.callbackNode=null,n.callbackPriority=0;var o=t.lanes|t.childLanes;if(Oft(n,o),n===qu&&(Yc=qu=null,Ld=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||f8||(f8=!0,T6e(AV,function(){return OL(),null})),o=(t.flags&15990)!==0,t.subtreeFlags&15990||o){o=ym.transition,ym.transition=null;var s=ua;ua=1;var a=ws;ws|=4,ipe.current=null,Kpt(n,t),_6e(t,n),ypt(fie),NV=!!hie,fie=hie=null,n.current=t,Ypt(t),xft(),ws=a,ua=s,ym.transition=o}else n.current=t;if(f8&&(f8=!1,GC=n,YV=r),o=n.pendingLanes,o===0&&(Cw=null),Ift(t.stateNode),Vf(n,vc()),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(KV)throw KV=!1,n=Nie,Nie=null,n;return YV&1&&n.tag!==0&&OL(),o=n.pendingLanes,o&1?n===Oie?KP++:(KP=0,Oie=n):KP=0,WS(),null}function OL(){if(GC!==null){var n=nFe(YV),e=ym.transition,t=ua;try{if(ym.transition=null,ua=16>n?16:n,GC===null)var i=!1;else{if(n=GC,GC=null,YV=0,ws&6)throw Error(Pn(331));var r=ws;for(ws|=4,Ni=n.current;Ni!==null;){var o=Ni,s=o.child;if(Ni.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Ni=c;Ni!==null;){var u=Ni;switch(u.tag){case 0:case 11:case 15:qP(8,u,o)}var d=u.child;if(d!==null)d.return=u,Ni=d;else for(;Ni!==null;){u=Ni;var h=u.sibling,f=u.return;if(p6e(u),u===c){Ni=null;break}if(h!==null){h.return=f,Ni=h;break}Ni=f}}}var g=o.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}Ni=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Ni=s;else e:for(;Ni!==null;){if(o=Ni,o.flags&2048)switch(o.tag){case 0:case 11:case 15:qP(9,o,o.return)}var _=o.sibling;if(_!==null){_.return=o.return,Ni=_;break e}Ni=o.return}}var b=n.current;for(Ni=b;Ni!==null;){s=Ni;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,Ni=y;else e:for(s=b;Ni!==null;){if(a=Ni,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ij(9,a)}}catch(E){Ql(a,a.return,E)}if(a===s){Ni=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,Ni=C;break e}Ni=a.return}}if(ws=r,WS(),Wb&&typeof Wb.onPostCommitFiberRoot=="function")try{Wb.onPostCommitFiberRoot(YU,n)}catch{}i=!0}return i}finally{ua=t,ym.transition=e}}return!1}function cEe(n,e,t){e=DD(t,e),e=i6e(n,e,1),n=yw(n,e,1),e=Vh(),n!==null&&(eF(n,1,e),Vf(n,e))}function Ql(n,e,t){if(n.tag===3)cEe(n,n,t);else for(;e!==null;){if(e.tag===3){cEe(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Cw===null||!Cw.has(i))){n=DD(t,n),n=r6e(e,n,1),e=yw(e,n,1),n=Vh(),e!==null&&(eF(e,1,n),Vf(e,n));break}}e=e.return}}function tgt(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),e=Vh(),n.pingedLanes|=n.suspendedLanes&t,qu===n&&(Ld&t)===t&&(mu===4||mu===3&&(Ld&130023424)===Ld&&500>vc()-ope?Zx(n,0):rpe|=t),Vf(n,e)}function E6e(n,e){e===0&&(n.mode&1?(e=i8,i8<<=1,!(i8&130023424)&&(i8=4194304)):e=1);var t=Vh();n=a1(n,e),n!==null&&(eF(n,e,t),Vf(n,t))}function ngt(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),E6e(n,t)}function igt(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(Pn(314))}i!==null&&i.delete(e),E6e(n,t)}var x6e;x6e=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Bf.current)Lf=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Lf=!1,Upt(n,e,t);Lf=!!(n.flags&131072)}else Lf=!1,wl&&e.flags&1048576&&IFe(e,VV,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;n$(n,e),n=e.pendingProps;var r=TD(e,lh.current);NL(e,t),r=Zfe(null,e,i,n,r,t);var o=Jfe();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,$f(i)?(o=!0,BV(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Gfe(e),r.updater=tj,e.stateNode=r,r._reactInternals=e,wie(e,i,n,t),e=xie(null,e,i,!0,o,t)):(e.tag=0,wl&&o&&Vfe(e),Dh(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(n$(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=ogt(i),n=x_(i,n),r){case 0:e=Eie(null,e,i,n,t);break e;case 1:e=JSe(null,e,i,n,t);break e;case 11:e=XSe(null,e,i,n,t);break e;case 14:e=ZSe(null,e,i,x_(i.type,n),t);break e}throw Error(Pn(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:x_(i,r),Eie(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:x_(i,r),JSe(n,e,i,r,t);case 3:e:{if(l6e(e),n===null)throw Error(Pn(387));i=e.pendingProps,o=e.memoizedState,r=o.element,RFe(n,e),zV(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=DD(Error(Pn(423)),e),e=eEe(n,e,i,t,r);break e}else if(i!==r){r=DD(Error(Pn(424)),e),e=eEe(n,e,i,t,r);break e}else for(Up=bw(e.stateNode.containerInfo.firstChild),tg=e,wl=!0,M_=null,t=MFe(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(kD(),i===r){e=l1(n,e,t);break e}Dh(n,e,i,t)}e=e.child}return e;case 5:return FFe(e),n===null&&bie(e),i=e.type,r=e.pendingProps,o=n!==null?n.memoizedProps:null,s=r.children,pie(i,r)?s=null:o!==null&&pie(i,o)&&(e.flags|=32),a6e(n,e),Dh(n,e,s,t),e.child;case 6:return n===null&&bie(e),null;case 13:return c6e(n,e,t);case 4:return Kfe(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=ID(e,null,i,t):Dh(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:x_(i,r),XSe(n,e,i,r,t);case 7:return Dh(n,e,e.pendingProps,t),e.child;case 8:return Dh(n,e,e.pendingProps.children,t),e.child;case 12:return Dh(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,Xa(HV,i._currentValue),i._currentValue=s,o!==null)if(mv(o.value,s)){if(o.children===r.children&&!Bf.current){e=l1(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),yie(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(Pn(341));s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),yie(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}Dh(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,NL(e,t),r=Dm(r),i=i(r),e.flags|=1,Dh(n,e,i,t),e.child;case 14:return i=e.type,r=x_(i,e.pendingProps),r=x_(i.type,r),ZSe(n,e,i,r,t);case 15:return o6e(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:x_(i,r),n$(n,e),e.tag=1,$f(i)?(n=!0,BV(e)):n=!1,NL(e,t),OFe(e,i,r),wie(e,i,r,t),xie(null,e,i,!0,n,t);case 19:return u6e(n,e,t);case 22:return s6e(n,e,t)}throw Error(Pn(156,e.tag))};function T6e(n,e){return Z5e(n,e)}function rgt(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 dm(n,e,t,i){return new rgt(n,e,t,i)}function cpe(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ogt(n){if(typeof n=="function")return cpe(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Ife)return 11;if(n===Lfe)return 14}return 2}function Sw(n,e){var t=n.alternate;return t===null?(t=dm(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 o$(n,e,t,i,r,o){var s=2;if(i=n,typeof n=="function")cpe(n)&&(s=1);else if(typeof n=="string")s=5;else e:switch(n){case N2:return Jx(t.children,r,o,e);case kfe:s=8,r|=8;break;case qne:return n=dm(12,t,e,r|2),n.elementType=qne,n.lanes=o,n;case Gne:return n=dm(13,t,e,r),n.elementType=Gne,n.lanes=o,n;case Kne:return n=dm(19,t,e,r),n.elementType=Kne,n.lanes=o,n;case P5e:return oj(t,r,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case N5e:s=10;break e;case O5e:s=9;break e;case Ife:s=11;break e;case Lfe:s=14;break e;case xC:s=16,i=null;break e}throw Error(Pn(130,n==null?n:typeof n,""))}return e=dm(s,t,e,r),e.elementType=n,e.type=i,e.lanes=o,e}function Jx(n,e,t,i){return n=dm(7,n,i,e),n.lanes=t,n}function oj(n,e,t,i){return n=dm(22,n,i,e),n.elementType=P5e,n.lanes=t,n.stateNode={isHidden:!1},n}function QX(n,e,t){return n=dm(6,n,null,e),n.lanes=t,n}function XX(n,e,t){return e=dm(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function sgt(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=AX(0),this.expirationTimes=AX(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=AX(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function upe(n,e,t,i,r,o,s,a,l){return n=new sgt(n,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=dm(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gfe(o),n}function agt(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R2,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}function k6e(n){if(!n)return tS;n=n._reactInternals;e:{if(Ik(n)!==n||n.tag!==1)throw Error(Pn(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if($f(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Pn(171))}if(n.tag===1){var t=n.type;if($f(t))return TFe(n,t,e)}return e}function I6e(n,e,t,i,r,o,s,a,l){return n=upe(t,i,!0,n,r,o,s,a,l),n.context=k6e(null),t=n.current,i=Vh(),r=ww(t),o=jy(i,r),o.callback=e??null,yw(t,o,r),n.current.lanes=r,eF(n,r,i),Vf(n,i),n}function sj(n,e,t,i){var r=e.current,o=Vh(),s=ww(r);return t=k6e(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=yw(r,e,s),n!==null&&(ov(n,r,s,o),J7(n,r,s)),s}function XV(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 uEe(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function dpe(n,e){uEe(n,e),(n=n.alternate)&&uEe(n,e)}function lgt(){return null}var L6e=typeof reportError=="function"?reportError:function(n){console.error(n)};function hpe(n){this._internalRoot=n}aj.prototype.render=hpe.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Pn(409));sj(n,e,null,null)};aj.prototype.unmount=hpe.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;IT(function(){sj(null,n,null,null)}),e[s1]=null}};function aj(n){this._internalRoot=n}aj.prototype.unstable_scheduleHydration=function(n){if(n){var e=oFe();n={blockedOn:null,target:n,priority:e};for(var t=0;t<PC.length&&e!==0&&e<PC[t].priority;t++);PC.splice(t,0,n),t===0&&aFe(n)}};function fpe(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function lj(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function dEe(){}function cgt(n,e,t,i,r){if(r){if(typeof i=="function"){var o=i;i=function(){var c=XV(s);o.call(c)}}var s=I6e(e,i,n,0,null,!1,!1,"",dEe);return n._reactRootContainer=s,n[s1]=s.current,b4(n.nodeType===8?n.parentNode:n),IT(),s}for(;r=n.lastChild;)n.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var c=XV(l);a.call(c)}}var l=upe(n,0,!1,null,null,!1,!1,"",dEe);return n._reactRootContainer=l,n[s1]=l.current,b4(n.nodeType===8?n.parentNode:n),IT(function(){sj(e,l,t,i)}),l}function cj(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=XV(s);a.call(l)}}sj(e,s,n,r)}else s=cgt(t,e,n,r,i);return XV(s)}iFe=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=iP(e.pendingLanes);t!==0&&(Rfe(e,t|1),Vf(e,vc()),!(ws&6)&&(AD=vc()+500,WS()))}break;case 13:IT(function(){var i=a1(n,1);if(i!==null){var r=Vh();ov(i,n,1,r)}}),dpe(n,1)}};Nfe=function(n){if(n.tag===13){var e=a1(n,134217728);if(e!==null){var t=Vh();ov(e,n,134217728,t)}dpe(n,134217728)}};rFe=function(n){if(n.tag===13){var e=ww(n),t=a1(n,e);if(t!==null){var i=Vh();ov(t,n,e,i)}dpe(n,e)}};oFe=function(){return ua};sFe=function(n,e){var t=ua;try{return ua=n,e()}finally{ua=t}};rie=function(n,e,t){switch(e){case"input":if(Xne(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=JU(i);if(!r)throw Error(Pn(90));F5e(i),Xne(i,r)}}}break;case"textarea":$5e(n,t);break;case"select":e=t.value,e!=null&&LL(n,!!t.multiple,e,!1)}};q5e=spe;G5e=IT;var ugt={usingClientEntryPoint:!1,Events:[nF,F2,JU,U5e,j5e,spe]},QN={findFiberByHostInstance:Dx,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},dgt={bundleType:QN.bundleType,version:QN.version,rendererPackageName:QN.rendererPackageName,rendererConfig:QN.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T1.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=Q5e(n),n===null?null:n.stateNode},findFiberByHostInstance:QN.findFiberByHostInstance||lgt,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 p8=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!p8.isDisabled&&p8.supportsFiber)try{YU=p8.inject(dgt),Wb=p8}catch{}}Sg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ugt;Sg.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fpe(e))throw Error(Pn(200));return agt(n,e,null,t)};Sg.createRoot=function(n,e){if(!fpe(n))throw Error(Pn(299));var t=!1,i="",r=L6e;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=upe(n,1,!1,null,null,t,!1,i,r),n[s1]=e.current,b4(n.nodeType===8?n.parentNode:n),new hpe(e)};Sg.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(Pn(188)):(n=Object.keys(n).join(","),Error(Pn(268,n)));return n=Q5e(e),n=n===null?null:n.stateNode,n};Sg.flushSync=function(n){return IT(n)};Sg.hydrate=function(n,e,t){if(!lj(e))throw Error(Pn(200));return cj(null,n,e,!0,t)};Sg.hydrateRoot=function(n,e,t){if(!fpe(n))throw Error(Pn(405));var i=t!=null&&t.hydratedSources||null,r=!1,o="",s=L6e;if(t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),e=I6e(e,null,n,1,t??null,r,!1,o,s),n[s1]=e.current,b4(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 aj(e)};Sg.render=function(n,e,t){if(!lj(e))throw Error(Pn(200));return cj(null,n,e,!1,t)};Sg.unmountComponentAtNode=function(n){if(!lj(n))throw Error(Pn(40));return n._reactRootContainer?(IT(function(){cj(null,null,n,!1,function(){n._reactRootContainer=null,n[s1]=null})}),!0):!1};Sg.unstable_batchedUpdates=spe;Sg.unstable_renderSubtreeIntoContainer=function(n,e,t,i){if(!lj(t))throw Error(Pn(200));if(n==null||n._reactInternals===void 0)throw Error(Pn(38));return cj(n,e,t,!1,i)};Sg.version="18.2.0-next-9e3b772b8-20220608";function D6e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(D6e)}catch(n){console.error(n)}}D6e(),I5e.exports=Sg;var op=I5e.exports;const uj=nl(op),hgt=h5e({__proto__:null,default:uj},[op]);function fgt(n){n()}let A6e=fgt;const pgt=n=>A6e=n,ggt=()=>A6e,hEe=Symbol.for("react-redux-context"),fEe=typeof globalThis<"u"?globalThis:{};function mgt(){var n;if(!w.createContext)return{};const e=(n=fEe[hEe])!=null?n:fEe[hEe]=new Map;let t=e.get(w.createContext);return t||(t=w.createContext(null),e.set(w.createContext,t)),t}const c1=mgt();function ppe(n=c1){return function(){return w.useContext(n)}}const R6e=ppe(),N6e=()=>{throw new Error("uSES not initialized!")};let O6e=N6e;const _gt=n=>{O6e=n},vgt=(n,e)=>n===e;function bgt(n=c1){const e=n===c1?R6e:ppe(n);return function(i,r={}){const{equalityFn:o=vgt,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 f=w.useCallback({[i.name](m){return i(m)}}[i.name],[i,d,s]),g=O6e(c.addNestedSub,l.getState,u||l.getState,f,o);return w.useDebugValue(g),g}}const Nc=bgt();function Tt(){return Tt=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},Tt.apply(this,arguments)}function gpe(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 P6e={exports:{}},da={};/** @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 Zu=typeof Symbol=="function"&&Symbol.for,mpe=Zu?Symbol.for("react.element"):60103,_pe=Zu?Symbol.for("react.portal"):60106,dj=Zu?Symbol.for("react.fragment"):60107,hj=Zu?Symbol.for("react.strict_mode"):60108,fj=Zu?Symbol.for("react.profiler"):60114,pj=Zu?Symbol.for("react.provider"):60109,gj=Zu?Symbol.for("react.context"):60110,vpe=Zu?Symbol.for("react.async_mode"):60111,mj=Zu?Symbol.for("react.concurrent_mode"):60111,_j=Zu?Symbol.for("react.forward_ref"):60112,vj=Zu?Symbol.for("react.suspense"):60113,ygt=Zu?Symbol.for("react.suspense_list"):60120,bj=Zu?Symbol.for("react.memo"):60115,yj=Zu?Symbol.for("react.lazy"):60116,Cgt=Zu?Symbol.for("react.block"):60121,wgt=Zu?Symbol.for("react.fundamental"):60117,Sgt=Zu?Symbol.for("react.responder"):60118,Egt=Zu?Symbol.for("react.scope"):60119;function xg(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case mpe:switch(n=n.type,n){case vpe:case mj:case dj:case fj:case hj:case vj:return n;default:switch(n=n&&n.$$typeof,n){case gj:case _j:case yj:case bj:case pj:return n;default:return e}}case _pe:return e}}}function M6e(n){return xg(n)===mj}da.AsyncMode=vpe;da.ConcurrentMode=mj;da.ContextConsumer=gj;da.ContextProvider=pj;da.Element=mpe;da.ForwardRef=_j;da.Fragment=dj;da.Lazy=yj;da.Memo=bj;da.Portal=_pe;da.Profiler=fj;da.StrictMode=hj;da.Suspense=vj;da.isAsyncMode=function(n){return M6e(n)||xg(n)===vpe};da.isConcurrentMode=M6e;da.isContextConsumer=function(n){return xg(n)===gj};da.isContextProvider=function(n){return xg(n)===pj};da.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===mpe};da.isForwardRef=function(n){return xg(n)===_j};da.isFragment=function(n){return xg(n)===dj};da.isLazy=function(n){return xg(n)===yj};da.isMemo=function(n){return xg(n)===bj};da.isPortal=function(n){return xg(n)===_pe};da.isProfiler=function(n){return xg(n)===fj};da.isStrictMode=function(n){return xg(n)===hj};da.isSuspense=function(n){return xg(n)===vj};da.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===dj||n===mj||n===fj||n===hj||n===vj||n===ygt||typeof n=="object"&&n!==null&&(n.$$typeof===yj||n.$$typeof===bj||n.$$typeof===pj||n.$$typeof===gj||n.$$typeof===_j||n.$$typeof===wgt||n.$$typeof===Sgt||n.$$typeof===Egt||n.$$typeof===Cgt)};da.typeOf=xg;P6e.exports=da;var xgt=P6e.exports,bpe=xgt,Tgt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},kgt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Igt={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},F6e={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ype={};ype[bpe.ForwardRef]=Igt;ype[bpe.Memo]=F6e;function pEe(n){return bpe.isMemo(n)?F6e:ype[n.$$typeof]||Tgt}var Lgt=Object.defineProperty,Dgt=Object.getOwnPropertyNames,gEe=Object.getOwnPropertySymbols,Agt=Object.getOwnPropertyDescriptor,Rgt=Object.getPrototypeOf,mEe=Object.prototype;function B6e(n,e,t){if(typeof e!="string"){if(mEe){var i=Rgt(e);i&&i!==mEe&&B6e(n,i,t)}var r=Dgt(e);gEe&&(r=r.concat(gEe(e)));for(var o=pEe(n),s=pEe(e),a=0;a<r.length;++a){var l=r[a];if(!kgt[l]&&!(t&&t[l])&&!(s&&s[l])&&!(o&&o[l])){var c=Agt(e,l);try{Lgt(n,l,c)}catch{}}}}return n}var Ngt=B6e;const _Ee=nl(Ngt);var $6e={exports:{}},ha={};/**
* @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 Cpe=Symbol.for("react.element"),wpe=Symbol.for("react.portal"),Cj=Symbol.for("react.fragment"),wj=Symbol.for("react.strict_mode"),Sj=Symbol.for("react.profiler"),Ej=Symbol.for("react.provider"),xj=Symbol.for("react.context"),Ogt=Symbol.for("react.server_context"),Tj=Symbol.for("react.forward_ref"),kj=Symbol.for("react.suspense"),Ij=Symbol.for("react.suspense_list"),Lj=Symbol.for("react.memo"),Dj=Symbol.for("react.lazy"),Pgt=Symbol.for("react.offscreen"),V6e;V6e=Symbol.for("react.module.reference");function jm(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case Cpe:switch(n=n.type,n){case Cj:case Sj:case wj:case kj:case Ij:return n;default:switch(n=n&&n.$$typeof,n){case Ogt:case xj:case Tj:case Dj:case Lj:case Ej:return n;default:return e}}case wpe:return e}}}ha.ContextConsumer=xj;ha.ContextProvider=Ej;ha.Element=Cpe;ha.ForwardRef=Tj;ha.Fragment=Cj;ha.Lazy=Dj;ha.Memo=Lj;ha.Portal=wpe;ha.Profiler=Sj;ha.StrictMode=wj;ha.Suspense=kj;ha.SuspenseList=Ij;ha.isAsyncMode=function(){return!1};ha.isConcurrentMode=function(){return!1};ha.isContextConsumer=function(n){return jm(n)===xj};ha.isContextProvider=function(n){return jm(n)===Ej};ha.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===Cpe};ha.isForwardRef=function(n){return jm(n)===Tj};ha.isFragment=function(n){return jm(n)===Cj};ha.isLazy=function(n){return jm(n)===Dj};ha.isMemo=function(n){return jm(n)===Lj};ha.isPortal=function(n){return jm(n)===wpe};ha.isProfiler=function(n){return jm(n)===Sj};ha.isStrictMode=function(n){return jm(n)===wj};ha.isSuspense=function(n){return jm(n)===kj};ha.isSuspenseList=function(n){return jm(n)===Ij};ha.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===Cj||n===Sj||n===wj||n===kj||n===Ij||n===Pgt||typeof n=="object"&&n!==null&&(n.$$typeof===Dj||n.$$typeof===Lj||n.$$typeof===Ej||n.$$typeof===xj||n.$$typeof===Tj||n.$$typeof===V6e||n.getModuleId!==void 0)};ha.typeOf=jm;$6e.exports=ha;var Mgt=$6e.exports;const Fgt=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Bgt(n,e,t,i,{areStatesEqual:r,areOwnPropsEqual:o,areStatePropsEqual:s}){let a=!1,l,c,u,d,h;function f(b,y){return l=b,c=y,u=n(l,c),d=e(i,c),h=t(u,d,c),a=!0,h}function g(){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 v(){const b=n(l,c),y=!s(b,u);return u=b,y&&(h=t(u,d,c)),h}function _(b,y){const C=!o(y,c),E=!r(b,l,y,c);return l=b,c=y,C&&E?g():C?m():E?v():h}return function(y,C){return a?_(y,C):f(y,C)}}function $gt(n,e){let{initMapStateToProps:t,initMapDispatchToProps:i,initMergeProps:r}=e,o=gpe(e,Fgt);const s=t(n,o),a=i(n,o),l=r(n,o);return Bgt(s,a,l,n,o)}function Vgt(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 Fie(n){return function(t){const i=n(t);function r(){return i}return r.dependsOnOwnProps=!1,r}}function vEe(n){return n.dependsOnOwnProps?!!n.dependsOnOwnProps:n.length!==1}function H6e(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=vEe(n);let c=o(a,l);return typeof c=="function"&&(o.mapToProps=c,o.dependsOnOwnProps=vEe(c),c=o(a,l)),c},o}}function Spe(n,e){return(t,i)=>{throw new Error(`Invalid value of type ${typeof n} for ${e} argument when connecting component ${i.wrappedComponentName}.`)}}function Hgt(n){return n&&typeof n=="object"?Fie(e=>Vgt(n,e)):n?typeof n=="function"?H6e(n):Spe(n,"mapDispatchToProps"):Fie(e=>({dispatch:e}))}function Wgt(n){return n?typeof n=="function"?H6e(n):Spe(n,"mapStateToProps"):Fie(()=>({}))}function zgt(n,e,t){return Tt({},t,n,e)}function Ugt(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 jgt(n){return n?typeof n=="function"?Ugt(n):Spe(n,"mergeProps"):()=>zgt}function qgt(){const n=ggt();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 bEe={notify(){},get:()=>[]};function W6e(n,e){let t,i=bEe,r=0,o=!1;function s(m){u();const v=i.subscribe(m);let _=!1;return()=>{_||(_=!0,v(),d())}}function a(){i.notify()}function l(){g.onStateChange&&g.onStateChange()}function c(){return o}function u(){r++,t||(t=e?e.addNestedSub(l):n.subscribe(l),i=qgt())}function d(){r--,t&&r===0&&(t(),t=void 0,i.clear(),i=bEe)}function h(){o||(o=!0,u())}function f(){o&&(o=!1,d())}const g={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:h,tryUnsubscribe:f,getListeners:()=>i};return g}const Ggt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZV=Ggt?w.useLayoutEffect:w.useEffect;function yEe(n,e){return n===e?n!==0||e!==0||1/n===1/e:n!==n&&e!==e}function ZX(n,e){if(yEe(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])||!yEe(n[t[r]],e[t[r]]))return!1;return!0}const Kgt=["reactReduxForwardedRef"];let z6e=N6e;const Ygt=n=>{z6e=n},Qgt=[null,null];function Xgt(n,e,t){ZV(()=>n(...e),t)}function Zgt(n,e,t,i,r,o){n.current=i,t.current=!1,r.current&&(r.current=null,o())}function Jgt(n,e,t,i,r,o,s,a,l,c,u){if(!n)return()=>{};let d=!1,h=null;const f=()=>{if(d||!a.current)return;const m=e.getState();let v,_;try{v=i(m,r.current)}catch(b){_=b,h=b}_||(h=null),v===o.current?s.current||c():(o.current=v,l.current=v,s.current=!0,u())};return t.onStateChange=f,t.trySubscribe(),f(),()=>{if(d=!0,t.tryUnsubscribe(),t.onStateChange=null,h)throw h}}function emt(n,e){return n===e}function U6e(n,e,t,{pure:i,areStatesEqual:r=emt,areOwnPropsEqual:o=ZX,areStatePropsEqual:s=ZX,areMergedPropsEqual:a=ZX,forwardRef:l=!1,context:c=c1}={}){const u=c,d=Wgt(n),h=Hgt(e),f=jgt(t),g=!!n;return v=>{const _=v.displayName||v.name||"Component",b=`Connect(${_})`,y={shouldHandleStateChanges:g,displayName:b,wrappedComponentName:_,WrappedComponent:v,initMapStateToProps:d,initMapDispatchToProps:h,initMergeProps:f,areStatesEqual:r,areStatePropsEqual:s,areOwnPropsEqual:o,areMergedPropsEqual:a};function C(k){const[L,D,A]=w.useMemo(()=>{const{reactReduxForwardedRef:bt}=k,Mt=gpe(k,Kgt);return[k.context,bt,Mt]},[k]),N=w.useMemo(()=>L&&L.Consumer&&Mgt.isContextConsumer(w.createElement(L.Consumer,null))?L:u,[L,u]),P=w.useContext(N),M=!!k.store&&!!k.store.getState&&!!k.store.dispatch,B=!!P&&!!P.store,F=M?k.store:P.store,U=B?P.getServerState:F.getState,H=w.useMemo(()=>$gt(F.dispatch,y),[F]),[W,q]=w.useMemo(()=>{if(!g)return Qgt;const bt=W6e(F,M?void 0:P.subscription),Mt=bt.notifyNestedSubs.bind(bt);return[bt,Mt]},[F,M,P]),V=w.useMemo(()=>M?P:Tt({},P,{subscription:W}),[M,P,W]),re=w.useRef(),oe=w.useRef(A),Q=w.useRef(),Ne=w.useRef(!1);w.useRef(!1);const Ve=w.useRef(!1),Ye=w.useRef();ZV(()=>(Ve.current=!0,()=>{Ve.current=!1}),[]);const ye=w.useMemo(()=>()=>Q.current&&A===oe.current?Q.current:H(F.getState(),A),[F,A]),He=w.useMemo(()=>Mt=>W?Jgt(g,F,W,H,oe,re,Ne,Ve,Q,q,Mt):()=>{},[W]);Xgt(Zgt,[oe,re,Ne,A,Q,q]);let Pe;try{Pe=z6e(He,ye,U?()=>H(U(),A):ye)}catch(bt){throw Ye.current&&(bt.message+=`
The error may be correlated with this previous error:
${Ye.current.stack}
`),bt}ZV(()=>{Ye.current=void 0,Q.current=void 0,re.current=Pe});const Ge=w.useMemo(()=>w.createElement(v,Tt({},Pe,{ref:D})),[D,v,Pe]);return w.useMemo(()=>g?w.createElement(N.Provider,{value:V},Ge):Ge,[N,Ge,V])}const x=w.memo(C);if(x.WrappedComponent=v,x.displayName=C.displayName=b,l){const L=w.forwardRef(function(A,N){return w.createElement(x,Tt({},A,{reactReduxForwardedRef:N}))});return L.displayName=b,L.WrappedComponent=v,_Ee(L,v)}return _Ee(x,v)}}function j6e({store:n,context:e,children:t,serverState:i,stabilityCheck:r="once",noopCheck:o="once"}){const s=w.useMemo(()=>{const c=W6e(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]);ZV(()=>{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||c1;return w.createElement(l.Provider,{value:s},t)}function q6e(n=c1){const e=n===c1?R6e:ppe(n);return function(){const{store:i}=e();return i}}const G6e=q6e();function tmt(n=c1){const e=n===c1?G6e:q6e(n);return function(){return e().dispatch}}const zi=tmt();_gt(lft.useSyncExternalStoreWithSelector);Ygt(x5e.useSyncExternalStore);pgt(op.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 Zi(){return Nc(n=>n.companyUsers.changes.company)}var JV={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
*/JV.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,f=4,g=1,m=2,v=1,_=2,b=4,y=8,C=16,E=32,x=64,k=128,L=256,D=512,A=30,N="...",P=800,M=16,B=1,F=2,U=3,H=1/0,W=9007199254740991,q=17976931348623157e292,V=0/0,re=4294967295,oe=re-1,Q=re>>>1,Ne=[["ary",k],["bind",v],["bindKey",_],["curry",y],["curryRight",C],["flip",D],["partial",E],["partialRight",x],["rearg",L]],Ve="[object Arguments]",Ye="[object Array]",ye="[object AsyncFunction]",He="[object Boolean]",Pe="[object Date]",Ge="[object DOMException]",Fe="[object Error]",bt="[object Function]",Mt="[object GeneratorFunction]",Ft="[object Map]",Yt="[object Number]",ln="[object Null]",Et="[object Object]",mt="[object Promise]",Lt="[object Proxy]",be="[object RegExp]",Te="[object Set]",se="[object String]",Y="[object Symbol]",X="[object Undefined]",le="[object WeakMap]",te="[object WeakSet]",me="[object ArrayBuffer]",Me="[object DataView]",rt="[object Float32Array]",It="[object Float64Array]",Qt="[object Int8Array]",pe="[object Int16Array]",We="[object Int32Array]",ne="[object Uint8Array]",Se="[object Uint8ClampedArray]",Ie="[object Uint16Array]",Ke="[object Uint32Array]",Je=/\b__p \+= '';/g,ot=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,pn=/&(?:amp|lt|gt|quot|#39);/g,Kn=/[&<>"']/g,Cn=RegExp(pn.source),hn=RegExp(Kn.source),bn=/<%-([\s\S]+?)%>/g,Wn=/<%([\s\S]+?)%>/g,Ei=/<%=([\s\S]+?)%>/g,er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ur=/^\w*$/,Jr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$i=/[\\^$.*+?()[\]{}|]/g,xs=RegExp($i.source),wr=/^\s+/,Ji=/\s/,rn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,di=/\{\n\/\* \[wrapped with (.+)\] \*/,Wr=/,? & /,Qe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ct=/[()=,{}\[\]\/\s]/,Gt=/\\(\\)?/g,Jt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ut=/\w*$/,Le=/^[-+]0x[0-9a-f]+$/i,st=/^0b[01]+$/i,ze=/^\[object .+?Constructor\]$/,Ee=/^0o[0-7]+$/i,tt=/^(?:0|[1-9]\d*)$/,xt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,gn=/['\n\r\u2028\u2029\\]/g,Ln="\\ud800-\\udfff",ri="\\u0300-\\u036f",mi="\\ufe20-\\ufe2f",Vi="\\u20d0-\\u20ff",qn=ri+mi+Vi,mn="\\u2700-\\u27bf",oi="a-z\\xdf-\\xf6\\xf8-\\xff",dr="\\xac\\xb1\\xd7\\xf7",gr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ta="\\u2000-\\u206f",ma=" \\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",za="A-Z\\xc0-\\xd6\\xd8-\\xde",ts="\\ufe0e\\ufe0f",fs=dr+gr+ta+ma,$o="[']",Tl="["+Ln+"]",ac="["+fs+"]",xi="["+qn+"]",co="\\d+",vo="["+mn+"]",Ws="["+oi+"]",Vo="[^"+Ln+fs+co+mn+oi+za+"]",zs="\\ud83c[\\udffb-\\udfff]",No="(?:"+xi+"|"+zs+")",Yr="[^"+Ln+"]",uo="(?:\\ud83c[\\udde6-\\uddff]){2}",Lr="[\\ud800-\\udbff][\\udc00-\\udfff]",Br="["+za+"]",so="\\u200d",Ki="(?:"+Ws+"|"+Vo+")",ti="(?:"+Br+"|"+Vo+")",yi="(?:"+$o+"(?:d|ll|m|re|s|t|ve))?",Qn="(?:"+$o+"(?:D|LL|M|RE|S|T|VE))?",li=No+"?",Si="["+ts+"]?",Yi="(?:"+so+"(?:"+[Yr,uo,Lr].join("|")+")"+Si+li+")*",Tn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xn=Si+li+Yi,vt="(?:"+[vo,uo,Lr].join("|")+")"+Xn,$t="(?:"+[Yr+xi+"?",xi,uo,Lr,Tl].join("|")+")",yn=RegExp($o,"g"),ni=RegExp(xi,"g"),Gn=RegExp(zs+"(?="+zs+")|"+$t+Xn,"g"),fi=RegExp([Br+"?"+Ws+"+"+yi+"(?="+[ac,Br,"$"].join("|")+")",ti+"+"+Qn+"(?="+[ac,Br+Ki,"$"].join("|")+")",Br+"?"+Ki+"+"+yi,Br+"+"+Qn,xn,Tn,co,vt].join("|"),"g"),$r=RegExp("["+so+Ln+qn+ts+"]"),ho=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eo=["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"],Ua=-1,Dr={};Dr[rt]=Dr[It]=Dr[Qt]=Dr[pe]=Dr[We]=Dr[ne]=Dr[Se]=Dr[Ie]=Dr[Ke]=!0,Dr[Ve]=Dr[Ye]=Dr[me]=Dr[He]=Dr[Me]=Dr[Pe]=Dr[Fe]=Dr[bt]=Dr[Ft]=Dr[Yt]=Dr[Et]=Dr[be]=Dr[Te]=Dr[se]=Dr[le]=!1;var Rn={};Rn[Ve]=Rn[Ye]=Rn[me]=Rn[Me]=Rn[He]=Rn[Pe]=Rn[rt]=Rn[It]=Rn[Qt]=Rn[pe]=Rn[We]=Rn[Ft]=Rn[Yt]=Rn[Et]=Rn[be]=Rn[Te]=Rn[se]=Rn[Y]=Rn[ne]=Rn[Se]=Rn[Ie]=Rn[Ke]=!0,Rn[Fe]=Rn[bt]=Rn[le]=!1;var Ts={À:"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"},kl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tu={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ps={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Hl=parseFloat,Wl=parseInt,Og=typeof Po=="object"&&Po&&Po.Object===Object&&Po,A0=typeof self=="object"&&self&&self.Object===Object&&self,vl=Og||A0||Function("return this")(),s_=e&&!e.nodeType&&e,bh=s_&&!0&&n&&!n.nodeType&&n,Pg=bh&&bh.exports===s_,ku=Pg&&Og.process,nu=function(){try{var ct=bh&&bh.require&&bh.require("util").types;return ct||ku&&ku.binding&&ku.binding("util")}catch{}}(),R0=nu&&nu.isArrayBuffer,Mg=nu&&nu.isDate,Fg=nu&&nu.isMap,rf=nu&&nu.isRegExp,gI=nu&&nu.isSet,mI=nu&&nu.isTypedArray;function ed(ct,Zt,Vt){switch(Vt.length){case 0:return ct.call(Zt);case 1:return ct.call(Zt,Vt[0]);case 2:return ct.call(Zt,Vt[0],Vt[1]);case 3:return ct.call(Zt,Vt[0],Vt[1],Vt[2])}return ct.apply(Zt,Vt)}function SN(ct,Zt,Vt,Di){for(var ro=-1,Ds=ct==null?0:ct.length;++ro<Ds;){var ou=ct[ro];Zt(Di,ou,Vt(ou),ct)}return Di}function iu(ct,Zt){for(var Vt=-1,Di=ct==null?0:ct.length;++Vt<Di&&Zt(ct[Vt],Vt,ct)!==!1;);return ct}function EN(ct,Zt){for(var Vt=ct==null?0:ct.length;Vt--&&Zt(ct[Vt],Vt,ct)!==!1;);return ct}function _I(ct,Zt){for(var Vt=-1,Di=ct==null?0:ct.length;++Vt<Di;)if(!Zt(ct[Vt],Vt,ct))return!1;return!0}function of(ct,Zt){for(var Vt=-1,Di=ct==null?0:ct.length,ro=0,Ds=[];++Vt<Di;){var ou=ct[Vt];Zt(ou,Vt,ct)&&(Ds[ro++]=ou)}return Ds}function yh(ct,Zt){var Vt=ct==null?0:ct.length;return!!Vt&&Kt(ct,Zt,0)>-1}function z1(ct,Zt,Vt){for(var Di=-1,ro=ct==null?0:ct.length;++Di<ro;)if(Vt(Zt,ct[Di]))return!0;return!1}function _a(ct,Zt){for(var Vt=-1,Di=ct==null?0:ct.length,ro=Array(Di);++Vt<Di;)ro[Vt]=Zt(ct[Vt],Vt,ct);return ro}function pp(ct,Zt){for(var Vt=-1,Di=Zt.length,ro=ct.length;++Vt<Di;)ct[ro+Vt]=Zt[Vt];return ct}function bl(ct,Zt,Vt,Di){var ro=-1,Ds=ct==null?0:ct.length;for(Di&&Ds&&(Vt=ct[++ro]);++ro<Ds;)Vt=Zt(Vt,ct[ro],ro,ct);return Vt}function yE(ct,Zt,Vt,Di){var ro=ct==null?0:ct.length;for(Di&&ro&&(Vt=ct[--ro]);ro--;)Vt=Zt(Vt,ct[ro],ro,ct);return Vt}function CE(ct,Zt){for(var Vt=-1,Di=ct==null?0:ct.length;++Vt<Di;)if(Zt(ct[Vt],Vt,ct))return!0;return!1}var ee=Oo("length");function z(ct){return ct.split("")}function Z(ct){return ct.match(Qe)||[]}function xe(ct,Zt,Vt){var Di;return Vt(ct,function(ro,Ds,ou){if(Zt(ro,Ds,ou))return Di=Ds,!1}),Di}function Oe(ct,Zt,Vt,Di){for(var ro=ct.length,Ds=Vt+(Di?1:-1);Di?Ds--:++Ds<ro;)if(Zt(ct[Ds],Ds,ct))return Ds;return-1}function Kt(ct,Zt,Vt){return Zt===Zt?bot(ct,Zt,Vt):Oe(ct,Li,Vt)}function $n(ct,Zt,Vt,Di){for(var ro=Vt-1,Ds=ct.length;++ro<Ds;)if(Di(ct[ro],Zt))return ro;return-1}function Li(ct){return ct!==ct}function Vr(ct,Zt){var Vt=ct==null?0:ct.length;return Vt?zr(ct,Zt)/Vt:V}function Oo(ct){return function(Zt){return Zt==null?t:Zt[ct]}}function Ci(ct){return function(Zt){return ct==null?t:ct[Zt]}}function Nn(ct,Zt,Vt,Di,ro){return ro(ct,function(Ds,ou,Da){Vt=Di?(Di=!1,Ds):Zt(Vt,Ds,ou,Da)}),Vt}function Mr(ct,Zt){var Vt=ct.length;for(ct.sort(Zt);Vt--;)ct[Vt]=ct[Vt].value;return ct}function zr(ct,Zt){for(var Vt,Di=-1,ro=ct.length;++Di<ro;){var Ds=Zt(ct[Di]);Ds!==t&&(Vt=Vt===t?Ds:Vt+Ds)}return Vt}function gs(ct,Zt){for(var Vt=-1,Di=Array(ct);++Vt<ct;)Di[Vt]=Zt(Vt);return Di}function Mc(ct,Zt){return _a(Zt,function(Vt){return[Vt,ct[Vt]]})}function td(ct){return ct&&ct.slice(0,pCe(ct)+1).replace(wr,"")}function ol(ct){return function(Zt){return ct(Zt)}}function Ch(ct,Zt){return _a(Zt,function(Vt){return ct[Vt]})}function gp(ct,Zt){return ct.has(Zt)}function Bg(ct,Zt){for(var Vt=-1,Di=ct.length;++Vt<Di&&Kt(Zt,ct[Vt],0)>-1;);return Vt}function ru(ct,Zt){for(var Vt=ct.length;Vt--&&Kt(Zt,ct[Vt],0)>-1;);return Vt}function hB(ct,Zt){for(var Vt=ct.length,Di=0;Vt--;)ct[Vt]===Zt&&++Di;return Di}var fB=Ci(Ts),xN=Ci(kl);function TN(ct){return"\\"+ps[ct]}function pB(ct,Zt){return ct==null?t:ct[Zt]}function U1(ct){return $r.test(ct)}function LQ(ct){return ho.test(ct)}function DQ(ct){for(var Zt,Vt=[];!(Zt=ct.next()).done;)Vt.push(Zt.value);return Vt}function kN(ct){var Zt=-1,Vt=Array(ct.size);return ct.forEach(function(Di,ro){Vt[++Zt]=[ro,Di]}),Vt}function IN(ct,Zt){return function(Vt){return ct(Zt(Vt))}}function j1(ct,Zt){for(var Vt=-1,Di=ct.length,ro=0,Ds=[];++Vt<Di;){var ou=ct[Vt];(ou===Zt||ou===u)&&(ct[Vt]=u,Ds[ro++]=Vt)}return Ds}function gB(ct){var Zt=-1,Vt=Array(ct.size);return ct.forEach(function(Di){Vt[++Zt]=Di}),Vt}function vot(ct){var Zt=-1,Vt=Array(ct.size);return ct.forEach(function(Di){Vt[++Zt]=[Di,Di]}),Vt}function bot(ct,Zt,Vt){for(var Di=Vt-1,ro=ct.length;++Di<ro;)if(ct[Di]===Zt)return Di;return-1}function yot(ct,Zt,Vt){for(var Di=Vt+1;Di--;)if(ct[Di]===Zt)return Di;return Di}function vI(ct){return U1(ct)?wot(ct):ee(ct)}function a_(ct){return U1(ct)?Sot(ct):z(ct)}function pCe(ct){for(var Zt=ct.length;Zt--&&Ji.test(ct.charAt(Zt)););return Zt}var Cot=Ci(tu);function wot(ct){for(var Zt=Gn.lastIndex=0;Gn.test(ct);)++Zt;return Zt}function Sot(ct){return ct.match(Gn)||[]}function Eot(ct){return ct.match(fi)||[]}var xot=function ct(Zt){Zt=Zt==null?vl:bI.defaults(vl.Object(),Zt,bI.pick(vl,eo));var Vt=Zt.Array,Di=Zt.Date,ro=Zt.Error,Ds=Zt.Function,ou=Zt.Math,Da=Zt.Object,AQ=Zt.RegExp,Tot=Zt.String,$g=Zt.TypeError,mB=Vt.prototype,kot=Ds.prototype,yI=Da.prototype,_B=Zt["__core-js_shared__"],vB=kot.toString,na=yI.hasOwnProperty,Iot=0,gCe=function(){var S=/[^.]+$/.exec(_B&&_B.keys&&_B.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),bB=yI.toString,Lot=vB.call(Da),Dot=vl._,Aot=AQ("^"+vB.call(na).replace($i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yB=Pg?Zt.Buffer:t,q1=Zt.Symbol,CB=Zt.Uint8Array,mCe=yB?yB.allocUnsafe:t,wB=IN(Da.getPrototypeOf,Da),_Ce=Da.create,vCe=yI.propertyIsEnumerable,SB=mB.splice,bCe=q1?q1.isConcatSpreadable:t,LN=q1?q1.iterator:t,wE=q1?q1.toStringTag:t,EB=function(){try{var S=kE(Da,"defineProperty");return S({},"",{}),S}catch{}}(),Rot=Zt.clearTimeout!==vl.clearTimeout&&Zt.clearTimeout,Not=Di&&Di.now!==vl.Date.now&&Di.now,Oot=Zt.setTimeout!==vl.setTimeout&&Zt.setTimeout,xB=ou.ceil,TB=ou.floor,RQ=Da.getOwnPropertySymbols,Pot=yB?yB.isBuffer:t,yCe=Zt.isFinite,Mot=mB.join,Fot=IN(Da.keys,Da),su=ou.max,Hd=ou.min,Bot=Di.now,$ot=Zt.parseInt,CCe=ou.random,Vot=mB.reverse,NQ=kE(Zt,"DataView"),DN=kE(Zt,"Map"),OQ=kE(Zt,"Promise"),CI=kE(Zt,"Set"),AN=kE(Zt,"WeakMap"),RN=kE(Da,"create"),kB=AN&&new AN,wI={},Hot=IE(NQ),Wot=IE(DN),zot=IE(OQ),Uot=IE(CI),jot=IE(AN),IB=q1?q1.prototype:t,NN=IB?IB.valueOf:t,wCe=IB?IB.toString:t;function ge(S){if(zl(S)&&!ao(S)&&!(S instanceof Ko)){if(S instanceof Vg)return S;if(na.call(S,"__wrapped__"))return Swe(S)}return new Vg(S)}var SI=function(){function S(){}return function(I){if(!Il(I))return{};if(_Ce)return _Ce(I);S.prototype=I;var R=new S;return S.prototype=t,R}}();function LB(){}function Vg(S,I){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!I,this.__index__=0,this.__values__=t}ge.templateSettings={escape:bn,evaluate:Wn,interpolate:Ei,variable:"",imports:{_:ge}},ge.prototype=LB.prototype,ge.prototype.constructor=ge,Vg.prototype=SI(LB.prototype),Vg.prototype.constructor=Vg;function Ko(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=re,this.__views__=[]}function qot(){var S=new Ko(this.__wrapped__);return S.__actions__=sf(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=sf(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=sf(this.__views__),S}function Got(){if(this.__filtered__){var S=new Ko(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function Kot(){var S=this.__wrapped__.value(),I=this.__dir__,R=ao(S),j=I<0,ae=R?S.length:0,Ce=sat(0,ae,this.__views__),Be=Ce.start,Xe=Ce.end,dt=Xe-Be,dn=j?Xe:Be-1,fn=this.__iteratees__,Sn=fn.length,hi=0,Ui=Hd(dt,this.__takeCount__);if(!R||!j&&ae==dt&&Ui==dt)return qCe(S,this.__actions__);var Ar=[];e:for(;dt--&&hi<Ui;){dn+=I;for(var wo=-1,Rr=S[dn];++wo<Sn;){var Ho=fn[wo],ns=Ho.iteratee,vp=Ho.type,Eh=ns(Rr);if(vp==F)Rr=Eh;else if(!Eh){if(vp==B)continue e;break e}}Ar[hi++]=Rr}return Ar}Ko.prototype=SI(LB.prototype),Ko.prototype.constructor=Ko;function SE(S){var I=-1,R=S==null?0:S.length;for(this.clear();++I<R;){var j=S[I];this.set(j[0],j[1])}}function Yot(){this.__data__=RN?RN(null):{},this.size=0}function Qot(S){var I=this.has(S)&&delete this.__data__[S];return this.size-=I?1:0,I}function Xot(S){var I=this.__data__;if(RN){var R=I[S];return R===l?t:R}return na.call(I,S)?I[S]:t}function Zot(S){var I=this.__data__;return RN?I[S]!==t:na.call(I,S)}function Jot(S,I){var R=this.__data__;return this.size+=this.has(S)?0:1,R[S]=RN&&I===t?l:I,this}SE.prototype.clear=Yot,SE.prototype.delete=Qot,SE.prototype.get=Xot,SE.prototype.has=Zot,SE.prototype.set=Jot;function N0(S){var I=-1,R=S==null?0:S.length;for(this.clear();++I<R;){var j=S[I];this.set(j[0],j[1])}}function est(){this.__data__=[],this.size=0}function tst(S){var I=this.__data__,R=DB(I,S);if(R<0)return!1;var j=I.length-1;return R==j?I.pop():SB.call(I,R,1),--this.size,!0}function nst(S){var I=this.__data__,R=DB(I,S);return R<0?t:I[R][1]}function ist(S){return DB(this.__data__,S)>-1}function rst(S,I){var R=this.__data__,j=DB(R,S);return j<0?(++this.size,R.push([S,I])):R[j][1]=I,this}N0.prototype.clear=est,N0.prototype.delete=tst,N0.prototype.get=nst,N0.prototype.has=ist,N0.prototype.set=rst;function O0(S){var I=-1,R=S==null?0:S.length;for(this.clear();++I<R;){var j=S[I];this.set(j[0],j[1])}}function ost(){this.size=0,this.__data__={hash:new SE,map:new(DN||N0),string:new SE}}function sst(S){var I=WB(this,S).delete(S);return this.size-=I?1:0,I}function ast(S){return WB(this,S).get(S)}function lst(S){return WB(this,S).has(S)}function cst(S,I){var R=WB(this,S),j=R.size;return R.set(S,I),this.size+=R.size==j?0:1,this}O0.prototype.clear=ost,O0.prototype.delete=sst,O0.prototype.get=ast,O0.prototype.has=lst,O0.prototype.set=cst;function EE(S){var I=-1,R=S==null?0:S.length;for(this.__data__=new O0;++I<R;)this.add(S[I])}function ust(S){return this.__data__.set(S,l),this}function dst(S){return this.__data__.has(S)}EE.prototype.add=EE.prototype.push=ust,EE.prototype.has=dst;function l_(S){var I=this.__data__=new N0(S);this.size=I.size}function hst(){this.__data__=new N0,this.size=0}function fst(S){var I=this.__data__,R=I.delete(S);return this.size=I.size,R}function pst(S){return this.__data__.get(S)}function gst(S){return this.__data__.has(S)}function mst(S,I){var R=this.__data__;if(R instanceof N0){var j=R.__data__;if(!DN||j.length<r-1)return j.push([S,I]),this.size=++R.size,this;R=this.__data__=new O0(j)}return R.set(S,I),this.size=R.size,this}l_.prototype.clear=hst,l_.prototype.delete=fst,l_.prototype.get=pst,l_.prototype.has=gst,l_.prototype.set=mst;function SCe(S,I){var R=ao(S),j=!R&&LE(S),ae=!R&&!j&&X1(S),Ce=!R&&!j&&!ae&&kI(S),Be=R||j||ae||Ce,Xe=Be?gs(S.length,Tot):[],dt=Xe.length;for(var dn in S)(I||na.call(S,dn))&&!(Be&&(dn=="length"||ae&&(dn=="offset"||dn=="parent")||Ce&&(dn=="buffer"||dn=="byteLength"||dn=="byteOffset")||B0(dn,dt)))&&Xe.push(dn);return Xe}function ECe(S){var I=S.length;return I?S[jQ(0,I-1)]:t}function _st(S,I){return zB(sf(S),xE(I,0,S.length))}function vst(S){return zB(sf(S))}function PQ(S,I,R){(R!==t&&!c_(S[I],R)||R===t&&!(I in S))&&P0(S,I,R)}function ON(S,I,R){var j=S[I];(!(na.call(S,I)&&c_(j,R))||R===t&&!(I in S))&&P0(S,I,R)}function DB(S,I){for(var R=S.length;R--;)if(c_(S[R][0],I))return R;return-1}function bst(S,I,R,j){return G1(S,function(ae,Ce,Be){I(j,ae,R(ae),Be)}),j}function xCe(S,I){return S&&Fv(I,Iu(I),S)}function yst(S,I){return S&&Fv(I,lf(I),S)}function P0(S,I,R){I=="__proto__"&&EB?EB(S,I,{configurable:!0,enumerable:!0,value:R,writable:!0}):S[I]=R}function MQ(S,I){for(var R=-1,j=I.length,ae=Vt(j),Ce=S==null;++R<j;)ae[R]=Ce?t:mX(S,I[R]);return ae}function xE(S,I,R){return S===S&&(R!==t&&(S=S<=R?S:R),I!==t&&(S=S>=I?S:I)),S}function Hg(S,I,R,j,ae,Ce){var Be,Xe=I&d,dt=I&h,dn=I&f;if(R&&(Be=ae?R(S,j,ae,Ce):R(S)),Be!==t)return Be;if(!Il(S))return S;var fn=ao(S);if(fn){if(Be=lat(S),!Xe)return sf(S,Be)}else{var Sn=Wd(S),hi=Sn==bt||Sn==Mt;if(X1(S))return YCe(S,Xe);if(Sn==Et||Sn==Ve||hi&&!ae){if(Be=dt||hi?{}:pwe(S),!Xe)return dt?Xst(S,yst(Be,S)):Qst(S,xCe(Be,S))}else{if(!Rn[Sn])return ae?S:{};Be=cat(S,Sn,Xe)}}Ce||(Ce=new l_);var Ui=Ce.get(S);if(Ui)return Ui;Ce.set(S,Be),zwe(S)?S.forEach(function(Rr){Be.add(Hg(Rr,I,R,Rr,S,Ce))}):Hwe(S)&&S.forEach(function(Rr,Ho){Be.set(Ho,Hg(Rr,I,R,Ho,S,Ce))});var Ar=dn?dt?nX:tX:dt?lf:Iu,wo=fn?t:Ar(S);return iu(wo||S,function(Rr,Ho){wo&&(Ho=Rr,Rr=S[Ho]),ON(Be,Ho,Hg(Rr,I,R,Ho,S,Ce))}),Be}function Cst(S){var I=Iu(S);return function(R){return TCe(R,S,I)}}function TCe(S,I,R){var j=R.length;if(S==null)return!j;for(S=Da(S);j--;){var ae=R[j],Ce=I[ae],Be=S[ae];if(Be===t&&!(ae in S)||!Ce(Be))return!1}return!0}function kCe(S,I,R){if(typeof S!="function")throw new $g(s);return HN(function(){S.apply(t,R)},I)}function PN(S,I,R,j){var ae=-1,Ce=yh,Be=!0,Xe=S.length,dt=[],dn=I.length;if(!Xe)return dt;R&&(I=_a(I,ol(R))),j?(Ce=z1,Be=!1):I.length>=r&&(Ce=gp,Be=!1,I=new EE(I));e:for(;++ae<Xe;){var fn=S[ae],Sn=R==null?fn:R(fn);if(fn=j||fn!==0?fn:0,Be&&Sn===Sn){for(var hi=dn;hi--;)if(I[hi]===Sn)continue e;dt.push(fn)}else Ce(I,Sn,j)||dt.push(fn)}return dt}var G1=ewe(Mv),ICe=ewe(BQ,!0);function wst(S,I){var R=!0;return G1(S,function(j,ae,Ce){return R=!!I(j,ae,Ce),R}),R}function AB(S,I,R){for(var j=-1,ae=S.length;++j<ae;){var Ce=S[j],Be=I(Ce);if(Be!=null&&(Xe===t?Be===Be&&!_p(Be):R(Be,Xe)))var Xe=Be,dt=Ce}return dt}function Sst(S,I,R,j){var ae=S.length;for(R=bo(R),R<0&&(R=-R>ae?0:ae+R),j=j===t||j>ae?ae:bo(j),j<0&&(j+=ae),j=R>j?0:jwe(j);R<j;)S[R++]=I;return S}function LCe(S,I){var R=[];return G1(S,function(j,ae,Ce){I(j,ae,Ce)&&R.push(j)}),R}function nd(S,I,R,j,ae){var Ce=-1,Be=S.length;for(R||(R=dat),ae||(ae=[]);++Ce<Be;){var Xe=S[Ce];I>0&&R(Xe)?I>1?nd(Xe,I-1,R,j,ae):pp(ae,Xe):j||(ae[ae.length]=Xe)}return ae}var FQ=twe(),DCe=twe(!0);function Mv(S,I){return S&&FQ(S,I,Iu)}function BQ(S,I){return S&&DCe(S,I,Iu)}function RB(S,I){return of(I,function(R){return $0(S[R])})}function TE(S,I){I=Y1(I,S);for(var R=0,j=I.length;S!=null&&R<j;)S=S[Bv(I[R++])];return R&&R==j?S:t}function ACe(S,I,R){var j=I(S);return ao(S)?j:pp(j,R(S))}function wh(S){return S==null?S===t?X:ln:wE&&wE in Da(S)?oat(S):vat(S)}function $Q(S,I){return S>I}function Est(S,I){return S!=null&&na.call(S,I)}function xst(S,I){return S!=null&&I in Da(S)}function Tst(S,I,R){return S>=Hd(I,R)&&S<su(I,R)}function VQ(S,I,R){for(var j=R?z1:yh,ae=S[0].length,Ce=S.length,Be=Ce,Xe=Vt(Ce),dt=1/0,dn=[];Be--;){var fn=S[Be];Be&&I&&(fn=_a(fn,ol(I))),dt=Hd(fn.length,dt),Xe[Be]=!R&&(I||ae>=120&&fn.length>=120)?new EE(Be&&fn):t}fn=S[0];var Sn=-1,hi=Xe[0];e:for(;++Sn<ae&&dn.length<dt;){var Ui=fn[Sn],Ar=I?I(Ui):Ui;if(Ui=R||Ui!==0?Ui:0,!(hi?gp(hi,Ar):j(dn,Ar,R))){for(Be=Ce;--Be;){var wo=Xe[Be];if(!(wo?gp(wo,Ar):j(S[Be],Ar,R)))continue e}hi&&hi.push(Ar),dn.push(Ui)}}return dn}function kst(S,I,R,j){return Mv(S,function(ae,Ce,Be){I(j,R(ae),Ce,Be)}),j}function MN(S,I,R){I=Y1(I,S),S=vwe(S,I);var j=S==null?S:S[Bv(zg(I))];return j==null?t:ed(j,S,R)}function RCe(S){return zl(S)&&wh(S)==Ve}function Ist(S){return zl(S)&&wh(S)==me}function Lst(S){return zl(S)&&wh(S)==Pe}function FN(S,I,R,j,ae){return S===I?!0:S==null||I==null||!zl(S)&&!zl(I)?S!==S&&I!==I:Dst(S,I,R,j,FN,ae)}function Dst(S,I,R,j,ae,Ce){var Be=ao(S),Xe=ao(I),dt=Be?Ye:Wd(S),dn=Xe?Ye:Wd(I);dt=dt==Ve?Et:dt,dn=dn==Ve?Et:dn;var fn=dt==Et,Sn=dn==Et,hi=dt==dn;if(hi&&X1(S)){if(!X1(I))return!1;Be=!0,fn=!1}if(hi&&!fn)return Ce||(Ce=new l_),Be||kI(S)?dwe(S,I,R,j,ae,Ce):iat(S,I,dt,R,j,ae,Ce);if(!(R&g)){var Ui=fn&&na.call(S,"__wrapped__"),Ar=Sn&&na.call(I,"__wrapped__");if(Ui||Ar){var wo=Ui?S.value():S,Rr=Ar?I.value():I;return Ce||(Ce=new l_),ae(wo,Rr,R,j,Ce)}}return hi?(Ce||(Ce=new l_),rat(S,I,R,j,ae,Ce)):!1}function Ast(S){return zl(S)&&Wd(S)==Ft}function HQ(S,I,R,j){var ae=R.length,Ce=ae,Be=!j;if(S==null)return!Ce;for(S=Da(S);ae--;){var Xe=R[ae];if(Be&&Xe[2]?Xe[1]!==S[Xe[0]]:!(Xe[0]in S))return!1}for(;++ae<Ce;){Xe=R[ae];var dt=Xe[0],dn=S[dt],fn=Xe[1];if(Be&&Xe[2]){if(dn===t&&!(dt in S))return!1}else{var Sn=new l_;if(j)var hi=j(dn,fn,dt,S,I,Sn);if(!(hi===t?FN(fn,dn,g|m,j,Sn):hi))return!1}}return!0}function NCe(S){if(!Il(S)||fat(S))return!1;var I=$0(S)?Aot:ze;return I.test(IE(S))}function Rst(S){return zl(S)&&wh(S)==be}function Nst(S){return zl(S)&&Wd(S)==Te}function Ost(S){return zl(S)&&YB(S.length)&&!!Dr[wh(S)]}function OCe(S){return typeof S=="function"?S:S==null?cf:typeof S=="object"?ao(S)?FCe(S[0],S[1]):MCe(S):nSe(S)}function WQ(S){if(!VN(S))return Fot(S);var I=[];for(var R in Da(S))na.call(S,R)&&R!="constructor"&&I.push(R);return I}function Pst(S){if(!Il(S))return _at(S);var I=VN(S),R=[];for(var j in S)j=="constructor"&&(I||!na.call(S,j))||R.push(j);return R}function zQ(S,I){return S<I}function PCe(S,I){var R=-1,j=af(S)?Vt(S.length):[];return G1(S,function(ae,Ce,Be){j[++R]=I(ae,Ce,Be)}),j}function MCe(S){var I=rX(S);return I.length==1&&I[0][2]?mwe(I[0][0],I[0][1]):function(R){return R===S||HQ(R,S,I)}}function FCe(S,I){return sX(S)&&gwe(I)?mwe(Bv(S),I):function(R){var j=mX(R,S);return j===t&&j===I?_X(R,S):FN(I,j,g|m)}}function NB(S,I,R,j,ae){S!==I&&FQ(I,function(Ce,Be){if(ae||(ae=new l_),Il(Ce))Mst(S,I,Be,R,NB,j,ae);else{var Xe=j?j(lX(S,Be),Ce,Be+"",S,I,ae):t;Xe===t&&(Xe=Ce),PQ(S,Be,Xe)}},lf)}function Mst(S,I,R,j,ae,Ce,Be){var Xe=lX(S,R),dt=lX(I,R),dn=Be.get(dt);if(dn){PQ(S,R,dn);return}var fn=Ce?Ce(Xe,dt,R+"",S,I,Be):t,Sn=fn===t;if(Sn){var hi=ao(dt),Ui=!hi&&X1(dt),Ar=!hi&&!Ui&&kI(dt);fn=dt,hi||Ui||Ar?ao(Xe)?fn=Xe:lc(Xe)?fn=sf(Xe):Ui?(Sn=!1,fn=YCe(dt,!0)):Ar?(Sn=!1,fn=QCe(dt,!0)):fn=[]:WN(dt)||LE(dt)?(fn=Xe,LE(Xe)?fn=qwe(Xe):(!Il(Xe)||$0(Xe))&&(fn=pwe(dt))):Sn=!1}Sn&&(Be.set(dt,fn),ae(fn,dt,j,Ce,Be),Be.delete(dt)),PQ(S,R,fn)}function BCe(S,I){var R=S.length;if(R)return I+=I<0?R:0,B0(I,R)?S[I]:t}function $Ce(S,I,R){I.length?I=_a(I,function(Ce){return ao(Ce)?function(Be){return TE(Be,Ce.length===1?Ce[0]:Ce)}:Ce}):I=[cf];var j=-1;I=_a(I,ol(Sr()));var ae=PCe(S,function(Ce,Be,Xe){var dt=_a(I,function(dn){return dn(Ce)});return{criteria:dt,index:++j,value:Ce}});return Mr(ae,function(Ce,Be){return Yst(Ce,Be,R)})}function Fst(S,I){return VCe(S,I,function(R,j){return _X(S,j)})}function VCe(S,I,R){for(var j=-1,ae=I.length,Ce={};++j<ae;){var Be=I[j],Xe=TE(S,Be);R(Xe,Be)&&BN(Ce,Y1(Be,S),Xe)}return Ce}function Bst(S){return function(I){return TE(I,S)}}function UQ(S,I,R,j){var ae=j?$n:Kt,Ce=-1,Be=I.length,Xe=S;for(S===I&&(I=sf(I)),R&&(Xe=_a(S,ol(R)));++Ce<Be;)for(var dt=0,dn=I[Ce],fn=R?R(dn):dn;(dt=ae(Xe,fn,dt,j))>-1;)Xe!==S&&SB.call(Xe,dt,1),SB.call(S,dt,1);return S}function HCe(S,I){for(var R=S?I.length:0,j=R-1;R--;){var ae=I[R];if(R==j||ae!==Ce){var Ce=ae;B0(ae)?SB.call(S,ae,1):KQ(S,ae)}}return S}function jQ(S,I){return S+TB(CCe()*(I-S+1))}function $st(S,I,R,j){for(var ae=-1,Ce=su(xB((I-S)/(R||1)),0),Be=Vt(Ce);Ce--;)Be[j?Ce:++ae]=S,S+=R;return Be}function qQ(S,I){var R="";if(!S||I<1||I>W)return R;do I%2&&(R+=S),I=TB(I/2),I&&(S+=S);while(I);return R}function Io(S,I){return cX(_we(S,I,cf),S+"")}function Vst(S){return ECe(II(S))}function Hst(S,I){var R=II(S);return zB(R,xE(I,0,R.length))}function BN(S,I,R,j){if(!Il(S))return S;I=Y1(I,S);for(var ae=-1,Ce=I.length,Be=Ce-1,Xe=S;Xe!=null&&++ae<Ce;){var dt=Bv(I[ae]),dn=R;if(dt==="__proto__"||dt==="constructor"||dt==="prototype")return S;if(ae!=Be){var fn=Xe[dt];dn=j?j(fn,dt,Xe):t,dn===t&&(dn=Il(fn)?fn:B0(I[ae+1])?[]:{})}ON(Xe,dt,dn),Xe=Xe[dt]}return S}var WCe=kB?function(S,I){return kB.set(S,I),S}:cf,Wst=EB?function(S,I){return EB(S,"toString",{configurable:!0,enumerable:!1,value:bX(I),writable:!0})}:cf;function zst(S){return zB(II(S))}function Wg(S,I,R){var j=-1,ae=S.length;I<0&&(I=-I>ae?0:ae+I),R=R>ae?ae:R,R<0&&(R+=ae),ae=I>R?0:R-I>>>0,I>>>=0;for(var Ce=Vt(ae);++j<ae;)Ce[j]=S[j+I];return Ce}function Ust(S,I){var R;return G1(S,function(j,ae,Ce){return R=I(j,ae,Ce),!R}),!!R}function OB(S,I,R){var j=0,ae=S==null?j:S.length;if(typeof I=="number"&&I===I&&ae<=Q){for(;j<ae;){var Ce=j+ae>>>1,Be=S[Ce];Be!==null&&!_p(Be)&&(R?Be<=I:Be<I)?j=Ce+1:ae=Ce}return ae}return GQ(S,I,cf,R)}function GQ(S,I,R,j){var ae=0,Ce=S==null?0:S.length;if(Ce===0)return 0;I=R(I);for(var Be=I!==I,Xe=I===null,dt=_p(I),dn=I===t;ae<Ce;){var fn=TB((ae+Ce)/2),Sn=R(S[fn]),hi=Sn!==t,Ui=Sn===null,Ar=Sn===Sn,wo=_p(Sn);if(Be)var Rr=j||Ar;else dn?Rr=Ar&&(j||hi):Xe?Rr=Ar&&hi&&(j||!Ui):dt?Rr=Ar&&hi&&!Ui&&(j||!wo):Ui||wo?Rr=!1:Rr=j?Sn<=I:Sn<I;Rr?ae=fn+1:Ce=fn}return Hd(Ce,oe)}function zCe(S,I){for(var R=-1,j=S.length,ae=0,Ce=[];++R<j;){var Be=S[R],Xe=I?I(Be):Be;if(!R||!c_(Xe,dt)){var dt=Xe;Ce[ae++]=Be===0?0:Be}}return Ce}function UCe(S){return typeof S=="number"?S:_p(S)?V:+S}function mp(S){if(typeof S=="string")return S;if(ao(S))return _a(S,mp)+"";if(_p(S))return wCe?wCe.call(S):"";var I=S+"";return I=="0"&&1/S==-H?"-0":I}function K1(S,I,R){var j=-1,ae=yh,Ce=S.length,Be=!0,Xe=[],dt=Xe;if(R)Be=!1,ae=z1;else if(Ce>=r){var dn=I?null:tat(S);if(dn)return gB(dn);Be=!1,ae=gp,dt=new EE}else dt=I?[]:Xe;e:for(;++j<Ce;){var fn=S[j],Sn=I?I(fn):fn;if(fn=R||fn!==0?fn:0,Be&&Sn===Sn){for(var hi=dt.length;hi--;)if(dt[hi]===Sn)continue e;I&&dt.push(Sn),Xe.push(fn)}else ae(dt,Sn,R)||(dt!==Xe&&dt.push(Sn),Xe.push(fn))}return Xe}function KQ(S,I){return I=Y1(I,S),S=vwe(S,I),S==null||delete S[Bv(zg(I))]}function jCe(S,I,R,j){return BN(S,I,R(TE(S,I)),j)}function PB(S,I,R,j){for(var ae=S.length,Ce=j?ae:-1;(j?Ce--:++Ce<ae)&&I(S[Ce],Ce,S););return R?Wg(S,j?0:Ce,j?Ce+1:ae):Wg(S,j?Ce+1:0,j?ae:Ce)}function qCe(S,I){var R=S;return R instanceof Ko&&(R=R.value()),bl(I,function(j,ae){return ae.func.apply(ae.thisArg,pp([j],ae.args))},R)}function YQ(S,I,R){var j=S.length;if(j<2)return j?K1(S[0]):[];for(var ae=-1,Ce=Vt(j);++ae<j;)for(var Be=S[ae],Xe=-1;++Xe<j;)Xe!=ae&&(Ce[ae]=PN(Ce[ae]||Be,S[Xe],I,R));return K1(nd(Ce,1),I,R)}function GCe(S,I,R){for(var j=-1,ae=S.length,Ce=I.length,Be={};++j<ae;){var Xe=j<Ce?I[j]:t;R(Be,S[j],Xe)}return Be}function QQ(S){return lc(S)?S:[]}function XQ(S){return typeof S=="function"?S:cf}function Y1(S,I){return ao(S)?S:sX(S,I)?[S]:wwe(Us(S))}var jst=Io;function Q1(S,I,R){var j=S.length;return R=R===t?j:R,!I&&R>=j?S:Wg(S,I,R)}var KCe=Rot||function(S){return vl.clearTimeout(S)};function YCe(S,I){if(I)return S.slice();var R=S.length,j=mCe?mCe(R):new S.constructor(R);return S.copy(j),j}function ZQ(S){var I=new S.constructor(S.byteLength);return new CB(I).set(new CB(S)),I}function qst(S,I){var R=I?ZQ(S.buffer):S.buffer;return new S.constructor(R,S.byteOffset,S.byteLength)}function Gst(S){var I=new S.constructor(S.source,ut.exec(S));return I.lastIndex=S.lastIndex,I}function Kst(S){return NN?Da(NN.call(S)):{}}function QCe(S,I){var R=I?ZQ(S.buffer):S.buffer;return new S.constructor(R,S.byteOffset,S.length)}function XCe(S,I){if(S!==I){var R=S!==t,j=S===null,ae=S===S,Ce=_p(S),Be=I!==t,Xe=I===null,dt=I===I,dn=_p(I);if(!Xe&&!dn&&!Ce&&S>I||Ce&&Be&&dt&&!Xe&&!dn||j&&Be&&dt||!R&&dt||!ae)return 1;if(!j&&!Ce&&!dn&&S<I||dn&&R&&ae&&!j&&!Ce||Xe&&R&&ae||!Be&&ae||!dt)return-1}return 0}function Yst(S,I,R){for(var j=-1,ae=S.criteria,Ce=I.criteria,Be=ae.length,Xe=R.length;++j<Be;){var dt=XCe(ae[j],Ce[j]);if(dt){if(j>=Xe)return dt;var dn=R[j];return dt*(dn=="desc"?-1:1)}}return S.index-I.index}function ZCe(S,I,R,j){for(var ae=-1,Ce=S.length,Be=R.length,Xe=-1,dt=I.length,dn=su(Ce-Be,0),fn=Vt(dt+dn),Sn=!j;++Xe<dt;)fn[Xe]=I[Xe];for(;++ae<Be;)(Sn||ae<Ce)&&(fn[R[ae]]=S[ae]);for(;dn--;)fn[Xe++]=S[ae++];return fn}function JCe(S,I,R,j){for(var ae=-1,Ce=S.length,Be=-1,Xe=R.length,dt=-1,dn=I.length,fn=su(Ce-Xe,0),Sn=Vt(fn+dn),hi=!j;++ae<fn;)Sn[ae]=S[ae];for(var Ui=ae;++dt<dn;)Sn[Ui+dt]=I[dt];for(;++Be<Xe;)(hi||ae<Ce)&&(Sn[Ui+R[Be]]=S[ae++]);return Sn}function sf(S,I){var R=-1,j=S.length;for(I||(I=Vt(j));++R<j;)I[R]=S[R];return I}function Fv(S,I,R,j){var ae=!R;R||(R={});for(var Ce=-1,Be=I.length;++Ce<Be;){var Xe=I[Ce],dt=j?j(R[Xe],S[Xe],Xe,R,S):t;dt===t&&(dt=S[Xe]),ae?P0(R,Xe,dt):ON(R,Xe,dt)}return R}function Qst(S,I){return Fv(S,oX(S),I)}function Xst(S,I){return Fv(S,hwe(S),I)}function MB(S,I){return function(R,j){var ae=ao(R)?SN:bst,Ce=I?I():{};return ae(R,S,Sr(j,2),Ce)}}function EI(S){return Io(function(I,R){var j=-1,ae=R.length,Ce=ae>1?R[ae-1]:t,Be=ae>2?R[2]:t;for(Ce=S.length>3&&typeof Ce=="function"?(ae--,Ce):t,Be&&Sh(R[0],R[1],Be)&&(Ce=ae<3?t:Ce,ae=1),I=Da(I);++j<ae;){var Xe=R[j];Xe&&S(I,Xe,j,Ce)}return I})}function ewe(S,I){return function(R,j){if(R==null)return R;if(!af(R))return S(R,j);for(var ae=R.length,Ce=I?ae:-1,Be=Da(R);(I?Ce--:++Ce<ae)&&j(Be[Ce],Ce,Be)!==!1;);return R}}function twe(S){return function(I,R,j){for(var ae=-1,Ce=Da(I),Be=j(I),Xe=Be.length;Xe--;){var dt=Be[S?Xe:++ae];if(R(Ce[dt],dt,Ce)===!1)break}return I}}function Zst(S,I,R){var j=I&v,ae=$N(S);function Ce(){var Be=this&&this!==vl&&this instanceof Ce?ae:S;return Be.apply(j?R:this,arguments)}return Ce}function nwe(S){return function(I){I=Us(I);var R=U1(I)?a_(I):t,j=R?R[0]:I.charAt(0),ae=R?Q1(R,1).join(""):I.slice(1);return j[S]()+ae}}function xI(S){return function(I){return bl(eSe(Jwe(I).replace(yn,"")),S,"")}}function $N(S){return function(){var I=arguments;switch(I.length){case 0:return new S;case 1:return new S(I[0]);case 2:return new S(I[0],I[1]);case 3:return new S(I[0],I[1],I[2]);case 4:return new S(I[0],I[1],I[2],I[3]);case 5:return new S(I[0],I[1],I[2],I[3],I[4]);case 6:return new S(I[0],I[1],I[2],I[3],I[4],I[5]);case 7:return new S(I[0],I[1],I[2],I[3],I[4],I[5],I[6])}var R=SI(S.prototype),j=S.apply(R,I);return Il(j)?j:R}}function Jst(S,I,R){var j=$N(S);function ae(){for(var Ce=arguments.length,Be=Vt(Ce),Xe=Ce,dt=TI(ae);Xe--;)Be[Xe]=arguments[Xe];var dn=Ce<3&&Be[0]!==dt&&Be[Ce-1]!==dt?[]:j1(Be,dt);if(Ce-=dn.length,Ce<R)return awe(S,I,FB,ae.placeholder,t,Be,dn,t,t,R-Ce);var fn=this&&this!==vl&&this instanceof ae?j:S;return ed(fn,this,Be)}return ae}function iwe(S){return function(I,R,j){var ae=Da(I);if(!af(I)){var Ce=Sr(R,3);I=Iu(I),R=function(Xe){return Ce(ae[Xe],Xe,ae)}}var Be=S(I,R,j);return Be>-1?ae[Ce?I[Be]:Be]:t}}function rwe(S){return F0(function(I){var R=I.length,j=R,ae=Vg.prototype.thru;for(S&&I.reverse();j--;){var Ce=I[j];if(typeof Ce!="function")throw new $g(s);if(ae&&!Be&&HB(Ce)=="wrapper")var Be=new Vg([],!0)}for(j=Be?j:R;++j<R;){Ce=I[j];var Xe=HB(Ce),dt=Xe=="wrapper"?iX(Ce):t;dt&&aX(dt[0])&&dt[1]==(k|y|E|L)&&!dt[4].length&&dt[9]==1?Be=Be[HB(dt[0])].apply(Be,dt[3]):Be=Ce.length==1&&aX(Ce)?Be[Xe]():Be.thru(Ce)}return function(){var dn=arguments,fn=dn[0];if(Be&&dn.length==1&&ao(fn))return Be.plant(fn).value();for(var Sn=0,hi=R?I[Sn].apply(this,dn):fn;++Sn<R;)hi=I[Sn].call(this,hi);return hi}})}function FB(S,I,R,j,ae,Ce,Be,Xe,dt,dn){var fn=I&k,Sn=I&v,hi=I&_,Ui=I&(y|C),Ar=I&D,wo=hi?t:$N(S);function Rr(){for(var Ho=arguments.length,ns=Vt(Ho),vp=Ho;vp--;)ns[vp]=arguments[vp];if(Ui)var Eh=TI(Rr),bp=hB(ns,Eh);if(j&&(ns=ZCe(ns,j,ae,Ui)),Ce&&(ns=JCe(ns,Ce,Be,Ui)),Ho-=bp,Ui&&Ho<dn){var cc=j1(ns,Eh);return awe(S,I,FB,Rr.placeholder,R,ns,cc,Xe,dt,dn-Ho)}var u_=Sn?R:this,H0=hi?u_[S]:S;return Ho=ns.length,Xe?ns=bat(ns,Xe):Ar&&Ho>1&&ns.reverse(),fn&&dt<Ho&&(ns.length=dt),this&&this!==vl&&this instanceof Rr&&(H0=wo||$N(H0)),H0.apply(u_,ns)}return Rr}function owe(S,I){return function(R,j){return kst(R,S,I(j),{})}}function BB(S,I){return function(R,j){var ae;if(R===t&&j===t)return I;if(R!==t&&(ae=R),j!==t){if(ae===t)return j;typeof R=="string"||typeof j=="string"?(R=mp(R),j=mp(j)):(R=UCe(R),j=UCe(j)),ae=S(R,j)}return ae}}function JQ(S){return F0(function(I){return I=_a(I,ol(Sr())),Io(function(R){var j=this;return S(I,function(ae){return ed(ae,j,R)})})})}function $B(S,I){I=I===t?" ":mp(I);var R=I.length;if(R<2)return R?qQ(I,S):I;var j=qQ(I,xB(S/vI(I)));return U1(I)?Q1(a_(j),0,S).join(""):j.slice(0,S)}function eat(S,I,R,j){var ae=I&v,Ce=$N(S);function Be(){for(var Xe=-1,dt=arguments.length,dn=-1,fn=j.length,Sn=Vt(fn+dt),hi=this&&this!==vl&&this instanceof Be?Ce:S;++dn<fn;)Sn[dn]=j[dn];for(;dt--;)Sn[dn++]=arguments[++Xe];return ed(hi,ae?R:this,Sn)}return Be}function swe(S){return function(I,R,j){return j&&typeof j!="number"&&Sh(I,R,j)&&(R=j=t),I=V0(I),R===t?(R=I,I=0):R=V0(R),j=j===t?I<R?1:-1:V0(j),$st(I,R,j,S)}}function VB(S){return function(I,R){return typeof I=="string"&&typeof R=="string"||(I=Ug(I),R=Ug(R)),S(I,R)}}function awe(S,I,R,j,ae,Ce,Be,Xe,dt,dn){var fn=I&y,Sn=fn?Be:t,hi=fn?t:Be,Ui=fn?Ce:t,Ar=fn?t:Ce;I|=fn?E:x,I&=~(fn?x:E),I&b||(I&=~(v|_));var wo=[S,I,ae,Ui,Sn,Ar,hi,Xe,dt,dn],Rr=R.apply(t,wo);return aX(S)&&bwe(Rr,wo),Rr.placeholder=j,ywe(Rr,S,I)}function eX(S){var I=ou[S];return function(R,j){if(R=Ug(R),j=j==null?0:Hd(bo(j),292),j&&yCe(R)){var ae=(Us(R)+"e").split("e"),Ce=I(ae[0]+"e"+(+ae[1]+j));return ae=(Us(Ce)+"e").split("e"),+(ae[0]+"e"+(+ae[1]-j))}return I(R)}}var tat=CI&&1/gB(new CI([,-0]))[1]==H?function(S){return new CI(S)}:wX;function lwe(S){return function(I){var R=Wd(I);return R==Ft?kN(I):R==Te?vot(I):Mc(I,S(I))}}function M0(S,I,R,j,ae,Ce,Be,Xe){var dt=I&_;if(!dt&&typeof S!="function")throw new $g(s);var dn=j?j.length:0;if(dn||(I&=~(E|x),j=ae=t),Be=Be===t?Be:su(bo(Be),0),Xe=Xe===t?Xe:bo(Xe),dn-=ae?ae.length:0,I&x){var fn=j,Sn=ae;j=ae=t}var hi=dt?t:iX(S),Ui=[S,I,R,j,ae,fn,Sn,Ce,Be,Xe];if(hi&&mat(Ui,hi),S=Ui[0],I=Ui[1],R=Ui[2],j=Ui[3],ae=Ui[4],Xe=Ui[9]=Ui[9]===t?dt?0:S.length:su(Ui[9]-dn,0),!Xe&&I&(y|C)&&(I&=~(y|C)),!I||I==v)var Ar=Zst(S,I,R);else I==y||I==C?Ar=Jst(S,I,Xe):(I==E||I==(v|E))&&!ae.length?Ar=eat(S,I,R,j):Ar=FB.apply(t,Ui);var wo=hi?WCe:bwe;return ywe(wo(Ar,Ui),S,I)}function cwe(S,I,R,j){return S===t||c_(S,yI[R])&&!na.call(j,R)?I:S}function uwe(S,I,R,j,ae,Ce){return Il(S)&&Il(I)&&(Ce.set(I,S),NB(S,I,t,uwe,Ce),Ce.delete(I)),S}function nat(S){return WN(S)?t:S}function dwe(S,I,R,j,ae,Ce){var Be=R&g,Xe=S.length,dt=I.length;if(Xe!=dt&&!(Be&&dt>Xe))return!1;var dn=Ce.get(S),fn=Ce.get(I);if(dn&&fn)return dn==I&&fn==S;var Sn=-1,hi=!0,Ui=R&m?new EE:t;for(Ce.set(S,I),Ce.set(I,S);++Sn<Xe;){var Ar=S[Sn],wo=I[Sn];if(j)var Rr=Be?j(wo,Ar,Sn,I,S,Ce):j(Ar,wo,Sn,S,I,Ce);if(Rr!==t){if(Rr)continue;hi=!1;break}if(Ui){if(!CE(I,function(Ho,ns){if(!gp(Ui,ns)&&(Ar===Ho||ae(Ar,Ho,R,j,Ce)))return Ui.push(ns)})){hi=!1;break}}else if(!(Ar===wo||ae(Ar,wo,R,j,Ce))){hi=!1;break}}return Ce.delete(S),Ce.delete(I),hi}function iat(S,I,R,j,ae,Ce,Be){switch(R){case Me:if(S.byteLength!=I.byteLength||S.byteOffset!=I.byteOffset)return!1;S=S.buffer,I=I.buffer;case me:return!(S.byteLength!=I.byteLength||!Ce(new CB(S),new CB(I)));case He:case Pe:case Yt:return c_(+S,+I);case Fe:return S.name==I.name&&S.message==I.message;case be:case se:return S==I+"";case Ft:var Xe=kN;case Te:var dt=j&g;if(Xe||(Xe=gB),S.size!=I.size&&!dt)return!1;var dn=Be.get(S);if(dn)return dn==I;j|=m,Be.set(S,I);var fn=dwe(Xe(S),Xe(I),j,ae,Ce,Be);return Be.delete(S),fn;case Y:if(NN)return NN.call(S)==NN.call(I)}return!1}function rat(S,I,R,j,ae,Ce){var Be=R&g,Xe=tX(S),dt=Xe.length,dn=tX(I),fn=dn.length;if(dt!=fn&&!Be)return!1;for(var Sn=dt;Sn--;){var hi=Xe[Sn];if(!(Be?hi in I:na.call(I,hi)))return!1}var Ui=Ce.get(S),Ar=Ce.get(I);if(Ui&&Ar)return Ui==I&&Ar==S;var wo=!0;Ce.set(S,I),Ce.set(I,S);for(var Rr=Be;++Sn<dt;){hi=Xe[Sn];var Ho=S[hi],ns=I[hi];if(j)var vp=Be?j(ns,Ho,hi,I,S,Ce):j(Ho,ns,hi,S,I,Ce);if(!(vp===t?Ho===ns||ae(Ho,ns,R,j,Ce):vp)){wo=!1;break}Rr||(Rr=hi=="constructor")}if(wo&&!Rr){var Eh=S.constructor,bp=I.constructor;Eh!=bp&&"constructor"in S&&"constructor"in I&&!(typeof Eh=="function"&&Eh instanceof Eh&&typeof bp=="function"&&bp instanceof bp)&&(wo=!1)}return Ce.delete(S),Ce.delete(I),wo}function F0(S){return cX(_we(S,t,Twe),S+"")}function tX(S){return ACe(S,Iu,oX)}function nX(S){return ACe(S,lf,hwe)}var iX=kB?function(S){return kB.get(S)}:wX;function HB(S){for(var I=S.name+"",R=wI[I],j=na.call(wI,I)?R.length:0;j--;){var ae=R[j],Ce=ae.func;if(Ce==null||Ce==S)return ae.name}return I}function TI(S){var I=na.call(ge,"placeholder")?ge:S;return I.placeholder}function Sr(){var S=ge.iteratee||yX;return S=S===yX?OCe:S,arguments.length?S(arguments[0],arguments[1]):S}function WB(S,I){var R=S.__data__;return hat(I)?R[typeof I=="string"?"string":"hash"]:R.map}function rX(S){for(var I=Iu(S),R=I.length;R--;){var j=I[R],ae=S[j];I[R]=[j,ae,gwe(ae)]}return I}function kE(S,I){var R=pB(S,I);return NCe(R)?R:t}function oat(S){var I=na.call(S,wE),R=S[wE];try{S[wE]=t;var j=!0}catch{}var ae=bB.call(S);return j&&(I?S[wE]=R:delete S[wE]),ae}var oX=RQ?function(S){return S==null?[]:(S=Da(S),of(RQ(S),function(I){return vCe.call(S,I)}))}:SX,hwe=RQ?function(S){for(var I=[];S;)pp(I,oX(S)),S=wB(S);return I}:SX,Wd=wh;(NQ&&Wd(new NQ(new ArrayBuffer(1)))!=Me||DN&&Wd(new DN)!=Ft||OQ&&Wd(OQ.resolve())!=mt||CI&&Wd(new CI)!=Te||AN&&Wd(new AN)!=le)&&(Wd=function(S){var I=wh(S),R=I==Et?S.constructor:t,j=R?IE(R):"";if(j)switch(j){case Hot:return Me;case Wot:return Ft;case zot:return mt;case Uot:return Te;case jot:return le}return I});function sat(S,I,R){for(var j=-1,ae=R.length;++j<ae;){var Ce=R[j],Be=Ce.size;switch(Ce.type){case"drop":S+=Be;break;case"dropRight":I-=Be;break;case"take":I=Hd(I,S+Be);break;case"takeRight":S=su(S,I-Be);break}}return{start:S,end:I}}function aat(S){var I=S.match(di);return I?I[1].split(Wr):[]}function fwe(S,I,R){I=Y1(I,S);for(var j=-1,ae=I.length,Ce=!1;++j<ae;){var Be=Bv(I[j]);if(!(Ce=S!=null&&R(S,Be)))break;S=S[Be]}return Ce||++j!=ae?Ce:(ae=S==null?0:S.length,!!ae&&YB(ae)&&B0(Be,ae)&&(ao(S)||LE(S)))}function lat(S){var I=S.length,R=new S.constructor(I);return I&&typeof S[0]=="string"&&na.call(S,"index")&&(R.index=S.index,R.input=S.input),R}function pwe(S){return typeof S.constructor=="function"&&!VN(S)?SI(wB(S)):{}}function cat(S,I,R){var j=S.constructor;switch(I){case me:return ZQ(S);case He:case Pe:return new j(+S);case Me:return qst(S,R);case rt:case It:case Qt:case pe:case We:case ne:case Se:case Ie:case Ke:return QCe(S,R);case Ft:return new j;case Yt:case se:return new j(S);case be:return Gst(S);case Te:return new j;case Y:return Kst(S)}}function uat(S,I){var R=I.length;if(!R)return S;var j=R-1;return I[j]=(R>1?"& ":"")+I[j],I=I.join(R>2?", ":" "),S.replace(rn,`{
/* [wrapped with `+I+`] */
`)}function dat(S){return ao(S)||LE(S)||!!(bCe&&S&&S[bCe])}function B0(S,I){var R=typeof S;return I=I??W,!!I&&(R=="number"||R!="symbol"&&tt.test(S))&&S>-1&&S%1==0&&S<I}function Sh(S,I,R){if(!Il(R))return!1;var j=typeof I;return(j=="number"?af(R)&&B0(I,R.length):j=="string"&&I in R)?c_(R[I],S):!1}function sX(S,I){if(ao(S))return!1;var R=typeof S;return R=="number"||R=="symbol"||R=="boolean"||S==null||_p(S)?!0:ur.test(S)||!er.test(S)||I!=null&&S in Da(I)}function hat(S){var I=typeof S;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?S!=="__proto__":S===null}function aX(S){var I=HB(S),R=ge[I];if(typeof R!="function"||!(I in Ko.prototype))return!1;if(S===R)return!0;var j=iX(R);return!!j&&S===j[0]}function fat(S){return!!gCe&&gCe in S}var pat=_B?$0:EX;function VN(S){var I=S&&S.constructor,R=typeof I=="function"&&I.prototype||yI;return S===R}function gwe(S){return S===S&&!Il(S)}function mwe(S,I){return function(R){return R==null?!1:R[S]===I&&(I!==t||S in Da(R))}}function gat(S){var I=GB(S,function(j){return R.size===c&&R.clear(),j}),R=I.cache;return I}function mat(S,I){var R=S[1],j=I[1],ae=R|j,Ce=ae<(v|_|k),Be=j==k&&R==y||j==k&&R==L&&S[7].length<=I[8]||j==(k|L)&&I[7].length<=I[8]&&R==y;if(!(Ce||Be))return S;j&v&&(S[2]=I[2],ae|=R&v?0:b);var Xe=I[3];if(Xe){var dt=S[3];S[3]=dt?ZCe(dt,Xe,I[4]):Xe,S[4]=dt?j1(S[3],u):I[4]}return Xe=I[5],Xe&&(dt=S[5],S[5]=dt?JCe(dt,Xe,I[6]):Xe,S[6]=dt?j1(S[5],u):I[6]),Xe=I[7],Xe&&(S[7]=Xe),j&k&&(S[8]=S[8]==null?I[8]:Hd(S[8],I[8])),S[9]==null&&(S[9]=I[9]),S[0]=I[0],S[1]=ae,S}function _at(S){var I=[];if(S!=null)for(var R in Da(S))I.push(R);return I}function vat(S){return bB.call(S)}function _we(S,I,R){return I=su(I===t?S.length-1:I,0),function(){for(var j=arguments,ae=-1,Ce=su(j.length-I,0),Be=Vt(Ce);++ae<Ce;)Be[ae]=j[I+ae];ae=-1;for(var Xe=Vt(I+1);++ae<I;)Xe[ae]=j[ae];return Xe[I]=R(Be),ed(S,this,Xe)}}function vwe(S,I){return I.length<2?S:TE(S,Wg(I,0,-1))}function bat(S,I){for(var R=S.length,j=Hd(I.length,R),ae=sf(S);j--;){var Ce=I[j];S[j]=B0(Ce,R)?ae[Ce]:t}return S}function lX(S,I){if(!(I==="constructor"&&typeof S[I]=="function")&&I!="__proto__")return S[I]}var bwe=Cwe(WCe),HN=Oot||function(S,I){return vl.setTimeout(S,I)},cX=Cwe(Wst);function ywe(S,I,R){var j=I+"";return cX(S,uat(j,yat(aat(j),R)))}function Cwe(S){var I=0,R=0;return function(){var j=Bot(),ae=M-(j-R);if(R=j,ae>0){if(++I>=P)return arguments[0]}else I=0;return S.apply(t,arguments)}}function zB(S,I){var R=-1,j=S.length,ae=j-1;for(I=I===t?j:I;++R<I;){var Ce=jQ(R,ae),Be=S[Ce];S[Ce]=S[R],S[R]=Be}return S.length=I,S}var wwe=gat(function(S){var I=[];return S.charCodeAt(0)===46&&I.push(""),S.replace(Jr,function(R,j,ae,Ce){I.push(ae?Ce.replace(Gt,"$1"):j||R)}),I});function Bv(S){if(typeof S=="string"||_p(S))return S;var I=S+"";return I=="0"&&1/S==-H?"-0":I}function IE(S){if(S!=null){try{return vB.call(S)}catch{}try{return S+""}catch{}}return""}function yat(S,I){return iu(Ne,function(R){var j="_."+R[0];I&R[1]&&!yh(S,j)&&S.push(j)}),S.sort()}function Swe(S){if(S instanceof Ko)return S.clone();var I=new Vg(S.__wrapped__,S.__chain__);return I.__actions__=sf(S.__actions__),I.__index__=S.__index__,I.__values__=S.__values__,I}function Cat(S,I,R){(R?Sh(S,I,R):I===t)?I=1:I=su(bo(I),0);var j=S==null?0:S.length;if(!j||I<1)return[];for(var ae=0,Ce=0,Be=Vt(xB(j/I));ae<j;)Be[Ce++]=Wg(S,ae,ae+=I);return Be}function wat(S){for(var I=-1,R=S==null?0:S.length,j=0,ae=[];++I<R;){var Ce=S[I];Ce&&(ae[j++]=Ce)}return ae}function Sat(){var S=arguments.length;if(!S)return[];for(var I=Vt(S-1),R=arguments[0],j=S;j--;)I[j-1]=arguments[j];return pp(ao(R)?sf(R):[R],nd(I,1))}var Eat=Io(function(S,I){return lc(S)?PN(S,nd(I,1,lc,!0)):[]}),xat=Io(function(S,I){var R=zg(I);return lc(R)&&(R=t),lc(S)?PN(S,nd(I,1,lc,!0),Sr(R,2)):[]}),Tat=Io(function(S,I){var R=zg(I);return lc(R)&&(R=t),lc(S)?PN(S,nd(I,1,lc,!0),t,R):[]});function kat(S,I,R){var j=S==null?0:S.length;return j?(I=R||I===t?1:bo(I),Wg(S,I<0?0:I,j)):[]}function Iat(S,I,R){var j=S==null?0:S.length;return j?(I=R||I===t?1:bo(I),I=j-I,Wg(S,0,I<0?0:I)):[]}function Lat(S,I){return S&&S.length?PB(S,Sr(I,3),!0,!0):[]}function Dat(S,I){return S&&S.length?PB(S,Sr(I,3),!0):[]}function Aat(S,I,R,j){var ae=S==null?0:S.length;return ae?(R&&typeof R!="number"&&Sh(S,I,R)&&(R=0,j=ae),Sst(S,I,R,j)):[]}function Ewe(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var ae=R==null?0:bo(R);return ae<0&&(ae=su(j+ae,0)),Oe(S,Sr(I,3),ae)}function xwe(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var ae=j-1;return R!==t&&(ae=bo(R),ae=R<0?su(j+ae,0):Hd(ae,j-1)),Oe(S,Sr(I,3),ae,!0)}function Twe(S){var I=S==null?0:S.length;return I?nd(S,1):[]}function Rat(S){var I=S==null?0:S.length;return I?nd(S,H):[]}function Nat(S,I){var R=S==null?0:S.length;return R?(I=I===t?1:bo(I),nd(S,I)):[]}function Oat(S){for(var I=-1,R=S==null?0:S.length,j={};++I<R;){var ae=S[I];j[ae[0]]=ae[1]}return j}function kwe(S){return S&&S.length?S[0]:t}function Pat(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var ae=R==null?0:bo(R);return ae<0&&(ae=su(j+ae,0)),Kt(S,I,ae)}function Mat(S){var I=S==null?0:S.length;return I?Wg(S,0,-1):[]}var Fat=Io(function(S){var I=_a(S,QQ);return I.length&&I[0]===S[0]?VQ(I):[]}),Bat=Io(function(S){var I=zg(S),R=_a(S,QQ);return I===zg(R)?I=t:R.pop(),R.length&&R[0]===S[0]?VQ(R,Sr(I,2)):[]}),$at=Io(function(S){var I=zg(S),R=_a(S,QQ);return I=typeof I=="function"?I:t,I&&R.pop(),R.length&&R[0]===S[0]?VQ(R,t,I):[]});function Vat(S,I){return S==null?"":Mot.call(S,I)}function zg(S){var I=S==null?0:S.length;return I?S[I-1]:t}function Hat(S,I,R){var j=S==null?0:S.length;if(!j)return-1;var ae=j;return R!==t&&(ae=bo(R),ae=ae<0?su(j+ae,0):Hd(ae,j-1)),I===I?yot(S,I,ae):Oe(S,Li,ae,!0)}function Wat(S,I){return S&&S.length?BCe(S,bo(I)):t}var zat=Io(Iwe);function Iwe(S,I){return S&&S.length&&I&&I.length?UQ(S,I):S}function Uat(S,I,R){return S&&S.length&&I&&I.length?UQ(S,I,Sr(R,2)):S}function jat(S,I,R){return S&&S.length&&I&&I.length?UQ(S,I,t,R):S}var qat=F0(function(S,I){var R=S==null?0:S.length,j=MQ(S,I);return HCe(S,_a(I,function(ae){return B0(ae,R)?+ae:ae}).sort(XCe)),j});function Gat(S,I){var R=[];if(!(S&&S.length))return R;var j=-1,ae=[],Ce=S.length;for(I=Sr(I,3);++j<Ce;){var Be=S[j];I(Be,j,S)&&(R.push(Be),ae.push(j))}return HCe(S,ae),R}function uX(S){return S==null?S:Vot.call(S)}function Kat(S,I,R){var j=S==null?0:S.length;return j?(R&&typeof R!="number"&&Sh(S,I,R)?(I=0,R=j):(I=I==null?0:bo(I),R=R===t?j:bo(R)),Wg(S,I,R)):[]}function Yat(S,I){return OB(S,I)}function Qat(S,I,R){return GQ(S,I,Sr(R,2))}function Xat(S,I){var R=S==null?0:S.length;if(R){var j=OB(S,I);if(j<R&&c_(S[j],I))return j}return-1}function Zat(S,I){return OB(S,I,!0)}function Jat(S,I,R){return GQ(S,I,Sr(R,2),!0)}function elt(S,I){var R=S==null?0:S.length;if(R){var j=OB(S,I,!0)-1;if(c_(S[j],I))return j}return-1}function tlt(S){return S&&S.length?zCe(S):[]}function nlt(S,I){return S&&S.length?zCe(S,Sr(I,2)):[]}function ilt(S){var I=S==null?0:S.length;return I?Wg(S,1,I):[]}function rlt(S,I,R){return S&&S.length?(I=R||I===t?1:bo(I),Wg(S,0,I<0?0:I)):[]}function olt(S,I,R){var j=S==null?0:S.length;return j?(I=R||I===t?1:bo(I),I=j-I,Wg(S,I<0?0:I,j)):[]}function slt(S,I){return S&&S.length?PB(S,Sr(I,3),!1,!0):[]}function alt(S,I){return S&&S.length?PB(S,Sr(I,3)):[]}var llt=Io(function(S){return K1(nd(S,1,lc,!0))}),clt=Io(function(S){var I=zg(S);return lc(I)&&(I=t),K1(nd(S,1,lc,!0),Sr(I,2))}),ult=Io(function(S){var I=zg(S);return I=typeof I=="function"?I:t,K1(nd(S,1,lc,!0),t,I)});function dlt(S){return S&&S.length?K1(S):[]}function hlt(S,I){return S&&S.length?K1(S,Sr(I,2)):[]}function flt(S,I){return I=typeof I=="function"?I:t,S&&S.length?K1(S,t,I):[]}function dX(S){if(!(S&&S.length))return[];var I=0;return S=of(S,function(R){if(lc(R))return I=su(R.length,I),!0}),gs(I,function(R){return _a(S,Oo(R))})}function Lwe(S,I){if(!(S&&S.length))return[];var R=dX(S);return I==null?R:_a(R,function(j){return ed(I,t,j)})}var plt=Io(function(S,I){return lc(S)?PN(S,I):[]}),glt=Io(function(S){return YQ(of(S,lc))}),mlt=Io(function(S){var I=zg(S);return lc(I)&&(I=t),YQ(of(S,lc),Sr(I,2))}),_lt=Io(function(S){var I=zg(S);return I=typeof I=="function"?I:t,YQ(of(S,lc),t,I)}),vlt=Io(dX);function blt(S,I){return GCe(S||[],I||[],ON)}function ylt(S,I){return GCe(S||[],I||[],BN)}var Clt=Io(function(S){var I=S.length,R=I>1?S[I-1]:t;return R=typeof R=="function"?(S.pop(),R):t,Lwe(S,R)});function Dwe(S){var I=ge(S);return I.__chain__=!0,I}function wlt(S,I){return I(S),S}function UB(S,I){return I(S)}var Slt=F0(function(S){var I=S.length,R=I?S[0]:0,j=this.__wrapped__,ae=function(Ce){return MQ(Ce,S)};return I>1||this.__actions__.length||!(j instanceof Ko)||!B0(R)?this.thru(ae):(j=j.slice(R,+R+(I?1:0)),j.__actions__.push({func:UB,args:[ae],thisArg:t}),new Vg(j,this.__chain__).thru(function(Ce){return I&&!Ce.length&&Ce.push(t),Ce}))});function Elt(){return Dwe(this)}function xlt(){return new Vg(this.value(),this.__chain__)}function Tlt(){this.__values__===t&&(this.__values__=Uwe(this.value()));var S=this.__index__>=this.__values__.length,I=S?t:this.__values__[this.__index__++];return{done:S,value:I}}function klt(){return this}function Ilt(S){for(var I,R=this;R instanceof LB;){var j=Swe(R);j.__index__=0,j.__values__=t,I?ae.__wrapped__=j:I=j;var ae=j;R=R.__wrapped__}return ae.__wrapped__=S,I}function Llt(){var S=this.__wrapped__;if(S instanceof Ko){var I=S;return this.__actions__.length&&(I=new Ko(this)),I=I.reverse(),I.__actions__.push({func:UB,args:[uX],thisArg:t}),new Vg(I,this.__chain__)}return this.thru(uX)}function Dlt(){return qCe(this.__wrapped__,this.__actions__)}var Alt=MB(function(S,I,R){na.call(S,R)?++S[R]:P0(S,R,1)});function Rlt(S,I,R){var j=ao(S)?_I:wst;return R&&Sh(S,I,R)&&(I=t),j(S,Sr(I,3))}function Nlt(S,I){var R=ao(S)?of:LCe;return R(S,Sr(I,3))}var Olt=iwe(Ewe),Plt=iwe(xwe);function Mlt(S,I){return nd(jB(S,I),1)}function Flt(S,I){return nd(jB(S,I),H)}function Blt(S,I,R){return R=R===t?1:bo(R),nd(jB(S,I),R)}function Awe(S,I){var R=ao(S)?iu:G1;return R(S,Sr(I,3))}function Rwe(S,I){var R=ao(S)?EN:ICe;return R(S,Sr(I,3))}var $lt=MB(function(S,I,R){na.call(S,R)?S[R].push(I):P0(S,R,[I])});function Vlt(S,I,R,j){S=af(S)?S:II(S),R=R&&!j?bo(R):0;var ae=S.length;return R<0&&(R=su(ae+R,0)),QB(S)?R<=ae&&S.indexOf(I,R)>-1:!!ae&&Kt(S,I,R)>-1}var Hlt=Io(function(S,I,R){var j=-1,ae=typeof I=="function",Ce=af(S)?Vt(S.length):[];return G1(S,function(Be){Ce[++j]=ae?ed(I,Be,R):MN(Be,I,R)}),Ce}),Wlt=MB(function(S,I,R){P0(S,R,I)});function jB(S,I){var R=ao(S)?_a:PCe;return R(S,Sr(I,3))}function zlt(S,I,R,j){return S==null?[]:(ao(I)||(I=I==null?[]:[I]),R=j?t:R,ao(R)||(R=R==null?[]:[R]),$Ce(S,I,R))}var Ult=MB(function(S,I,R){S[R?0:1].push(I)},function(){return[[],[]]});function jlt(S,I,R){var j=ao(S)?bl:Nn,ae=arguments.length<3;return j(S,Sr(I,4),R,ae,G1)}function qlt(S,I,R){var j=ao(S)?yE:Nn,ae=arguments.length<3;return j(S,Sr(I,4),R,ae,ICe)}function Glt(S,I){var R=ao(S)?of:LCe;return R(S,KB(Sr(I,3)))}function Klt(S){var I=ao(S)?ECe:Vst;return I(S)}function Ylt(S,I,R){(R?Sh(S,I,R):I===t)?I=1:I=bo(I);var j=ao(S)?_st:Hst;return j(S,I)}function Qlt(S){var I=ao(S)?vst:zst;return I(S)}function Xlt(S){if(S==null)return 0;if(af(S))return QB(S)?vI(S):S.length;var I=Wd(S);return I==Ft||I==Te?S.size:WQ(S).length}function Zlt(S,I,R){var j=ao(S)?CE:Ust;return R&&Sh(S,I,R)&&(I=t),j(S,Sr(I,3))}var Jlt=Io(function(S,I){if(S==null)return[];var R=I.length;return R>1&&Sh(S,I[0],I[1])?I=[]:R>2&&Sh(I[0],I[1],I[2])&&(I=[I[0]]),$Ce(S,nd(I,1),[])}),qB=Not||function(){return vl.Date.now()};function ect(S,I){if(typeof I!="function")throw new $g(s);return S=bo(S),function(){if(--S<1)return I.apply(this,arguments)}}function Nwe(S,I,R){return I=R?t:I,I=S&&I==null?S.length:I,M0(S,k,t,t,t,t,I)}function Owe(S,I){var R;if(typeof I!="function")throw new $g(s);return S=bo(S),function(){return--S>0&&(R=I.apply(this,arguments)),S<=1&&(I=t),R}}var hX=Io(function(S,I,R){var j=v;if(R.length){var ae=j1(R,TI(hX));j|=E}return M0(S,j,I,R,ae)}),Pwe=Io(function(S,I,R){var j=v|_;if(R.length){var ae=j1(R,TI(Pwe));j|=E}return M0(I,j,S,R,ae)});function Mwe(S,I,R){I=R?t:I;var j=M0(S,y,t,t,t,t,t,I);return j.placeholder=Mwe.placeholder,j}function Fwe(S,I,R){I=R?t:I;var j=M0(S,C,t,t,t,t,t,I);return j.placeholder=Fwe.placeholder,j}function Bwe(S,I,R){var j,ae,Ce,Be,Xe,dt,dn=0,fn=!1,Sn=!1,hi=!0;if(typeof S!="function")throw new $g(s);I=Ug(I)||0,Il(R)&&(fn=!!R.leading,Sn="maxWait"in R,Ce=Sn?su(Ug(R.maxWait)||0,I):Ce,hi="trailing"in R?!!R.trailing:hi);function Ui(cc){var u_=j,H0=ae;return j=ae=t,dn=cc,Be=S.apply(H0,u_),Be}function Ar(cc){return dn=cc,Xe=HN(Ho,I),fn?Ui(cc):Be}function wo(cc){var u_=cc-dt,H0=cc-dn,iSe=I-u_;return Sn?Hd(iSe,Ce-H0):iSe}function Rr(cc){var u_=cc-dt,H0=cc-dn;return dt===t||u_>=I||u_<0||Sn&&H0>=Ce}function Ho(){var cc=qB();if(Rr(cc))return ns(cc);Xe=HN(Ho,wo(cc))}function ns(cc){return Xe=t,hi&&j?Ui(cc):(j=ae=t,Be)}function vp(){Xe!==t&&KCe(Xe),dn=0,j=dt=ae=Xe=t}function Eh(){return Xe===t?Be:ns(qB())}function bp(){var cc=qB(),u_=Rr(cc);if(j=arguments,ae=this,dt=cc,u_){if(Xe===t)return Ar(dt);if(Sn)return KCe(Xe),Xe=HN(Ho,I),Ui(dt)}return Xe===t&&(Xe=HN(Ho,I)),Be}return bp.cancel=vp,bp.flush=Eh,bp}var tct=Io(function(S,I){return kCe(S,1,I)}),nct=Io(function(S,I,R){return kCe(S,Ug(I)||0,R)});function ict(S){return M0(S,D)}function GB(S,I){if(typeof S!="function"||I!=null&&typeof I!="function")throw new $g(s);var R=function(){var j=arguments,ae=I?I.apply(this,j):j[0],Ce=R.cache;if(Ce.has(ae))return Ce.get(ae);var Be=S.apply(this,j);return R.cache=Ce.set(ae,Be)||Ce,Be};return R.cache=new(GB.Cache||O0),R}GB.Cache=O0;function KB(S){if(typeof S!="function")throw new $g(s);return function(){var I=arguments;switch(I.length){case 0:return!S.call(this);case 1:return!S.call(this,I[0]);case 2:return!S.call(this,I[0],I[1]);case 3:return!S.call(this,I[0],I[1],I[2])}return!S.apply(this,I)}}function rct(S){return Owe(2,S)}var oct=jst(function(S,I){I=I.length==1&&ao(I[0])?_a(I[0],ol(Sr())):_a(nd(I,1),ol(Sr()));var R=I.length;return Io(function(j){for(var ae=-1,Ce=Hd(j.length,R);++ae<Ce;)j[ae]=I[ae].call(this,j[ae]);return ed(S,this,j)})}),fX=Io(function(S,I){var R=j1(I,TI(fX));return M0(S,E,t,I,R)}),$we=Io(function(S,I){var R=j1(I,TI($we));return M0(S,x,t,I,R)}),sct=F0(function(S,I){return M0(S,L,t,t,t,I)});function act(S,I){if(typeof S!="function")throw new $g(s);return I=I===t?I:bo(I),Io(S,I)}function lct(S,I){if(typeof S!="function")throw new $g(s);return I=I==null?0:su(bo(I),0),Io(function(R){var j=R[I],ae=Q1(R,0,I);return j&&pp(ae,j),ed(S,this,ae)})}function cct(S,I,R){var j=!0,ae=!0;if(typeof S!="function")throw new $g(s);return Il(R)&&(j="leading"in R?!!R.leading:j,ae="trailing"in R?!!R.trailing:ae),Bwe(S,I,{leading:j,maxWait:I,trailing:ae})}function uct(S){return Nwe(S,1)}function dct(S,I){return fX(XQ(I),S)}function hct(){if(!arguments.length)return[];var S=arguments[0];return ao(S)?S:[S]}function fct(S){return Hg(S,f)}function pct(S,I){return I=typeof I=="function"?I:t,Hg(S,f,I)}function gct(S){return Hg(S,d|f)}function mct(S,I){return I=typeof I=="function"?I:t,Hg(S,d|f,I)}function _ct(S,I){return I==null||TCe(S,I,Iu(I))}function c_(S,I){return S===I||S!==S&&I!==I}var vct=VB($Q),bct=VB(function(S,I){return S>=I}),LE=RCe(function(){return arguments}())?RCe:function(S){return zl(S)&&na.call(S,"callee")&&!vCe.call(S,"callee")},ao=Vt.isArray,yct=R0?ol(R0):Ist;function af(S){return S!=null&&YB(S.length)&&!$0(S)}function lc(S){return zl(S)&&af(S)}function Cct(S){return S===!0||S===!1||zl(S)&&wh(S)==He}var X1=Pot||EX,wct=Mg?ol(Mg):Lst;function Sct(S){return zl(S)&&S.nodeType===1&&!WN(S)}function Ect(S){if(S==null)return!0;if(af(S)&&(ao(S)||typeof S=="string"||typeof S.splice=="function"||X1(S)||kI(S)||LE(S)))return!S.length;var I=Wd(S);if(I==Ft||I==Te)return!S.size;if(VN(S))return!WQ(S).length;for(var R in S)if(na.call(S,R))return!1;return!0}function xct(S,I){return FN(S,I)}function Tct(S,I,R){R=typeof R=="function"?R:t;var j=R?R(S,I):t;return j===t?FN(S,I,t,R):!!j}function pX(S){if(!zl(S))return!1;var I=wh(S);return I==Fe||I==Ge||typeof S.message=="string"&&typeof S.name=="string"&&!WN(S)}function kct(S){return typeof S=="number"&&yCe(S)}function $0(S){if(!Il(S))return!1;var I=wh(S);return I==bt||I==Mt||I==ye||I==Lt}function Vwe(S){return typeof S=="number"&&S==bo(S)}function YB(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=W}function Il(S){var I=typeof S;return S!=null&&(I=="object"||I=="function")}function zl(S){return S!=null&&typeof S=="object"}var Hwe=Fg?ol(Fg):Ast;function Ict(S,I){return S===I||HQ(S,I,rX(I))}function Lct(S,I,R){return R=typeof R=="function"?R:t,HQ(S,I,rX(I),R)}function Dct(S){return Wwe(S)&&S!=+S}function Act(S){if(pat(S))throw new ro(o);return NCe(S)}function Rct(S){return S===null}function Nct(S){return S==null}function Wwe(S){return typeof S=="number"||zl(S)&&wh(S)==Yt}function WN(S){if(!zl(S)||wh(S)!=Et)return!1;var I=wB(S);if(I===null)return!0;var R=na.call(I,"constructor")&&I.constructor;return typeof R=="function"&&R instanceof R&&vB.call(R)==Lot}var gX=rf?ol(rf):Rst;function Oct(S){return Vwe(S)&&S>=-W&&S<=W}var zwe=gI?ol(gI):Nst;function QB(S){return typeof S=="string"||!ao(S)&&zl(S)&&wh(S)==se}function _p(S){return typeof S=="symbol"||zl(S)&&wh(S)==Y}var kI=mI?ol(mI):Ost;function Pct(S){return S===t}function Mct(S){return zl(S)&&Wd(S)==le}function Fct(S){return zl(S)&&wh(S)==te}var Bct=VB(zQ),$ct=VB(function(S,I){return S<=I});function Uwe(S){if(!S)return[];if(af(S))return QB(S)?a_(S):sf(S);if(LN&&S[LN])return DQ(S[LN]());var I=Wd(S),R=I==Ft?kN:I==Te?gB:II;return R(S)}function V0(S){if(!S)return S===0?S:0;if(S=Ug(S),S===H||S===-H){var I=S<0?-1:1;return I*q}return S===S?S:0}function bo(S){var I=V0(S),R=I%1;return I===I?R?I-R:I:0}function jwe(S){return S?xE(bo(S),0,re):0}function Ug(S){if(typeof S=="number")return S;if(_p(S))return V;if(Il(S)){var I=typeof S.valueOf=="function"?S.valueOf():S;S=Il(I)?I+"":I}if(typeof S!="string")return S===0?S:+S;S=td(S);var R=st.test(S);return R||Ee.test(S)?Wl(S.slice(2),R?2:8):Le.test(S)?V:+S}function qwe(S){return Fv(S,lf(S))}function Vct(S){return S?xE(bo(S),-W,W):S===0?S:0}function Us(S){return S==null?"":mp(S)}var Hct=EI(function(S,I){if(VN(I)||af(I)){Fv(I,Iu(I),S);return}for(var R in I)na.call(I,R)&&ON(S,R,I[R])}),Gwe=EI(function(S,I){Fv(I,lf(I),S)}),XB=EI(function(S,I,R,j){Fv(I,lf(I),S,j)}),Wct=EI(function(S,I,R,j){Fv(I,Iu(I),S,j)}),zct=F0(MQ);function Uct(S,I){var R=SI(S);return I==null?R:xCe(R,I)}var jct=Io(function(S,I){S=Da(S);var R=-1,j=I.length,ae=j>2?I[2]:t;for(ae&&Sh(I[0],I[1],ae)&&(j=1);++R<j;)for(var Ce=I[R],Be=lf(Ce),Xe=-1,dt=Be.length;++Xe<dt;){var dn=Be[Xe],fn=S[dn];(fn===t||c_(fn,yI[dn])&&!na.call(S,dn))&&(S[dn]=Ce[dn])}return S}),qct=Io(function(S){return S.push(t,uwe),ed(Kwe,t,S)});function Gct(S,I){return xe(S,Sr(I,3),Mv)}function Kct(S,I){return xe(S,Sr(I,3),BQ)}function Yct(S,I){return S==null?S:FQ(S,Sr(I,3),lf)}function Qct(S,I){return S==null?S:DCe(S,Sr(I,3),lf)}function Xct(S,I){return S&&Mv(S,Sr(I,3))}function Zct(S,I){return S&&BQ(S,Sr(I,3))}function Jct(S){return S==null?[]:RB(S,Iu(S))}function eut(S){return S==null?[]:RB(S,lf(S))}function mX(S,I,R){var j=S==null?t:TE(S,I);return j===t?R:j}function tut(S,I){return S!=null&&fwe(S,I,Est)}function _X(S,I){return S!=null&&fwe(S,I,xst)}var nut=owe(function(S,I,R){I!=null&&typeof I.toString!="function"&&(I=bB.call(I)),S[I]=R},bX(cf)),iut=owe(function(S,I,R){I!=null&&typeof I.toString!="function"&&(I=bB.call(I)),na.call(S,I)?S[I].push(R):S[I]=[R]},Sr),rut=Io(MN);function Iu(S){return af(S)?SCe(S):WQ(S)}function lf(S){return af(S)?SCe(S,!0):Pst(S)}function out(S,I){var R={};return I=Sr(I,3),Mv(S,function(j,ae,Ce){P0(R,I(j,ae,Ce),j)}),R}function sut(S,I){var R={};return I=Sr(I,3),Mv(S,function(j,ae,Ce){P0(R,ae,I(j,ae,Ce))}),R}var aut=EI(function(S,I,R){NB(S,I,R)}),Kwe=EI(function(S,I,R,j){NB(S,I,R,j)}),lut=F0(function(S,I){var R={};if(S==null)return R;var j=!1;I=_a(I,function(Ce){return Ce=Y1(Ce,S),j||(j=Ce.length>1),Ce}),Fv(S,nX(S),R),j&&(R=Hg(R,d|h|f,nat));for(var ae=I.length;ae--;)KQ(R,I[ae]);return R});function cut(S,I){return Ywe(S,KB(Sr(I)))}var uut=F0(function(S,I){return S==null?{}:Fst(S,I)});function Ywe(S,I){if(S==null)return{};var R=_a(nX(S),function(j){return[j]});return I=Sr(I),VCe(S,R,function(j,ae){return I(j,ae[0])})}function dut(S,I,R){I=Y1(I,S);var j=-1,ae=I.length;for(ae||(ae=1,S=t);++j<ae;){var Ce=S==null?t:S[Bv(I[j])];Ce===t&&(j=ae,Ce=R),S=$0(Ce)?Ce.call(S):Ce}return S}function hut(S,I,R){return S==null?S:BN(S,I,R)}function fut(S,I,R,j){return j=typeof j=="function"?j:t,S==null?S:BN(S,I,R,j)}var Qwe=lwe(Iu),Xwe=lwe(lf);function put(S,I,R){var j=ao(S),ae=j||X1(S)||kI(S);if(I=Sr(I,4),R==null){var Ce=S&&S.constructor;ae?R=j?new Ce:[]:Il(S)?R=$0(Ce)?SI(wB(S)):{}:R={}}return(ae?iu:Mv)(S,function(Be,Xe,dt){return I(R,Be,Xe,dt)}),R}function gut(S,I){return S==null?!0:KQ(S,I)}function mut(S,I,R){return S==null?S:jCe(S,I,XQ(R))}function _ut(S,I,R,j){return j=typeof j=="function"?j:t,S==null?S:jCe(S,I,XQ(R),j)}function II(S){return S==null?[]:Ch(S,Iu(S))}function vut(S){return S==null?[]:Ch(S,lf(S))}function but(S,I,R){return R===t&&(R=I,I=t),R!==t&&(R=Ug(R),R=R===R?R:0),I!==t&&(I=Ug(I),I=I===I?I:0),xE(Ug(S),I,R)}function yut(S,I,R){return I=V0(I),R===t?(R=I,I=0):R=V0(R),S=Ug(S),Tst(S,I,R)}function Cut(S,I,R){if(R&&typeof R!="boolean"&&Sh(S,I,R)&&(I=R=t),R===t&&(typeof I=="boolean"?(R=I,I=t):typeof S=="boolean"&&(R=S,S=t)),S===t&&I===t?(S=0,I=1):(S=V0(S),I===t?(I=S,S=0):I=V0(I)),S>I){var j=S;S=I,I=j}if(R||S%1||I%1){var ae=CCe();return Hd(S+ae*(I-S+Hl("1e-"+((ae+"").length-1))),I)}return jQ(S,I)}var wut=xI(function(S,I,R){return I=I.toLowerCase(),S+(R?Zwe(I):I)});function Zwe(S){return vX(Us(S).toLowerCase())}function Jwe(S){return S=Us(S),S&&S.replace(xt,fB).replace(ni,"")}function Sut(S,I,R){S=Us(S),I=mp(I);var j=S.length;R=R===t?j:xE(bo(R),0,j);var ae=R;return R-=I.length,R>=0&&S.slice(R,ae)==I}function Eut(S){return S=Us(S),S&&hn.test(S)?S.replace(Kn,xN):S}function xut(S){return S=Us(S),S&&xs.test(S)?S.replace($i,"\\$&"):S}var Tut=xI(function(S,I,R){return S+(R?"-":"")+I.toLowerCase()}),kut=xI(function(S,I,R){return S+(R?" ":"")+I.toLowerCase()}),Iut=nwe("toLowerCase");function Lut(S,I,R){S=Us(S),I=bo(I);var j=I?vI(S):0;if(!I||j>=I)return S;var ae=(I-j)/2;return $B(TB(ae),R)+S+$B(xB(ae),R)}function Dut(S,I,R){S=Us(S),I=bo(I);var j=I?vI(S):0;return I&&j<I?S+$B(I-j,R):S}function Aut(S,I,R){S=Us(S),I=bo(I);var j=I?vI(S):0;return I&&j<I?$B(I-j,R)+S:S}function Rut(S,I,R){return R||I==null?I=0:I&&(I=+I),$ot(Us(S).replace(wr,""),I||0)}function Nut(S,I,R){return(R?Sh(S,I,R):I===t)?I=1:I=bo(I),qQ(Us(S),I)}function Out(){var S=arguments,I=Us(S[0]);return S.length<3?I:I.replace(S[1],S[2])}var Put=xI(function(S,I,R){return S+(R?"_":"")+I.toLowerCase()});function Mut(S,I,R){return R&&typeof R!="number"&&Sh(S,I,R)&&(I=R=t),R=R===t?re:R>>>0,R?(S=Us(S),S&&(typeof I=="string"||I!=null&&!gX(I))&&(I=mp(I),!I&&U1(S))?Q1(a_(S),0,R):S.split(I,R)):[]}var Fut=xI(function(S,I,R){return S+(R?" ":"")+vX(I)});function But(S,I,R){return S=Us(S),R=R==null?0:xE(bo(R),0,S.length),I=mp(I),S.slice(R,R+I.length)==I}function $ut(S,I,R){var j=ge.templateSettings;R&&Sh(S,I,R)&&(I=t),S=Us(S),I=XB({},I,j,cwe);var ae=XB({},I.imports,j.imports,cwe),Ce=Iu(ae),Be=Ch(ae,Ce),Xe,dt,dn=0,fn=I.interpolate||lt,Sn="__p += '",hi=AQ((I.escape||lt).source+"|"+fn.source+"|"+(fn===Ei?Jt:lt).source+"|"+(I.evaluate||lt).source+"|$","g"),Ui="//# sourceURL="+(na.call(I,"sourceURL")?(I.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ua+"]")+`
`;S.replace(hi,function(Rr,Ho,ns,vp,Eh,bp){return ns||(ns=vp),Sn+=S.slice(dn,bp).replace(gn,TN),Ho&&(Xe=!0,Sn+=`' +
__e(`+Ho+`) +
'`),Eh&&(dt=!0,Sn+=`';
`+Eh+`;
__p += '`),ns&&(Sn+=`' +
((__t = (`+ns+`)) == null ? '' : __t) +
'`),dn=bp+Rr.length,Rr}),Sn+=`';
`;var Ar=na.call(I,"variable")&&I.variable;if(!Ar)Sn=`with (obj) {
`+Sn+`
}
`;else if(Ct.test(Ar))throw new ro(a);Sn=(dt?Sn.replace(Je,""):Sn).replace(ot,"$1").replace(wt,"$1;"),Sn="function("+(Ar||"obj")+`) {
`+(Ar?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Xe?", __e = _.escape":"")+(dt?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Sn+`return __p
}`;var wo=tSe(function(){return Ds(Ce,Ui+"return "+Sn).apply(t,Be)});if(wo.source=Sn,pX(wo))throw wo;return wo}function Vut(S){return Us(S).toLowerCase()}function Hut(S){return Us(S).toUpperCase()}function Wut(S,I,R){if(S=Us(S),S&&(R||I===t))return td(S);if(!S||!(I=mp(I)))return S;var j=a_(S),ae=a_(I),Ce=Bg(j,ae),Be=ru(j,ae)+1;return Q1(j,Ce,Be).join("")}function zut(S,I,R){if(S=Us(S),S&&(R||I===t))return S.slice(0,pCe(S)+1);if(!S||!(I=mp(I)))return S;var j=a_(S),ae=ru(j,a_(I))+1;return Q1(j,0,ae).join("")}function Uut(S,I,R){if(S=Us(S),S&&(R||I===t))return S.replace(wr,"");if(!S||!(I=mp(I)))return S;var j=a_(S),ae=Bg(j,a_(I));return Q1(j,ae).join("")}function jut(S,I){var R=A,j=N;if(Il(I)){var ae="separator"in I?I.separator:ae;R="length"in I?bo(I.length):R,j="omission"in I?mp(I.omission):j}S=Us(S);var Ce=S.length;if(U1(S)){var Be=a_(S);Ce=Be.length}if(R>=Ce)return S;var Xe=R-vI(j);if(Xe<1)return j;var dt=Be?Q1(Be,0,Xe).join(""):S.slice(0,Xe);if(ae===t)return dt+j;if(Be&&(Xe+=dt.length-Xe),gX(ae)){if(S.slice(Xe).search(ae)){var dn,fn=dt;for(ae.global||(ae=AQ(ae.source,Us(ut.exec(ae))+"g")),ae.lastIndex=0;dn=ae.exec(fn);)var Sn=dn.index;dt=dt.slice(0,Sn===t?Xe:Sn)}}else if(S.indexOf(mp(ae),Xe)!=Xe){var hi=dt.lastIndexOf(ae);hi>-1&&(dt=dt.slice(0,hi))}return dt+j}function qut(S){return S=Us(S),S&&Cn.test(S)?S.replace(pn,Cot):S}var Gut=xI(function(S,I,R){return S+(R?" ":"")+I.toUpperCase()}),vX=nwe("toUpperCase");function eSe(S,I,R){return S=Us(S),I=R?t:I,I===t?LQ(S)?Eot(S):Z(S):S.match(I)||[]}var tSe=Io(function(S,I){try{return ed(S,t,I)}catch(R){return pX(R)?R:new ro(R)}}),Kut=F0(function(S,I){return iu(I,function(R){R=Bv(R),P0(S,R,hX(S[R],S))}),S});function Yut(S){var I=S==null?0:S.length,R=Sr();return S=I?_a(S,function(j){if(typeof j[1]!="function")throw new $g(s);return[R(j[0]),j[1]]}):[],Io(function(j){for(var ae=-1;++ae<I;){var Ce=S[ae];if(ed(Ce[0],this,j))return ed(Ce[1],this,j)}})}function Qut(S){return Cst(Hg(S,d))}function bX(S){return function(){return S}}function Xut(S,I){return S==null||S!==S?I:S}var Zut=rwe(),Jut=rwe(!0);function cf(S){return S}function yX(S){return OCe(typeof S=="function"?S:Hg(S,d))}function edt(S){return MCe(Hg(S,d))}function tdt(S,I){return FCe(S,Hg(I,d))}var ndt=Io(function(S,I){return function(R){return MN(R,S,I)}}),idt=Io(function(S,I){return function(R){return MN(S,R,I)}});function CX(S,I,R){var j=Iu(I),ae=RB(I,j);R==null&&!(Il(I)&&(ae.length||!j.length))&&(R=I,I=S,S=this,ae=RB(I,Iu(I)));var Ce=!(Il(R)&&"chain"in R)||!!R.chain,Be=$0(S);return iu(ae,function(Xe){var dt=I[Xe];S[Xe]=dt,Be&&(S.prototype[Xe]=function(){var dn=this.__chain__;if(Ce||dn){var fn=S(this.__wrapped__),Sn=fn.__actions__=sf(this.__actions__);return Sn.push({func:dt,args:arguments,thisArg:S}),fn.__chain__=dn,fn}return dt.apply(S,pp([this.value()],arguments))})}),S}function rdt(){return vl._===this&&(vl._=Dot),this}function wX(){}function odt(S){return S=bo(S),Io(function(I){return BCe(I,S)})}var sdt=JQ(_a),adt=JQ(_I),ldt=JQ(CE);function nSe(S){return sX(S)?Oo(Bv(S)):Bst(S)}function cdt(S){return function(I){return S==null?t:TE(S,I)}}var udt=swe(),ddt=swe(!0);function SX(){return[]}function EX(){return!1}function hdt(){return{}}function fdt(){return""}function pdt(){return!0}function gdt(S,I){if(S=bo(S),S<1||S>W)return[];var R=re,j=Hd(S,re);I=Sr(I),S-=re;for(var ae=gs(j,I);++R<S;)I(R);return ae}function mdt(S){return ao(S)?_a(S,Bv):_p(S)?[S]:sf(wwe(Us(S)))}function _dt(S){var I=++Iot;return Us(S)+I}var vdt=BB(function(S,I){return S+I},0),bdt=eX("ceil"),ydt=BB(function(S,I){return S/I},1),Cdt=eX("floor");function wdt(S){return S&&S.length?AB(S,cf,$Q):t}function Sdt(S,I){return S&&S.length?AB(S,Sr(I,2),$Q):t}function Edt(S){return Vr(S,cf)}function xdt(S,I){return Vr(S,Sr(I,2))}function Tdt(S){return S&&S.length?AB(S,cf,zQ):t}function kdt(S,I){return S&&S.length?AB(S,Sr(I,2),zQ):t}var Idt=BB(function(S,I){return S*I},1),Ldt=eX("round"),Ddt=BB(function(S,I){return S-I},0);function Adt(S){return S&&S.length?zr(S,cf):0}function Rdt(S,I){return S&&S.length?zr(S,Sr(I,2)):0}return ge.after=ect,ge.ary=Nwe,ge.assign=Hct,ge.assignIn=Gwe,ge.assignInWith=XB,ge.assignWith=Wct,ge.at=zct,ge.before=Owe,ge.bind=hX,ge.bindAll=Kut,ge.bindKey=Pwe,ge.castArray=hct,ge.chain=Dwe,ge.chunk=Cat,ge.compact=wat,ge.concat=Sat,ge.cond=Yut,ge.conforms=Qut,ge.constant=bX,ge.countBy=Alt,ge.create=Uct,ge.curry=Mwe,ge.curryRight=Fwe,ge.debounce=Bwe,ge.defaults=jct,ge.defaultsDeep=qct,ge.defer=tct,ge.delay=nct,ge.difference=Eat,ge.differenceBy=xat,ge.differenceWith=Tat,ge.drop=kat,ge.dropRight=Iat,ge.dropRightWhile=Lat,ge.dropWhile=Dat,ge.fill=Aat,ge.filter=Nlt,ge.flatMap=Mlt,ge.flatMapDeep=Flt,ge.flatMapDepth=Blt,ge.flatten=Twe,ge.flattenDeep=Rat,ge.flattenDepth=Nat,ge.flip=ict,ge.flow=Zut,ge.flowRight=Jut,ge.fromPairs=Oat,ge.functions=Jct,ge.functionsIn=eut,ge.groupBy=$lt,ge.initial=Mat,ge.intersection=Fat,ge.intersectionBy=Bat,ge.intersectionWith=$at,ge.invert=nut,ge.invertBy=iut,ge.invokeMap=Hlt,ge.iteratee=yX,ge.keyBy=Wlt,ge.keys=Iu,ge.keysIn=lf,ge.map=jB,ge.mapKeys=out,ge.mapValues=sut,ge.matches=edt,ge.matchesProperty=tdt,ge.memoize=GB,ge.merge=aut,ge.mergeWith=Kwe,ge.method=ndt,ge.methodOf=idt,ge.mixin=CX,ge.negate=KB,ge.nthArg=odt,ge.omit=lut,ge.omitBy=cut,ge.once=rct,ge.orderBy=zlt,ge.over=sdt,ge.overArgs=oct,ge.overEvery=adt,ge.overSome=ldt,ge.partial=fX,ge.partialRight=$we,ge.partition=Ult,ge.pick=uut,ge.pickBy=Ywe,ge.property=nSe,ge.propertyOf=cdt,ge.pull=zat,ge.pullAll=Iwe,ge.pullAllBy=Uat,ge.pullAllWith=jat,ge.pullAt=qat,ge.range=udt,ge.rangeRight=ddt,ge.rearg=sct,ge.reject=Glt,ge.remove=Gat,ge.rest=act,ge.reverse=uX,ge.sampleSize=Ylt,ge.set=hut,ge.setWith=fut,ge.shuffle=Qlt,ge.slice=Kat,ge.sortBy=Jlt,ge.sortedUniq=tlt,ge.sortedUniqBy=nlt,ge.split=Mut,ge.spread=lct,ge.tail=ilt,ge.take=rlt,ge.takeRight=olt,ge.takeRightWhile=slt,ge.takeWhile=alt,ge.tap=wlt,ge.throttle=cct,ge.thru=UB,ge.toArray=Uwe,ge.toPairs=Qwe,ge.toPairsIn=Xwe,ge.toPath=mdt,ge.toPlainObject=qwe,ge.transform=put,ge.unary=uct,ge.union=llt,ge.unionBy=clt,ge.unionWith=ult,ge.uniq=dlt,ge.uniqBy=hlt,ge.uniqWith=flt,ge.unset=gut,ge.unzip=dX,ge.unzipWith=Lwe,ge.update=mut,ge.updateWith=_ut,ge.values=II,ge.valuesIn=vut,ge.without=plt,ge.words=eSe,ge.wrap=dct,ge.xor=glt,ge.xorBy=mlt,ge.xorWith=_lt,ge.zip=vlt,ge.zipObject=blt,ge.zipObjectDeep=ylt,ge.zipWith=Clt,ge.entries=Qwe,ge.entriesIn=Xwe,ge.extend=Gwe,ge.extendWith=XB,CX(ge,ge),ge.add=vdt,ge.attempt=tSe,ge.camelCase=wut,ge.capitalize=Zwe,ge.ceil=bdt,ge.clamp=but,ge.clone=fct,ge.cloneDeep=gct,ge.cloneDeepWith=mct,ge.cloneWith=pct,ge.conformsTo=_ct,ge.deburr=Jwe,ge.defaultTo=Xut,ge.divide=ydt,ge.endsWith=Sut,ge.eq=c_,ge.escape=Eut,ge.escapeRegExp=xut,ge.every=Rlt,ge.find=Olt,ge.findIndex=Ewe,ge.findKey=Gct,ge.findLast=Plt,ge.findLastIndex=xwe,ge.findLastKey=Kct,ge.floor=Cdt,ge.forEach=Awe,ge.forEachRight=Rwe,ge.forIn=Yct,ge.forInRight=Qct,ge.forOwn=Xct,ge.forOwnRight=Zct,ge.get=mX,ge.gt=vct,ge.gte=bct,ge.has=tut,ge.hasIn=_X,ge.head=kwe,ge.identity=cf,ge.includes=Vlt,ge.indexOf=Pat,ge.inRange=yut,ge.invoke=rut,ge.isArguments=LE,ge.isArray=ao,ge.isArrayBuffer=yct,ge.isArrayLike=af,ge.isArrayLikeObject=lc,ge.isBoolean=Cct,ge.isBuffer=X1,ge.isDate=wct,ge.isElement=Sct,ge.isEmpty=Ect,ge.isEqual=xct,ge.isEqualWith=Tct,ge.isError=pX,ge.isFinite=kct,ge.isFunction=$0,ge.isInteger=Vwe,ge.isLength=YB,ge.isMap=Hwe,ge.isMatch=Ict,ge.isMatchWith=Lct,ge.isNaN=Dct,ge.isNative=Act,ge.isNil=Nct,ge.isNull=Rct,ge.isNumber=Wwe,ge.isObject=Il,ge.isObjectLike=zl,ge.isPlainObject=WN,ge.isRegExp=gX,ge.isSafeInteger=Oct,ge.isSet=zwe,ge.isString=QB,ge.isSymbol=_p,ge.isTypedArray=kI,ge.isUndefined=Pct,ge.isWeakMap=Mct,ge.isWeakSet=Fct,ge.join=Vat,ge.kebabCase=Tut,ge.last=zg,ge.lastIndexOf=Hat,ge.lowerCase=kut,ge.lowerFirst=Iut,ge.lt=Bct,ge.lte=$ct,ge.max=wdt,ge.maxBy=Sdt,ge.mean=Edt,ge.meanBy=xdt,ge.min=Tdt,ge.minBy=kdt,ge.stubArray=SX,ge.stubFalse=EX,ge.stubObject=hdt,ge.stubString=fdt,ge.stubTrue=pdt,ge.multiply=Idt,ge.nth=Wat,ge.noConflict=rdt,ge.noop=wX,ge.now=qB,ge.pad=Lut,ge.padEnd=Dut,ge.padStart=Aut,ge.parseInt=Rut,ge.random=Cut,ge.reduce=jlt,ge.reduceRight=qlt,ge.repeat=Nut,ge.replace=Out,ge.result=dut,ge.round=Ldt,ge.runInContext=ct,ge.sample=Klt,ge.size=Xlt,ge.snakeCase=Put,ge.some=Zlt,ge.sortedIndex=Yat,ge.sortedIndexBy=Qat,ge.sortedIndexOf=Xat,ge.sortedLastIndex=Zat,ge.sortedLastIndexBy=Jat,ge.sortedLastIndexOf=elt,ge.startCase=Fut,ge.startsWith=But,ge.subtract=Ddt,ge.sum=Adt,ge.sumBy=Rdt,ge.template=$ut,ge.times=gdt,ge.toFinite=V0,ge.toInteger=bo,ge.toLength=jwe,ge.toLower=Vut,ge.toNumber=Ug,ge.toSafeInteger=Vct,ge.toString=Us,ge.toUpper=Hut,ge.trim=Wut,ge.trimEnd=zut,ge.trimStart=Uut,ge.truncate=jut,ge.unescape=qut,ge.uniqueId=_dt,ge.upperCase=Gut,ge.upperFirst=vX,ge.each=Awe,ge.eachRight=Rwe,ge.first=kwe,CX(ge,function(){var S={};return Mv(ge,function(I,R){na.call(ge.prototype,R)||(S[R]=I)}),S}(),{chain:!1}),ge.VERSION=i,iu(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){ge[S].placeholder=ge}),iu(["drop","take"],function(S,I){Ko.prototype[S]=function(R){R=R===t?1:su(bo(R),0);var j=this.__filtered__&&!I?new Ko(this):this.clone();return j.__filtered__?j.__takeCount__=Hd(R,j.__takeCount__):j.__views__.push({size:Hd(R,re),type:S+(j.__dir__<0?"Right":"")}),j},Ko.prototype[S+"Right"]=function(R){return this.reverse()[S](R).reverse()}}),iu(["filter","map","takeWhile"],function(S,I){var R=I+1,j=R==B||R==U;Ko.prototype[S]=function(ae){var Ce=this.clone();return Ce.__iteratees__.push({iteratee:Sr(ae,3),type:R}),Ce.__filtered__=Ce.__filtered__||j,Ce}}),iu(["head","last"],function(S,I){var R="take"+(I?"Right":"");Ko.prototype[S]=function(){return this[R](1).value()[0]}}),iu(["initial","tail"],function(S,I){var R="drop"+(I?"":"Right");Ko.prototype[S]=function(){return this.__filtered__?new Ko(this):this[R](1)}}),Ko.prototype.compact=function(){return this.filter(cf)},Ko.prototype.find=function(S){return this.filter(S).head()},Ko.prototype.findLast=function(S){return this.reverse().find(S)},Ko.prototype.invokeMap=Io(function(S,I){return typeof S=="function"?new Ko(this):this.map(function(R){return MN(R,S,I)})}),Ko.prototype.reject=function(S){return this.filter(KB(Sr(S)))},Ko.prototype.slice=function(S,I){S=bo(S);var R=this;return R.__filtered__&&(S>0||I<0)?new Ko(R):(S<0?R=R.takeRight(-S):S&&(R=R.drop(S)),I!==t&&(I=bo(I),R=I<0?R.dropRight(-I):R.take(I-S)),R)},Ko.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},Ko.prototype.toArray=function(){return this.take(re)},Mv(Ko.prototype,function(S,I){var R=/^(?:filter|find|map|reject)|While$/.test(I),j=/^(?:head|last)$/.test(I),ae=ge[j?"take"+(I=="last"?"Right":""):I],Ce=j||/^find/.test(I);ae&&(ge.prototype[I]=function(){var Be=this.__wrapped__,Xe=j?[1]:arguments,dt=Be instanceof Ko,dn=Xe[0],fn=dt||ao(Be),Sn=function(Ho){var ns=ae.apply(ge,pp([Ho],Xe));return j&&hi?ns[0]:ns};fn&&R&&typeof dn=="function"&&dn.length!=1&&(dt=fn=!1);var hi=this.__chain__,Ui=!!this.__actions__.length,Ar=Ce&&!hi,wo=dt&&!Ui;if(!Ce&&fn){Be=wo?Be:new Ko(this);var Rr=S.apply(Be,Xe);return Rr.__actions__.push({func:UB,args:[Sn],thisArg:t}),new Vg(Rr,hi)}return Ar&&wo?S.apply(this,Xe):(Rr=this.thru(Sn),Ar?j?Rr.value()[0]:Rr.value():Rr)})}),iu(["pop","push","shift","sort","splice","unshift"],function(S){var I=mB[S],R=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",j=/^(?:pop|shift)$/.test(S);ge.prototype[S]=function(){var ae=arguments;if(j&&!this.__chain__){var Ce=this.value();return I.apply(ao(Ce)?Ce:[],ae)}return this[R](function(Be){return I.apply(ao(Be)?Be:[],ae)})}}),Mv(Ko.prototype,function(S,I){var R=ge[I];if(R){var j=R.name+"";na.call(wI,j)||(wI[j]=[]),wI[j].push({name:I,func:R})}}),wI[FB(t,_).name]=[{name:"wrapper",func:t}],Ko.prototype.clone=qot,Ko.prototype.reverse=Got,Ko.prototype.value=Kot,ge.prototype.at=Slt,ge.prototype.chain=Elt,ge.prototype.commit=xlt,ge.prototype.next=Tlt,ge.prototype.plant=Ilt,ge.prototype.reverse=Llt,ge.prototype.toJSON=ge.prototype.valueOf=ge.prototype.value=Dlt,ge.prototype.first=ge.prototype.head,LN&&(ge.prototype[LN]=klt),ge},bI=xot();bh?((bh.exports=bI)._=bI,s_._=bI):vl._=bI}).call(Po)})(JV,JV.exports);var An=JV.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 Ti(){var e;const n=Nc(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.company}function nmt(){const n=Ti(),e=Zi();return()=>typeof e>"u"?!1:!An.isEqual(n,e)}var K6e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,function(){var t=1e3,i=6e4,r=36e5,o="millisecond",s="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|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"],U=B%100;return"["+B+(F[(U-20)%10]||F[U]||F[0])+"]"}},y=function(B,F,U){var H=String(B);return!H||H.length>=F?B:""+Array(F+1-H.length).join(U)+B},C={s:y,z:function(B){var F=-B.utcOffset(),U=Math.abs(F),H=Math.floor(U/60),W=U%60;return(F<=0?"+":"-")+y(H,2,"0")+":"+y(W,2,"0")},m:function B(F,U){if(F.date()<U.date())return-B(U,F);var H=12*(U.year()-F.year())+(U.month()-F.month()),W=F.clone().add(H,d),q=U-W<0,V=F.clone().add(H+(q?-1:1),d);return+(-(H+(U-W)/(q?W-V:V-W))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:d,y:f,w:u,d:c,D:g,h:l,m:a,s,ms:o,Q:h}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},E="en",x={};x[E]=b;var k="$isDayjsObject",L=function(B){return B instanceof P||!(!B||!B[k])},D=function B(F,U,H){var W;if(!F)return E;if(typeof F=="string"){var q=F.toLowerCase();x[q]&&(W=q),U&&(x[q]=U,W=q);var V=F.split("-");if(!W&&V.length>1)return B(V[0])}else{var re=F.name;x[re]=F,W=re}return!H&&W&&(E=W),W||!H&&E},A=function(B,F){if(L(B))return B.clone();var U=typeof F=="object"?F:{};return U.date=B,U.args=arguments,new P(U)},N=C;N.l=D,N.i=L,N.w=function(B,F){return A(B,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var P=function(){function B(U){this.$L=D(U.locale,null,!0),this.parse(U),this.$x=this.$x||U.x||{},this[k]=!0}var F=B.prototype;return F.parse=function(U){this.$d=function(H){var W=H.date,q=H.utc;if(W===null)return new Date(NaN);if(N.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var V=W.match(v);if(V){var re=V[2]-1||0,oe=(V[7]||"0").substring(0,3);return q?new Date(Date.UTC(V[1],re,V[3]||1,V[4]||0,V[5]||0,V[6]||0,oe)):new Date(V[1],re,V[3]||1,V[4]||0,V[5]||0,V[6]||0,oe)}}return new Date(W)}(U),this.init()},F.init=function(){var U=this.$d;this.$y=U.getFullYear(),this.$M=U.getMonth(),this.$D=U.getDate(),this.$W=U.getDay(),this.$H=U.getHours(),this.$m=U.getMinutes(),this.$s=U.getSeconds(),this.$ms=U.getMilliseconds()},F.$utils=function(){return N},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(U,H){var W=A(U);return this.startOf(H)<=W&&W<=this.endOf(H)},F.isAfter=function(U,H){return A(U)<this.startOf(H)},F.isBefore=function(U,H){return this.endOf(H)<A(U)},F.$g=function(U,H,W){return N.u(U)?this[H]:this.set(W,U)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(U,H){var W=this,q=!!N.u(H)||H,V=N.p(U),re=function(Pe,Ge){var Fe=N.w(W.$u?Date.UTC(W.$y,Ge,Pe):new Date(W.$y,Ge,Pe),W);return q?Fe:Fe.endOf(c)},oe=function(Pe,Ge){return N.w(W.toDate()[Pe].apply(W.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(Ge)),W)},Q=this.$W,Ne=this.$M,Ve=this.$D,Ye="set"+(this.$u?"UTC":"");switch(V){case f:return q?re(1,0):re(31,11);case d:return q?re(1,Ne):re(0,Ne+1);case u:var ye=this.$locale().weekStart||0,He=(Q<ye?Q+7:Q)-ye;return re(q?Ve-He:Ve+(6-He),Ne);case c:case g:return oe(Ye+"Hours",0);case l:return oe(Ye+"Minutes",1);case a:return oe(Ye+"Seconds",2);case s:return oe(Ye+"Milliseconds",3);default:return this.clone()}},F.endOf=function(U){return this.startOf(U,!1)},F.$set=function(U,H){var W,q=N.p(U),V="set"+(this.$u?"UTC":""),re=(W={},W[c]=V+"Date",W[g]=V+"Date",W[d]=V+"Month",W[f]=V+"FullYear",W[l]=V+"Hours",W[a]=V+"Minutes",W[s]=V+"Seconds",W[o]=V+"Milliseconds",W)[q],oe=q===c?this.$D+(H-this.$W):H;if(q===d||q===f){var Q=this.clone().set(g,1);Q.$d[re](oe),Q.init(),this.$d=Q.set(g,Math.min(this.$D,Q.daysInMonth())).$d}else re&&this.$d[re](oe);return this.init(),this},F.set=function(U,H){return this.clone().$set(U,H)},F.get=function(U){return this[N.p(U)]()},F.add=function(U,H){var W,q=this;U=Number(U);var V=N.p(H),re=function(Ne){var Ve=A(q);return N.w(Ve.date(Ve.date()+Math.round(Ne*U)),q)};if(V===d)return this.set(d,this.$M+U);if(V===f)return this.set(f,this.$y+U);if(V===c)return re(1);if(V===u)return re(7);var oe=(W={},W[a]=i,W[l]=r,W[s]=t,W)[V]||1,Q=this.$d.getTime()+U*oe;return N.w(Q,this)},F.subtract=function(U,H){return this.add(-1*U,H)},F.format=function(U){var H=this,W=this.$locale();if(!this.isValid())return W.invalidDate||m;var q=U||"YYYY-MM-DDTHH:mm:ssZ",V=N.z(this),re=this.$H,oe=this.$m,Q=this.$M,Ne=W.weekdays,Ve=W.months,Ye=W.meridiem,ye=function(Ge,Fe,bt,Mt){return Ge&&(Ge[Fe]||Ge(H,q))||bt[Fe].slice(0,Mt)},He=function(Ge){return N.s(re%12||12,Ge,"0")},Pe=Ye||function(Ge,Fe,bt){var Mt=Ge<12?"AM":"PM";return bt?Mt.toLowerCase():Mt};return q.replace(_,function(Ge,Fe){return Fe||function(bt){switch(bt){case"YY":return String(H.$y).slice(-2);case"YYYY":return N.s(H.$y,4,"0");case"M":return Q+1;case"MM":return N.s(Q+1,2,"0");case"MMM":return ye(W.monthsShort,Q,Ve,3);case"MMMM":return ye(Ve,Q);case"D":return H.$D;case"DD":return N.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return ye(W.weekdaysMin,H.$W,Ne,2);case"ddd":return ye(W.weekdaysShort,H.$W,Ne,3);case"dddd":return Ne[H.$W];case"H":return String(re);case"HH":return N.s(re,2,"0");case"h":return He(1);case"hh":return He(2);case"a":return Pe(re,oe,!0);case"A":return Pe(re,oe,!1);case"m":return String(oe);case"mm":return N.s(oe,2,"0");case"s":return String(H.$s);case"ss":return N.s(H.$s,2,"0");case"SSS":return N.s(H.$ms,3,"0");case"Z":return V}return null}(Ge)||V.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(U,H,W){var q,V=this,re=N.p(H),oe=A(U),Q=(oe.utcOffset()-this.utcOffset())*i,Ne=this-oe,Ve=function(){return N.m(V,oe)};switch(re){case f:q=Ve()/12;break;case d:q=Ve();break;case h:q=Ve()/3;break;case u:q=(Ne-Q)/6048e5;break;case c:q=(Ne-Q)/864e5;break;case l:q=Ne/r;break;case a:q=Ne/i;break;case s:q=Ne/t;break;default:q=Ne}return W?q:N.a(q)},F.daysInMonth=function(){return this.endOf(d).$D},F.$locale=function(){return x[this.$L]},F.locale=function(U,H){if(!U)return this.$L;var W=this.clone(),q=D(U,H,!0);return q&&(W.$L=q),W},F.clone=function(){return N.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}(),M=P.prototype;return A.prototype=M,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",f],["$D",g]].forEach(function(B){M[B[1]]=function(F){return this.$g(F,B[0],B[1])}}),A.extend=function(B,F){return B.$i||(B(F,P,A),B.$i=!0),A},A.locale=D,A.isDayjs=L,A.unix=function(B){return A(1e3*B)},A.en=x[E],A.Ls=x,A.p={},A})})(K6e);var imt=K6e.exports;const Un=nl(imt);function Zr(n){"@babel/helpers - typeof";return Zr=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},Zr(n)}function El(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function rmt(n,e){if(Zr(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Zr(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Y6e(n){var e=rmt(n,"string");return Zr(e)==="symbol"?e:String(e)}function CEe(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,Y6e(i.key),i)}}function xl(n,e,t){return e&&CEe(n.prototype,e),t&&CEe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Xr(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function eH(n,e){return eH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},eH(n,e)}function Tv(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&&eH(n,e)}function dR(n,e){if(e&&(Zr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xr(n)}function Rm(n){return Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rm(n)}function it(n,e,t){return e=Y6e(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Q6e(n){if(Array.isArray(n))return n}function X6e(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Bie(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 Epe(n,e){if(n){if(typeof n=="string")return Bie(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 Bie(n,e)}}function Z6e(){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 J6e(n){return Q6e(n)||X6e(n)||Epe(n)||Z6e()}function wEe(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 SEe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wEe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var omt={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)}},smt=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};El(this,n),this.init(e,t)}return xl(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||omt,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,SEe(SEe({},{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}(),kb=new smt,nS=function(){function n(){El(this,n),this.observers={}}return xl(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 XN(){var n,e,t=new Promise(function(i,r){n=i,e=r});return t.resolve=n,t.reject=e,t}function EEe(n){return n==null?"":""+n}function amt(n,e,t){n.forEach(function(i){e[i]&&(t[i]=e[i])})}function xpe(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 xEe(n,e,t){var i=xpe(n,e,Object),r=i.obj,o=i.k;r[o]=t}function lmt(n,e,t,i){var r=xpe(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 tH(n,e){var t=xpe(n,e),i=t.obj,r=t.k;if(i)return i[r]}function cmt(n,e,t){var i=tH(n,t);return i!==void 0?i:tH(e,t)}function eBe(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]):eBe(n[i],e[i],t):n[i]=e[i]);return n}function DI(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var umt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function dmt(n){return typeof n=="string"?n.replace(/[&<>"'\/]/g,function(e){return umt[e]}):n}var Aj=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,hmt=[" ",",","?","!",";"];function fmt(n,e,t){e=e||"",t=t||"";var i=hmt.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 nH(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?nH(l,c,t):void 0}r=r[i[o]]}return r}}function TEe(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 g8(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?TEe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):TEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function pmt(n){var e=gmt();return function(){var i=Rm(n),r;if(e){var o=Rm(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return dR(this,r)}}function gmt(){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 mmt=function(n){Tv(t,n);var e=pmt(t);function t(i){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return El(this,t),r=e.call(this),Aj&&nS.call(Xr(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 xl(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=tH(this.data,u);return d||!c||typeof s!="string"?d:nH(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),xEe(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=tH(this.data,u)||{};a?eBe(d,s,l):d=g8(g8({},d),s),xEe(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"?g8(g8({},{}),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}(nS),tBe={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 kEe(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 jd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kEe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function _mt(n){var e=vmt();return function(){var i=Rm(n),r;if(e){var o=Rm(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return dR(this,r)}}function vmt(){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 IEe={},LEe=function(n){Tv(t,n);var e=_mt(t);function t(i){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return El(this,t),r=e.call(this),Aj&&nS.call(Xr(r)),amt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,Xr(r)),r.options=o,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.logger=kb.create("translator"),r}return xl(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&&!fmt(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(Zr(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),Zr(o)==="object"&&(o=jd({},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,f=h[h.length-1],g=o.lng||this.language,m=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(m){var v=o.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(f).concat(v).concat(d),usedKey:d,exactUsedKey:d,usedLng:g,usedNS:f}:"".concat(f).concat(v).concat(d)}return l?{res:d,usedKey:d,exactUsedKey:d,usedLng:g,usedNS:f}:d}var _=this.resolve(r,o),b=_&&_.res,y=_&&_.usedKey||d,C=_&&_.exactUsedKey||d,E=Object.prototype.toString.apply(b),x=["[object Number]","[object Function]","[object RegExp]"],k=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&&x.indexOf(E)<0&&!(typeof k=="string"&&E==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,b,jd(jd({},o),{},{ns:h})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(_.res=A,_):A}if(c){var N=E==="[object Array]",P=N?[]:{},M=N?C:y;for(var B in b)if(Object.prototype.hasOwnProperty.call(b,B)){var F="".concat(M).concat(c).concat(B);P[B]=this.translate(F,jd(jd({},o),{joinArrays:!1,ns:h})),P[B]===F&&(P[B]=b[B])}b=P}}else if(L&&typeof k=="string"&&E==="[object Array]")b=b.join(k),b&&(b=this.extendTranslation(b,r,o,s));else{var U=!1,H=!1,W=o.count!==void 0&&typeof o.count!="string",q=t.hasDefaultValue(o),V=W?this.pluralResolver.getSuffix(g,o.count,o):"",re=o["defaultValue".concat(V)]||o.defaultValue;!this.isValidLookup(b)&&q&&(U=!0,b=re),this.isValidLookup(b)||(H=!0,b=d);var oe=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Q=oe&&H?void 0:b,Ne=q&&re!==b&&this.options.updateMissing;if(H||U||Ne){if(this.logger.log(Ne?"updateKey":"missingKey",g,f,d,Ne?re:b),c){var Ve=this.resolve(d,jd(jd({},o),{},{keySeparator:!1}));Ve&&Ve.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 Ye=[],ye=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ye&&ye[0])for(var He=0;He<ye.length;He++)Ye.push(ye[He]);else this.options.saveMissingTo==="all"?Ye=this.languageUtils.toResolveHierarchy(o.lng||this.language):Ye.push(o.lng||this.language);var Pe=function(Fe,bt,Mt){var Ft=q&&Mt!==b?Mt:Q;a.options.missingKeyHandler?a.options.missingKeyHandler(Fe,f,bt,Ft,Ne,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Fe,f,bt,Ft,Ne,o),a.emit("missingKey",Fe,f,bt,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&W?Ye.forEach(function(Ge){a.pluralResolver.getSuffixes(Ge,o).forEach(function(Fe){Pe([Ge],d+Fe,o["defaultValue".concat(Fe)]||re)})}):Pe(Ye,d,re))}b=this.extendTranslation(b,r,o,_,s),H&&b===d&&this.options.appendNamespaceToMissingKey&&(b="".concat(f,":").concat(d)),(H||U)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(f,":").concat(d):d,U?b:void 0):b=this.options.parseMissingKeyHandler(b))}return l?(_.res=b,_):b}},{key:"extendTranslation",value:function(r,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)r=this.i18nFormat.parse(r,jd(jd({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(jd(jd({},s),{interpolation:jd(jd({},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 f=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(f=jd(jd({},this.options.interpolation.defaultVariables),f)),r=this.interpolator.interpolate(r,f,s.lng||this.language,s),u){var g=r.match(this.interpolator.nestingRegexp),m=g&&g.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 v=s.postProcess||this.options.postProcess,_=typeof v=="string"?[v]:v;return r!=null&&_&&_.length&&s.applyPostProcessor!==!1&&(r=tBe.handle(_,r,o,this.options&&this.options.postProcessPassResolved?jd({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 f=o.extractFromKey(h,s),g=f.key;l=g;var m=f.namespaces;o.options.fallbackNS&&(m=m.concat(o.options.fallbackNS));var v=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,!IEe["".concat(y[0],"-").concat(C)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(d)&&(IEe["".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(E){if(!o.isValidLookup(a)){u=E;var x=[g];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(x,g,E,C,s);else{var k;v&&(k=o.pluralResolver.getSuffix(E,s.count,s));var L="".concat(o.options.pluralSeparator,"zero");if(v&&(x.push(g+k),_&&x.push(g+L)),b){var D="".concat(g).concat(o.options.contextSeparator).concat(s.context);x.push(D),v&&(x.push(D+k),_&&x.push(D+L))}}for(var A;A=x.pop();)o.isValidLookup(a)||(c=A,a=o.getResource(E,C,A,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}(nS);function JX(n){return n.charAt(0).toUpperCase()+n.slice(1)}var DEe=function(){function n(e){El(this,n),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=kb.create("languageUtils")}return xl(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]=JX(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]=JX(r[1].toLowerCase())),i.indexOf(r[2].toLowerCase())>-1&&(r[2]=JX(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}(),bmt=[{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}],ymt={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}},Cmt=["v1","v2","v3"],AEe={zero:0,one:1,two:2,few:3,many:4,other:5};function wmt(){var n={};return bmt.forEach(function(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:ymt[e.fc]}})}),n}var Smt=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};El(this,n),this.languageUtils=e,this.options=t,this.logger=kb.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=wmt()}return xl(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 AEe[s]-AEe[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!Cmt.includes(this.options.compatibilityJSON)}}]),n}();function REe(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 h_(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?REe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):REe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function NEe(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=cmt(n,e,t);return!o&&r&&typeof t=="string"&&(o=nH(n,t,i),o===void 0&&(o=nH(e,t,i))),o}var Emt=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(this,n),this.logger=kb.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return xl(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:dmt,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?DI(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?DI(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?DI(i.nestingPrefix):i.nestingPrefixEscaped||DI("$t("),this.nestingSuffix=i.nestingSuffix?DI(i.nestingSuffix):i.nestingSuffixEscaped||DI(")"),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(v){return v.replace(/\$/g,"$$$$")}var h=function(_){if(_.indexOf(s.formatSeparator)<0){var b=NEe(i,u,_,s.options.keySeparator,s.options.ignoreJSONStructure);return s.alwaysFormat?s.format(b,void 0,r,h_(h_(h_({},o),i),{},{interpolationkey:_})):b}var y=_.split(s.formatSeparator),C=y.shift().trim(),E=y.join(s.formatSeparator).trim();return s.format(NEe(i,u,C,s.options.keySeparator,s.options.ignoreJSONStructure),E,r,h_(h_(h_({},o),i),{},{interpolationkey:C}))};this.resetRegExp();var f=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(_){return d(_)}},{regex:this.regexp,safeValue:function(_){return s.escapeValue?d(s.escape(_)):d(_)}}];return m.forEach(function(v){for(c=0;a=v.regex.exec(t);){var _=a[1].trim();if(l=h(_),l===void 0)if(typeof f=="function"){var b=f(t,a,o);l=typeof b=="string"?b:""}else if(o&&Object.prototype.hasOwnProperty.call(o,_))l="";else if(g){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(_," for interpolating ").concat(t)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=EEe(l));var y=v.safeValue(l);if(t=t.replace(a[0],y),g?(v.regex.lastIndex+=l.length,v.regex.lastIndex-=a[0].length):v.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(f,g){var m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;var v=f.split(new RegExp("".concat(m,"[ ]*{"))),_="{".concat(v[1]);f=v[0],_=this.interpolate(_,l);var b=_.match(/'/g),y=_.match(/"/g);(b&&b.length%2===0&&!y||y.length%2!==0)&&(_=_.replace(/'/g,'"'));try{l=JSON.parse(_),g&&(l=h_(h_({},g),l))}catch(C){return this.logger.warn("failed parsing options string in nesting for key ".concat(f),C),"".concat(f).concat(m).concat(_)}return delete l.defaultValue,f}for(;s=this.nestingRegexp.exec(t);){var u=[];l=h_({},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(f){return f.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=EEe(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(t)),a=""),d&&(a=u.reduce(function(f,g){return r.format(f,g,o.lng,h_(h_({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),t=t.replace(s[0],a),this.regexp.lastIndex=0}return t}}]),n}();function OEe(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 W0(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?OEe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):OEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function xmt(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=J6e(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 AI(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 Tmt=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(this,n),this.logger=kb.create("formatter"),this.options=e,this.formats={number:AI(function(t,i){var r=new Intl.NumberFormat(t,W0({},i));return function(o){return r.format(o)}}),currency:AI(function(t,i){var r=new Intl.NumberFormat(t,W0(W0({},i),{},{style:"currency"}));return function(o){return r.format(o)}}),datetime:AI(function(t,i){var r=new Intl.DateTimeFormat(t,W0({},i));return function(o){return r.format(o)}}),relativetime:AI(function(t,i){var r=new Intl.RelativeTimeFormat(t,W0({},i));return function(o){return r.format(o,i.range||"day")}}),list:AI(function(t,i){var r=new Intl.ListFormat(t,W0({},i));return function(o){return r.format(o)}})},this.init(e)}return xl(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()]=AI(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=xmt(u),h=d.formatName,f=d.formatOptions;if(o.formats[h]){var g=c;try{var m=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},v=m.locale||m.lng||s.locale||s.lng||r;g=o.formats[h](c,v,W0(W0(W0({},f),s),m))}catch(_){o.logger.warn(_)}return g}else o.logger.warn("there was no format function for ".concat(h));return c},t);return l}}]),n}();function PEe(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 MEe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?PEe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):PEe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function kmt(n){var e=Imt();return function(){var i=Rm(n),r;if(e){var o=Rm(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return dR(this,r)}}function Imt(){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 Lmt(n,e){n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)}var Dmt=function(n){Tv(t,n);var e=kmt(t);function t(i,r,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return El(this,t),s=e.call(this),Aj&&nS.call(Xr(s)),s.backend=i,s.store=r,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=kb.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 xl(t,[{key:"queueLoad",value:function(r,o,s,a){var l=this,c={},u={},d={},h={};return r.forEach(function(f){var g=!0;o.forEach(function(m){var v="".concat(f,"|").concat(m);!s.reload&&l.store.hasResourceBundle(f,m)?l.state[v]=2:l.state[v]<0||(l.state[v]===1?u[v]===void 0&&(u[v]=!0):(l.state[v]=1,g=!1,u[v]===void 0&&(u[v]=!0),c[v]===void 0&&(c[v]=!0),h[m]===void 0&&(h[m]=!0)))}),g||(d[f]=!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){lmt(d.loaded,[l],c),Lmt(d,r),o&&d.errors.push(o),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(h){u[h]||(u[h]={});var f=d.loaded[h];f.length&&f.forEach(function(g){u[h][g]===void 0&&(u[h][g]=!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,v){if(a.readingCalls--,a.waitingReads.length>0){var _=a.waitingReads.shift();a.read(_.lng,_.ns,_.fcName,_.tried,_.wait,_.callback)}if(m&&v&&l<a.maxRetries){setTimeout(function(){a.read.call(a,r,o,s,l+1,c*2,u)},c);return}u(m,v)},h=this.backend[s].bind(this.backend);if(h.length===2){try{var f=h(r,o);f&&typeof f.then=="function"?f.then(function(g){return d(null,g)}).catch(d):d(null,f)}catch(g){d(g)}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=MEe(MEe({},c),{},{isUpdate:l}),h=this.backend.create.bind(this.backend);if(h.length<6)try{var f;h.length===5?f=h(r,o,s,a,d):f=h(r,o,s,a),f&&typeof f.then=="function"?f.then(function(g){return u(null,g)}).catch(u):u(null,f)}catch(g){u(g)}else h(r,o,s,a,u,d)}!r||!r[0]||this.store.addResource(r[0],o,s,a)}}}]),t}(nS);function FEe(){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(Zr(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),Zr(e[2])==="object"||Zr(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 BEe(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 $Ee(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 Vv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$Ee(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$Ee(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Amt(n){var e=Rmt();return function(){var i=Rm(n),r;if(e){var o=Rm(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return dR(this,r)}}function Rmt(){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 m8(){}function Nmt(n){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(n));e.forEach(function(t){typeof n[t]=="function"&&(n[t]=n[t].bind(n))})}var iH=function(n){Tv(t,n);var e=Amt(t);function t(){var i,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(El(this,t),i=e.call(this),Aj&&nS.call(Xr(i)),i.options=BEe(r),i.services={},i.logger=kb,i.modules={external:[]},Nmt(Xr(i)),o&&!i.isInitialized&&!r.isClone){if(!i.options.initImmediate)return i.init(r,o),dR(i,Xr(i));setTimeout(function(){i.init(r,o)},0)}return i}return xl(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=FEe();this.options=Vv(Vv(Vv({},a),this.options),BEe(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Vv(Vv({},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(_){return _?typeof _=="function"?new _:_:null}if(!this.options.isClone){this.modules.logger?kb.init(l(this.modules.logger),this.options):kb.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Tmt);var u=new DEe(this.options);this.store=new mmt(this.options.resources,this.options);var d=this.services;d.logger=kb,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new Smt(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 Emt(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new Dmt(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(_){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,[_].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 LEe(this.services,this.options),this.translator.on("*",function(_){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,[_].concat(y))}),this.modules.external.forEach(function(_){_.init&&_.init(r)})}if(this.format=this.options.interpolation.format,s||(s=m8),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 f=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];f.forEach(function(_){r[_]=function(){var b;return(b=r.store)[_].apply(b,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(_){r[_]=function(){var b;return(b=r.store)[_].apply(b,arguments),r}});var m=XN(),v=function(){var b=function(C,E){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(E),s(C,E)};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?v():setTimeout(v,0),m}},{key:"loadResources",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m8,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(f){if(f){var g=o.services.languageUtils.toResolveHierarchy(f);g.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=XN();return r||(r=this.languages),o||(o=this.options.ns),s||(s=m8),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"&&tBe.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=XN();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,f){f?(l(f),s.translator.changeLanguage(f),s.isLanguageChangingTo=void 0,s.emit("languageChanged",f),s.logger.log("languageChanged",f)):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 f=typeof h=="string"?h:s.services.languageUtils.getBestMatchFromCodes(h);f&&(s.language||l(f),s.translator.language||s.translator.changeLanguage(f),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(f)),s.loadResources(f,function(g){c(g,f)})};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(Zr(d)!=="object"){for(var f=arguments.length,g=new Array(f>2?f-2:0),m=2;m<f;m++)g[m-2]=arguments[m];h=a.options.overloadTranslationOptionHandler([u,d].concat(g))}else h=Vv({},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 v=a.options.keySeparator||".",_;return h.keyPrefix&&Array.isArray(u)?_=u.map(function(b){return"".concat(h.keyPrefix).concat(v).concat(b)}):_=h.keyPrefix?"".concat(h.keyPrefix).concat(v).concat(u):u,a.t(_,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(f,g){var m=o.services.backendConnector.state["".concat(f,"|").concat(g)];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=XN();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=XN();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 DEe(FEe());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]:m8,a=Vv(Vv(Vv({},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=Vv({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new LEe(l.services,l.options),l.translator.on("*",function(u){for(var d=arguments.length,h=new Array(d>1?d-1:0),f=1;f<d;f++)h[f-1]=arguments[f];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}(nS);it(iH,"createInstance",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new iH(n,e)});var fh=iH.createInstance();fh.createInstance=iH.createInstance;fh.createInstance;fh.dir;fh.init;fh.loadResources;fh.reloadResources;fh.use;fh.changeLanguage;fh.getFixedT;var $ie=fh.t;fh.exists;fh.setDefaultNamespace;fh.hasLoadedNamespace;fh.loadNamespaces;fh.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 At(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 nr=(n=>(n.Active="active",n.Archived="archived",n.Deleted="deleted",n))(nr||{});/**
* 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 eZ={[nr.Active]:"active",[nr.Archived]:"archived",[nr.Deleted]:"deleted"};var Tpe={exports:{}},nBe=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)}},Omt=nBe,kpe=Object.prototype.toString,Ipe=function(n){return function(e){var t=kpe.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function Lk(n){return n=n.toLowerCase(),function(t){return Ipe(t)===n}}function Lpe(n){return Array.isArray(n)}function rH(n){return typeof n>"u"}function Pmt(n){return n!==null&&!rH(n)&&n.constructor!==null&&!rH(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}var iBe=Lk("ArrayBuffer");function Mmt(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&iBe(n.buffer),e}function Fmt(n){return typeof n=="string"}function Bmt(n){return typeof n=="number"}function rBe(n){return n!==null&&typeof n=="object"}function s$(n){if(Ipe(n)!=="object")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}var $mt=Lk("Date"),Vmt=Lk("File"),Hmt=Lk("Blob"),Wmt=Lk("FileList");function Dpe(n){return kpe.call(n)==="[object Function]"}function zmt(n){return rBe(n)&&Dpe(n.pipe)}function Umt(n){var e="[object FormData]";return n&&(typeof FormData=="function"&&n instanceof FormData||kpe.call(n)===e||Dpe(n.toString)&&n.toString()===e)}var jmt=Lk("URLSearchParams");function qmt(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Gmt(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Ape(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),Lpe(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 Vie(){var n={};function e(r,o){s$(n[o])&&s$(r)?n[o]=Vie(n[o],r):s$(r)?n[o]=Vie({},r):Lpe(r)?n[o]=r.slice():n[o]=r}for(var t=0,i=arguments.length;t<i;t++)Ape(arguments[t],e);return n}function Kmt(n,e,t){return Ape(e,function(r,o){t&&typeof r=="function"?n[o]=Omt(r,t):n[o]=r}),n}function Ymt(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}function Qmt(n,e,t,i){n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,t&&Object.assign(n.prototype,t)}function Xmt(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 Zmt(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 Jmt(n){if(!n)return null;var e=n.length;if(rH(e))return null;for(var t=new Array(e);e-- >0;)t[e]=n[e];return t}var e_t=function(n){return function(e){return n&&e instanceof n}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),Fd={isArray:Lpe,isArrayBuffer:iBe,isBuffer:Pmt,isFormData:Umt,isArrayBufferView:Mmt,isString:Fmt,isNumber:Bmt,isObject:rBe,isPlainObject:s$,isUndefined:rH,isDate:$mt,isFile:Vmt,isBlob:Hmt,isFunction:Dpe,isStream:zmt,isURLSearchParams:jmt,isStandardBrowserEnv:Gmt,forEach:Ape,merge:Vie,extend:Kmt,trim:qmt,stripBOM:Ymt,inherits:Qmt,toFlatObject:Xmt,kindOf:Ipe,kindOfTest:Lk,endsWith:Zmt,toArray:Jmt,isTypedArray:e_t,isFileList:Wmt},RI=Fd;function VEe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var oBe=function(e,t,i){if(!t)return e;var r;if(i)r=i(t);else if(RI.isURLSearchParams(t))r=t.toString();else{var o=[];RI.forEach(t,function(l,c){l===null||typeof l>"u"||(RI.isArray(l)?c=c+"[]":l=[l],RI.forEach(l,function(d){RI.isDate(d)?d=d.toISOString():RI.isObject(d)&&(d=JSON.stringify(d)),o.push(VEe(c)+"="+VEe(d))}))}),r=o.join("&")}if(r){var s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e},t_t=Fd;function Rj(){this.handlers=[]}Rj.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};Rj.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Rj.prototype.forEach=function(e){t_t.forEach(this.handlers,function(i){i!==null&&e(i)})};var n_t=Rj,i_t=Fd,r_t=function(e,t){i_t.forEach(e,function(r,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[o])})},sBe=Fd;function RD(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)}sBe.inherits(RD,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 aBe=RD.prototype,lBe={};["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){lBe[n]={value:n}});Object.defineProperties(RD,lBe);Object.defineProperty(aBe,"isAxiosError",{value:!0});RD.from=function(n,e,t,i,r,o){var s=Object.create(aBe);return sBe.toFlatObject(n,s,function(l){return l!==Error.prototype}),RD.call(s,n.message,e,t,i,r),s.name=n.name,o&&Object.assign(s,o),s};var hR=RD,cBe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},f_=Fd;function o_t(n,e){e=e||new FormData;var t=[];function i(o){return o===null?"":f_.isDate(o)?o.toISOString():f_.isArrayBuffer(o)||f_.isTypedArray(o)?typeof Blob=="function"?new Blob([o]):Buffer.from(o):o}function r(o,s){if(f_.isPlainObject(o)||f_.isArray(o)){if(t.indexOf(o)!==-1)throw Error("Circular reference detected in "+s);t.push(o),f_.forEach(o,function(l,c){if(!f_.isUndefined(l)){var u=s?s+"."+c:c,d;if(l&&!s&&typeof l=="object"){if(f_.endsWith(c,"{}"))l=JSON.stringify(l);else if(f_.endsWith(c,"[]")&&(d=f_.toArray(l))){d.forEach(function(h){!f_.isUndefined(h)&&e.append(u,i(h))});return}}r(l,u)}}),t.pop()}else e.append(s,i(o))}return r(n),e}var uBe=o_t,tZ,HEe;function s_t(){if(HEe)return tZ;HEe=1;var n=hR;return tZ=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))},tZ}var nZ,WEe;function a_t(){if(WEe)return nZ;WEe=1;var n=Fd;return nZ=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(){}}}(),nZ}var l_t=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},c_t=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},u_t=l_t,d_t=c_t,dBe=function(e,t){return e&&!u_t(t)?d_t(e,t):t},iZ,zEe;function h_t(){if(zEe)return iZ;zEe=1;var n=Fd,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 iZ=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},iZ}var rZ,UEe;function f_t(){if(UEe)return rZ;UEe=1;var n=Fd;return rZ=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}}(),rZ}var oZ,jEe;function Nj(){if(jEe)return oZ;jEe=1;var n=hR,e=Fd;function t(i){n.call(this,i??"canceled",n.ERR_CANCELED),this.name="CanceledError"}return e.inherits(t,n,{__CANCEL__:!0}),oZ=t,oZ}var sZ,qEe;function p_t(){return qEe||(qEe=1,sZ=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),sZ}var aZ,GEe;function KEe(){if(GEe)return aZ;GEe=1;var n=Fd,e=s_t(),t=a_t(),i=oBe,r=dBe,o=h_t(),s=f_t(),a=cBe,l=hR,c=Nj(),u=p_t();return aZ=function(h){return new Promise(function(g,m){var v=h.data,_=h.headers,b=h.responseType,y;function C(){h.cancelToken&&h.cancelToken.unsubscribe(y),h.signal&&h.signal.removeEventListener("abort",y)}n.isFormData(v)&&n.isStandardBrowserEnv()&&delete _["Content-Type"];var E=new XMLHttpRequest;if(h.auth){var x=h.auth.username||"",k=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"";_.Authorization="Basic "+btoa(x+":"+k)}var L=r(h.baseURL,h.url);E.open(h.method.toUpperCase(),i(L,h.params,h.paramsSerializer),!0),E.timeout=h.timeout;function D(){if(E){var P="getAllResponseHeaders"in E?o(E.getAllResponseHeaders()):null,M=!b||b==="text"||b==="json"?E.responseText:E.response,B={data:M,status:E.status,statusText:E.statusText,headers:P,config:h,request:E};e(function(U){g(U),C()},function(U){m(U),C()},B),E=null}}if("onloadend"in E?E.onloadend=D:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(D)},E.onabort=function(){E&&(m(new l("Request aborted",l.ECONNABORTED,h,E)),E=null)},E.onerror=function(){m(new l("Network Error",l.ERR_NETWORK,h,E,E)),E=null},E.ontimeout=function(){var M=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",B=h.transitional||a;h.timeoutErrorMessage&&(M=h.timeoutErrorMessage),m(new l(M,B.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,h,E)),E=null},n.isStandardBrowserEnv()){var A=(h.withCredentials||s(L))&&h.xsrfCookieName?t.read(h.xsrfCookieName):void 0;A&&(_[h.xsrfHeaderName]=A)}"setRequestHeader"in E&&n.forEach(_,function(M,B){typeof v>"u"&&B.toLowerCase()==="content-type"?delete _[B]:E.setRequestHeader(B,M)}),n.isUndefined(h.withCredentials)||(E.withCredentials=!!h.withCredentials),b&&b!=="json"&&(E.responseType=h.responseType),typeof h.onDownloadProgress=="function"&&E.addEventListener("progress",h.onDownloadProgress),typeof h.onUploadProgress=="function"&&E.upload&&E.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(y=function(P){E&&(m(!P||P&&P.type?new c:P),E.abort(),E=null)},h.cancelToken&&h.cancelToken.subscribe(y),h.signal&&(h.signal.aborted?y():h.signal.addEventListener("abort",y))),v||(v=null);var N=u(L);if(N&&["http","https","file"].indexOf(N)===-1){m(new l("Unsupported protocol "+N+":",l.ERR_BAD_REQUEST,h));return}E.send(v)})},aZ}var lZ,YEe;function g_t(){return YEe||(YEe=1,lZ=null),lZ}var Pu=Fd,QEe=r_t,XEe=hR,m_t=cBe,__t=uBe,v_t={"Content-Type":"application/x-www-form-urlencoded"};function ZEe(n,e){!Pu.isUndefined(n)&&Pu.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function b_t(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=KEe()),n}function y_t(n,e,t){if(Pu.isString(n))try{return(e||JSON.parse)(n),Pu.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}var Oj={transitional:m_t,adapter:b_t(),transformRequest:[function(e,t){if(QEe(t,"Accept"),QEe(t,"Content-Type"),Pu.isFormData(e)||Pu.isArrayBuffer(e)||Pu.isBuffer(e)||Pu.isStream(e)||Pu.isFile(e)||Pu.isBlob(e))return e;if(Pu.isArrayBufferView(e))return e.buffer;if(Pu.isURLSearchParams(e))return ZEe(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i=Pu.isObject(e),r=t&&t["Content-Type"],o;if((o=Pu.isFileList(e))||i&&r==="multipart/form-data"){var s=this.env&&this.env.FormData;return __t(o?{"files[]":e}:e,s&&new s)}else if(i||r==="application/json")return ZEe(t,"application/json"),y_t(e);return e}],transformResponse:[function(e){var t=this.transitional||Oj.transitional,i=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!i&&this.responseType==="json";if(o||r&&Pu.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?XEe.from(s,XEe.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:g_t()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Pu.forEach(["delete","get","head"],function(e){Oj.headers[e]={}});Pu.forEach(["post","put","patch"],function(e){Oj.headers[e]=Pu.merge(v_t)});var Rpe=Oj,C_t=Fd,w_t=Rpe,S_t=function(e,t,i){var r=this||w_t;return C_t.forEach(i,function(s){e=s.call(r,e,t)}),e},cZ,JEe;function hBe(){return JEe||(JEe=1,cZ=function(e){return!!(e&&e.__CANCEL__)}),cZ}var exe=Fd,uZ=S_t,E_t=hBe(),x_t=Rpe,T_t=Nj();function dZ(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new T_t}var k_t=function(e){dZ(e),e.headers=e.headers||{},e.data=uZ.call(e,e.data,e.headers,e.transformRequest),e.headers=exe.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),exe.forEach(["delete","get","head","post","put","patch","common"],function(r){delete e.headers[r]});var t=e.adapter||x_t.adapter;return t(e).then(function(r){return dZ(e),r.data=uZ.call(e,r.data,r.headers,e.transformResponse),r},function(r){return E_t(r)||(dZ(e),r&&r.response&&(r.response.data=uZ.call(e,r.response.data,r.response.headers,e.transformResponse))),Promise.reject(r)})},yp=Fd,fBe=function(e,t){t=t||{};var i={};function r(u,d){return yp.isPlainObject(u)&&yp.isPlainObject(d)?yp.merge(u,d):yp.isPlainObject(d)?yp.merge({},d):yp.isArray(d)?d.slice():d}function o(u){if(yp.isUndefined(t[u])){if(!yp.isUndefined(e[u]))return r(void 0,e[u])}else return r(e[u],t[u])}function s(u){if(!yp.isUndefined(t[u]))return r(void 0,t[u])}function a(u){if(yp.isUndefined(t[u])){if(!yp.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 yp.forEach(Object.keys(e).concat(Object.keys(t)),function(d){var h=c[d]||o,f=h(d);yp.isUndefined(f)&&h!==l||(i[d]=f)}),i},hZ,txe;function pBe(){return txe||(txe=1,hZ={version:"0.27.2"}),hZ}var I_t=pBe().version,kC=hR,Npe={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){Npe[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});var nxe={};Npe.transitional=function(e,t,i){function r(o,s){return"[Axios v"+I_t+"] Transitional option '"+o+"'"+s+(i?". "+i:"")}return function(o,s,a){if(e===!1)throw new kC(r(s," has been removed"+(t?" in "+t:"")),kC.ERR_DEPRECATED);return t&&!nxe[s]&&(nxe[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 L_t(n,e,t){if(typeof n!="object")throw new kC("options must be an object",kC.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 kC("option "+o+" must be "+l,kC.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new kC("Unknown option "+o,kC.ERR_BAD_OPTION)}}var D_t={assertOptions:L_t,validators:Npe},gBe=Fd,A_t=oBe,ixe=n_t,rxe=k_t,Pj=fBe,R_t=dBe,mBe=D_t,NI=mBe.validators;function ND(n){this.defaults=n,this.interceptors={request:new ixe,response:new ixe}}ND.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Pj(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&&mBe.assertOptions(i,{silentJSONParsing:NI.transitional(NI.boolean),forcedJSONParsing:NI.transitional(NI.boolean),clarifyTimeoutError:NI.transitional(NI.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(o=o&&f.synchronous,r.unshift(f.fulfilled,f.rejected))});var s=[];this.interceptors.response.forEach(function(f){s.push(f.fulfilled,f.rejected)});var a;if(!o){var l=[rxe,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=rxe(c)}catch(h){return Promise.reject(h)}for(;s.length;)a=a.then(s.shift(),s.shift());return a};ND.prototype.getUri=function(e){e=Pj(this.defaults,e);var t=R_t(e.baseURL,e.url);return A_t(t,e.params,e.paramsSerializer)};gBe.forEach(["delete","get","head","options"],function(e){ND.prototype[e]=function(t,i){return this.request(Pj(i||{},{method:e,url:t,data:(i||{}).data}))}});gBe.forEach(["post","put","patch"],function(e){function t(i){return function(o,s,a){return this.request(Pj(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}ND.prototype[e]=t(),ND.prototype[e+"Form"]=t(!0)});var N_t=ND,fZ,oxe;function O_t(){if(oxe)return fZ;oxe=1;var n=Nj();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}},fZ=e,fZ}var pZ,sxe;function P_t(){return sxe||(sxe=1,pZ=function(e){return function(i){return e.apply(null,i)}}),pZ}var gZ,axe;function M_t(){if(axe)return gZ;axe=1;var n=Fd;return gZ=function(t){return n.isObject(t)&&t.isAxiosError===!0},gZ}var lxe=Fd,F_t=nBe,a$=N_t,B_t=fBe,$_t=Rpe;function _Be(n){var e=new a$(n),t=F_t(a$.prototype.request,e);return lxe.extend(t,a$.prototype,e),lxe.extend(t,e),t.create=function(r){return _Be(B_t(n,r))},t}var qf=_Be($_t);qf.Axios=a$;qf.CanceledError=Nj();qf.CancelToken=O_t();qf.isCancel=hBe();qf.VERSION=pBe().version;qf.toFormData=uBe;qf.AxiosError=hR;qf.Cancel=qf.CanceledError;qf.all=function(e){return Promise.all(e)};qf.spread=P_t();qf.isAxiosError=M_t();Tpe.exports=qf;Tpe.exports.default=qf;var V_t=Tpe.exports,H_t=V_t;const vBe=nl(H_t);let W_t=0;function Ro(n,e){const t=`atom${++W_t}`,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 cxe=n=>"init"in n,uxe=n=>!!n.write,oH=new WeakMap,z_t=(n,e)=>{oH.set(n,e),n.catch(()=>{}).finally(()=>oH.delete(n))},dxe=(n,e)=>{const t=oH.get(n);t&&(oH.delete(n),t(e))},hxe=(n,e)=>{n.status="fulfilled",n.value=e},fxe=(n,e)=>{n.status="rejected",n.reason=e},U_t=n=>typeof(n==null?void 0:n.then)=="function",ZN=(n,e)=>!!n&&"v"in n&&"v"in e&&Object.is(n.v,e.v),pxe=(n,e)=>!!n&&"e"in n&&"e"in e&&Object.is(n.e,e.e),OI=n=>!!n&&"v"in n&&n.v instanceof Promise,j_t=(n,e)=>"v"in n&&"v"in e&&n.v.orig&&n.v.orig===e.v.orig,_8=n=>{if("e"in n)throw n.e;return n.v},q_t=()=>{const n=new WeakMap,e=new WeakMap,t=new Map;let i,r;const o=L=>n.get(L),s=(L,D)=>{const A=n.get(L);if(n.set(L,D),t.has(L)||t.set(L,A),OI(A)){const N="v"in D?D.v instanceof Promise?D.v:Promise.resolve(D.v):Promise.reject(D.e);A.v!==N&&dxe(A.v,N)}},a=(L,D,A)=>{const N=new Map;let P=!1;A.forEach((M,B)=>{!M&&B===L&&(M=D),M&&(N.set(B,M),D.d.get(B)!==M&&(P=!0))}),(P||D.d.size!==N.size)&&(D.d=N)},l=(L,D,A)=>{const N=o(L),P={d:(N==null?void 0:N.d)||new Map,v:D};if(A&&a(L,P,A),ZN(N,P)&&N.d===P.d)return N;if(OI(N)&&OI(P)&&j_t(N,P)){if(N.d===P.d)return N;P.v=N.v}return s(L,P),P},c=(L,D,A,N)=>{if(U_t(D)){let P;const M=()=>{const F=o(L);if(!OI(F)||F.v!==B)return;const U=l(L,B,A);e.has(L)&&F.d!==U.d&&E(L,U,F.d)},B=new Promise((F,U)=>{let H=!1;D.then(W=>{H||(H=!0,hxe(B,W),F(W),M())},W=>{H||(H=!0,fxe(B,W),U(W),M())}),P=W=>{H||(H=!0,W.then(q=>hxe(B,q),q=>fxe(B,q)),F(W))}});return B.orig=D,B.status="pending",z_t(B,F=>{F&&P(F),N==null||N()}),l(L,B,A)}return l(L,D,A)},u=(L,D,A)=>{const N=o(L),P={d:(N==null?void 0:N.d)||new Map,e:D};return A&&a(L,P,A),pxe(N,P)&&N.d===P.d?N:(s(L,P),P)},d=(L,D)=>{const A=o(L);if(!D&&A&&(e.has(L)||Array.from(A.d).every(([H,W])=>{if(H===L)return!0;const q=d(H);return q===W||ZN(q,W)})))return A;const N=new Map;let P=!0;const M=H=>{if(H===L){const q=o(H);if(q)return N.set(H,q),_8(q);if(cxe(H))return N.set(H,void 0),H.init;throw new Error("no atom init")}const W=d(H);return N.set(H,W),_8(W)};let B,F;const U={get signal(){return B||(B=new AbortController),B.signal},get setSelf(){return!F&&uxe(L)&&(F=(...H)=>{if(!P)return b(L,...H)}),F}};try{const H=L.read(M,U);return c(L,H,N,()=>B==null?void 0:B.abort())}catch(H){return u(L,H,N)}finally{P=!1}},h=L=>_8(d(L)),f=L=>{let D=e.get(L);return D||(D=y(L)),D},g=(L,D)=>!D.l.size&&(!D.t.size||D.t.size===1&&D.t.has(L)),m=L=>{const D=e.get(L);D&&g(L,D)&&C(L)},v=L=>{const D=new Map,A=new WeakMap,N=B=>{var F;const U=new Set((F=e.get(B))==null?void 0:F.t);return t.forEach((H,W)=>{var q;(q=o(W))!=null&&q.d.has(B)&&U.add(W)}),U},P=B=>{N(B).forEach(F=>{F!==B&&(D.set(F,(D.get(F)||new Set).add(B)),A.set(F,(A.get(F)||0)+1),P(F))})};P(L);const M=B=>{N(B).forEach(F=>{var U;if(F!==B){let H=A.get(F);if(H&&A.set(F,--H),!H){let W=!!((U=D.get(F))!=null&&U.size);if(W){const q=o(F),V=d(F,!0);W=!ZN(q,V)}W||D.forEach(q=>q.delete(F))}M(F)}})};M(L)},_=(L,...D)=>{let A=!0;const N=B=>_8(d(B)),P=(B,...F)=>{let U;if(B===L){if(!cxe(B))throw new Error("atom not writable");const H=o(B),W=c(B,F[0]);ZN(H,W)||v(B)}else U=_(B,...F);if(!A){const H=x()}return U},M=L.write(N,P,...D);return A=!1,M},b=(L,...D)=>{const A=_(L,...D),N=x();return A},y=(L,D,A)=>{var N;const P=A||[];(N=o(L))==null||N.d.forEach((B,F)=>{const U=e.get(F);U?U.t.add(L):F!==L&&y(F,L,P)}),d(L);const M={t:new Set(D&&[D]),l:new Set};if(e.set(L,M),uxe(L)&&L.onMount){const{onMount:B}=L;P.push(()=>{const F=B((...U)=>b(L,...U));F&&(M.u=F)})}return A||P.forEach(B=>B()),M},C=L=>{var D;const A=(D=e.get(L))==null?void 0:D.u;A&&A(),e.delete(L);const N=o(L);N&&(OI(N)&&dxe(N.v),N.d.forEach((P,M)=>{if(M!==L){const B=e.get(M);B&&(B.t.delete(L),g(M,B)&&C(M))}}))},E=(L,D,A)=>{const N=new Set(D.d.keys());A==null||A.forEach((P,M)=>{if(N.has(M)){N.delete(M);return}const B=e.get(M);B&&(B.t.delete(L),g(M,B)&&C(M))}),N.forEach(P=>{const M=e.get(P);M?M.t.add(L):e.has(L)&&y(P,L)})},x=()=>{let L;for(;t.size;){const D=Array.from(t);t.clear(),D.forEach(([A,N])=>{const P=o(A);if(P){const M=e.get(A);M&&P.d!==(N==null?void 0:N.d)&&E(A,P,N==null?void 0:N.d),M&&!(!OI(N)&&(ZN(N,P)||pxe(N,P)))&&M.l.forEach(B=>B())}})}};return{get:h,set:b,sub:(L,D)=>{const A=f(L),N=x(),P=A.l;return P.add(D),()=>{P.delete(D),m(L)}}}};let mZ;const G_t=()=>(mZ||(mZ=q_t()),mZ),K_t=w.createContext(void 0),bBe=n=>{const e=w.useContext(K_t);return(n==null?void 0:n.store)||e||G_t()},Y_t=n=>typeof(n==null?void 0:n.then)=="function",Q_t=ce.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 Gi(n,e){const t=bBe(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),Y_t(a)?Q_t(a):a}function Wi(n,e){const t=bBe(e);return w.useCallback((...r)=>t.set(n,...r),[t,n])}function us(n,e){return[Gi(n,e),Wi(n,e)]}var X_t={exports:{}};/*!
* Pusher JavaScript Library v8.4.0-rc2
* https://pusher.com/
*
* Copyright 2020, Pusher
* Released under the MIT licence.
*/(function(n,e){(function(i,r){n.exports=r()})(window,function(){return function(t){var i={};function r(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=t,r.c=i,r.d=function(o,s,a){r.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:a})},r.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},r.t=function(o,s){if(s&1&&(o=r(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var l in o)r.d(a,l,(function(c){return o[c]}).bind(null,l));return a},r.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return r.d(s,"a",s),s},r.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},r.p="",r(r.s=2)}([function(t,i,r){var o=this&&this.__extends||function(){var m=function(v,_){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,y){b.__proto__=y}||function(b,y){for(var C in y)y.hasOwnProperty(C)&&(b[C]=y[C])},m(v,_)};return function(v,_){m(v,_);function b(){this.constructor=v}v.prototype=_===null?Object.create(_):(b.prototype=_.prototype,new b)}}();Object.defineProperty(i,"__esModule",{value:!0});var s=256,a=function(){function m(v){v===void 0&&(v="="),this._paddingCharacter=v}return m.prototype.encodedLength=function(v){return this._paddingCharacter?(v+2)/3*4|0:(v*8+5)/6|0},m.prototype.encode=function(v){for(var _="",b=0;b<v.length-2;b+=3){var y=v[b]<<16|v[b+1]<<8|v[b+2];_+=this._encodeByte(y>>>3*6&63),_+=this._encodeByte(y>>>2*6&63),_+=this._encodeByte(y>>>1*6&63),_+=this._encodeByte(y>>>0*6&63)}var C=v.length-b;if(C>0){var y=v[b]<<16|(C===2?v[b+1]<<8:0);_+=this._encodeByte(y>>>3*6&63),_+=this._encodeByte(y>>>2*6&63),C===2?_+=this._encodeByte(y>>>1*6&63):_+=this._paddingCharacter||"",_+=this._paddingCharacter||""}return _},m.prototype.maxDecodedLength=function(v){return this._paddingCharacter?v/4*3|0:(v*6+7)/8|0},m.prototype.decodedLength=function(v){return this.maxDecodedLength(v.length-this._getPaddingLength(v))},m.prototype.decode=function(v){if(v.length===0)return new Uint8Array(0);for(var _=this._getPaddingLength(v),b=v.length-_,y=new Uint8Array(this.maxDecodedLength(b)),C=0,E=0,x=0,k=0,L=0,D=0,A=0;E<b-4;E+=4)k=this._decodeChar(v.charCodeAt(E+0)),L=this._decodeChar(v.charCodeAt(E+1)),D=this._decodeChar(v.charCodeAt(E+2)),A=this._decodeChar(v.charCodeAt(E+3)),y[C++]=k<<2|L>>>4,y[C++]=L<<4|D>>>2,y[C++]=D<<6|A,x|=k&s,x|=L&s,x|=D&s,x|=A&s;if(E<b-1&&(k=this._decodeChar(v.charCodeAt(E)),L=this._decodeChar(v.charCodeAt(E+1)),y[C++]=k<<2|L>>>4,x|=k&s,x|=L&s),E<b-2&&(D=this._decodeChar(v.charCodeAt(E+2)),y[C++]=L<<4|D>>>2,x|=D&s),E<b-3&&(A=this._decodeChar(v.charCodeAt(E+3)),y[C++]=D<<6|A,x|=A&s),x!==0)throw new Error("Base64Coder: incorrect characters for decoding");return y},m.prototype._encodeByte=function(v){var _=v;return _+=65,_+=25-v>>>8&0-65-26+97,_+=51-v>>>8&26-97-52+48,_+=61-v>>>8&52-48-62+43,_+=62-v>>>8&62-43-63+47,String.fromCharCode(_)},m.prototype._decodeChar=function(v){var _=s;return _+=(42-v&v-44)>>>8&-s+v-43+62,_+=(46-v&v-48)>>>8&-s+v-47+63,_+=(47-v&v-58)>>>8&-s+v-48+52,_+=(64-v&v-91)>>>8&-s+v-65+0,_+=(96-v&v-123)>>>8&-s+v-97+26,_},m.prototype._getPaddingLength=function(v){var _=0;if(this._paddingCharacter){for(var b=v.length-1;b>=0&&v[b]===this._paddingCharacter;b--)_++;if(v.length<4||_>2)throw new Error("Base64Coder: incorrect padding")}return _},m}();i.Coder=a;var l=new a;function c(m){return l.encode(m)}i.encode=c;function u(m){return l.decode(m)}i.decode=u;var d=function(m){o(v,m);function v(){return m!==null&&m.apply(this,arguments)||this}return v.prototype._encodeByte=function(_){var b=_;return b+=65,b+=25-_>>>8&0-65-26+97,b+=51-_>>>8&26-97-52+48,b+=61-_>>>8&52-48-62+45,b+=62-_>>>8&62-45-63+95,String.fromCharCode(b)},v.prototype._decodeChar=function(_){var b=s;return b+=(44-_&_-46)>>>8&-s+_-45+62,b+=(94-_&_-96)>>>8&-s+_-95+63,b+=(47-_&_-58)>>>8&-s+_-48+52,b+=(64-_&_-91)>>>8&-s+_-65+0,b+=(96-_&_-123)>>>8&-s+_-97+26,b},v}(a);i.URLSafeCoder=d;var h=new d;function f(m){return h.encode(m)}i.encodeURLSafe=f;function g(m){return h.decode(m)}i.decodeURLSafe=g,i.encodedLength=function(m){return l.encodedLength(m)},i.maxDecodedLength=function(m){return l.maxDecodedLength(m)},i.decodedLength=function(m){return l.decodedLength(m)}},function(t,i,r){Object.defineProperty(i,"__esModule",{value:!0});var o="utf8: invalid string",s="utf8: invalid source encoding";function a(u){for(var d=new Uint8Array(l(u)),h=0,f=0;f<u.length;f++){var g=u.charCodeAt(f);g<128?d[h++]=g:g<2048?(d[h++]=192|g>>6,d[h++]=128|g&63):g<55296?(d[h++]=224|g>>12,d[h++]=128|g>>6&63,d[h++]=128|g&63):(f++,g=(g&1023)<<10,g|=u.charCodeAt(f)&1023,g+=65536,d[h++]=240|g>>18,d[h++]=128|g>>12&63,d[h++]=128|g>>6&63,d[h++]=128|g&63)}return d}i.encode=a;function l(u){for(var d=0,h=0;h<u.length;h++){var f=u.charCodeAt(h);if(f<128)d+=1;else if(f<2048)d+=2;else if(f<55296)d+=3;else if(f<=57343){if(h>=u.length-1)throw new Error(o);h++,d+=4}else throw new Error(o)}return d}i.encodedLength=l;function c(u){for(var d=[],h=0;h<u.length;h++){var f=u[h];if(f&128){var g=void 0;if(f<224){if(h>=u.length)throw new Error(s);var m=u[++h];if((m&192)!==128)throw new Error(s);f=(f&31)<<6|m&63,g=128}else if(f<240){if(h>=u.length-1)throw new Error(s);var m=u[++h],v=u[++h];if((m&192)!==128||(v&192)!==128)throw new Error(s);f=(f&15)<<12|(m&63)<<6|v&63,g=2048}else if(f<248){if(h>=u.length-2)throw new Error(s);var m=u[++h],v=u[++h],_=u[++h];if((m&192)!==128||(v&192)!==128||(_&192)!==128)throw new Error(s);f=(f&15)<<18|(m&63)<<12|(v&63)<<6|_&63,g=65536}else throw new Error(s);if(f<g||f>=55296&&f<=57343)throw new Error(s);if(f>=65536){if(f>1114111)throw new Error(s);f-=65536,d.push(String.fromCharCode(55296|f>>10)),f=56320|f&1023}}d.push(String.fromCharCode(f))}return d.join("")}i.decode=c},function(t,i,r){t.exports=r(3).default},function(t,i,r){r.r(i);class o{constructor(z,Z){this.lastId=0,this.prefix=z,this.name=Z}create(z){this.lastId++;var Z=this.lastId,xe=this.prefix+Z,Oe=this.name+"["+Z+"]",Kt=!1,$n=function(){Kt||(z.apply(null,arguments),Kt=!0)};return this[Z]=$n,{number:Z,id:xe,name:Oe,callback:$n}}remove(z){delete this[z.number]}}var s=new o("_pusher_script_","Pusher.ScriptReceivers"),a={VERSION:"8.4.0-rc2",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},l=a;class c{constructor(z){this.options=z,this.receivers=z.receivers||s,this.loading={}}load(z,Z,xe){var Oe=this;if(Oe.loading[z]&&Oe.loading[z].length>0)Oe.loading[z].push(xe);else{Oe.loading[z]=[xe];var Kt=Rn.createScriptRequest(Oe.getPath(z,Z)),$n=Oe.receivers.create(function(Li){if(Oe.receivers.remove($n),Oe.loading[z]){var Vr=Oe.loading[z];delete Oe.loading[z];for(var Oo=function(Nn){Nn||Kt.cleanup()},Ci=0;Ci<Vr.length;Ci++)Vr[Ci](Li,Oo)}});Kt.send($n)}}getRoot(z){var Z,xe=Rn.getDocument().location.protocol;return z&&z.useTLS||xe==="https:"?Z=this.options.cdn_https:Z=this.options.cdn_http,Z.replace(/\/*$/,"")+"/"+this.options.version}getPath(z,Z){return this.getRoot(Z)+"/"+z+this.options.suffix+".js"}}var u=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),d=new c({cdn_http:l.cdn_http,cdn_https:l.cdn_https,version:l.VERSION,suffix:l.dependency_suffix,receivers:u});const h={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var g={buildLogSuffix:function(ee){const z="See:",Z=h.urls[ee];if(!Z)return"";let xe;return Z.fullUrl?xe=Z.fullUrl:Z.path&&(xe=h.baseUrl+Z.path),xe?`${z} ${xe}`:""}},m;(function(ee){ee.UserAuthentication="user-authentication",ee.ChannelAuthorization="channel-authorization"})(m||(m={}));class v extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class b extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class y extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class k extends Error{constructor(z){super(z),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(z,Z){super(Z),this.status=z,Object.setPrototypeOf(this,new.target.prototype)}}var A=function(ee,z,Z,xe,Oe){const Kt=Rn.createXHR();Kt.open("POST",Z.endpoint,!0),Kt.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var $n in Z.headers)Kt.setRequestHeader($n,Z.headers[$n]);if(Z.headersProvider!=null){let Li=Z.headersProvider();for(var $n in Li)Kt.setRequestHeader($n,Li[$n])}return Kt.onreadystatechange=function(){if(Kt.readyState===4)if(Kt.status===200){let Li,Vr=!1;try{Li=JSON.parse(Kt.responseText),Vr=!0}catch{Oe(new L(200,`JSON returned from ${xe.toString()} endpoint was invalid, yet status code was 200. Data was: ${Kt.responseText}`),null)}Vr&&Oe(null,Li)}else{let Li="";switch(xe){case m.UserAuthentication:Li=g.buildLogSuffix("authenticationEndpoint");break;case m.ChannelAuthorization:Li=`Clients must be authorized to join private or presence channels. ${g.buildLogSuffix("authorizationEndpoint")}`;break}Oe(new L(Kt.status,`Unable to retrieve auth string from ${xe.toString()} endpoint - received status: ${Kt.status} from ${Z.endpoint}. ${Li}`),null)}},Kt.send(z),Kt};function N(ee){return H(F(ee))}var P=String.fromCharCode,M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=function(ee){var z=ee.charCodeAt(0);return z<128?ee:z<2048?P(192|z>>>6)+P(128|z&63):P(224|z>>>12&15)+P(128|z>>>6&63)+P(128|z&63)},F=function(ee){return ee.replace(/[^\x00-\x7F]/g,B)},U=function(ee){var z=[0,2,1][ee.length%3],Z=ee.charCodeAt(0)<<16|(ee.length>1?ee.charCodeAt(1):0)<<8|(ee.length>2?ee.charCodeAt(2):0),xe=[M.charAt(Z>>>18),M.charAt(Z>>>12&63),z>=2?"=":M.charAt(Z>>>6&63),z>=1?"=":M.charAt(Z&63)];return xe.join("")},H=window.btoa||function(ee){return ee.replace(/[\s\S]{1,3}/g,U)};class W{constructor(z,Z,xe,Oe){this.clear=Z,this.timer=z(()=>{this.timer&&(this.timer=Oe(this.timer))},xe)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var q=W;function V(ee){window.clearTimeout(ee)}function re(ee){window.clearInterval(ee)}class oe extends q{constructor(z,Z){super(setTimeout,V,z,function(xe){return Z(),null})}}class Q extends q{constructor(z,Z){super(setInterval,re,z,function(xe){return Z(),xe})}}var Ne={now(){return Date.now?Date.now():new Date().valueOf()},defer(ee){return new oe(0,ee)},method(ee,...z){var Z=Array.prototype.slice.call(arguments,1);return function(xe){return xe[ee].apply(xe,Z.concat(arguments))}}},Ve=Ne;function Ye(ee,...z){for(var Z=0;Z<z.length;Z++){var xe=z[Z];for(var Oe in xe)xe[Oe]&&xe[Oe].constructor&&xe[Oe].constructor===Object?ee[Oe]=Ye(ee[Oe]||{},xe[Oe]):ee[Oe]=xe[Oe]}return ee}function ye(){for(var ee=["Pusher"],z=0;z<arguments.length;z++)typeof arguments[z]=="string"?ee.push(arguments[z]):ee.push(Y(arguments[z]));return ee.join(" : ")}function He(ee,z){var Z=Array.prototype.indexOf;if(ee===null)return-1;if(Z&&ee.indexOf===Z)return ee.indexOf(z);for(var xe=0,Oe=ee.length;xe<Oe;xe++)if(ee[xe]===z)return xe;return-1}function Pe(ee,z){for(var Z in ee)Object.prototype.hasOwnProperty.call(ee,Z)&&z(ee[Z],Z,ee)}function Ge(ee){var z=[];return Pe(ee,function(Z,xe){z.push(xe)}),z}function Fe(ee){var z=[];return Pe(ee,function(Z){z.push(Z)}),z}function bt(ee,z,Z){for(var xe=0;xe<ee.length;xe++)z.call(Z||window,ee[xe],xe,ee)}function Mt(ee,z){for(var Z=[],xe=0;xe<ee.length;xe++)Z.push(z(ee[xe],xe,ee,Z));return Z}function Ft(ee,z){var Z={};return Pe(ee,function(xe,Oe){Z[Oe]=z(xe)}),Z}function Yt(ee,z){z=z||function(Oe){return!!Oe};for(var Z=[],xe=0;xe<ee.length;xe++)z(ee[xe],xe,ee,Z)&&Z.push(ee[xe]);return Z}function ln(ee,z){var Z={};return Pe(ee,function(xe,Oe){(z&&z(xe,Oe,ee,Z)||xe)&&(Z[Oe]=xe)}),Z}function Et(ee){var z=[];return Pe(ee,function(Z,xe){z.push([xe,Z])}),z}function mt(ee,z){for(var Z=0;Z<ee.length;Z++)if(z(ee[Z],Z,ee))return!0;return!1}function Lt(ee,z){for(var Z=0;Z<ee.length;Z++)if(!z(ee[Z],Z,ee))return!1;return!0}function be(ee){return Ft(ee,function(z){return typeof z=="object"&&(z=Y(z)),encodeURIComponent(N(z.toString()))})}function Te(ee){var z=ln(ee,function(xe){return xe!==void 0}),Z=Mt(Et(be(z)),Ve.method("join","=")).join("&");return Z}function se(ee){var z=[],Z=[];return function xe(Oe,Kt){var $n,Li,Vr;switch(typeof Oe){case"object":if(!Oe)return null;for($n=0;$n<z.length;$n+=1)if(z[$n]===Oe)return{$ref:Z[$n]};if(z.push(Oe),Z.push(Kt),Object.prototype.toString.apply(Oe)==="[object Array]")for(Vr=[],$n=0;$n<Oe.length;$n+=1)Vr[$n]=xe(Oe[$n],Kt+"["+$n+"]");else{Vr={};for(Li in Oe)Object.prototype.hasOwnProperty.call(Oe,Li)&&(Vr[Li]=xe(Oe[Li],Kt+"["+JSON.stringify(Li)+"]"))}return Vr;case"number":case"string":case"boolean":return Oe}}(ee,"$")}function Y(ee){try{return JSON.stringify(ee)}catch{return JSON.stringify(se(ee))}}class X{constructor(){this.globalLog=z=>{window.console&&window.console.log&&window.console.log(z)}}debug(...z){this.log(this.globalLog,z)}warn(...z){this.log(this.globalLogWarn,z)}error(...z){this.log(this.globalLogError,z)}globalLogWarn(z){window.console&&window.console.warn?window.console.warn(z):this.globalLog(z)}globalLogError(z){window.console&&window.console.error?window.console.error(z):this.globalLogWarn(z)}log(z,...Z){var xe=ye.apply(this,arguments);yE.log?yE.log(xe):yE.logToConsole&&z.bind(this)(xe)}}var le=new X,te=function(ee,z,Z,xe,Oe){(Z.headers!==void 0||Z.headersProvider!=null)&&le.warn(`To send headers with the ${xe.toString()} request, you must use AJAX, rather than JSONP.`);var Kt=ee.nextAuthCallbackID.toString();ee.nextAuthCallbackID++;var $n=ee.getDocument(),Li=$n.createElement("script");ee.auth_callbacks[Kt]=function(Ci){Oe(null,Ci)};var Vr="Pusher.auth_callbacks['"+Kt+"']";Li.src=Z.endpoint+"?callback="+encodeURIComponent(Vr)+"&"+z;var Oo=$n.getElementsByTagName("head")[0]||$n.documentElement;Oo.insertBefore(Li,Oo.firstChild)},me=te;class Me{constructor(z){this.src=z}send(z){var Z=this,xe="Error loading "+Z.src;Z.script=document.createElement("script"),Z.script.id=z.id,Z.script.src=Z.src,Z.script.type="text/javascript",Z.script.charset="UTF-8",Z.script.addEventListener?(Z.script.onerror=function(){z.callback(xe)},Z.script.onload=function(){z.callback(null)}):Z.script.onreadystatechange=function(){(Z.script.readyState==="loaded"||Z.script.readyState==="complete")&&z.callback(null)},Z.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(Z.errorScript=document.createElement("script"),Z.errorScript.id=z.id+"_error",Z.errorScript.text=z.name+"('"+xe+"');",Z.script.async=Z.errorScript.async=!1):Z.script.async=!0;var Oe=document.getElementsByTagName("head")[0];Oe.insertBefore(Z.script,Oe.firstChild),Z.errorScript&&Oe.insertBefore(Z.errorScript,Z.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class rt{constructor(z,Z){this.url=z,this.data=Z}send(z){if(!this.request){var Z=Te(this.data),xe=this.url+"/"+z.number+"?"+Z;this.request=Rn.createScriptRequest(xe),this.request.send(z)}}cleanup(){this.request&&this.request.cleanup()}}var It=function(ee,z){return function(Z,xe){var Oe="http"+(z?"s":"")+"://",Kt=Oe+(ee.host||ee.options.host)+ee.options.path,$n=Rn.createJSONPRequest(Kt,Z),Li=Rn.ScriptReceivers.create(function(Vr,Oo){s.remove(Li),$n.cleanup(),Oo&&Oo.host&&(ee.host=Oo.host),xe&&xe(Vr,Oo)});$n.send(Li)}},Qt={name:"jsonp",getAgent:It},pe=Qt;function We(ee,z,Z){var xe=ee+(z.useTLS?"s":""),Oe=z.useTLS?z.hostTLS:z.hostNonTLS;return xe+"://"+Oe+Z}function ne(ee,z){var Z="/app/"+ee,xe="?protocol="+l.PROTOCOL+"&client=js&version="+l.VERSION+(z?"&"+z:"");return Z+xe}var Se={getInitial:function(ee,z){var Z=(z.httpPath||"")+ne(ee,"flash=false");return We("ws",z,Z)}},Ie={getInitial:function(ee,z){var Z=(z.httpPath||"/pusher")+ne(ee);return We("http",z,Z)}},Ke={getInitial:function(ee,z){return We("http",z,z.httpPath||"/pusher")},getPath:function(ee,z){return ne(ee)}};class Je{constructor(){this._callbacks={}}get(z){return this._callbacks[ot(z)]}add(z,Z,xe){var Oe=ot(z);this._callbacks[Oe]=this._callbacks[Oe]||[],this._callbacks[Oe].push({fn:Z,context:xe})}remove(z,Z,xe){if(!z&&!Z&&!xe){this._callbacks={};return}var Oe=z?[ot(z)]:Ge(this._callbacks);Z||xe?this.removeCallback(Oe,Z,xe):this.removeAllCallbacks(Oe)}removeCallback(z,Z,xe){bt(z,function(Oe){this._callbacks[Oe]=Yt(this._callbacks[Oe]||[],function(Kt){return Z&&Z!==Kt.fn||xe&&xe!==Kt.context}),this._callbacks[Oe].length===0&&delete this._callbacks[Oe]},this)}removeAllCallbacks(z){bt(z,function(Z){delete this._callbacks[Z]},this)}}function ot(ee){return"_"+ee}class wt{constructor(z){this.callbacks=new Je,this.global_callbacks=[],this.failThrough=z}bind(z,Z,xe){return this.callbacks.add(z,Z,xe),this}bind_global(z){return this.global_callbacks.push(z),this}unbind(z,Z,xe){return this.callbacks.remove(z,Z,xe),this}unbind_global(z){return z?(this.global_callbacks=Yt(this.global_callbacks||[],Z=>Z!==z),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(z,Z,xe){for(var Oe=0;Oe<this.global_callbacks.length;Oe++)this.global_callbacks[Oe](z,Z);var Kt=this.callbacks.get(z),$n=[];if(xe?$n.push(Z,xe):Z&&$n.push(Z),Kt&&Kt.length>0)for(var Oe=0;Oe<Kt.length;Oe++)Kt[Oe].fn.apply(Kt[Oe].context||window,$n);else this.failThrough&&this.failThrough(z,Z);return this}}class pn extends wt{constructor(z,Z,xe,Oe,Kt){super(),this.initialize=Rn.transportConnectionInitializer,this.hooks=z,this.name=Z,this.priority=xe,this.key=Oe,this.options=Kt,this.state="new",this.timeline=Kt.timeline,this.activityTimeout=Kt.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var z=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(z,this.options)}catch(Z){return Ve.defer(()=>{this.onError(Z),this.changeState("closed")}),!1}return this.bindListeners(),le.debug("Connecting",{transport:this.name,url:z}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(z){return this.state==="open"?(Ve.defer(()=>{this.socket&&this.socket.send(z)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(z){this.emit("error",{type:"WebSocketError",error:z}),this.timeline.error(this.buildTimelineMessage({error:z.toString()}))}onClose(z){z?this.changeState("closed",{code:z.code,reason:z.reason,wasClean:z.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(z){this.emit("message",z)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=z=>{this.onError(z)},this.socket.onclose=z=>{this.onClose(z)},this.socket.onmessage=z=>{this.onMessage(z)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(z,Z){this.state=z,this.timeline.info(this.buildTimelineMessage({state:z,params:Z})),this.emit(z,Z)}buildTimelineMessage(z){return Ye({cid:this.id},z)}}class Kn{constructor(z){this.hooks=z}isSupported(z){return this.hooks.isSupported(z)}createConnection(z,Z,xe,Oe){return new pn(this.hooks,z,Z,xe,Oe)}}var Cn=new Kn({urls:Se,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Rn.getWebSocketAPI()},isSupported:function(){return!!Rn.getWebSocketAPI()},getSocket:function(ee){return Rn.createWebSocket(ee)}}),hn={urls:Ie,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},bn=Ye({getSocket:function(ee){return Rn.HTTPFactory.createStreamingSocket(ee)}},hn),Wn=Ye({getSocket:function(ee){return Rn.HTTPFactory.createPollingSocket(ee)}},hn),Ei={isSupported:function(){return Rn.isXHRSupported()}},er=new Kn(Ye({},bn,Ei)),ur=new Kn(Ye({},Wn,Ei)),Jr={ws:Cn,xhr_streaming:er,xhr_polling:ur},$i=Jr,xs=new Kn({file:"sockjs",urls:Ke,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(ee,z){return new window.SockJS(ee,null,{js_path:d.getPath("sockjs",{useTLS:z.useTLS}),ignore_null_origin:z.ignoreNullOrigin})},beforeOpen:function(ee,z){ee.send(JSON.stringify({path:z}))}}),wr={isSupported:function(ee){var z=Rn.isXDRSupported(ee.useTLS);return z}},Ji=new Kn(Ye({},bn,wr)),rn=new Kn(Ye({},Wn,wr));$i.xdr_streaming=Ji,$i.xdr_polling=rn,$i.sockjs=xs;var di=$i;class Wr extends wt{constructor(){super();var z=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){z.emit("online")},!1),window.addEventListener("offline",function(){z.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Qe=new Wr;class Ct{constructor(z,Z,xe){this.manager=z,this.transport=Z,this.minPingDelay=xe.minPingDelay,this.maxPingDelay=xe.maxPingDelay,this.pingDelay=void 0}createConnection(z,Z,xe,Oe){Oe=Ye({},Oe,{activityTimeout:this.pingDelay});var Kt=this.transport.createConnection(z,Z,xe,Oe),$n=null,Li=function(){Kt.unbind("open",Li),Kt.bind("closed",Vr),$n=Ve.now()},Vr=Oo=>{if(Kt.unbind("closed",Vr),Oo.code===1002||Oo.code===1003)this.manager.reportDeath();else if(!Oo.wasClean&&$n){var Ci=Ve.now()-$n;Ci<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(Ci/2,this.minPingDelay))}};return Kt.bind("open",Li),Kt}isSupported(z){return this.manager.isAlive()&&this.transport.isSupported(z)}}const Gt={decodeMessage:function(ee){try{var z=JSON.parse(ee.data),Z=z.data;if(typeof Z=="string")try{Z=JSON.parse(z.data)}catch{}var xe={event:z.event,channel:z.channel,data:Z};return z.user_id&&(xe.user_id=z.user_id),xe}catch(Oe){throw{type:"MessageParseError",error:Oe,data:ee.data}}},encodeMessage:function(ee){return JSON.stringify(ee)},processHandshake:function(ee){var z=Gt.decodeMessage(ee);if(z.event==="pusher:connection_established"){if(!z.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:z.data.socket_id,activityTimeout:z.data.activity_timeout*1e3}}else{if(z.event==="pusher:error")return{action:this.getCloseAction(z.data),error:this.getCloseError(z.data)};throw"Invalid handshake"}},getCloseAction:function(ee){return ee.code<4e3?ee.code>=1002&&ee.code<=1004?"backoff":null:ee.code===4e3?"tls_only":ee.code<4100?"refused":ee.code<4200?"backoff":ee.code<4300?"retry":"refused"},getCloseError:function(ee){return ee.code!==1e3&&ee.code!==1001?{type:"PusherError",data:{code:ee.code,message:ee.reason||ee.message}}:null}};var Jt=Gt;class ut extends wt{constructor(z,Z){super(),this.id=z,this.transport=Z,this.activityTimeout=Z.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(z){return this.transport.send(z)}send_event(z,Z,xe){var Oe={event:z,data:Z};return xe&&(Oe.channel=xe),le.debug("Event sent",Oe),this.send(Jt.encodeMessage(Oe))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var z={message:xe=>{var Oe;try{Oe=Jt.decodeMessage(xe)}catch(Kt){this.emit("error",{type:"MessageParseError",error:Kt,data:xe.data})}if(Oe!==void 0){switch(le.debug("Event recd",Oe),Oe.event){case"pusher:error":this.emit("error",{type:"PusherError",data:Oe.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",Oe)}},activity:()=>{this.emit("activity")},error:xe=>{this.emit("error",xe)},closed:xe=>{Z(),xe&&xe.code&&this.handleCloseEvent(xe),this.transport=null,this.emit("closed")}},Z=()=>{Pe(z,(xe,Oe)=>{this.transport.unbind(Oe,xe)})};Pe(z,(xe,Oe)=>{this.transport.bind(Oe,xe)})}handleCloseEvent(z){var Z=Jt.getCloseAction(z),xe=Jt.getCloseError(z);xe&&this.emit("error",xe),Z&&this.emit(Z,{action:Z,error:xe})}}class Le{constructor(z,Z){this.transport=z,this.callback=Z,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=z=>{this.unbindListeners();var Z;try{Z=Jt.processHandshake(z)}catch(xe){this.finish("error",{error:xe}),this.transport.close();return}Z.action==="connected"?this.finish("connected",{connection:new ut(Z.id,this.transport),activityTimeout:Z.activityTimeout}):(this.finish(Z.action,{error:Z.error}),this.transport.close())},this.onClosed=z=>{this.unbindListeners();var Z=Jt.getCloseAction(z)||"backoff",xe=Jt.getCloseError(z);this.finish(Z,{error:xe})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(z,Z){this.callback(Ye({transport:this.transport,action:z},Z))}}class st{constructor(z,Z){this.timeline=z,this.options=Z||{}}send(z,Z){this.timeline.isEmpty()||this.timeline.send(Rn.TimelineTransport.getAgent(this,z),Z)}}class ze extends wt{constructor(z,Z){super(function(xe,Oe){le.debug("No callbacks on "+z+" for "+xe)}),this.name=z,this.pusher=Z,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(z,Z){return Z(null,{auth:""})}trigger(z,Z){if(z.indexOf("client-")!==0)throw new v("Event '"+z+"' does not start with 'client-'");if(!this.subscribed){var xe=g.buildLogSuffix("triggeringClientEvents");le.warn(`Client event triggered before channel 'subscription_succeeded' event . ${xe}`)}return this.pusher.send_event(z,Z,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(z){var Z=z.event,xe=z.data;if(Z==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(z);else if(Z==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(z);else if(Z.indexOf("pusher_internal:")!==0){var Oe={};this.emit(Z,xe,Oe)}}handleSubscriptionSucceededEvent(z){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",z.data)}handleSubscriptionCountEvent(z){z.data.subscription_count&&(this.subscriptionCount=z.data.subscription_count),this.emit("pusher:subscription_count",z.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(z,Z)=>{z?(this.subscriptionPending=!1,le.error(z.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:z.message},z instanceof L?{status:z.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:Z.auth,channel_data:Z.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class Ee extends ze{authorize(z,Z){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:z},Z)}}class tt{constructor(){this.reset()}get(z){return Object.prototype.hasOwnProperty.call(this.members,z)?{id:z,info:this.members[z]}:null}each(z){Pe(this.members,(Z,xe)=>{z(this.get(xe))})}setMyID(z){this.myID=z}onSubscription(z){this.members=z.presence.hash,this.count=z.presence.count,this.me=this.get(this.myID)}addMember(z){return this.get(z.user_id)===null&&this.count++,this.members[z.user_id]=z.user_info,this.get(z.user_id)}removeMember(z){var Z=this.get(z.user_id);return Z&&(delete this.members[z.user_id],this.count--),Z}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var xt=function(ee,z,Z,xe){function Oe(Kt){return Kt instanceof Z?Kt:new Z(function($n){$n(Kt)})}return new(Z||(Z=Promise))(function(Kt,$n){function Li(Ci){try{Oo(xe.next(Ci))}catch(Nn){$n(Nn)}}function Vr(Ci){try{Oo(xe.throw(Ci))}catch(Nn){$n(Nn)}}function Oo(Ci){Ci.done?Kt(Ci.value):Oe(Ci.value).then(Li,Vr)}Oo((xe=xe.apply(ee,z||[])).next())})};class lt extends Ee{constructor(z,Z){super(z,Z),this.members=new tt}authorize(z,Z){super.authorize(z,(xe,Oe)=>xt(this,void 0,void 0,function*(){if(!xe)if(Oe=Oe,Oe.channel_data!=null){var Kt=JSON.parse(Oe.channel_data);this.members.setMyID(Kt.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let $n=g.buildLogSuffix("authorizationEndpoint");le.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${$n}, or the user should be signed in.`),Z("Invalid auth response");return}Z(xe,Oe)}))}handleEvent(z){var Z=z.event;if(Z.indexOf("pusher_internal:")===0)this.handleInternalEvent(z);else{var xe=z.data,Oe={};z.user_id&&(Oe.user_id=z.user_id),this.emit(Z,xe,Oe)}}handleInternalEvent(z){var Z=z.event,xe=z.data;switch(Z){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(z);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(z);break;case"pusher_internal:member_added":var Oe=this.members.addMember(xe);this.emit("pusher:member_added",Oe);break;case"pusher_internal:member_removed":var Kt=this.members.removeMember(xe);Kt&&this.emit("pusher:member_removed",Kt);break}}handleSubscriptionSucceededEvent(z){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(z.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var gn=r(1),Ln=r(0);class ri extends Ee{constructor(z,Z,xe){super(z,Z),this.key=null,this.nacl=xe}authorize(z,Z){super.authorize(z,(xe,Oe)=>{if(xe){Z(xe,Oe);return}let Kt=Oe.shared_secret;if(!Kt){Z(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(Ln.decode)(Kt),delete Oe.shared_secret,Z(null,Oe)})}trigger(z,Z){throw new E("Client events are not currently supported for encrypted channels")}handleEvent(z){var Z=z.event,xe=z.data;if(Z.indexOf("pusher_internal:")===0||Z.indexOf("pusher:")===0){super.handleEvent(z);return}this.handleEncryptedEvent(Z,xe)}handleEncryptedEvent(z,Z){if(!this.key){le.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!Z.ciphertext||!Z.nonce){le.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+Z);return}let xe=Object(Ln.decode)(Z.ciphertext);if(xe.length<this.nacl.secretbox.overheadLength){le.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${xe.length}`);return}let Oe=Object(Ln.decode)(Z.nonce);if(Oe.length<this.nacl.secretbox.nonceLength){le.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${Oe.length}`);return}let Kt=this.nacl.secretbox.open(xe,Oe,this.key);if(Kt===null){le.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,($n,Li)=>{if($n){le.error(`Failed to make a request to the authEndpoint: ${Li}. Unable to fetch new key, so dropping encrypted event`);return}if(Kt=this.nacl.secretbox.open(xe,Oe,this.key),Kt===null){le.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(z,this.getDataToEmit(Kt))});return}this.emit(z,this.getDataToEmit(Kt))}getDataToEmit(z){let Z=Object(gn.decode)(z);try{return JSON.parse(Z)}catch{return Z}}}class mi extends wt{constructor(z,Z){super(),this.state="initialized",this.connection=null,this.key=z,this.options=Z,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var xe=Rn.getNetwork();xe.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),xe.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(z){this.key=z,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(z){return this.connection?this.connection.send(z):!1}send_event(z,Z,xe){return this.connection?this.connection.send_event(z,Z,xe):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var z=(Z,xe)=>{Z?this.runner=this.strategy.connect(0,z):xe.action==="error"?(this.emit("error",{type:"HandshakeError",error:xe.error}),this.timeline.error({handshakeError:xe.error})):(this.abortConnecting(),this.handshakeCallbacks[xe.action](xe))};this.runner=this.strategy.connect(0,z)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var z=this.abandonConnection();z.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(z){this.timeline.info({action:"retry",delay:z}),z>0&&this.emit("connecting_in",Math.round(z/1e3)),this.retryTimer=new oe(z||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new oe(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new oe(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new oe(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(z){return Ye({},z,{message:Z=>{this.resetActivityCheck(),this.emit("message",Z)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:Z=>{this.emit("error",Z)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(z){return Ye({},z,{connected:Z=>{this.activityTimeout=Math.min(this.options.activityTimeout,Z.activityTimeout,Z.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(Z.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let z=Z=>xe=>{xe.error&&this.emit("error",{type:"WebSocketError",error:xe.error}),Z(xe)};return{tls_only:z(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:z(()=>{this.disconnect()}),backoff:z(()=>{this.retryIn(1e3)}),retry:z(()=>{this.retryIn(0)})}}setConnection(z){this.connection=z;for(var Z in this.connectionCallbacks)this.connection.bind(Z,this.connectionCallbacks[Z]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var z in this.connectionCallbacks)this.connection.unbind(z,this.connectionCallbacks[z]);var Z=this.connection;return this.connection=null,Z}}updateState(z,Z){var xe=this.state;if(this.state=z,xe!==z){var Oe=z;Oe==="connected"&&(Oe+=" with new socket ID "+Z.socket_id),le.debug("State changed",xe+" -> "+Oe),this.timeline.info({state:z,params:Z}),this.emit("state_change",{previous:xe,current:z}),this.emit(z,Z)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Vi{constructor(){this.channels={}}add(z,Z){return this.channels[z]||(this.channels[z]=qn(z,Z)),this.channels[z]}all(){return Fe(this.channels)}find(z){return this.channels[z]}remove(z){var Z=this.channels[z];return delete this.channels[z],Z}disconnect(){Pe(this.channels,function(z){z.disconnect()})}}function qn(ee,z){if(ee.indexOf("private-encrypted-")===0){if(z.config.nacl)return oi.createEncryptedChannel(ee,z,z.config.nacl);let Z="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",xe=g.buildLogSuffix("encryptedChannelSupport");throw new E(`${Z}. ${xe}`)}else{if(ee.indexOf("private-")===0)return oi.createPrivateChannel(ee,z);if(ee.indexOf("presence-")===0)return oi.createPresenceChannel(ee,z);if(ee.indexOf("#")===0)throw new _('Cannot create a channel with name "'+ee+'".');return oi.createChannel(ee,z)}}var mn={createChannels(){return new Vi},createConnectionManager(ee,z){return new mi(ee,z)},createChannel(ee,z){return new ze(ee,z)},createPrivateChannel(ee,z){return new Ee(ee,z)},createPresenceChannel(ee,z){return new lt(ee,z)},createEncryptedChannel(ee,z,Z){return new ri(ee,z,Z)},createTimelineSender(ee,z){return new st(ee,z)},createHandshake(ee,z){return new Le(ee,z)},createAssistantToTheTransportManager(ee,z,Z){return new Ct(ee,z,Z)}},oi=mn;class dr{constructor(z){this.options=z||{},this.livesLeft=this.options.lives||1/0}getAssistant(z){return oi.createAssistantToTheTransportManager(this,z,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class gr{constructor(z,Z){this.strategies=z,this.loop=!!Z.loop,this.failFast=!!Z.failFast,this.timeout=Z.timeout,this.timeoutLimit=Z.timeoutLimit}isSupported(){return mt(this.strategies,Ve.method("isSupported"))}connect(z,Z){var xe=this.strategies,Oe=0,Kt=this.timeout,$n=null,Li=(Vr,Oo)=>{Oo?Z(null,Oo):(Oe=Oe+1,this.loop&&(Oe=Oe%xe.length),Oe<xe.length?(Kt&&(Kt=Kt*2,this.timeoutLimit&&(Kt=Math.min(Kt,this.timeoutLimit))),$n=this.tryStrategy(xe[Oe],z,{timeout:Kt,failFast:this.failFast},Li)):Z(!0))};return $n=this.tryStrategy(xe[Oe],z,{timeout:Kt,failFast:this.failFast},Li),{abort:function(){$n.abort()},forceMinPriority:function(Vr){z=Vr,$n&&$n.forceMinPriority(Vr)}}}tryStrategy(z,Z,xe,Oe){var Kt=null,$n=null;return xe.timeout>0&&(Kt=new oe(xe.timeout,function(){$n.abort(),Oe(!0)})),$n=z.connect(Z,function(Li,Vr){Li&&Kt&&Kt.isRunning()&&!xe.failFast||(Kt&&Kt.ensureAborted(),Oe(Li,Vr))}),{abort:function(){Kt&&Kt.ensureAborted(),$n.abort()},forceMinPriority:function(Li){$n.forceMinPriority(Li)}}}}class ta{constructor(z){this.strategies=z}isSupported(){return mt(this.strategies,Ve.method("isSupported"))}connect(z,Z){return ma(this.strategies,z,function(xe,Oe){return function(Kt,$n){if(Oe[xe].error=Kt,Kt){za(Oe)&&Z(!0);return}bt(Oe,function(Li){Li.forceMinPriority($n.transport.priority)}),Z(null,$n)}})}}function ma(ee,z,Z){var xe=Mt(ee,function(Oe,Kt,$n,Li){return Oe.connect(z,Z(Kt,Li))});return{abort:function(){bt(xe,ts)},forceMinPriority:function(Oe){bt(xe,function(Kt){Kt.forceMinPriority(Oe)})}}}function za(ee){return Lt(ee,function(z){return!!z.error})}function ts(ee){!ee.error&&!ee.aborted&&(ee.abort(),ee.aborted=!0)}class fs{constructor(z,Z,xe){this.strategy=z,this.transports=Z,this.ttl=xe.ttl||1800*1e3,this.usingTLS=xe.useTLS,this.timeline=xe.timeline}isSupported(){return this.strategy.isSupported()}connect(z,Z){var xe=this.usingTLS,Oe=Tl(xe),Kt=Oe&&Oe.cacheSkipCount?Oe.cacheSkipCount:0,$n=[this.strategy];if(Oe&&Oe.timestamp+this.ttl>=Ve.now()){var Li=this.transports[Oe.transport];Li&&(["ws","wss"].includes(Oe.transport)||Kt>3?(this.timeline.info({cached:!0,transport:Oe.transport,latency:Oe.latency}),$n.push(new gr([Li],{timeout:Oe.latency*2+1e3,failFast:!0}))):Kt++)}var Vr=Ve.now(),Oo=$n.pop().connect(z,function Ci(Nn,Mr){Nn?(xi(xe),$n.length>0?(Vr=Ve.now(),Oo=$n.pop().connect(z,Ci)):Z(Nn)):(ac(xe,Mr.transport.name,Ve.now()-Vr,Kt),Z(null,Mr))});return{abort:function(){Oo.abort()},forceMinPriority:function(Ci){z=Ci,Oo&&Oo.forceMinPriority(Ci)}}}}function $o(ee){return"pusherTransport"+(ee?"TLS":"NonTLS")}function Tl(ee){var z=Rn.getLocalStorage();if(z)try{var Z=z[$o(ee)];if(Z)return JSON.parse(Z)}catch{xi(ee)}return null}function ac(ee,z,Z,xe){var Oe=Rn.getLocalStorage();if(Oe)try{Oe[$o(ee)]=Y({timestamp:Ve.now(),transport:z,latency:Z,cacheSkipCount:xe})}catch{}}function xi(ee){var z=Rn.getLocalStorage();if(z)try{delete z[$o(ee)]}catch{}}class co{constructor(z,{delay:Z}){this.strategy=z,this.options={delay:Z}}isSupported(){return this.strategy.isSupported()}connect(z,Z){var xe=this.strategy,Oe,Kt=new oe(this.options.delay,function(){Oe=xe.connect(z,Z)});return{abort:function(){Kt.ensureAborted(),Oe&&Oe.abort()},forceMinPriority:function($n){z=$n,Oe&&Oe.forceMinPriority($n)}}}}class vo{constructor(z,Z,xe){this.test=z,this.trueBranch=Z,this.falseBranch=xe}isSupported(){var z=this.test()?this.trueBranch:this.falseBranch;return z.isSupported()}connect(z,Z){var xe=this.test()?this.trueBranch:this.falseBranch;return xe.connect(z,Z)}}class Ws{constructor(z){this.strategy=z}isSupported(){return this.strategy.isSupported()}connect(z,Z){var xe=this.strategy.connect(z,function(Oe,Kt){Kt&&xe.abort(),Z(Oe,Kt)});return xe}}function Vo(ee){return function(){return ee.isSupported()}}var zs=function(ee,z,Z){var xe={};function Oe(pB,U1,LQ,DQ,kN){var IN=Z(ee,pB,U1,LQ,DQ,kN);return xe[pB]=IN,IN}var Kt=Object.assign({},z,{hostNonTLS:ee.wsHost+":"+ee.wsPort,hostTLS:ee.wsHost+":"+ee.wssPort,httpPath:ee.wsPath}),$n=Object.assign({},Kt,{useTLS:!0}),Li=Object.assign({},z,{hostNonTLS:ee.httpHost+":"+ee.httpPort,hostTLS:ee.httpHost+":"+ee.httpsPort,httpPath:ee.httpPath}),Vr={loop:!0,timeout:15e3,timeoutLimit:6e4},Oo=new dr({minPingDelay:1e4,maxPingDelay:ee.activityTimeout}),Ci=new dr({lives:2,minPingDelay:1e4,maxPingDelay:ee.activityTimeout}),Nn=Oe("ws","ws",3,Kt,Oo),Mr=Oe("wss","ws",3,$n,Oo),zr=Oe("sockjs","sockjs",1,Li),gs=Oe("xhr_streaming","xhr_streaming",1,Li,Ci),Mc=Oe("xdr_streaming","xdr_streaming",1,Li,Ci),td=Oe("xhr_polling","xhr_polling",1,Li),ol=Oe("xdr_polling","xdr_polling",1,Li),Ch=new gr([Nn],Vr),gp=new gr([Mr],Vr),Bg=new gr([zr],Vr),ru=new gr([new vo(Vo(gs),gs,Mc)],Vr),hB=new gr([new vo(Vo(td),td,ol)],Vr),fB=new gr([new vo(Vo(ru),new ta([ru,new co(hB,{delay:4e3})]),hB)],Vr),xN=new vo(Vo(fB),fB,Bg),TN;return z.useTLS?TN=new ta([Ch,new co(xN,{delay:2e3})]):TN=new ta([Ch,new co(gp,{delay:2e3}),new co(xN,{delay:5e3})]),new fs(new Ws(new vo(Vo(Nn),TN,xN)),xe,{ttl:18e5,timeline:z.timeline,useTLS:z.useTLS})},No=zs,Yr=function(){var ee=this;ee.timeline.info(ee.buildTimelineMessage({transport:ee.name+(ee.options.useTLS?"s":"")})),ee.hooks.isInitialized()?ee.changeState("initialized"):ee.hooks.file?(ee.changeState("initializing"),d.load(ee.hooks.file,{useTLS:ee.options.useTLS},function(z,Z){ee.hooks.isInitialized()?(ee.changeState("initialized"),Z(!0)):(z&&ee.onError(z),ee.onClose(),Z(!1))})):ee.onClose()},uo={getRequest:function(ee){var z=new window.XDomainRequest;return z.ontimeout=function(){ee.emit("error",new b),ee.close()},z.onerror=function(Z){ee.emit("error",Z),ee.close()},z.onprogress=function(){z.responseText&&z.responseText.length>0&&ee.onChunk(200,z.responseText)},z.onload=function(){z.responseText&&z.responseText.length>0&&ee.onChunk(200,z.responseText),ee.emit("finished",200),ee.close()},z},abortRequest:function(ee){ee.ontimeout=ee.onerror=ee.onprogress=ee.onload=null,ee.abort()}},Lr=uo;const Br=256*1024;class so extends wt{constructor(z,Z,xe){super(),this.hooks=z,this.method=Z,this.url=xe}start(z){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Rn.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(z)}close(){this.unloader&&(Rn.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(z,Z){for(;;){var xe=this.advanceBuffer(Z);if(xe)this.emit("chunk",{status:z,data:xe});else break}this.isBufferTooLong(Z)&&this.emit("buffer_too_long")}advanceBuffer(z){var Z=z.slice(this.position),xe=Z.indexOf(`
`);return xe!==-1?(this.position+=xe+1,Z.slice(0,xe)):null}isBufferTooLong(z){return this.position===z.length&&z.length>Br}}var Ki;(function(ee){ee[ee.CONNECTING=0]="CONNECTING",ee[ee.OPEN=1]="OPEN",ee[ee.CLOSED=3]="CLOSED"})(Ki||(Ki={}));var ti=Ki,yi=1;class Qn{constructor(z,Z){this.hooks=z,this.session=xn(1e3)+"/"+Xn(8),this.location=li(Z),this.readyState=ti.CONNECTING,this.openStream()}send(z){return this.sendRaw(JSON.stringify([z]))}ping(){this.hooks.sendHeartbeat(this)}close(z,Z){this.onClose(z,Z,!0)}sendRaw(z){if(this.readyState===ti.OPEN)try{return Rn.createSocketRequest("POST",Yi(Si(this.location,this.session))).start(z),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(z,Z,xe){this.closeStream(),this.readyState=ti.CLOSED,this.onclose&&this.onclose({code:z,reason:Z,wasClean:xe})}onChunk(z){if(z.status===200){this.readyState===ti.OPEN&&this.onActivity();var Z,xe=z.data.slice(0,1);switch(xe){case"o":Z=JSON.parse(z.data.slice(1)||"{}"),this.onOpen(Z);break;case"a":Z=JSON.parse(z.data.slice(1)||"[]");for(var Oe=0;Oe<Z.length;Oe++)this.onEvent(Z[Oe]);break;case"m":Z=JSON.parse(z.data.slice(1)||"null"),this.onEvent(Z);break;case"h":this.hooks.onHeartbeat(this);break;case"c":Z=JSON.parse(z.data.slice(1)||"[]"),this.onClose(Z[0],Z[1],!0);break}}}onOpen(z){this.readyState===ti.CONNECTING?(z&&z.hostname&&(this.location.base=Tn(this.location.base,z.hostname)),this.readyState=ti.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(z){this.readyState===ti.OPEN&&this.onmessage&&this.onmessage({data:z})}onActivity(){this.onactivity&&this.onactivity()}onError(z){this.onerror&&this.onerror(z)}openStream(){this.stream=Rn.createSocketRequest("POST",Yi(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",z=>{this.onChunk(z)}),this.stream.bind("finished",z=>{this.hooks.onFinished(this,z)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(z){Ve.defer(()=>{this.onError(z),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function li(ee){var z=/([^\?]*)\/*(\??.*)/.exec(ee);return{base:z[1],queryString:z[2]}}function Si(ee,z){return ee.base+"/"+z+"/xhr_send"}function Yi(ee){var z=ee.indexOf("?")===-1?"?":"&";return ee+z+"t="+ +new Date+"&n="+yi++}function Tn(ee,z){var Z=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(ee);return Z[1]+z+Z[3]}function xn(ee){return Rn.randomInt(ee)}function Xn(ee){for(var z=[],Z=0;Z<ee;Z++)z.push(xn(32).toString(32));return z.join("")}var vt=Qn,$t={getReceiveURL:function(ee,z){return ee.base+"/"+z+"/xhr_streaming"+ee.queryString},onHeartbeat:function(ee){ee.sendRaw("[]")},sendHeartbeat:function(ee){ee.sendRaw("[]")},onFinished:function(ee,z){ee.onClose(1006,"Connection interrupted ("+z+")",!1)}},yn=$t,ni={getReceiveURL:function(ee,z){return ee.base+"/"+z+"/xhr"+ee.queryString},onHeartbeat:function(){},sendHeartbeat:function(ee){ee.sendRaw("[]")},onFinished:function(ee,z){z===200?ee.reconnect():ee.onClose(1006,"Connection interrupted ("+z+")",!1)}},Gn=ni,fi={getRequest:function(ee){var z=Rn.getXHRAPI(),Z=new z;return Z.onreadystatechange=Z.onprogress=function(){switch(Z.readyState){case 3:Z.responseText&&Z.responseText.length>0&&ee.onChunk(Z.status,Z.responseText);break;case 4:Z.responseText&&Z.responseText.length>0&&ee.onChunk(Z.status,Z.responseText),ee.emit("finished",Z.status),ee.close();break}},Z},abortRequest:function(ee){ee.onreadystatechange=null,ee.abort()}},$r=fi,ho={createStreamingSocket(ee){return this.createSocket(yn,ee)},createPollingSocket(ee){return this.createSocket(Gn,ee)},createSocket(ee,z){return new vt(ee,z)},createXHR(ee,z){return this.createRequest($r,ee,z)},createRequest(ee,z,Z){return new so(ee,z,Z)}},eo=ho;eo.createXDR=function(ee,z){return this.createRequest(Lr,ee,z)};var Ua=eo,Dr={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:s,DependenciesReceivers:u,getDefaultStrategy:No,Transports:di,transportConnectionInitializer:Yr,HTTPFactory:Ua,TimelineTransport:pe,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(ee){window.Pusher=ee;var z=()=>{this.onDocumentBody(ee.ready)};window.JSON?z():d.load("json2",{},z)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:A,jsonp:me}},onDocumentBody(ee){document.body?ee():setTimeout(()=>{this.onDocumentBody(ee)},0)},createJSONPRequest(ee,z){return new rt(ee,z)},createScriptRequest(ee){return new Me(ee)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var ee=this.getXHRAPI();return new ee},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Qe},createWebSocket(ee){var z=this.getWebSocketAPI();return new z(ee)},createSocketRequest(ee,z){if(this.isXHRSupported())return this.HTTPFactory.createXHR(ee,z);if(this.isXDRSupported(z.indexOf("https:")===0))return this.HTTPFactory.createXDR(ee,z);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var ee=this.getXHRAPI();return!!ee&&new ee().withCredentials!==void 0},isXDRSupported(ee){var z=ee?"https:":"http:",Z=this.getProtocol();return!!window.XDomainRequest&&Z===z},addUnloadListener(ee){window.addEventListener!==void 0?window.addEventListener("unload",ee,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",ee)},removeUnloadListener(ee){window.addEventListener!==void 0?window.removeEventListener("unload",ee,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",ee)},randomInt(ee){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*ee)}},Rn=Dr,Ts;(function(ee){ee[ee.ERROR=3]="ERROR",ee[ee.INFO=6]="INFO",ee[ee.DEBUG=7]="DEBUG"})(Ts||(Ts={}));var kl=Ts;class tu{constructor(z,Z,xe){this.key=z,this.session=Z,this.events=[],this.options=xe||{},this.sent=0,this.uniqueID=0}log(z,Z){z<=this.options.level&&(this.events.push(Ye({},Z,{timestamp:Ve.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(z){this.log(kl.ERROR,z)}info(z){this.log(kl.INFO,z)}debug(z){this.log(kl.DEBUG,z)}isEmpty(){return this.events.length===0}send(z,Z){var xe=Ye({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],z(xe,(Oe,Kt)=>{Oe||this.sent++,Z&&Z(Oe,Kt)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class ps{constructor(z,Z,xe,Oe){this.name=z,this.priority=Z,this.transport=xe,this.options=Oe||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(z,Z){if(this.isSupported()){if(this.priority<z)return Hl(new y,Z)}else return Hl(new k,Z);var xe=!1,Oe=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),Kt=null,$n=function(){Oe.unbind("initialized",$n),Oe.connect()},Li=function(){Kt=oi.createHandshake(Oe,function(Nn){xe=!0,Ci(),Z(null,Nn)})},Vr=function(Nn){Ci(),Z(Nn)},Oo=function(){Ci();var Nn;Nn=Y(Oe),Z(new C(Nn))},Ci=function(){Oe.unbind("initialized",$n),Oe.unbind("open",Li),Oe.unbind("error",Vr),Oe.unbind("closed",Oo)};return Oe.bind("initialized",$n),Oe.bind("open",Li),Oe.bind("error",Vr),Oe.bind("closed",Oo),Oe.initialize(),{abort:()=>{xe||(Ci(),Kt?Kt.close():Oe.close())},forceMinPriority:Nn=>{xe||this.priority<Nn&&(Kt?Kt.close():Oe.close())}}}}function Hl(ee,z){return Ve.defer(function(){z(ee)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Wl}=Rn;var Og=function(ee,z,Z,xe,Oe,Kt){var $n=Wl[Z];if(!$n)throw new x(Z);var Li=(!ee.enabledTransports||He(ee.enabledTransports,z)!==-1)&&(!ee.disabledTransports||He(ee.disabledTransports,z)===-1),Vr;return Li?(Oe=Object.assign({ignoreNullOrigin:ee.ignoreNullOrigin},Oe),Vr=new ps(z,xe,Kt?Kt.getAssistant($n):$n,Oe)):Vr=A0,Vr},A0={isSupported:function(){return!1},connect:function(ee,z){var Z=Ve.defer(function(){z(new k)});return{abort:function(){Z.ensureAborted()},forceMinPriority:function(){}}}};function vl(ee){if(ee==null)throw"You must pass an options object";if(ee.cluster==null)throw"Options object must provide a cluster";"disableStats"in ee&&le.warn("The disableStats option is deprecated in favor of enableStats")}const s_=(ee,z)=>{var Z="socket_id="+encodeURIComponent(ee.socketId);for(var xe in z.params)Z+="&"+encodeURIComponent(xe)+"="+encodeURIComponent(z.params[xe]);if(z.paramsProvider!=null){let Oe=z.paramsProvider();for(var xe in Oe)Z+="&"+encodeURIComponent(xe)+"="+encodeURIComponent(Oe[xe])}return Z};var Pg=ee=>{if(typeof Rn.getAuthorizers()[ee.transport]>"u")throw`'${ee.transport}' is not a recognized auth transport`;return(z,Z)=>{const xe=s_(z,ee);Rn.getAuthorizers()[ee.transport](Rn,xe,ee,m.UserAuthentication,Z)}};const ku=(ee,z)=>{var Z="socket_id="+encodeURIComponent(ee.socketId);Z+="&channel_name="+encodeURIComponent(ee.channelName);for(var xe in z.params)Z+="&"+encodeURIComponent(xe)+"="+encodeURIComponent(z.params[xe]);if(z.paramsProvider!=null){let Oe=z.paramsProvider();for(var xe in Oe)Z+="&"+encodeURIComponent(xe)+"="+encodeURIComponent(Oe[xe])}return Z};var R0=ee=>{if(typeof Rn.getAuthorizers()[ee.transport]>"u")throw`'${ee.transport}' is not a recognized auth transport`;return(z,Z)=>{const xe=ku(z,ee);Rn.getAuthorizers()[ee.transport](Rn,xe,ee,m.ChannelAuthorization,Z)}};const Mg=(ee,z,Z)=>{const xe={authTransport:z.transport,authEndpoint:z.endpoint,auth:{params:z.params,headers:z.headers}};return(Oe,Kt)=>{const $n=ee.channel(Oe.channelName);Z($n,xe).authorize(Oe.socketId,Kt)}};function Fg(ee,z){let Z={activityTimeout:ee.activityTimeout||l.activityTimeout,cluster:ee.cluster,httpPath:ee.httpPath||l.httpPath,httpPort:ee.httpPort||l.httpPort,httpsPort:ee.httpsPort||l.httpsPort,pongTimeout:ee.pongTimeout||l.pongTimeout,statsHost:ee.statsHost||l.stats_host,unavailableTimeout:ee.unavailableTimeout||l.unavailableTimeout,wsPath:ee.wsPath||l.wsPath,wsPort:ee.wsPort||l.wsPort,wssPort:ee.wssPort||l.wssPort,enableStats:SN(ee),httpHost:rf(ee),useTLS:ed(ee),wsHost:gI(ee),userAuthenticator:EN(ee),channelAuthorizer:of(ee,z)};return"disabledTransports"in ee&&(Z.disabledTransports=ee.disabledTransports),"enabledTransports"in ee&&(Z.enabledTransports=ee.enabledTransports),"ignoreNullOrigin"in ee&&(Z.ignoreNullOrigin=ee.ignoreNullOrigin),"timelineParams"in ee&&(Z.timelineParams=ee.timelineParams),"nacl"in ee&&(Z.nacl=ee.nacl),Z}function rf(ee){return ee.httpHost?ee.httpHost:ee.cluster?`sockjs-${ee.cluster}.pusher.com`:l.httpHost}function gI(ee){return ee.wsHost?ee.wsHost:mI(ee.cluster)}function mI(ee){return`ws-${ee}.pusher.com`}function ed(ee){return Rn.getProtocol()==="https:"?!0:ee.forceTLS!==!1}function SN(ee){return"enableStats"in ee?ee.enableStats:"disableStats"in ee?!ee.disableStats:!1}const iu=ee=>"customHandler"in ee&&ee.customHandler!=null;function EN(ee){const z=Object.assign(Object.assign({},l.userAuthentication),ee.userAuthentication);return iu(z)?z.customHandler:Pg(z)}function _I(ee,z){let Z;if("channelAuthorization"in ee)Z=Object.assign(Object.assign({},l.channelAuthorization),ee.channelAuthorization);else if(Z={transport:ee.authTransport||l.authTransport,endpoint:ee.authEndpoint||l.authEndpoint},"auth"in ee&&("params"in ee.auth&&(Z.params=ee.auth.params),"headers"in ee.auth&&(Z.headers=ee.auth.headers)),"authorizer"in ee)return{customHandler:Mg(z,Z,ee.authorizer)};return Z}function of(ee,z){const Z=_I(ee,z);return iu(Z)?Z.customHandler:R0(Z)}class yh extends wt{constructor(z){super(function(Z,xe){le.debug(`No callbacks on watchlist events for ${Z}`)}),this.pusher=z,this.bindWatchlistInternalEvent()}handleEvent(z){z.data.events.forEach(Z=>{this.emit(Z.name,Z)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",z=>{var Z=z.event;Z==="pusher_internal:watchlist_events"&&this.handleEvent(z)})}}function z1(){let ee,z;return{promise:new Promise((xe,Oe)=>{ee=xe,z=Oe}),resolve:ee,reject:z}}var _a=z1;class pp extends wt{constructor(z){super(function(Z,xe){le.debug("No callbacks on user for "+Z)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(Z,xe)=>{if(Z){le.warn(`Error during signin: ${Z}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:xe.auth,user_data:xe.user_data})},this.pusher=z,this.pusher.connection.bind("state_change",({previous:Z,current:xe})=>{Z!=="connected"&&xe==="connected"&&this._signin(),Z==="connected"&&xe!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new yh(z),this.pusher.connection.bind("message",Z=>{var xe=Z.event;xe==="pusher:signin_success"&&this._onSigninSuccess(Z.data),this.serverToUserChannel&&this.serverToUserChannel.name===Z.channel&&this.serverToUserChannel.handleEvent(Z)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(z){try{this.user_data=JSON.parse(z.user_data)}catch{le.error(`Failed parsing user data after signin: ${z.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){le.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const z=Z=>{Z.subscriptionPending&&Z.subscriptionCancelled?Z.reinstateSubscription():!Z.subscriptionPending&&this.pusher.connection.state==="connected"&&Z.subscribe()};this.serverToUserChannel=new ze(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((Z,xe)=>{Z.indexOf("pusher_internal:")===0||Z.indexOf("pusher:")===0||this.emit(Z,xe)}),z(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:z,resolve:Z,reject:xe}=_a();z.done=!1;const Oe=()=>{z.done=!0};z.then(Oe).catch(Oe),this.signinDonePromise=z,this._signinDoneResolve=Z}}class bl{static ready(){bl.isReady=!0;for(var z=0,Z=bl.instances.length;z<Z;z++)bl.instances[z].connect()}static getClientFeatures(){return Ge(ln({ws:Rn.Transports.ws},function(z){return z.isSupported({})}))}constructor(z,Z){CE(z),vl(Z),this.key=z,this.options=Z,this.config=Fg(this.options,this),this.channels=oi.createChannels(),this.global_emitter=new wt,this.sessionID=Rn.randomInt(1e9),this.timeline=new tu(this.key,this.sessionID,{cluster:this.config.cluster,features:bl.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:kl.INFO,version:l.VERSION}),this.config.enableStats&&(this.timelineSender=oi.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Rn.TimelineTransport.name}));var xe=Oe=>Rn.getDefaultStrategy(this.config,Oe,Og);this.connection=oi.createConnectionManager(this.key,{getStrategy:xe,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",Oe=>{var Kt=Oe.event,$n=Kt.indexOf("pusher_internal:")===0;if(Oe.channel){var Li=this.channel(Oe.channel);Li&&Li.handleEvent(Oe)}$n||this.global_emitter.emit(Oe.event,Oe.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",Oe=>{le.warn(Oe)}),bl.instances.push(this),this.timeline.info({instances:bl.instances.length}),this.user=new pp(this),bl.isReady&&this.connect()}switchCluster(z){const{appKey:Z,cluster:xe}=z;this.key=Z,this.options=Object.assign(Object.assign({},this.options),{cluster:xe}),this.config=Fg(this.options,this),this.connection.switchCluster(this.key)}channel(z){return this.channels.find(z)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var z=this.connection.isUsingTLS(),Z=this.timelineSender;this.timelineSenderTimer=new Q(6e4,function(){Z.send(z)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(z,Z,xe){return this.global_emitter.bind(z,Z,xe),this}unbind(z,Z,xe){return this.global_emitter.unbind(z,Z,xe),this}bind_global(z){return this.global_emitter.bind_global(z),this}unbind_global(z){return this.global_emitter.unbind_global(z),this}unbind_all(z){return this.global_emitter.unbind_all(),this}subscribeAll(){var z;for(z in this.channels.channels)this.channels.channels.hasOwnProperty(z)&&this.subscribe(z)}subscribe(z){var Z=this.channels.add(z,this);return Z.subscriptionPending&&Z.subscriptionCancelled?Z.reinstateSubscription():!Z.subscriptionPending&&this.connection.state==="connected"&&Z.subscribe(),Z}unsubscribe(z){var Z=this.channels.find(z);Z&&Z.subscriptionPending?Z.cancelSubscription():(Z=this.channels.remove(z),Z&&Z.subscribed&&Z.unsubscribe())}send_event(z,Z,xe){return this.connection.send_event(z,Z,xe)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}bl.instances=[],bl.isReady=!1,bl.logToConsole=!1,bl.Runtime=Rn,bl.ScriptReceivers=Rn.ScriptReceivers,bl.DependenciesReceivers=Rn.DependenciesReceivers,bl.auth_callbacks=Rn.auth_callbacks;var yE=i.default=bl;function CE(ee){if(ee==null)throw"You must pass your app key when you instantiate Pusher."}Rn.setup(bl)}])})})(X_t);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Z_t=Ro(null);function yBe(){const[n,e]=us(Z_t),t=Ti();return w.useEffect(()=>{},[t]),n}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function J_t(){const n=yBe(),e=Ti(),t={"App\\Events\\Invoice\\InvoiceWasPaid":()=>{}};return w.useEffect(()=>{if(!n||!e)return;n.subscribe(`private-company-${e.company_key}`).bind_global((r,o)=>{console.log(`channel: ${r}`);const s=t[r];s&&(s(o),window.dispatchEvent(new CustomEvent(`pusher::${r}`,{detail:{event:r,data:o}})))})},[n,e]),null}function vTr({on:n,callback:e}){w.useEffect(()=>{const t=new AbortController,i=t.signal,r=s=>{i.aborted||e({event:s.detail.event,data:s.detail.data})};return(Array.isArray(n)?n:[n]).forEach(s=>{const a=l=>{i.aborted||r(l)};window.addEventListener(`pusher::${s}`,a),i.addEventListener("abort",()=>{window.removeEventListener(`pusher::${s}`,a)})}),()=>{t.abort()}},[n,e])}function gxe(){return localStorage.getItem("X-SOCKET-ID")?parseFloat(localStorage.getItem("X-SOCKET-ID")):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 LT(){const n={"X-Api-Token":localStorage.getItem("X-NINJA-TOKEN"),"X-Requested-With":"XMLHttpRequest","X-React":"true"};return gxe()&&qo()&&(n["X-Socket-ID"]=gxe()),n}let evt={data:""},tvt=n=>typeof window=="object"?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||evt,nvt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ivt=/\/\*[^]*?\*\/| +/g,mxe=/\n+/g,FC=(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"?FC(s,o):o+"{"+FC(s,o[1]=="k"?"":e)+"}":typeof s=="object"?i+=FC(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+=FC.p?FC.p(o,s):o+":"+s+";")}return t+(e&&r?e+"{"+r+"}":r)+i},z0={},CBe=n=>{if(typeof n=="object"){let e="";for(let t in n)e+=t+CBe(n[t]);return e}return n},rvt=(n,e,t,i,r)=>{let o=CBe(n),s=z0[o]||(z0[o]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(o));if(!z0[s]){let l=o!==n?n:(c=>{let u,d,h=[{}];for(;u=nvt.exec(c.replace(ivt,""));)u[4]?h.shift():u[3]?(d=u[3].replace(mxe," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(mxe," ").trim();return h[0]})(n);z0[s]=FC(r?{["@keyframes "+s]:l}:l,t?"":"."+s)}let a=t&&z0.g?z0.g:null;return t&&(z0.g=z0[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)})(z0[s],e,i,a),s},ovt=(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?"":FC(a,""):a===!1?"":a}return i+r+(s??"")},"");function Mj(n){let e=this||{},t=n.call?n(e.p):n;return rvt(t.unshift?t.raw?ovt(t,[].slice.call(arguments,1),e.p):t.reduce((i,r)=>Object.assign(i,r&&r.call?r(e.p):r),{}):t,tvt(e.target),e.g,e.o,e.k)}let wBe,Hie,Wie;Mj.bind({g:1});let u1=Mj.bind({k:1});function svt(n,e,t,i){FC.p=e,wBe=n,Hie=t,Wie=i}function zS(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:Hie&&Hie()},a),t.o=/ *go\d+/.test(l),a.className=Mj.apply(t,i)+(l?" "+l:""),e&&(a.ref=s);let c=n;return n[0]&&(c=a.as||n,delete a.as),Wie&&c[0]&&Wie(a),wBe(c,a)}return e?e(r):r}}var avt=n=>typeof n=="function",sH=(n,e)=>avt(n)?n(e):n,lvt=(()=>{let n=0;return()=>(++n).toString()})(),SBe=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");n=!e||e.matches}return n}})(),cvt=20,l$=new Map,uvt=1e3,_xe=n=>{if(l$.has(n))return;let e=setTimeout(()=>{l$.delete(n),Dk({type:4,toastId:n})},uvt);l$.set(n,e)},dvt=n=>{let e=l$.get(n);e&&clearTimeout(e)},zie=(n,e)=>{switch(e.type){case 0:return{...n,toasts:[e.toast,...n.toasts].slice(0,cvt)};case 1:return e.toast.id&&dvt(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)?zie(n,{type:1,toast:t}):zie(n,{type:0,toast:t});case 3:let{toastId:i}=e;return i?_xe(i):n.toasts.forEach(o=>{_xe(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}))}}},c$=[],u$={toasts:[],pausedAt:void 0},Dk=n=>{u$=zie(u$,n),c$.forEach(e=>{e(u$)})},hvt={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fvt=(n={})=>{let[e,t]=w.useState(u$);w.useEffect(()=>(c$.push(t),()=>{let r=c$.indexOf(t);r>-1&&c$.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)||hvt[r.type],style:{...n.style,...(s=n[r.type])==null?void 0:s.style,...r.style}}});return{...e,toasts:i}},pvt=(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)||lvt()}),rF=n=>(e,t)=>{let i=pvt(e,n,t);return Dk({type:2,toast:i}),i.id},yd=(n,e)=>rF("blank")(n,e);yd.error=rF("error");yd.success=rF("success");yd.loading=rF("loading");yd.custom=rF("custom");yd.dismiss=n=>{Dk({type:3,toastId:n})};yd.remove=n=>Dk({type:4,toastId:n});yd.promise=(n,e,t)=>{let i=yd.loading(e.loading,{...t,...t==null?void 0:t.loading});return n.then(r=>(yd.success(sH(e.success,r),{id:i,...t,...t==null?void 0:t.success}),r)).catch(r=>{yd.error(sH(e.error,r),{id:i,...t,...t==null?void 0:t.error})}),n};var gvt=(n,e)=>{Dk({type:1,toast:{id:n,height:e}})},mvt=()=>{Dk({type:5,time:Date.now()})},_vt=n=>{let{toasts:e,pausedAt:t}=fvt(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&&yd.dismiss(a.id);return}return setTimeout(()=>yd.dismiss(a.id),l)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[e,t]);let i=w.useCallback(()=>{t&&Dk({type:6,time:Date.now()})},[t]),r=w.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=s||{},u=e.filter(f=>(f.position||c)===(o.position||c)&&f.height),d=u.findIndex(f=>f.id===o.id),h=u.filter((f,g)=>g<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,g)=>f+(g.height||0)+l,0)},[e]);return{toasts:e,handlers:{updateHeight:gvt,startPause:mvt,endPause:i,calculateOffset:r}}},vvt=u1`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,bvt=u1`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`,yvt=u1`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`,Cvt=zS("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${n=>n.primary||"#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${vvt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${bvt} 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: ${yvt} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`,wvt=u1`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,Svt=zS("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: ${wvt} 1s linear infinite;
`,Evt=u1`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,xvt=u1`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`,Tvt=zS("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${n=>n.primary||"#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${Evt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${xvt} 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;
}
`,kvt=zS("div")`
position: absolute;
`,Ivt=zS("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`,Lvt=u1`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`,Dvt=zS("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${Lvt} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`,Avt=({toast:n})=>{let{icon:e,type:t,iconTheme:i}=n;return e!==void 0?typeof e=="string"?w.createElement(Dvt,null,e):e:t==="blank"?null:w.createElement(Ivt,null,w.createElement(Svt,{...i}),t!=="loading"&&w.createElement(kvt,null,t==="error"?w.createElement(Cvt,{...i}):w.createElement(Tvt,{...i})))},Rvt=n=>`
0% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,Nvt=n=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;}
`,Ovt="0%{opacity:0;} 100%{opacity:1;}",Pvt="0%{opacity:1;} 100%{opacity:0;}",Mvt=zS("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;
`,Fvt=zS("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`,Bvt=(n,e)=>{let t=n.includes("top")?1:-1,[i,r]=SBe()?[Ovt,Pvt]:[Rvt(t),Nvt(t)];return{animation:e?`${u1(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${u1(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},$vt=w.memo(({toast:n,position:e,style:t,children:i})=>{let r=n.height?Bvt(n.position||e||"top-center",n.visible):{opacity:0},o=w.createElement(Avt,{toast:n}),s=w.createElement(Fvt,{...n.ariaProps},sH(n.message,n));return w.createElement(Mvt,{className:n.className,style:{...r,...t,...n.style}},typeof i=="function"?i({icon:o,message:s}):w.createElement(w.Fragment,null,o,s))});svt(w.createElement);var Vvt=({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)},Hvt=(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:SBe()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(t?1:-1)}px)`,...i,...r}},Wvt=Mj`
z-index: 9999;
> * {
pointer-events: auto;
}
`,v8=16,zvt=({reverseOrder:n,position:e="top-center",toastOptions:t,gutter:i,children:r,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:l}=_vt(t);return w.createElement("div",{style:{position:"fixed",zIndex:9999,top:v8,left:v8,right:v8,bottom:v8,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=Hvt(u,d);return w.createElement(Vvt,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?Wvt:"",style:h},c.type==="custom"?sH(c.message,c):r?r(c):w.createElement($vt,{toast:c,position:u}))}))},Uvt=yd;/**
* 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 jvt{processing(){return this.currentId=yd.loading($ie("processing",{}),{id:this.currentId}),this}success(e="success",t={}){return this.currentId=yd.success(Ca(e,t),{id:this.currentId}),this}error(e="error_title"){return this.currentId=yd.error($ie(e),{id:this.currentId}),this}dismiss(){return yd.dismiss(this.currentId),this}}const he=new jvt;function oF(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,eH(n,e)}var sF=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}(),aH=typeof window>"u";function Xd(){}function qvt(n,e){return typeof n=="function"?n(e):n}function Uie(n){return typeof n=="number"&&n>=0&&n!==1/0}function lH(n){return Array.isArray(n)?n:[n]}function EBe(n,e){return Math.max(n+(e||0)-Date.now(),0)}function d$(n,e,t){return Fj(n)?typeof e=="function"?Tt({},t,{queryKey:n,queryFn:e}):Tt({},e,{queryKey:n}):n}function IC(n,e,t){return Fj(n)?[Tt({},e,{queryKey:n}),t]:[n||{},e]}function Gvt(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 vxe(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(Fj(a)){if(i){if(e.queryHash!==Ope(a,e.options))return!1}else if(!cH(e.queryKey,a))return!1}var c=Gvt(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 bxe(n,e){var t=n.exact,i=n.fetching,r=n.predicate,o=n.mutationKey;if(Fj(o)){if(!e.options.mutationKey)return!1;if(t){if(Nx(e.options.mutationKey)!==Nx(o))return!1}else if(!cH(e.options.mutationKey,o))return!1}return!(typeof i=="boolean"&&e.state.status==="loading"!==i||r&&!r(e))}function Ope(n,e){var t=(e==null?void 0:e.queryKeyHashFn)||Nx;return t(n)}function Nx(n){var e=lH(n);return Kvt(e)}function Kvt(n){return JSON.stringify(n,function(e,t){return jie(t)?Object.keys(t).sort().reduce(function(i,r){return i[r]=t[r],i},{}):t})}function cH(n,e){return xBe(lH(n),lH(e))}function xBe(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!xBe(n[t],e[t])}):!1}function uH(n,e){if(n===e)return n;var t=Array.isArray(n)&&Array.isArray(e);if(t||jie(n)&&jie(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]=uH(n[c],e[c]),s[c]===n[c]&&a++}return i===o&&a===i?n:s}return e}function Yvt(n,e){if(n&&!e||e&&!n)return!1;for(var t in n)if(n[t]!==e[t])return!1;return!0}function jie(n){if(!yxe(n))return!1;var e=n.constructor;if(typeof e>"u")return!0;var t=e.prototype;return!(!yxe(t)||!t.hasOwnProperty("isPrototypeOf"))}function yxe(n){return Object.prototype.toString.call(n)==="[object Object]"}function Fj(n){return typeof n=="string"||Array.isArray(n)}function Qvt(n){return new Promise(function(e){setTimeout(e,n)})}function Cxe(n){Promise.resolve().then(n).catch(function(e){return setTimeout(function(){throw e})})}function TBe(){if(typeof AbortController=="function")return new AbortController}var Xvt=function(n){oF(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var o;if(!aH&&((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}(sF),YP=new Xvt,Zvt=function(n){oF(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var o;if(!aH&&((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}(sF),h$=new Zvt;function Jvt(n){return Math.min(1e3*Math.pow(2,n),3e4)}function dH(n){return typeof(n==null?void 0:n.cancel)=="function"}var kBe=function(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent};function f$(n){return n instanceof kBe}var IBe=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,f){s=h,a=f});var l=function(f){t.isResolved||(t.isResolved=!0,e.onSuccess==null||e.onSuccess(f),o==null||o(),s(f))},c=function(f){t.isResolved||(t.isResolved=!0,e.onError==null||e.onError(f),o==null||o(),a(f))},u=function(){return new Promise(function(f){o=f,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 f;try{f=e.fn()}catch(g){f=Promise.reject(g)}r=function(m){if(!t.isResolved&&(c(new kBe(m)),t.abort==null||t.abort(),dH(f)))try{f.cancel()}catch{}},t.isTransportCancelable=dH(f),Promise.resolve(f).then(l).catch(function(g){var m,v;if(!t.isResolved){var _=(m=e.retry)!=null?m:3,b=(v=e.retryDelay)!=null?v:Jvt,y=typeof b=="function"?b(t.failureCount,g):b,C=_===!0||typeof _=="number"&&t.failureCount<_||typeof _=="function"&&_(t.failureCount,g);if(i||!C){c(g);return}t.failureCount++,e.onFail==null||e.onFail(t.failureCount,g),Qvt(y).then(function(){if(!YP.isFocused()||!h$.isOnline())return u()}).then(function(){i?c(g):h()})}})}};d()},ebt=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):Cxe(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&&Cxe(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}(),Xl=new ebt,LBe=console;function hH(){return LBe}function tbt(n){LBe=n}var nbt=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=Tt({},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(),Uie(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=qvt(i,a);return(o=(s=this.options).isDataEqual)!=null&&o.call(s,a,l)?l=a:this.options.structuralSharing!==!1&&(l=uH(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(Xd).catch(Xd):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||!EBe(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=lH(this.queryKey),h=TBe(),f={queryKey:d,pageParam:void 0,meta:this.meta};Object.defineProperty(f,"signal",{enumerable:!0,get:function(){if(h)return o.abortSignalConsumed=!0,h.signal}});var g=function(){return o.options.queryFn?(o.abortSignalConsumed=!1,o.options.queryFn(f)):Promise.reject("Missing queryFn")},m={fetchOptions:r,options:this.options,queryKey:d,state:this.state,fetchFn:g,meta:this.meta};if((s=this.options.behavior)!=null&&s.onFetch){var v;(v=this.options.behavior)==null||v.onFetch(m)}if(this.revertState=this.state,!this.state.isFetching||this.state.fetchMeta!==((a=m.fetchOptions)==null?void 0:a.meta)){var _;this.dispatch({type:"fetch",meta:(_=m.fetchOptions)==null?void 0:_.meta})}return this.retryer=new IBe({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){f$(y)&&y.silent||o.dispatch({type:"error",error:y}),f$(y)||(o.cache.config.onError==null||o.cache.config.onError(y,o),hH().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),Xl.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 Tt({},i,{fetchFailureCount:i.fetchFailureCount+1});case"pause":return Tt({},i,{isPaused:!0});case"continue":return Tt({},i,{isPaused:!1});case"fetch":return Tt({},i,{fetchFailureCount:0,fetchMeta:(o=r.meta)!=null?o:null,isFetching:!0,isPaused:!1},!i.dataUpdatedAt&&{error:null,status:"loading"});case"success":return Tt({},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 f$(a)&&a.revert&&this.revertState?Tt({},this.revertState):Tt({},i,{error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,isFetching:!1,isPaused:!1,status:"error"});case"invalidate":return Tt({},i,{isInvalidated:!0});case"setState":return Tt({},i,r.state);default:return i}},n}(),ibt=function(n){oF(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:Ope(l,o),u=this.get(c);return u||(u=new nbt({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;Xl.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=IC(r,o),a=s[0];return typeof a.exact>"u"&&(a.exact=!0),this.queries.find(function(l){return vxe(a,l)})},t.findAll=function(r,o){var s=IC(r,o),a=s[0];return Object.keys(a).length>0?this.queries.filter(function(l){return vxe(a,l)}):this.queries},t.notify=function(r){var o=this;Xl.batch(function(){o.listeners.forEach(function(s){s(r)})})},t.onFocus=function(){var r=this;Xl.batch(function(){r.queries.forEach(function(o){o.onFocus()})})},t.onOnline=function(){var r=this;Xl.batch(function(){r.queries.forEach(function(o){o.onOnline()})})},e}(sF),rbt=function(){function n(t){this.options=Tt({},t.defaultOptions,t.options),this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.observers=[],this.state=t.state||obt(),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(Xd).catch(Xd)):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),hH().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 IBe({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=sbt(this.state,i),Xl.batch(function(){r.observers.forEach(function(o){o.onMutationUpdate(i)}),r.mutationCache.notify(r)})},n}();function obt(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function sbt(n,e){switch(e.type){case"failed":return Tt({},n,{failureCount:n.failureCount+1});case"pause":return Tt({},n,{isPaused:!0});case"continue":return Tt({},n,{isPaused:!1});case"loading":return Tt({},n,{context:e.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:e.variables});case"success":return Tt({},n,{data:e.data,error:null,status:"success",isPaused:!1});case"error":return Tt({},n,{data:void 0,error:e.error,failureCount:n.failureCount+1,isPaused:!1,status:"error"});case"setState":return Tt({},n,e.state);default:return n}}var abt=function(n){oF(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 rbt({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;Xl.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 bxe(r,o)})},t.findAll=function(r){return this.mutations.filter(function(o){return bxe(r,o)})},t.notify=function(r){var o=this;Xl.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 Xl.batch(function(){return r.reduce(function(o,s){return o.then(function(){return s.continue().catch(Xd)})},Promise.resolve())})},e}(sF);function lbt(){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",f=((s=e.state.data)==null?void 0:s.pages)||[],g=((a=e.state.data)==null?void 0:a.pageParams)||[],m=TBe(),v=m==null?void 0:m.signal,_=g,b=!1,y=e.options.queryFn||function(){return Promise.reject("Missing queryFn")},C=function(B,F,U,H){return _=H?[F].concat(_):[].concat(_,[F]),H?[U].concat(B):[].concat(B,[U])},E=function(B,F,U,H){if(b)return Promise.reject("Cancelled");if(typeof U>"u"&&!F&&B.length)return Promise.resolve(B);var W={queryKey:e.queryKey,signal:v,pageParam:U,meta:e.meta},q=y(W),V=Promise.resolve(q).then(function(oe){return C(B,U,oe,H)});if(dH(q)){var re=V;re.cancel=q.cancel}return V},x;if(!f.length)x=E([]);else if(d){var k=typeof u<"u",L=k?u:wxe(e.options,f);x=E(f,k,L)}else if(h){var D=typeof u<"u",A=D?u:cbt(e.options,f);x=E(f,D,A,!0)}else(function(){_=[];var M=typeof e.options.getNextPageParam>"u",B=l&&f[0]?l(f[0],0,f):!0;x=B?E([],M,g[0]):Promise.resolve(C([],g[0],f[0]));for(var F=function(W){x=x.then(function(q){var V=l&&f[W]?l(f[W],W,f):!0;if(V){var re=M?g[W]:wxe(e.options,q);return E(q,M,re)}return Promise.resolve(C(q,g[W],f[W]))})},U=1;U<f.length;U++)F(U)})();var N=x.then(function(M){return{pages:M,pageParams:_}}),P=N;return P.cancel=function(){b=!0,m==null||m.abort(),dH(x)&&x.cancel()},N}}}}function wxe(n,e){return n.getNextPageParam==null?void 0:n.getNextPageParam(e[e.length-1],e)}function cbt(n,e){return n.getPreviousPageParam==null?void 0:n.getPreviousPageParam(e[0],e)}var ubt=function(){function n(t){t===void 0&&(t={}),this.queryCache=t.queryCache||new ibt,this.mutationCache=t.mutationCache||new abt,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}var e=n.prototype;return e.mount=function(){var i=this;this.unsubscribeFocus=YP.subscribe(function(){YP.isFocused()&&h$.isOnline()&&(i.mutationCache.onFocus(),i.queryCache.onFocus())}),this.unsubscribeOnline=h$.subscribe(function(){YP.isFocused()&&h$.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=IC(i,r),s=o[0];return s.fetching=!0,this.queryCache.findAll(s).length},e.isMutating=function(i){return this.mutationCache.findAll(Tt({},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=d$(i),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(r,o)},e.setQueriesData=function(i,r,o){var s=this;return Xl.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=IC(i,r),s=o[0],a=this.queryCache;Xl.batch(function(){a.findAll(s).forEach(function(l){a.remove(l)})})},e.resetQueries=function(i,r,o){var s=this,a=IC(i,r,o),l=a[0],c=a[1],u=this.queryCache,d=Tt({},l,{active:!0});return Xl.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=IC(i,r,o),l=a[0],c=a[1],u=c===void 0?{}:c;typeof u.revert>"u"&&(u.revert=!0);var d=Xl.batch(function(){return s.queryCache.findAll(l).map(function(h){return h.cancel(u)})});return Promise.all(d).then(Xd).catch(Xd)},e.invalidateQueries=function(i,r,o){var s,a,l,c=this,u=IC(i,r,o),d=u[0],h=u[1],f=Tt({},d,{active:(s=(a=d.refetchActive)!=null?a:d.active)!=null?s:!0,inactive:(l=d.refetchInactive)!=null?l:!1});return Xl.batch(function(){return c.queryCache.findAll(d).forEach(function(g){g.invalidate()}),c.refetchQueries(f,h)})},e.refetchQueries=function(i,r,o){var s=this,a=IC(i,r,o),l=a[0],c=a[1],u=Xl.batch(function(){return s.queryCache.findAll(l).map(function(h){return h.fetch(void 0,Tt({},c,{meta:{refetchPage:l==null?void 0:l.refetchPage}}))})}),d=Promise.all(u).then(Xd);return c!=null&&c.throwOnError||(d=d.catch(Xd)),d},e.fetchQuery=function(i,r,o){var s=d$(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(Xd).catch(Xd)},e.fetchInfiniteQuery=function(i,r,o){var s=d$(i,r,o);return s.behavior=lbt(),this.fetchQuery(s)},e.prefetchInfiniteQuery=function(i,r,o){return this.fetchInfiniteQuery(i,r,o).then(Xd).catch(Xd)},e.cancelMutations=function(){var i=this,r=Xl.batch(function(){return i.mutationCache.getAll().map(function(o){return o.cancel()})});return Promise.all(r).then(Xd).catch(Xd)},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 Nx(i)===Nx(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 cH(i,o.queryKey)}))==null?void 0:r.defaultOptions:void 0},e.setMutationDefaults=function(i,r){var o=this.mutationDefaults.find(function(s){return Nx(i)===Nx(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 cH(i,o.mutationKey)}))==null?void 0:r.defaultOptions:void 0},e.defaultQueryOptions=function(i){if(i!=null&&i._defaulted)return i;var r=Tt({},this.defaultOptions.queries,this.getQueryDefaults(i==null?void 0:i.queryKey),i,{_defaulted:!0});return!r.queryHash&&r.queryKey&&(r.queryHash=Ope(r.queryKey,r)),r},e.defaultQueryObserverOptions=function(i){return this.defaultQueryOptions(i)},e.defaultMutationOptions=function(i){return i!=null&&i._defaulted?i:Tt({},this.defaultOptions.mutations,this.getMutationDefaults(i==null?void 0:i.mutationKey),i,{_defaulted:!0})},e.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},n}(),dbt=function(n){oF(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),Sxe(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},t.onUnsubscribe=function(){this.listeners.length||this.destroy()},t.shouldFetchOnReconnect=function(){return qie(this.currentQuery,this.options,this.options.refetchOnReconnect)},t.shouldFetchOnWindowFocus=function(){return qie(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&&Exe(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(Tt({},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(Xd)),o},t.updateStaleTimeout=function(){var r=this;if(this.clearStaleTimeout(),!(aH||this.currentResult.isStale||!Uie(this.options.staleTime))){var o=EBe(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,!(aH||this.options.enabled===!1||!Uie(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(function(){(o.options.refetchIntervalInBackground||YP.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,f=d?this.currentResult:this.previousQueryResult,g=r.state,m=g.dataUpdatedAt,v=g.error,_=g.errorUpdatedAt,b=g.isFetching,y=g.status,C=!1,E=!1,x;if(o.optimisticResults){var k=this.hasListeners(),L=!k&&Sxe(r,o),D=k&&Exe(r,s,o,a);(L||D)&&(b=!0,m||(y="loading"))}if(o.keepPreviousData&&!g.dataUpdateCount&&(f!=null&&f.isSuccess)&&y!=="error")x=f.data,m=f.dataUpdatedAt,y=f.status,C=!0;else if(o.select&&typeof g.data<"u")if(l&&g.data===(c==null?void 0:c.data)&&o.select===this.selectFn)x=this.selectResult;else try{this.selectFn=o.select,x=o.select(g.data),o.structuralSharing!==!1&&(x=uH(l==null?void 0:l.data,x)),this.selectResult=x,this.selectError=null}catch(P){hH().error(P),this.selectError=P}else x=g.data;if(typeof o.placeholderData<"u"&&typeof x>"u"&&(y==="loading"||y==="idle")){var A;if(l!=null&&l.isPlaceholderData&&o.placeholderData===(u==null?void 0:u.placeholderData))A=l.data;else if(A=typeof o.placeholderData=="function"?o.placeholderData():o.placeholderData,o.select&&typeof A<"u")try{A=o.select(A),o.structuralSharing!==!1&&(A=uH(l==null?void 0:l.data,A)),this.selectError=null}catch(P){hH().error(P),this.selectError=P}typeof A<"u"&&(y="success",x=A,E=!0)}this.selectError&&(v=this.selectError,x=this.selectResult,_=Date.now(),y="error");var N={status:y,isLoading:y==="loading",isSuccess:y==="success",isError:y==="error",isIdle:y==="idle",data:x,dataUpdatedAt:m,error:v,errorUpdatedAt:_,failureCount:g.fetchFailureCount,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:b,isRefetching:b&&y!=="loading",isLoadingError:y==="error"&&g.dataUpdatedAt===0,isPlaceholderData:E,isPreviousData:C,isRefetchError:y==="error"&&g.dataUpdatedAt!==0,isStale:Ppe(r,o),refetch:this.refetch,remove:this.remove};return N},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],f=c==null?void 0:c.some(function(m){return m===u}),g=l==null?void 0:l.some(function(m){return m===u});return h&&!g&&(!c||f)})},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,!Yvt(this.currentResult,o)){var s={cache:!0};(r==null?void 0:r.listeners)!==!1&&this.shouldNotifyListeners(this.currentResult,o)&&(s.listeners=!0),this.notify(Tt({},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"&&!f$(r.error)&&(o.onError=!0),this.updateResult(o),this.hasListeners()&&this.updateTimers()},t.notify=function(r){var o=this;Xl.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}(sF);function hbt(n,e){return e.enabled!==!1&&!n.state.dataUpdatedAt&&!(n.state.status==="error"&&e.retryOnMount===!1)}function Sxe(n,e){return hbt(n,e)||n.state.dataUpdatedAt>0&&qie(n,e,e.refetchOnMount)}function qie(n,e,t){if(e.enabled!==!1){var i=typeof t=="function"?t(n):t;return i==="always"||i!==!1&&Ppe(n,e)}return!1}function Exe(n,e,t,i){return t.enabled!==!1&&(n!==e||i.enabled===!1)&&(!t.suspense||n.state.status!=="error")&&Ppe(n,t)}function Ppe(n,e){return n.isStaleByTime(e.staleTime)}var fbt=uj.unstable_batchedUpdates;Xl.setBatchNotifyFunction(fbt);var pbt=console;tbt(pbt);var xxe=ce.createContext(void 0),DBe=ce.createContext(!1);function ABe(n){return n&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=xxe),window.ReactQueryClientContext):xxe}var Co=function(){var e=ce.useContext(ABe(ce.useContext(DBe)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},gbt=function(e){var t=e.client,i=e.contextSharing,r=i===void 0?!1:i,o=e.children;ce.useEffect(function(){return t.mount(),function(){t.unmount()}},[t]);var s=ABe(r);return ce.createElement(DBe.Provider,{value:r},ce.createElement(s.Provider,{value:t},o))};function mbt(){var n=!1;return{clearReset:function(){n=!1},reset:function(){n=!0},isReset:function(){return n}}}var _bt=ce.createContext(mbt()),vbt=function(){return ce.useContext(_bt)};function bbt(n,e,t){return typeof e=="function"?e.apply(void 0,t):typeof e=="boolean"?e:!!n}function ybt(n,e){var t=ce.useRef(!1),i=ce.useState(0),r=i[1],o=Co(),s=vbt(),a=o.defaultQueryObserverOptions(n);a.optimisticResults=!0,a.onError&&(a.onError=Xl.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=Xl.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=Xl.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=ce.useState(function(){return new e(o,a)}),c=l[0],u=c.getOptimisticResult(a);if(ce.useEffect(function(){t.current=!0,s.clearReset();var d=c.subscribe(Xl.batchCalls(function(){t.current&&r(function(h){return h+1})}));return c.updateResult(),function(){t.current=!1,d()}},[s,c]),ce.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&&bbt(a.suspense,a.useErrorBoundary,[u.error,c.getCurrentQuery()]))throw u.error;return a.notifyOnChangeProps==="tracked"&&(u=c.trackResult(u,a)),u}function Ii(n,e,t){var i=d$(n,e,t);return ybt(i,dbt)}/**
* 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 PL={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 RBe(){const n=Co();return e=>{e.map(t=>{PL[t]&&(n.invalidateQueries(PL[t].path),PL[t].dependencies.map(i=>{n.invalidateQueries(i)}))})}}function In(n){window.dispatchEvent(new CustomEvent("refetch",{detail:{property:n}}))}function Cbt(n){return Object.keys(PL).find(t=>PL[t].path.startsWith(n)||n.startsWith(PL[t].path))}function wbt(n){n.map(e=>{const t=Cbt(e);t&&In([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 NBe(){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 OBe=vBe.create();OBe.interceptors.response.use(n=>{const e=Sbt(n.config.data),t=n.config.method;return(t==="put"||t==="post"&&(e==null?void 0:e.action)==="delete"||t==="delete")&&In(["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(),NBe()),((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&&he.error(((o=n.response)==null?void 0:o.data.message)||"error_title"),(s=n.response)!=null&&s.status&&n.response.status===500&&he.error("error_title"),((a=n.response)==null?void 0:a.status)===409&&he.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 $e(n,e,t,i){return OBe({method:n,url:e,data:t,...i,headers:{...LT(),...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 sc(){const n=Ti(),{data:e}=ph(),[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 qo(){return!1}function fR(){return!qo()}function aF(){return window.location.origin||"https://invoicing.co"}function Ae(n,e={}){return aF()+At(n,e)}function _Z(...n){return n.filter(Boolean).join(" ")}function xo(n,e){return n===0||n===""||n===void 0?"":typeof n=="number"?Un.unix(n).format(e):Un(n).format(e)}function bTr(){const{dateFormat:n}=sc(),e=["DD. MMM. YYYY","ddd MMM D, YYYY"];return t=>Un(t,e.includes(n)?void 0:n)}function Tr(n){if(!n.is_deleted&&!n.archived_at)return eZ.active;if(n.archived_at&&!n.is_deleted)return eZ.archived;if(n.is_deleted)return eZ.deleted}function Ca(n,e){let t=$ie(n);for(const i in e)t=t.replace(`:${i}`,e[i]);return t}function yTr(n,e={}){return aF()+At(n,e)}function d1(){return"https://demo.invoiceninja.com"===aF()}function Sbt(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 ph(){return Ii(["/api/v1/statics"],()=>$e("GET",Ae("/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 Bj(){const{data:n}=ph(),[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 PBe(){const n=Bj();return e=>n.find(t=>t.id.toString()===e.toString())}function Ku(n,e){if(n==null)return{};var t=gpe(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 Ebt(){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 Txe={};function Gie(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];typeof e[0]=="string"&&Txe[e[0]]||(typeof e[0]=="string"&&(Txe[e[0]]=new Date),Ebt.apply(void 0,e))}var MBe=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 kxe(n,e,t){n.loadNamespaces(e,MBe(n,t))}function Ixe(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,MBe(n,i))}function xbt(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 Tbt(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return Gie("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}}):xbt(n,e,t)}var kbt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ibt={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Lbt=function(e){return Ibt[e]},Dbt=function(e){return e.replace(kbt,Lbt)};function Lxe(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 Dxe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lxe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Lxe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var Kie={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Dbt};function Abt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kie=Dxe(Dxe({},Kie),n)}function Rbt(){return Kie}var FBe;function Nbt(n){FBe=n}function Obt(){return FBe}var Pbt={type:"3rdParty",init:function(e){Abt(e.options.react),Nbt(e)}},Mbt=w.createContext(),Fbt=function(){function n(){El(this,n),this.usedNamespaces={}}return xl(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 Bbt(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 cn(n,e){return Q6e(n)||Bbt(n,e)||Epe(n,e)||Z6e()}function Axe(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 vZ(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Axe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Axe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var $bt=function(e,t){var i=w.useRef();return w.useEffect(function(){i.current=t?i.current:e},[e,t]),i.current};function ve(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.i18n,i=w.useContext(Mbt)||{},r=i.i18n,o=i.defaultNS,s=t||r||Obt();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Fbt),!s){Gie("You will need to pass in an i18next instance by using initReactI18next");var a=function(D,A){return typeof A=="string"?A:A&&Zr(A)==="object"&&typeof A.defaultValue=="string"?A.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&&Gie("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=vZ(vZ(vZ({},Rbt()),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 f=(s.isInitialized||s.initializedStoreOnce)&&h.every(function(L){return Tbt(L,s,c)});function g(){return s.getFixedT(e.lng||null,c.nsMode==="fallback"?h:h[0],d)}var m=w.useState(g),v=cn(m,2),_=v[0],b=v[1],y=h.join();e.lng&&(y="".concat(e.lng).concat(y));var C=$bt(y),E=w.useRef(!0);w.useEffect(function(){var L=c.bindI18n,D=c.bindI18nStore;E.current=!0,!f&&!u&&(e.lng?Ixe(s,e.lng,h,function(){E.current&&b(g)}):kxe(s,h,function(){E.current&&b(g)})),f&&C&&C!==y&&E.current&&b(g);function A(){E.current&&b(g)}return L&&s&&s.on(L,A),D&&s&&s.store.on(D,A),function(){E.current=!1,L&&s&&L.split(" ").forEach(function(N){return s.off(N,A)}),D&&s&&D.split(" ").forEach(function(N){return s.store.off(N,A)})}},[s,y]);var x=w.useRef(!0);w.useEffect(function(){E.current&&!x.current&&b(g),x.current=!1},[s,d]);var k=[_,s,f];if(k.t=_,k.i18n=s,k.ready=f,f||!f&&!u)return k;throw new Promise(function(L){e.lng?Ixe(s,e.lng,h,function(){return L()}):kxe(s,h,function(){return L()})})}const Vbt="modulepreload",Hbt=function(n){return"/"+n},Rxe={},ie=function(e,t,i){if(!t||t.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Hbt(o),o in Rxe)return;Rxe[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":Vbt,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 I4(){return I4=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},I4.apply(this,arguments)}var KC;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(KC||(KC={}));const Nxe="popstate";function Wbt(n){n===void 0&&(n={});function e(i,r){let{pathname:o,search:s,hash:a}=i.location;return Yie("",{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:fH(r)}return Ubt(e,t,null,n)}function ec(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function $j(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function zbt(){return Math.random().toString(36).substr(2,8)}function Oxe(n,e){return{usr:n.state,key:n.key,idx:e}}function Yie(n,e,t,i){return t===void 0&&(t=null),I4({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?pR(e):e,{state:t,key:e&&e.key||i||zbt()})}function fH(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 pR(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 Ubt(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:o=!1}=i,s=r.history,a=KC.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(I4({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=KC.Pop;let v=u(),_=v==null?null:v-c;c=v,l&&l({action:a,location:m.location,delta:_})}function h(v,_){a=KC.Push;let b=Yie(m.location,v,_);t&&t(b,v),c=u()+1;let y=Oxe(b,c),C=m.createHref(b);try{s.pushState(y,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;r.location.assign(C)}o&&l&&l({action:a,location:m.location,delta:1})}function f(v,_){a=KC.Replace;let b=Yie(m.location,v,_);t&&t(b,v),c=u();let y=Oxe(b,c),C=m.createHref(b);s.replaceState(y,"",C),o&&l&&l({action:a,location:m.location,delta:0})}function g(v){let _=r.location.origin!=="null"?r.location.origin:r.location.href,b=typeof v=="string"?v:fH(v);return ec(_,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,_)}let m={get action(){return a},get location(){return n(r,s)},listen(v){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(Nxe,d),l=v,()=>{r.removeEventListener(Nxe,d),l=null}},createHref(v){return e(r,v)},createURL:g,encodeLocation(v){let _=g(v);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:h,replace:f,go(v){return s.go(v)}};return m}var Pxe;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Pxe||(Pxe={}));function jbt(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?pR(e):e,r=Mpe(i.pathname||"/",t);if(r==null)return null;let o=BBe(n);qbt(o);let s=null;for(let a=0;s==null&&a<o.length;++a)s=t0t(o[a],r0t(r));return s}function BBe(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("/")&&(ec(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=Ew([i,l.relativePath]),u=t.concat(l);o.children&&o.children.length>0&&(ec(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),BBe(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:Jbt(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 $Be(o.path))r(o,s,l)}),e}function $Be(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=$Be(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 qbt(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:e0t(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const Gbt=/^:\w+$/,Kbt=3,Ybt=2,Qbt=1,Xbt=10,Zbt=-2,Mxe=n=>n==="*";function Jbt(n,e){let t=n.split("/"),i=t.length;return t.some(Mxe)&&(i+=Zbt),e&&(i+=Ybt),t.filter(r=>!Mxe(r)).reduce((r,o)=>r+(Gbt.test(o)?Kbt:o===""?Qbt:Xbt),i)}function e0t(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 t0t(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=n0t({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:Ew([r,u.pathname]),pathnameBase:l0t(Ew([r,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(r=Ew([r,u.pathnameBase]))}return o}function CTr(n,e){e===void 0&&(e={});let t=n;t.endsWith("*")&&t!=="*"&&!t.endsWith("/*")&&($j(!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 f=e[d];return ec(h==="?"||f!=null,'Missing ":'+d+'" param'),r(f)}return s.replace(/\?$/g,"")}).filter(s=>!!s);return i+o.join("/")}function n0t(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=i0t(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]=o0t(a[d]||"",u),c},{}),pathname:o,pathnameBase:s,pattern:n}}function i0t(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),$j(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 r0t(n){try{return decodeURI(n)}catch(e){return $j(!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 o0t(n,e){try{return decodeURIComponent(n)}catch(t){return $j(!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 Mpe(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 s0t(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?pR(n):n;return{pathname:t?t.startsWith("/")?t:a0t(t,e):e,search:c0t(i),hash:u0t(r)}}function a0t(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 bZ(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 Fpe(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Bpe(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=pR(n):(r=I4({},n),ec(!r.pathname||!r.pathname.includes("?"),bZ("?","pathname","search",r)),ec(!r.pathname||!r.pathname.includes("#"),bZ("#","pathname","hash",r)),ec(!r.search||!r.search.includes("#"),bZ("#","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=s0t(r,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ew=n=>n.join("/").replace(/\/\/+/g,"/"),l0t=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),c0t=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,u0t=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function d0t(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const VBe=["post","put","patch","delete"];new Set(VBe);const h0t=["get",...VBe];new Set(h0t);/**
* 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 pH(){return pH=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},pH.apply(this,arguments)}const $pe=w.createContext(null),f0t=w.createContext(null),gR=w.createContext(null),Vj=w.createContext(null),b0=w.createContext({outlet:null,matches:[],isDataRoute:!1}),HBe=w.createContext(null);function p0t(n,e){let{relative:t}=e===void 0?{}:e;mR()||ec(!1);let{basename:i,navigator:r}=w.useContext(gR),{hash:o,pathname:s,search:a}=jBe(n,{relative:t}),l=s;return i!=="/"&&(l=s==="/"?i:Ew([i,s])),r.createHref({pathname:l,search:a,hash:o})}function mR(){return w.useContext(Vj)!=null}function ml(){return mR()||ec(!1),w.useContext(Vj).location}function WBe(n){w.useContext(gR).static||w.useLayoutEffect(n)}function ki(){let{isDataRoute:n}=w.useContext(b0);return n?I0t():g0t()}function g0t(){mR()||ec(!1);let n=w.useContext($pe),{basename:e,navigator:t}=w.useContext(gR),{matches:i}=w.useContext(b0),{pathname:r}=ml(),o=JSON.stringify(Fpe(i).map(l=>l.pathnameBase)),s=w.useRef(!1);return WBe(()=>{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=Bpe(l,JSON.parse(o),r,c.relative==="path");n==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Ew([e,u.pathname])),(c.replace?t.replace:t.push)(u,c.state,c)},[e,t,o,r,n])}const zBe=w.createContext(null);function UBe(){return w.useContext(zBe)}function m0t(n){let e=w.useContext(b0).outlet;return e&&w.createElement(zBe.Provider,{value:n},e)}function il(){let{matches:n}=w.useContext(b0),e=n[n.length-1];return e?e.params:{}}function jBe(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=w.useContext(b0),{pathname:r}=ml(),o=JSON.stringify(Fpe(i).map(s=>s.pathnameBase));return w.useMemo(()=>Bpe(n,JSON.parse(o),r,t==="path"),[n,o,r,t])}function _0t(n,e){return v0t(n,e)}function v0t(n,e,t){mR()||ec(!1);let{navigator:i}=w.useContext(gR),{matches:r}=w.useContext(b0),o=r[r.length-1],s=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let l=ml(),c;if(e){var u;let m=typeof e=="string"?pR(e):e;a==="/"||(u=m.pathname)!=null&&u.startsWith(a)||ec(!1),c=m}else c=l;let d=c.pathname||"/",h=a==="/"?d:d.slice(a.length)||"/",f=jbt(n,{pathname:h}),g=S0t(f&&f.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:Ew([a,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:Ew([a,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),r,t);return e&&g?w.createElement(Vj.Provider,{value:{location:pH({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:KC.Pop}},g):g}function b0t(){let n=k0t(),e=d0t(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 y0t=w.createElement(b0t,null);class C0t 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(b0.Provider,{value:this.props.routeContext},w.createElement(HBe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function w0t(n){let{routeContext:e,match:t,children:i}=n,r=w.useContext($pe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(b0.Provider,{value:e},i)}function S0t(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||ec(!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||y0t);let h=e.concat(o.slice(0,c+1)),f=()=>{let g;return u?g=d:l.route.Component?g=w.createElement(l.route.Component,null):l.route.element?g=l.route.element:g=a,w.createElement(w0t,{match:l,routeContext:{outlet:a,matches:h,isDataRoute:t!=null},children:g})};return t&&(l.route.ErrorBoundary||l.route.errorElement||c===0)?w.createElement(C0t,{location:t.location,revalidation:t.revalidation,component:d,error:u,children:f(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):f()},null)}var qBe=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(qBe||{}),gH=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}(gH||{});function E0t(n){let e=w.useContext($pe);return e||ec(!1),e}function x0t(n){let e=w.useContext(f0t);return e||ec(!1),e}function T0t(n){let e=w.useContext(b0);return e||ec(!1),e}function GBe(n){let e=T0t(),t=e.matches[e.matches.length-1];return t.route.id||ec(!1),t.route.id}function k0t(){var n;let e=w.useContext(HBe),t=x0t(gH.UseRouteError),i=GBe(gH.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function I0t(){let{router:n}=E0t(qBe.UseNavigateStable),e=GBe(gH.UseNavigateStable),t=w.useRef(!1);return WBe(()=>{t.current=!0}),w.useCallback(function(r,o){o===void 0&&(o={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,pH({fromRouteId:e},o)))},[n,e])}function DT(n){let{to:e,replace:t,state:i,relative:r}=n;mR()||ec(!1);let{matches:o}=w.useContext(b0),{pathname:s}=ml(),a=ki(),l=Bpe(e,Fpe(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 sp(n){return m0t(n.context)}function _e(n){ec(!1)}function L0t(n){let{basename:e="/",children:t=null,location:i,navigationType:r=KC.Pop,navigator:o,static:s=!1}=n;mR()&&ec(!1);let a=e.replace(/^\/*/,"/"),l=w.useMemo(()=>({basename:a,navigator:o,static:s}),[a,o,s]);typeof i=="string"&&(i=pR(i));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=i,g=w.useMemo(()=>{let m=Mpe(c,a);return m==null?null:{location:{pathname:m,search:u,hash:d,state:h,key:f},navigationType:r}},[a,c,u,d,h,f,r]);return g==null?null:w.createElement(gR.Provider,{value:l},w.createElement(Vj.Provider,{children:t,value:g}))}function D0t(n){let{children:e,location:t}=n;return _0t(Qie(e),t)}new Promise(()=>{});function Qie(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,Qie(i.props.children,o));return}i.type!==_e&&ec(!1),!i.props.index||!i.props.children||ec(!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=Qie(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 Xie(){return Xie=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},Xie.apply(this,arguments)}function A0t(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 R0t(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function N0t(n,e){return n.button===0&&(!e||e==="_self")&&!R0t(n)}function Zie(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 O0t(n,e){let t=Zie(n);return e&&e.forEach((i,r)=>{t.has(r)||e.getAll(r).forEach(o=>{t.append(r,o)})}),t}const P0t=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],M0t="startTransition",Fxe=Lm[M0t];function F0t(n){let{basename:e,children:t,future:i,window:r}=n,o=w.useRef();o.current==null&&(o.current=Wbt({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&&Fxe?Fxe(()=>l(d)):l(d)},[l,c]);return w.useLayoutEffect(()=>s.listen(u),[s,u]),w.createElement(L0t,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}const B0t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$0t=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,k1=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=A0t(e,P0t),{basename:f}=w.useContext(gR),g,m=!1;if(typeof c=="string"&&$0t.test(c)&&(g=c,B0t))try{let y=new URL(window.location.href),C=c.startsWith("//")?new URL(y.protocol+c):new URL(c),E=Mpe(C.pathname,f);C.origin===y.origin&&E!=null?c=E+C.search+C.hash:m=!0}catch{}let v=p0t(c,{relative:r}),_=V0t(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,unstable_viewTransition:d});function b(y){i&&i(y),y.defaultPrevented||_(y)}return w.createElement("a",Xie({},h,{href:g||v,onClick:m||o?i:b,ref:t,target:l}))});var Bxe;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Bxe||(Bxe={}));var $xe;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})($xe||($xe={}));function V0t(n,e){let{target:t,replace:i,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:a}=e===void 0?{}:e,l=ki(),c=ml(),u=jBe(n,{relative:s});return w.useCallback(d=>{if(N0t(d,t)){d.preventDefault();let h=i!==void 0?i:fH(c)===fH(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 lF(n){let e=w.useRef(Zie(n)),t=w.useRef(!1),i=ml(),r=w.useMemo(()=>O0t(i.search,t.current?null:e.current),[i.search]),o=ki(),s=w.useCallback((a,l)=>{const c=Zie(typeof a=="function"?a(r):a);t.current=!0,o("?"+c,l)},[o,r]);return[r,s]}function zu(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 Gf(n){return!!n&&!!n[po]}function dg(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)===K0t}(n)||Array.isArray(n)||!!n[ML]||!!(!((e=n.constructor)===null||e===void 0)&&e[ML])||Hj(n)||Wj(n))}function KBe(n){return Gf(n)||zu(23,n),n[po].t}function h1(n,e,t){t===void 0&&(t=!1),iS(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 iS(n){var e=n[po];return e?e.i>3?e.i-4:e.i:Array.isArray(n)?1:Hj(n)?2:Wj(n)?3:0}function xw(n,e){return iS(n)===2?n.has(e):Object.prototype.hasOwnProperty.call(n,e)}function p$(n,e){return iS(n)===2?n.get(e):n[e]}function YBe(n,e,t){var i=iS(n);i===2?n.set(e,t):i===3?n.add(t):n[e]=t}function QBe(n,e){return n===e?n!==0||1/n==1/e:n!=n&&e!=e}function Hj(n){return q0t&&n instanceof Map}function Wj(n){return G0t&&n instanceof Set}function Mu(n){return n.o||n.t}function Vpe(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var e=JBe(n);delete e[po];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 cF(n,e){return e===void 0&&(e=!1),Hpe(n)||Gf(n)||!dg(n)||(iS(n)>1&&(n.set=n.add=n.clear=n.delete=H0t),Object.freeze(n),e&&h1(n,function(t,i){return cF(i,!0)},!0)),n}function H0t(){zu(2)}function Hpe(n){return n==null||typeof n!="object"||Object.isFrozen(n)}function Ub(n){var e=ere[n];return e||zu(18,n),e}function Wpe(n,e){ere[n]||(ere[n]=e)}function L4(){return A4}function yZ(n,e){e&&(Ub("Patches"),n.u=[],n.s=[],n.v=e)}function mH(n){Jie(n),n.p.forEach(W0t),n.p=null}function Jie(n){n===A4&&(A4=n.l)}function Vxe(n){return A4={p:[],l:A4,h:n,m:!0,_:0}}function W0t(n){var e=n[po];e.i===0||e.i===1?e.j():e.g=!0}function CZ(n,e){e._=e.p.length;var t=e.p[0],i=n!==void 0&&n!==t;return e.h.O||Ub("ES5").S(e,n,i),i?(t[po].P&&(mH(e),zu(4)),dg(n)&&(n=_H(e,n),e.l||vH(e,n)),e.u&&Ub("Patches").M(t[po].t,n,e.u,e.s)):n=_H(e,t,[]),mH(e),e.u&&e.v(e.u,e.s),n!==Uj?n:void 0}function _H(n,e,t){if(Hpe(e))return e;var i=e[po];if(!i)return h1(e,function(a,l){return Hxe(n,i,e,a,l,t)},!0),e;if(i.A!==n)return e;if(!i.P)return vH(n,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var r=i.i===4||i.i===5?i.o=Vpe(i.k):i.o,o=r,s=!1;i.i===3&&(o=new Set(r),r.clear(),s=!0),h1(o,function(a,l){return Hxe(n,i,r,a,l,t,s)}),vH(n,r,!1),t&&n.u&&Ub("Patches").N(i,t,n.u,n.s)}return i.o}function Hxe(n,e,t,i,r,o,s){if(Gf(r)){var a=_H(n,r,o&&e&&e.i!==3&&!xw(e.R,i)?o.concat(i):void 0);if(YBe(t,i,a),!Gf(a))return;n.m=!1}else s&&t.add(r);if(dg(r)&&!Hpe(r)){if(!n.h.D&&n._<1)return;_H(n,r),e&&e.A.l||vH(n,r)}}function vH(n,e,t){t===void 0&&(t=!1),!n.l&&n.h.D&&n.m&&cF(e,t)}function wZ(n,e){var t=n[po];return(t?Mu(t):n)[e]}function Wxe(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 Cf(n){n.P||(n.P=!0,n.l&&Cf(n.l))}function SZ(n){n.o||(n.o=Vpe(n.t))}function D4(n,e,t){var i=Hj(e)?Ub("MapSet").F(e,t):Wj(e)?Ub("MapSet").T(e,t):n.O?function(r,o){var s=Array.isArray(r),a={i:s?1:0,A:o?o.A:L4(),P:!1,I:!1,R:{},l:o,t:r,k:null,o:null,j:null,C:!1},l=a,c=R4;s&&(l=[a],c=oP);var u=Proxy.revocable(l,c),d=u.revoke,h=u.proxy;return a.k=h,a.j=d,h}(e,t):Ub("ES5").J(e,t);return(t?t.A:L4()).p.push(i),i}function zj(n){return Gf(n)||zu(22,n),function e(t){if(!dg(t))return t;var i,r=t[po],o=iS(t);if(r){if(!r.P&&(r.i<4||!Ub("ES5").K(r)))return r.t;r.I=!0,i=zxe(t,o),r.I=!1}else i=zxe(t,o);return h1(i,function(s,a){r&&p$(r.t,s)===a||YBe(i,s,e(a))}),o===3?new Set(i):i}(n)}function zxe(n,e){switch(e){case 2:return new Map(n);case 3:return Array.from(n)}return Vpe(n)}function zpe(){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[po];return R4.get(l,o)},set:function(l){var c=this[po];R4.set(c,o,l)}},a}function e(o){for(var s=o.length-1;s>=0;s--){var a=o[s][po];if(!a.P)switch(a.i){case 5:i(a)&&Cf(a);break;case 4:t(a)&&Cf(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!==po){var d=s[u];if(d===void 0&&!xw(s,u))return!0;var h=a[u],f=h&&h[po];if(f?f.t!==d:!QBe(h,d))return!0}}var g=!!s[po];return l.length!==FL(s).length+(g?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={};Wpe("ES5",{J:function(o,s){var a=Array.isArray(o),l=function(u,d){if(u){for(var h=Array(d.length),f=0;f<d.length;f++)Object.defineProperty(h,""+f,n(f,!0));return h}var g=JBe(d);delete g[po];for(var m=FL(g),v=0;v<m.length;v++){var _=m[v];g[_]=n(_,u||!!g[_].enumerable)}return Object.create(Object.getPrototypeOf(d),g)}(a,o),c={i:a?5:4,A:s?s.A:L4(),P:!1,I:!1,R:{},l:s,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,po,{value:c,writable:!0}),l},S:function(o,s,a){a?Gf(s)&&s[po].A===o&&e(o.p):(o.u&&function l(c){if(c&&typeof c=="object"){var u=c[po];if(u){var d=u.t,h=u.k,f=u.R,g=u.i;if(g===4)h1(h,function(y){y!==po&&(d[y]!==void 0||xw(d,y)?f[y]||l(h[y]):(f[y]=!0,Cf(u)))}),h1(d,function(y){h[y]!==void 0||xw(h,y)||(f[y]=!1,Cf(u))});else if(g===5){if(i(u)&&(Cf(u),f.length=!0),h.length<d.length)for(var m=h.length;m<d.length;m++)f[m]=!1;else for(var v=d.length;v<h.length;v++)f[v]=!0;for(var _=Math.min(h.length,d.length),b=0;b<_;b++)h.hasOwnProperty(b)||(f[b]=!0),f[b]===void 0&&l(h[b])}}}}(o.p[0]),e(o.p))},K:function(o){return o.i===4?t(o):i(o)}})}function XBe(){function n(i){if(!dg(i))return i;if(Array.isArray(i))return i.map(n);if(Hj(i))return new Map(Array.from(i.entries()).map(function(s){return[s[0],n(s[1])]}));if(Wj(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 xw(i,ML)&&(r[ML]=i[ML]),r}function e(i){return Gf(i)?n(i):i}var t="add";Wpe("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=iS(l),d=s[c];typeof d!="string"&&typeof d!="number"&&(d=""+d),u!==0&&u!==1||d!=="__proto__"&&d!=="constructor"||zu(24),typeof l=="function"&&d==="prototype"&&zu(24),typeof(l=p$(l,d))!="object"&&zu(15,s.join("/"))}var h=iS(l),f=n(o.value),g=s[s.length-1];switch(a){case"replace":switch(h){case 2:return l.set(g,f);case 3:zu(16);default:return l[g]=f}case t:switch(h){case 1:return g==="-"?l.push(f):l.splice(g,0,f);case 2:return l.set(g,f);case 3:return l.add(f);default:return l[g]=f}case"remove":switch(h){case 1:return l.splice(g,1);case 2:return l.delete(g);case 3:return l.delete(o.value);default:return delete l[g]}default:zu(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;h1(a.R,function(f,g){var m=p$(d,f),v=p$(h,f),_=g?xw(d,f)?"replace":t:"remove";if(m!==v||_!=="replace"){var b=l.concat(f);c.push(_==="remove"?{op:_,path:b}:{op:_,path:b,value:v}),u.push(_===t?{op:"remove",path:b}:_==="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,f=a.o;if(f.length<d.length){var g=[f,d];d=g[0],f=g[1];var m=[u,c];c=m[0],u=m[1]}for(var v=0;v<d.length;v++)if(h[v]&&f[v]!==d[v]){var _=l.concat([v]);c.push({op:"replace",path:_,value:e(f[v])}),u.push({op:"replace",path:_,value:e(d[v])})}for(var b=d.length;b<f.length;b++){var y=l.concat([b]);c.push({op:t,path:y,value:e(f[b])})}d.length<f.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,f=0;d.forEach(function(g){if(!h.has(g)){var m=l.concat([f]);c.push({op:"remove",path:m,value:g}),u.unshift({op:t,path:m,value:g})}f++}),f=0,h.forEach(function(g){if(!d.has(g)){var m=l.concat([f]);c.push({op:t,path:m,value:g}),u.unshift({op:"remove",path:m,value:g})}f++})}(i,r,o,s)}},M:function(i,r,o,s){o.push({op:"replace",path:[],value:r===Uj?void 0:r}),s.push({op:"replace",path:[],value:i})}})}function ZBe(){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(dg(l)){var c=D4(a.A.h,l,a);a.p.set(l,c),a.o.add(c)}else a.o.add(l)}))}function i(a){a.g&&zu(3,JSON.stringify(Mu(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[po]={i:2,l:u,A:u?u.A:L4(),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 Mu(this[po]).size}}),l.has=function(c){return Mu(this[po]).has(c)},l.set=function(c,u){var d=this[po];return i(d),Mu(d).has(c)&&Mu(d).get(c)===u||(e(d),Cf(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[po];return i(u),e(u),Cf(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[po];i(c),Mu(c).size&&(e(c),Cf(c),c.R=new Map,h1(c.t,function(u){c.R.set(u,!1)}),c.o.clear())},l.forEach=function(c,u){var d=this;Mu(this[po]).forEach(function(h,f){c.call(u,d.get(f),f,d)})},l.get=function(c){var u=this[po];i(u);var d=Mu(u).get(c);if(u.I||!dg(d)||d!==u.t.get(c))return d;var h=D4(u.A.h,d,u);return e(u),u.o.set(c,h),h},l.keys=function(){return Mu(this[po]).keys()},l.values=function(){var c,u=this,d=this.keys();return(c={})[b8]=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={})[b8]=function(){return u.entries()},c.next=function(){var h=d.next();if(h.done)return h;var f=u.get(h.value);return{done:!1,value:[h.value,f]}},c},l[b8]=function(){return this.entries()},a}(),s=function(){function a(c,u){return this[po]={i:3,l:u,A:u?u.A:L4(),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 Mu(this[po]).size}}),l.has=function(c){var u=this[po];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[po];return i(u),this.has(c)||(t(u),Cf(u),u.o.add(c)),this},l.delete=function(c){if(!this.has(c))return!1;var u=this[po];return i(u),t(u),Cf(u),u.o.delete(c)||!!u.p.has(c)&&u.o.delete(u.p.get(c))},l.clear=function(){var c=this[po];i(c),Mu(c).size&&(t(c),Cf(c),c.o.clear())},l.values=function(){var c=this[po];return i(c),t(c),c.o.values()},l.entries=function(){var c=this[po];return i(c),t(c),c.o.entries()},l.keys=function(){return this.values()},l[b8]=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}();Wpe("MapSet",{F:function(a,l){return new o(a,l)},T:function(a,l){return new s(a,l)}})}function z0t(){zpe(),ZBe(),XBe()}function U0t(n){return n}function j0t(n){return n}var Uxe,A4,Upe=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",q0t=typeof Map<"u",G0t=typeof Set<"u",jxe=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Uj=Upe?Symbol.for("immer-nothing"):((Uxe={})["immer-nothing"]=!0,Uxe),ML=Upe?Symbol.for("immer-draftable"):"__$immer_draftable",po=Upe?Symbol.for("immer-state"):"__$immer_state",b8=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",K0t=""+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,JBe=Object.getOwnPropertyDescriptors||function(n){var e={};return FL(n).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(n,t)}),e},ere={},R4={get:function(n,e){if(e===po)return n;var t=Mu(n);if(!xw(t,e))return function(r,o,s){var a,l=Wxe(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||!dg(i)?i:i===wZ(n.t,e)?(SZ(n),n.o[e]=D4(n.A.h,i,n)):i},has:function(n,e){return e in Mu(n)},ownKeys:function(n){return Reflect.ownKeys(Mu(n))},set:function(n,e,t){var i=Wxe(Mu(n),e);if(i!=null&&i.set)return i.set.call(n.k,t),!0;if(!n.P){var r=wZ(Mu(n),e),o=r==null?void 0:r[po];if(o&&o.t===t)return n.o[e]=t,n.R[e]=!1,!0;if(QBe(t,r)&&(t!==void 0||xw(n.t,e)))return!0;SZ(n),Cf(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 wZ(n.t,e)!==void 0||e in n.t?(n.R[e]=!1,SZ(n),Cf(n)):delete n.R[e],n.o&&delete n.o[e],!0},getOwnPropertyDescriptor:function(n,e){var t=Mu(n),i=Reflect.getOwnPropertyDescriptor(t,e);return i&&{writable:!0,configurable:n.i!==1||e!=="length",enumerable:i.enumerable,value:t[e]}},defineProperty:function(){zu(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){zu(12)}},oP={};h1(R4,function(n,e){oP[n]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),oP.deleteProperty=function(n,e){return oP.set.call(this,n,e,void 0)},oP.set=function(n,e,t){return R4.set.call(this,n[0],e,t,n[0])};var e8e=function(){function n(t){var i=this;this.O=jxe,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 v=this;m===void 0&&(m=a);for(var _=arguments.length,b=Array(_>1?_-1:0),y=1;y<_;y++)b[y-1]=arguments[y];return l.produce(m,function(C){var E;return(E=o).call.apply(E,[v,C].concat(b))})}}var c;if(typeof o!="function"&&zu(6),s!==void 0&&typeof s!="function"&&zu(7),dg(r)){var u=Vxe(i),d=D4(i,r,void 0),h=!0;try{c=o(d),h=!1}finally{h?mH(u):Jie(u)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return yZ(u,s),CZ(m,u)},function(m){throw mH(u),m}):(yZ(u,s),CZ(c,u))}if(!r||typeof r!="object"){if((c=o(r))===void 0&&(c=r),c===Uj&&(c=void 0),i.D&&cF(c,!0),s){var f=[],g=[];Ub("Patches").M(r,c,f,g),s(f,g)}return c}zu(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(f){return r.apply(void 0,[f].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){dg(t)||zu(8),Gf(t)&&(t=zj(t));var i=Vxe(this),r=D4(this,t,void 0);return r[po].C=!0,Jie(i),r},e.finishDraft=function(t,i){var r=t&&t[po],o=r.A;return yZ(o,i),CZ(void 0,o)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!jxe&&zu(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=Ub("Patches").$;return Gf(t)?s(t,i):this.produce(t,function(a){return s(a,i)})},n}(),hg=new e8e,OD=hg.produce,Y0t=hg.produceWithPatches.bind(hg),Q0t=hg.setAutoFreeze.bind(hg),X0t=hg.setUseProxies.bind(hg),Z0t=hg.applyPatches.bind(hg),J0t=hg.createDraft.bind(hg),eyt=hg.finishDraft.bind(hg);const tyt=Object.freeze(Object.defineProperty({__proto__:null,Immer:e8e,applyPatches:Z0t,castDraft:U0t,castImmutable:j0t,createDraft:J0t,current:zj,default:OD,enableAllPlugins:z0t,enableES5:zpe,enableMapSet:ZBe,enablePatches:XBe,finishDraft:eyt,freeze:cF,immerable:ML,isDraft:Gf,isDraftable:dg,nothing:Uj,original:KBe,produce:OD,produceWithPatches:Y0t,setAutoFreeze:Q0t,setUseProxies:X0t},Symbol.toStringTag,{value:"Module"}));function qxe(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 pt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qxe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qxe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ld(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 Gxe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),EZ=function(){return Math.random().toString(36).substring(7).split("").join(".")},N4={INIT:"@@redux/INIT"+EZ(),REPLACE:"@@redux/REPLACE"+EZ(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+EZ()}};function nyt(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 uF(n,e,t){var i;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ld(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ld(1));return t(uF)(n,e)}if(typeof n!="function")throw new Error(ld(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(ld(3));return o}function d(m){if(typeof m!="function")throw new Error(ld(4));if(l)throw new Error(ld(5));var v=!0;return c(),a.push(m),function(){if(v){if(l)throw new Error(ld(6));v=!1,c();var b=a.indexOf(m);a.splice(b,1),s=null}}}function h(m){if(!nyt(m))throw new Error(ld(7));if(typeof m.type>"u")throw new Error(ld(8));if(l)throw new Error(ld(9));try{l=!0,o=r(o,m)}finally{l=!1}for(var v=s=a,_=0;_<v.length;_++){var b=v[_];b()}return m}function f(m){if(typeof m!="function")throw new Error(ld(10));r=m,h({type:N4.REPLACE})}function g(){var m,v=d;return m={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(ld(11));function y(){b.next&&b.next(u())}y();var C=v(y);return{unsubscribe:C}}},m[Gxe]=function(){return this},m}return h({type:N4.INIT}),i={dispatch:h,subscribe:d,getState:u,replaceReducer:f},i[Gxe]=g,i}var iyt=uF;function ryt(n){Object.keys(n).forEach(function(e){var t=n[e],i=t(void 0,{type:N4.INIT});if(typeof i>"u")throw new Error(ld(12));if(typeof t(void 0,{type:N4.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ld(13))})}function t8e(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{ryt(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 f=o[h],g=t[f],m=l[f],v=g(m,c);if(typeof v>"u")throw c&&c.type,new Error(ld(14));d[f]=v,u=u||v!==m}return u=u||o.length!==Object.keys(l).length,u?d:l}}function Kxe(n,e){return function(){return e(n.apply(this,arguments))}}function tre(n,e){if(typeof n=="function")return Kxe(n,e);if(typeof n!="object"||n===null)throw new Error(ld(16));var t={};for(var i in n){var r=n[i];typeof r=="function"&&(t[i]=Kxe(r,e))}return t}function PD(){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 jpe(){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(ld(15))},s={getState:r.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(l){return l(s)});return o=PD.apply(void 0,a)(r.dispatch),pt(pt({},r),{},{dispatch:o})}}}var bH="NOT_FOUND";function oyt(n){var e;return{get:function(i){return e&&n(e.key,i)?e.value:bH},put:function(i,r){e={key:i,value:r}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function syt(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 bH}function r(a,l){i(a)===bH&&(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 n8e=function(e,t){return e===t};function ayt(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 i8e(n,e){var t=typeof e=="object"?e:{equalityCheck:e},i=t.equalityCheck,r=i===void 0?n8e:i,o=t.maxSize,s=o===void 0?1:o,a=t.resultEqualityCheck,l=ayt(r),c=s===1?oyt(l):syt(s,l);function u(){var d=c.get(arguments);if(d===bH){if(d=n.apply(null,arguments),a){var h=c.getEntries(),f=h.find(function(g){return a(g.value,d)});f&&(d=f.value)}c.put(arguments,d)}return d}return u.clearCache=function(){return c.clear()},u}function lyt(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 r8e(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 f=d,g=f.memoizeOptions,m=g===void 0?t:g,v=Array.isArray(m)?m:[m],_=lyt(a),b=n.apply(void 0,[function(){return c++,h.apply(null,arguments)}].concat(v)),y=n(function(){for(var E=[],x=_.length,k=0;k<x;k++)E.push(_[k].apply(null,arguments));return u=b.apply(null,E),u});return Object.assign(y,{resultFunc:h,memoizedResultFunc:b,dependencies:_,lastResult:function(){return u},recomputations:function(){return c},resetRecomputations:function(){return c=0}}),y};return r}var jj=r8e(i8e),cyt=function(e,t){if(t===void 0&&(t=jj),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 uyt=Object.freeze(Object.defineProperty({__proto__:null,createSelector:jj,createSelectorCreator:r8e,createStructuredSelector:cyt,defaultEqualityCheck:n8e,defaultMemoize:i8e},Symbol.toStringTag,{value:"Module"}));function o8e(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 s8e=o8e();s8e.withExtraArgument=o8e;const Yxe=s8e;var a8e=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)}}(),dF=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}}},rS=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},dyt=Object.defineProperty,hyt=Object.defineProperties,fyt=Object.getOwnPropertyDescriptors,Qxe=Object.getOwnPropertySymbols,pyt=Object.prototype.hasOwnProperty,gyt=Object.prototype.propertyIsEnumerable,Xxe=function(n,e,t){return e in n?dyt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Df=function(n,e){for(var t in e||(e={}))pyt.call(e,t)&&Xxe(n,t,e[t]);if(Qxe)for(var i=0,r=Qxe(e);i<r.length;i++){var t=r[i];gyt.call(e,t)&&Xxe(n,t,e[t])}return n},xZ=function(n,e){return hyt(n,fyt(e))},hF=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=jj.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,rS([Gf(r)?zj(r):r],o))};return i},myt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?PD:PD.apply(null,arguments)};function qj(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 l8e=function(n){return n&&typeof n.match=="function"};function jb(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 Df(Df({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 qpe(n){return qj(n)&&"type"in n}function _yt(n){return typeof n=="function"&&"type"in n&&l8e(n)}function c8e(n){return qpe(n)&&typeof n.type=="string"&&Object.keys(n).every(vyt)}function vyt(n){return["type","payload","error","meta"].indexOf(n)>-1}function byt(n){return""+n}function yyt(n){return function(){return function(e){return function(t){return e(t)}}}}var u8e=function(n){a8e(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,rS([void 0],t[0].concat(this)))):new(e.bind.apply(e,rS([void 0],t.concat(this))))},e}(Array),d8e=function(n){a8e(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,rS([void 0],t[0].concat(this)))):new(e.bind.apply(e,rS([void 0],t.concat(this))))},e}(Array);function nre(n){return dg(n)?OD(n,function(){}):n}function Cyt(n){return typeof n!="object"||n==null||Object.isFrozen(n)}function wyt(n){return function(){return function(e){return function(t){return e(t)}}}}function h8e(n){var e=typeof n;return n==null||e==="string"||e==="boolean"||e==="number"||Array.isArray(n)||qj(n)}function f8e(n,e,t,i,r,o){e===void 0&&(e=""),t===void 0&&(t=h8e),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+"."+v:v;if(l){var y=r.some(function(C){return C instanceof RegExp?C.test(b):b===C});if(y)return"continue"}if(!t(_))return{value:{keyPath:b,value:_}};if(typeof _=="object"&&(s=f8e(_,b,t,i,r,o),s))return{value:s}},u=0,d=a;u<d.length;u++){var h=d[u],f=h[0],g=h[1],m=c(f,g);if(typeof m=="object")return m.value}return o&&p8e(n)&&o.add(n),!1}function p8e(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)&&!p8e(i))return!1}return!0}function Syt(n){return function(){return function(e){return function(t){return e(t)}}}}function Eyt(n){return typeof n=="boolean"}function xyt(){return function(e){return g8e(e)}}function g8e(n){n===void 0&&(n={});var e=n.thunk,t=e===void 0?!0:e;n.immutableCheck,n.serializableCheck,n.actionCreatorCheck;var i=new u8e;return t&&(Eyt(t)?i.push(Yxe):i.push(Yxe.withExtraArgument(t.extraArgument))),i}var Tyt=!0;function m8e(n){var e=xyt(),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,f;if(typeof r=="function")f=r;else if(qj(r))f=t8e(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 g=s;typeof g=="function"&&(g=g(e));var m=jpe.apply(void 0,g),v=PD;l&&(v=myt(Df({trace:!Tyt},typeof l=="object"&&l)));var _=new d8e(m),b=_;Array.isArray(h)?b=rS([m],h):typeof h=="function"&&(b=h(_));var y=v.apply(void 0,b);return uF(f,u,y)}function _8e(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 kyt(n){return typeof n=="function"}function v8e(n,e,t,i){t===void 0&&(t=[]);var r=typeof e=="function"?_8e(e):[e,t,i],o=r[0],s=r[1],a=r[2],l;if(kyt(n))l=function(){return nre(n())};else{var c=nre(n);l=function(){return c}}function u(d,h){d===void 0&&(d=l());var f=rS([o[h.type]],s.filter(function(g){var m=g.matcher;return m(h)}).map(function(g){var m=g.reducer;return m}));return f.filter(function(g){return!!g}).length===0&&(f=[a]),f.reduce(function(g,m){if(m)if(Gf(g)){var v=g,_=m(v,h);return _===void 0?g:_}else{if(dg(g))return OD(g,function(b){return m(b,h)});var _=m(g,h);if(_===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return g},d)}return u.getInitialState=l,u}function Iyt(n,e){return n+"/"+e}function _R(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:nre(n.initialState),i=n.reducers||{},r=Object.keys(i),o={},s={},a={};r.forEach(function(u){var d=i[u],h=Iyt(e,u),f,g;"reducer"in d?(f=d.reducer,g=d.prepare):f=d,o[u]=f,s[h]=f,a[u]=g?jb(h,g):jb(h)});function l(){var u=typeof n.extraReducers=="function"?_8e(n.extraReducers):[n.extraReducers],d=u[0],h=d===void 0?{}:d,f=u[1],g=f===void 0?[]:f,m=u[2],v=m===void 0?void 0:m,_=Df(Df({},h),s);return v8e(t,function(b){for(var y in _)b.addCase(y,_[y]);for(var C=0,E=g;C<E.length;C++){var x=E[C];b.addMatcher(x.matcher,x.reducer)}v&&b.addDefaultCase(v)})}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 Lyt(){return{ids:[],entities:{}}}function Dyt(){function n(e){return e===void 0&&(e={}),Object.assign(Lyt(),e)}return{getInitialState:n}}function Ayt(){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 Ryt(n){var e=fc(function(t,i){return n(i)});return function(i){return e(i,void 0)}}function fc(n){return function(t,i){function r(s){return c8e(s)}var o=function(s){r(i)?n(i.payload,s):n(i,s)};return Gf(t)?(o(t),t):OD(t,o)}}function QP(n,e){var t=e(n);return t}function eT(n){return Array.isArray(n)||(n=Object.values(n)),n}function b8e(n,e,t){n=eT(n);for(var i=[],r=[],o=0,s=n;o<s.length;o++){var a=s[o],l=QP(a,e);l in t.entities?r.push({id:l,changes:a}):i.push(a)}return[i,r]}function y8e(n){function e(g,m){var v=QP(g,n);v in m.entities||(m.ids.push(v),m.entities[v]=g)}function t(g,m){g=eT(g);for(var v=0,_=g;v<_.length;v++){var b=_[v];e(b,m)}}function i(g,m){var v=QP(g,n);v in m.entities||m.ids.push(v),m.entities[v]=g}function r(g,m){g=eT(g);for(var v=0,_=g;v<_.length;v++){var b=_[v];i(b,m)}}function o(g,m){g=eT(g),m.ids=[],m.entities={},t(g,m)}function s(g,m){return a([g],m)}function a(g,m){var v=!1;g.forEach(function(_){_ in m.entities&&(delete m.entities[_],v=!0)}),v&&(m.ids=m.ids.filter(function(_){return _ in m.entities}))}function l(g){Object.assign(g,{ids:[],entities:{}})}function c(g,m,v){var _=v.entities[m.id],b=Object.assign({},_,m.changes),y=QP(b,n),C=y!==m.id;return C&&(g[m.id]=y,delete v.entities[m.id]),v.entities[y]=b,C}function u(g,m){return d([g],m)}function d(g,m){var v={},_={};g.forEach(function(C){C.id in m.entities&&(_[C.id]={id:C.id,changes:Df(Df({},_[C.id]?_[C.id].changes:null),C.changes)})}),g=Object.values(_);var b=g.length>0;if(b){var y=g.filter(function(C){return c(v,C,m)}).length>0;y&&(m.ids=Object.keys(m.entities))}}function h(g,m){return f([g],m)}function f(g,m){var v=b8e(g,n,m),_=v[0],b=v[1];d(b,m),t(_,m)}return{removeAll:Ryt(l),addOne:fc(e),addMany:fc(t),setOne:fc(i),setMany:fc(r),setAll:fc(o),updateOne:fc(u),updateMany:fc(d),upsertOne:fc(h),upsertMany:fc(f),removeOne:fc(s),removeMany:fc(a)}}function Nyt(n,e){var t=y8e(n),i=t.removeOne,r=t.removeMany,o=t.removeAll;function s(b,y){return a([b],y)}function a(b,y){b=eT(b);var C=b.filter(function(E){return!(QP(E,n)in y.entities)});C.length!==0&&v(C,y)}function l(b,y){return c([b],y)}function c(b,y){b=eT(b),b.length!==0&&v(b,y)}function u(b,y){b=eT(b),y.entities={},y.ids=[],a(b,y)}function d(b,y){return h([b],y)}function h(b,y){for(var C=!1,E=0,x=b;E<x.length;E++){var k=x[E],L=y.entities[k.id];if(L){C=!0,Object.assign(L,k.changes);var D=n(L);k.id!==D&&(delete y.entities[k.id],y.entities[D]=L)}}C&&_(y)}function f(b,y){return g([b],y)}function g(b,y){var C=b8e(b,n,y),E=C[0],x=C[1];h(x,y),a(E,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 v(b,y){b.forEach(function(C){y.entities[n(C)]=C}),_(y)}function _(b){var y=Object.values(b.entities);y.sort(e);var C=y.map(n),E=b.ids;m(E,C)||(b.ids=C)}return{removeOne:i,removeMany:r,removeAll:o,addOne:fc(s),updateOne:fc(d),upsertOne:fc(f),setOne:fc(l),setMany:fc(c),setAll:fc(u),addMany:fc(a),updateMany:fc(h),upsertMany:fc(g)}}function Oyt(n){n===void 0&&(n={});var e=Df({sortComparer:!1,selectId:function(a){return a.id}},n),t=e.selectId,i=e.sortComparer,r=Dyt(),o=Ayt(),s=i?Nyt(t,i):y8e(t);return Df(Df(Df({selectId:t,sortComparer:i},r),o),s)}var Pyt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Gpe=function(n){n===void 0&&(n=21);for(var e="",t=n;t--;)e+=Pyt[Math.random()*64|0];return e},Myt=["name","message","stack","code"],TZ=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),Zxe=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),C8e=function(n){if(typeof n=="object"&&n!==null){for(var e={},t=0,i=Myt;t<i.length;t++){var r=i[t];typeof n[r]=="string"&&(e[r]=n[r])}return e}return{message:String(n)}},Fyt=function(){function n(e,t,i){var r=jb(e+"/fulfilled",function(c,u,d,h){return{payload:c,meta:xZ(Df({},h||{}),{arg:d,requestId:u,requestStatus:"fulfilled"})}}),o=jb(e+"/pending",function(c,u,d){return{payload:void 0,meta:xZ(Df({},d||{}),{arg:u,requestId:c,requestStatus:"pending"})}}),s=jb(e+"/rejected",function(c,u,d,h,f){return{payload:h,error:(i&&i.serializeError||C8e)(c||"Rejected"),meta:xZ(Df({},f||{}),{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 f=i!=null&&i.idGenerator?i.idGenerator(c):Gpe(),g=new a,m;function v(b){m=b,g.abort()}var _=function(){return hF(this,null,function(){var b,y,C,E,x,k,L;return dF(this,function(D){switch(D.label){case 0:return D.trys.push([0,4,,5]),E=(b=i==null?void 0:i.condition)==null?void 0:b.call(i,c,{getState:d,extra:h}),Byt(E)?[4,E]:[3,2];case 1:E=D.sent(),D.label=2;case 2:if(E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return x=new Promise(function(A,N){return g.signal.addEventListener("abort",function(){return N({name:"AbortError",message:m||"Aborted"})})}),u(o(f,c,(y=i==null?void 0:i.getPendingMeta)==null?void 0:y.call(i,{requestId:f,arg:c},{getState:d,extra:h}))),[4,Promise.race([x,Promise.resolve(t(c,{dispatch:u,getState:d,extra:h,requestId:f,signal:g.signal,abort:v,rejectWithValue:function(A,N){return new TZ(A,N)},fulfillWithValue:function(A,N){return new Zxe(A,N)}})).then(function(A){if(A instanceof TZ)throw A;return A instanceof Zxe?r(A.payload,f,c,A.meta):r(A,f,c)})])];case 3:return C=D.sent(),[3,5];case 4:return k=D.sent(),C=k instanceof TZ?s(null,f,c,k.payload,k.meta):s(k,f,c),[3,5];case 5:return L=i&&!i.dispatchConditionRejection&&s.match(C)&&C.meta.condition,L||u(C),[2,C]}})})}();return Object.assign(_,{abort:v,requestId:f,arg:c,unwrap:function(){return _.then(w8e)}})}}return Object.assign(l,{pending:o,rejected:s,fulfilled:r,typePrefix:e})}return n.withTypes=function(){return n},n}();function w8e(n){if(n.meta&&n.meta.rejectedWithValue)throw n.payload;if(n.error)throw n.error;return n.payload}function Byt(n){return n!==null&&typeof n=="object"&&typeof n.then=="function"}var S8e=function(n,e){return l8e(n)?n.match(e):n(e)};function fF(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.some(function(i){return S8e(i,t)})}}function ire(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.every(function(i){return S8e(i,t)})}}function Gj(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 pF(n){return typeof n[0]=="function"&&"pending"in n[0]&&"fulfilled"in n[0]&&"rejected"in n[0]}function E8e(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Gj(t,["pending"])}:pF(n)?function(t){var i=n.map(function(o){return o.pending}),r=fF.apply(void 0,i);return r(t)}:E8e()(n[0])}function yH(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Gj(t,["rejected"])}:pF(n)?function(t){var i=n.map(function(o){return o.rejected}),r=fF.apply(void 0,i);return r(t)}:yH()(n[0])}function x8e(){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=ire(yH.apply(void 0,n),t);return r(i)}:pF(n)?function(i){var r=ire(yH.apply(void 0,n),t);return r(i)}:x8e()(n[0])}function T8e(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Gj(t,["fulfilled"])}:pF(n)?function(t){var i=n.map(function(o){return o.fulfilled}),r=fF.apply(void 0,i);return r(t)}:T8e()(n[0])}function k8e(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Gj(t,["pending","fulfilled","rejected"])}:pF(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=fF.apply(void 0,i);return a(t)}:k8e()(n[0])}var Kpe=function(n,e){if(typeof n!="function")throw new TypeError(e+" is not a function")},rre=function(){},I8e=function(n,e){return e===void 0&&(e=rre),n.catch(e),n},L8e=function(n,e){return n.addEventListener("abort",e,{once:!0}),function(){return n.removeEventListener("abort",e)}},BL=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))},$yt="task",D8e="listener",A8e="completed",Ype="cancelled",Vyt="task-"+Ype,Hyt="task-"+A8e,R8e=D8e+"-"+Ype,Wyt=D8e+"-"+A8e,gF=function(){function n(e){this.code=e,this.name="TaskAbortError",this.message=$yt+" "+Ype+" (reason: "+e+")"}return n}(),$L=function(n){if(n.aborted)throw new gF(n.reason)};function N8e(n,e){var t=rre;return new Promise(function(i,r){var o=function(){return r(new gF(n.reason))};if(n.aborted){o();return}t=L8e(n,o),e.finally(function(){return t()}).then(i,r)}).finally(function(){t=rre})}var zyt=function(n,e){return hF(void 0,null,function(){var t,i;return dF(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 gF?"cancelled":"rejected",error:i}];case 4:return e==null||e(),[7];case 5:return[2]}})})},CH=function(n){return function(e){return I8e(N8e(n,e).then(function(t){return $L(n),t}))}},O8e=function(n){var e=CH(n);return function(t){return e(new Promise(function(i){return setTimeout(i,t)}))}},Uyt=Object.assign,Jxe={},mF="listenerMiddleware",jyt=function(n,e){var t=function(i){return L8e(n,function(){return BL(i,n.reason)})};return function(i,r){Kpe(i,"taskExecutor");var o=new AbortController;t(o);var s=zyt(function(){return hF(void 0,null,function(){var a;return dF(this,function(l){switch(l.label){case 0:return $L(n),$L(o.signal),[4,i({pause:CH(o.signal),delay:O8e(o.signal),signal:o.signal})];case 1:return a=l.sent(),$L(o.signal),[2,a]}})})},function(){return BL(o,Hyt)});return r!=null&&r.autoJoin&&e.push(s),{result:CH(n)(s),cancel:function(){BL(o,Vyt)}}}},qyt=function(n,e){var t=function(i,r){return hF(void 0,null,function(){var o,s,a,l;return dF(this,function(c){switch(c.label){case 0:$L(e),o=function(){},s=new Promise(function(u,d){var h=n({predicate:i,effect:function(f,g){g.unsubscribe(),u([f,g.getState(),g.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,N8e(e,Promise.race(a))];case 2:return l=c.sent(),$L(e),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(i,r){return I8e(t(i,r))}},P8e=function(n){var e=n.type,t=n.actionCreator,i=n.matcher,r=n.predicate,o=n.effect;if(e)r=jb(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 Kpe(o,"options.listener"),{predicate:r,type:e,effect:o}},Gyt=function(n){var e=P8e(n),t=e.type,i=e.predicate,r=e.effect,o=Gpe(),s={id:o,effect:r,type:t,predicate:i,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return s},ore=function(n){n.pending.forEach(function(e){BL(e,R8e)})},Kyt=function(n){return function(){n.forEach(ore),n.clear()}},eTe=function(n,e,t){try{n(e,t)}catch(i){setTimeout(function(){throw i},0)}},M8e=jb(mF+"/add"),F8e=jb(mF+"/removeAll"),B8e=jb(mF+"/remove"),Yyt=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,rS([mF+"/error"],n))};function Qyt(n){var e=this;n===void 0&&(n={});var t=new Map,i=n.extra,r=n.onError,o=r===void 0?Yyt:r;Kpe(o,"onError");var s=function(f){return f.unsubscribe=function(){return t.delete(f.id)},t.set(f.id,f),function(g){f.unsubscribe(),g!=null&&g.cancelActive&&ore(f)}},a=function(f){for(var g=0,m=Array.from(t.values());g<m.length;g++){var v=m[g];if(f(v))return v}},l=function(f){var g=a(function(m){return m.effect===f.effect});return g||(g=Gyt(f)),s(g)},c=function(f){var g=P8e(f),m=g.type,v=g.effect,_=g.predicate,b=a(function(y){var C=typeof m=="string"?y.type===m:y.predicate===_;return C&&y.effect===v});return b&&(b.unsubscribe(),f.cancelActive&&ore(b)),!!b},u=function(f,g,m,v){return hF(e,null,function(){var _,b,y,C;return dF(this,function(E){switch(E.label){case 0:_=new AbortController,b=qyt(l,_.signal),y=[],E.label=1;case 1:return E.trys.push([1,3,4,6]),f.pending.add(_),[4,Promise.resolve(f.effect(g,Uyt({},m,{getOriginalState:v,condition:function(x,k){return b(x,k).then(Boolean)},take:b,delay:O8e(_.signal),pause:CH(_.signal),extra:i,signal:_.signal,fork:jyt(_.signal,y),unsubscribe:f.unsubscribe,subscribe:function(){t.set(f.id,f)},cancelActiveListeners:function(){f.pending.forEach(function(x,k,L){x!==_&&(BL(x,R8e),L.delete(x))})}})))];case 2:return E.sent(),[3,6];case 3:return C=E.sent(),C instanceof gF||eTe(o,C,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(y)];case 5:return E.sent(),BL(_,Wyt),f.pending.delete(_),[7];case 6:return[2]}})})},d=Kyt(t),h=function(f){return function(g){return function(m){if(!qpe(m))return g(m);if(M8e.match(m))return l(m.payload);if(F8e.match(m)){d();return}if(B8e.match(m))return c(m.payload);var v=f.getState(),_=function(){if(v===Jxe)throw new Error(mF+": getOriginalState can only be called synchronously");return v},b;try{if(b=g(m),t.size>0)for(var y=f.getState(),C=Array.from(t.values()),E=0,x=C;E<x.length;E++){var k=x[E],L=!1;try{L=k.predicate(m,y,v)}catch(D){L=!1,eTe(o,D,{raisedBy:"predicate"})}L&&u(k,m,f,_)}}finally{v=Jxe}return b}}};return{middleware:h,startListening:l,stopListening:c,clearListeners:d}}var Qpe="RTK_autoBatch",Xyt=function(){return function(n){var e;return{payload:n,meta:(e={},e[Qpe]=!0,e)}}},tTe,Zyt=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(n){return(tTe||(tTe=Promise.resolve())).then(n).catch(function(e){return setTimeout(function(){throw e},0)})},$8e=function(n){return function(e){setTimeout(e,n)}},Jyt=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:$8e(10),e1t=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"?Zyt:n.type==="raf"?Jyt:n.type==="callback"?n.queueNotification:$8e(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()},f=r.subscribe(h);return l.add(d),function(){f(),l.delete(d)}},dispatch:function(d){var h;try{return o=!((h=d==null?void 0:d.meta)!=null&&h[Qpe]),s=!o,s&&(a||(a=!0,c(u))),r.dispatch(d)}finally{o=!0}}})}}};zpe();const t1t=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:d8e,MiddlewareArray:u8e,SHOULD_AUTOBATCH:Qpe,TaskAbortError:gF,__DO_NOT_USE__ActionTypes:N4,addListener:M8e,applyMiddleware:jpe,autoBatchEnhancer:e1t,bindActionCreators:tre,clearAllListeners:F8e,combineReducers:t8e,compose:PD,configureStore:m8e,createAction:jb,createActionCreatorInvariantMiddleware:yyt,createAsyncThunk:Fyt,createDraftSafeSelector:ry,createEntityAdapter:Oyt,createImmutableStateInvariantMiddleware:wyt,createListenerMiddleware:Qyt,createNextState:OD,createReducer:v8e,createSelector:jj,createSerializableStateInvariantMiddleware:Syt,createSlice:_R,createStore:uF,current:zj,findNonSerializableValue:f8e,freeze:cF,getDefaultMiddleware:g8e,getType:byt,isAction:qpe,isActionCreator:_yt,isAllOf:ire,isAnyOf:fF,isAsyncThunkAction:k8e,isDraft:Gf,isFluxStandardAction:c8e,isFulfilled:T8e,isImmutableDefault:Cyt,isPending:E8e,isPlain:h8e,isPlainObject:qj,isRejected:yH,isRejectedWithValue:x8e,legacy_createStore:iyt,miniSerializeError:C8e,nanoid:Gpe,original:KBe,prepareAutoBatched:Xyt,removeListener:B8e,unwrapResult:w8e},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 n1t={currentIndex:localStorage.getItem("X-CURRENT-INDEX")?parseInt(localStorage.getItem("X-CURRENT-INDEX")):0,api:{},changes:{company:void 0}},V8e=_R({name:"companyUser",initialState:n1t,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]=An.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:Kj,updateCompanyUsers:y0,injectInChanges:AT,resetChanges:Xpe,updateChanges:go,updateRecord:US}=V8e.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 vR=(n=>(n.TOKEN="invoiceninja_token",n.GOOGLE_SSO="google_sso",n))(vR||{});/**
* 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 i1t={authenticated:!1,user:{},changes:{}},H8e=_R({name:"user",initialState:i1t,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)=>{An.set(n.changes,e.payload.property,e.payload.value)},deletePassword:n=>{delete n.changes.password,delete n.user.password}}}),{updateUser:qy,injectInChanges:Zpe,injectInChangesWithData:kZ,resetChanges:r1t,authenticate:_F,register:o1t,updateChanges:Ak,deletePassword:s1t}=H8e.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 Jpe(){const n=Nc(o=>o.user),e=localStorage.getItem("X-NINJA-TOKEN"),t=ki(),i=zi(),r=Co();return e===null?!1:(n.authenticated||r.fetchQuery("/api/v1/refresh",()=>$e("POST",Ae("/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(_F({type:vR.TOKEN,user:o.data.data[s].user,token:localStorage.getItem("X-NINJA-TOKEN")})),i(y0(o.data.data)),i(Kj(s))}).catch(()=>{localStorage.removeItem("X-NINJA-TOKEN"),t("/login")})),!0)}const a1t=Symbol(),l1t=n=>typeof(n==null?void 0:n.then)=="function";function W8e(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 l1t(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 c1t=W8e(()=>typeof window<"u"?window.localStorage:void 0);function Yj(n,e,t=c1t,i){const r=i==null?void 0:i.unstable_getOnInit,o=Ro(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},Ro(a=>a(o),(a,l,c)=>{const u=typeof c=="function"?c(a(o)):c;return u===a1t?(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 Va(){return Nc(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 vF(){return Nc(n=>n.user.changes)}function I1(n){const e=Va(),t=zi(),i=vF();return w.useEffect(()=>{i&&(n==null?void 0:n.overwrite)===!1||t(Zpe())},[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 wH={dashboard_charts:{default_view:"month",currency:1,range:"this_month"},datatables:{clients:{sort:"id|desc"}},reports:{columns:{}},auto_expand_product_table_notes:!1};function _l(n){var o,s;const e=I1({overwrite:n==null?void 0:n.overwrite}),t=Nc(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:An.cloneDeep(wH)};return An.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 u1t={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"},z8e={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"},U8e=Yj("colorScheme",z8e);function si(){const n=_l({overwrite:!1}),[e,t]=us(U8e);return w.useEffect(()=>{n&&(n.dark_mode?t(u1t):t(z8e))},[n==null?void 0:n.dark_mode]),e}function ds(n){const e=si();return O("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:[p("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p("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 d1t(){return p("div",{className:"flex items-center justify-center h-screen",children:p(ds,{variant:"dark"})})}var j8e={exports:{}},h1t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",f1t=h1t,p1t=f1t;function q8e(){}function G8e(){}G8e.resetWarningCache=q8e;var g1t=function(){function n(i,r,o,s,a,l){if(l!==p1t){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:G8e,resetWarningCache:q8e};return t.PropTypes=t,t};j8e.exports=g1t();var _n=j8e.exports;const et=nl(_n);function sre(){return sre=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},sre.apply(this,arguments)}function m1t(n,e){if(n==null)return{};var t=_1t(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 _1t(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 ege=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=m1t(n,["color","size"]);return ce.createElement("svg",sre({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),ce.createElement("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"}))});ege.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};ege.displayName="Activity";const v1t=ege;function are(){return are=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},are.apply(this,arguments)}function b1t(n,e){if(n==null)return{};var t=y1t(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 y1t(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 tge=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=b1t(n,["color","size"]);return ce.createElement("svg",are({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),ce.createElement("circle",{cx:"12",cy:"12",r:"10"}),ce.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),ce.createElement("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))});tge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};tge.displayName="AlertCircle";const C1t=tge;function lre(){return lre=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},lre.apply(this,arguments)}function w1t(n,e){if(n==null)return{};var t=S1t(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 S1t(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 nge=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=w1t(n,["color","size"]);return ce.createElement("svg",lre({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),ce.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"}),ce.createElement("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),ce.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});nge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};nge.displayName="AlertTriangle";const K8e=nge;function cre(){return cre=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},cre.apply(this,arguments)}function E1t(n,e){if(n==null)return{};var t=x1t(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 x1t(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 ige=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=E1t(n,["color","size"]);return ce.createElement("svg",cre({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),ce.createElement("line",{x1:"21",y1:"10",x2:"3",y2:"10"}),ce.createElement("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),ce.createElement("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),ce.createElement("line",{x1:"21",y1:"18",x2:"3",y2:"18"}))});ige.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};ige.displayName="AlignJustify";const T1t=ige;function ure(){return ure=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},ure.apply(this,arguments)}function k1t(n,e){if(n==null)return{};var t=I1t(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 I1t(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 rge=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=k1t(n,["color","size"]);return ce.createElement("svg",ure({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),ce.createElement("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),ce.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"}))});rge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};rge.displayName="Book";const L1t=rge;function dre(){return dre=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},dre.apply(this,arguments)}function D1t(n,e){if(n==null)return{};var t=A1t(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 A1t(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 oge=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=D1t(n,["color","size"]);return ce.createElement("svg",dre({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),ce.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"}),ce.createElement("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),ce.createElement("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"}))});oge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};oge.displayName="Box";const R1t=oge;function hre(){return hre=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},hre.apply(this,arguments)}function N1t(n,e){if(n==null)return{};var t=O1t(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 O1t(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 sge=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=N1t(n,["color","size"]);return ce.createElement("svg",hre({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),ce.createElement("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"}),ce.createElement("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"}))});sge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};sge.displayName="Briefcase";const P1t=sge;function fre(){return fre=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},fre.apply(this,arguments)}function M1t(n,e){if(n==null)return{};var t=F1t(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 F1t(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 age=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=M1t(n,["color","size"]);return ce.createElement("svg",fre({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),ce.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),ce.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),ce.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),ce.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"}))});age.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};age.displayName="Calendar";const Y8e=age;function pre(){return pre=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},pre.apply(this,arguments)}function B1t(n,e){if(n==null)return{};var t=$1t(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 $1t(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 lge=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=B1t(n,["color","size"]);return ce.createElement("svg",pre({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),ce.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),ce.createElement("polyline",{points:"22 4 12 14.01 9 11.01"}))});lge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};lge.displayName="CheckCircle";const IZ=lge;function gre(){return gre=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},gre.apply(this,arguments)}function V1t(n,e){if(n==null)return{};var t=H1t(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 H1t(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 cge=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=V1t(n,["color","size"]);return ce.createElement("svg",gre({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),ce.createElement("polyline",{points:"20 6 9 17 4 12"}))});cge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};cge.displayName="Check";const Qj=cge;function mre(){return mre=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},mre.apply(this,arguments)}function W1t(n,e){if(n==null)return{};var t=z1t(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 z1t(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 uge=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=W1t(n,["color","size"]);return ce.createElement("svg",mre({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),ce.createElement("polyline",{points:"6 9 12 15 18 9"}))});uge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};uge.displayName="ChevronDown";const bR=uge;function _re(){return _re=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},_re.apply(this,arguments)}function U1t(n,e){if(n==null)return{};var t=j1t(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 j1t(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 dge=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=U1t(n,["color","size"]);return ce.createElement("svg",_re({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),ce.createElement("polyline",{points:"15 18 9 12 15 6"}))});dge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};dge.displayName="ChevronLeft";const Q8e=dge;function vre(){return vre=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},vre.apply(this,arguments)}function q1t(n,e){if(n==null)return{};var t=G1t(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 G1t(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 hge=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=q1t(n,["color","size"]);return ce.createElement("svg",vre({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),ce.createElement("polyline",{points:"9 18 15 12 9 6"}))});hge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};hge.displayName="ChevronRight";const Xj=hge;function bre(){return bre=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},bre.apply(this,arguments)}function K1t(n,e){if(n==null)return{};var t=Y1t(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 Y1t(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 fge=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=K1t(n,["color","size"]);return ce.createElement("svg",bre({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),ce.createElement("polyline",{points:"18 15 12 9 6 15"}))});fge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};fge.displayName="ChevronUp";const X8e=fge;function yre(){return yre=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},yre.apply(this,arguments)}function Q1t(n,e){if(n==null)return{};var t=X1t(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 X1t(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 pge=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=Q1t(n,["color","size"]);return ce.createElement("svg",yre({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),ce.createElement("polyline",{points:"11 17 6 12 11 7"}),ce.createElement("polyline",{points:"18 17 13 12 18 7"}))});pge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};pge.displayName="ChevronsLeft";const Z1t=pge;function Cre(){return Cre=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},Cre.apply(this,arguments)}function J1t(n,e){if(n==null)return{};var t=eCt(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 eCt(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 gge=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=J1t(n,["color","size"]);return ce.createElement("svg",Cre({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),ce.createElement("polyline",{points:"13 17 18 12 13 7"}),ce.createElement("polyline",{points:"6 17 11 12 6 7"}))});gge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};gge.displayName="ChevronsRight";const tm=gge;function wre(){return wre=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},wre.apply(this,arguments)}function tCt(n,e){if(n==null)return{};var t=nCt(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 nCt(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 mge=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=tCt(n,["color","size"]);return ce.createElement("svg",wre({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),ce.createElement("circle",{cx:"12",cy:"12",r:"10"}),ce.createElement("polyline",{points:"12 6 12 12 16 14"}))});mge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};mge.displayName="Clock";const iCt=mge;function Sre(){return Sre=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},Sre.apply(this,arguments)}function rCt(n,e){if(n==null)return{};var t=oCt(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 oCt(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 _ge=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=rCt(n,["color","size"]);return ce.createElement("svg",Sre({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),ce.createElement("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),ce.createElement("line",{x1:"1",y1:"10",x2:"23",y2:"10"}))});_ge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};_ge.displayName="CreditCard";const sCt=_ge;function Ere(){return Ere=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},Ere.apply(this,arguments)}function aCt(n,e){if(n==null)return{};var t=lCt(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 lCt(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 vge=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=aCt(n,["color","size"]);return ce.createElement("svg",Ere({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),ce.createElement("polyline",{points:"8 17 12 21 16 17"}),ce.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),ce.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"}))});vge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};vge.displayName="DownloadCloud";const cCt=vge;function xre(){return xre=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},xre.apply(this,arguments)}function uCt(n,e){if(n==null)return{};var t=dCt(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 dCt(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 bge=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=uCt(n,["color","size"]);return ce.createElement("svg",xre({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),ce.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ce.createElement("polyline",{points:"15 3 21 3 21 9"}),ce.createElement("line",{x1:"10",y1:"14",x2:"21",y2:"3"}))});bge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};bge.displayName="ExternalLink";const Z8e=bge;function Tre(){return Tre=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},Tre.apply(this,arguments)}function hCt(n,e){if(n==null)return{};var t=fCt(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 fCt(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 yge=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=hCt(n,["color","size"]);return ce.createElement("svg",Tre({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),ce.createElement("path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"}))});yge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};yge.displayName="Facebook";const pCt=yge;function kre(){return kre=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},kre.apply(this,arguments)}function gCt(n,e){if(n==null)return{};var t=mCt(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 mCt(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 Cge=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=gCt(n,["color","size"]);return ce.createElement("svg",kre({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),ce.createElement("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),ce.createElement("polyline",{points:"14 2 14 8 20 8"}),ce.createElement("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),ce.createElement("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),ce.createElement("polyline",{points:"10 9 9 9 8 9"}))});Cge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Cge.displayName="FileText";const oS=Cge;function Ire(){return Ire=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},Ire.apply(this,arguments)}function _Ct(n,e){if(n==null)return{};var t=vCt(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 vCt(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 wge=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=_Ct(n,["color","size"]);return ce.createElement("svg",Ire({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),ce.createElement("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),ce.createElement("polyline",{points:"13 2 13 9 20 9"}))});wge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};wge.displayName="File";const Sge=wge;function Lre(){return Lre=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},Lre.apply(this,arguments)}function bCt(n,e){if(n==null)return{};var t=yCt(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 yCt(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 Ege=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=bCt(n,["color","size"]);return ce.createElement("svg",Lre({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),ce.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"}))});Ege.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Ege.displayName="GitHub";const CCt=Ege;function Dre(){return Dre=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},Dre.apply(this,arguments)}function wCt(n,e){if(n==null)return{};var t=SCt(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 SCt(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 xge=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=wCt(n,["color","size"]);return ce.createElement("svg",Dre({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),ce.createElement("circle",{cx:"12",cy:"12",r:"10"}),ce.createElement("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),ce.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});xge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};xge.displayName="HelpCircle";const Tge=xge;function Are(){return Are=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},Are.apply(this,arguments)}function ECt(n,e){if(n==null)return{};var t=xCt(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 xCt(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 kge=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=ECt(n,["color","size"]);return ce.createElement("svg",Are({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),ce.createElement("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),ce.createElement("polyline",{points:"9 22 9 12 15 12 15 22"}))});kge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};kge.displayName="Home";const J8e=kge;function Rre(){return Rre=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},Rre.apply(this,arguments)}function TCt(n,e){if(n==null)return{};var t=kCt(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 kCt(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 Ige=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=TCt(n,["color","size"]);return ce.createElement("svg",Rre({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),ce.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),ce.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),ce.createElement("polyline",{points:"21 15 16 10 5 21"}))});Ige.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Ige.displayName="Image";const RT=Ige;function Nre(){return Nre=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},Nre.apply(this,arguments)}function ICt(n,e){if(n==null)return{};var t=LCt(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 LCt(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 Lge=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=ICt(n,["color","size"]);return ce.createElement("svg",Nre({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),ce.createElement("circle",{cx:"12",cy:"12",r:"10"}),ce.createElement("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),ce.createElement("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"}))});Lge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Lge.displayName="Info";const DCt=Lge;function Ore(){return Ore=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},Ore.apply(this,arguments)}function ACt(n,e){if(n==null)return{};var t=RCt(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 RCt(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 Dge=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=ACt(n,["color","size"]);return ce.createElement("svg",Ore({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),ce.createElement("polygon",{points:"12 2 2 7 12 12 22 7 12 2"}),ce.createElement("polyline",{points:"2 17 12 22 22 17"}),ce.createElement("polyline",{points:"2 12 12 17 22 12"}))});Dge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Dge.displayName="Layers";const NCt=Dge;function Pre(){return Pre=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},Pre.apply(this,arguments)}function OCt(n,e){if(n==null)return{};var t=PCt(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 PCt(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 Age=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=OCt(n,["color","size"]);return ce.createElement("svg",Pre({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),ce.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),ce.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}))});Age.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Age.displayName="Lock";const MCt=Age;function Mre(){return Mre=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},Mre.apply(this,arguments)}function FCt(n,e){if(n==null)return{};var t=BCt(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 BCt(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 Rge=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=FCt(n,["color","size"]);return ce.createElement("svg",Mre({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),ce.createElement("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),ce.createElement("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),ce.createElement("line",{x1:"3",y1:"18",x2:"21",y2:"18"}))});Rge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Rge.displayName="Menu";const $Ct=Rge;function Fre(){return Fre=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},Fre.apply(this,arguments)}function VCt(n,e){if(n==null)return{};var t=HCt(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 HCt(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 Nge=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=VCt(n,["color","size"]);return ce.createElement("svg",Fre({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),ce.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"}))});Nge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Nge.displayName="MessageSquare";const WCt=Nge;function Bre(){return Bre=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},Bre.apply(this,arguments)}function zCt(n,e){if(n==null)return{};var t=UCt(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 UCt(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 Oge=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=zCt(n,["color","size"]);return ce.createElement("svg",Bre({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),ce.createElement("path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83"}),ce.createElement("path",{d:"M22 12A10 10 0 0 0 12 2v10z"}))});Oge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Oge.displayName="PieChart";const jCt=Oge;function $re(){return $re=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},$re.apply(this,arguments)}function qCt(n,e){if(n==null)return{};var t=GCt(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 GCt(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 Pge=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=qCt(n,["color","size"]);return ce.createElement("svg",$re({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),ce.createElement("circle",{cx:"12",cy:"12",r:"10"}),ce.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),ce.createElement("line",{x1:"8",y1:"12",x2:"16",y2:"12"}))});Pge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Pge.displayName="PlusCircle";const Gd=Pge;function Vre(){return Vre=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},Vre.apply(this,arguments)}function KCt(n,e){if(n==null)return{};var t=YCt(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 YCt(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 Mge=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=KCt(n,["color","size"]);return ce.createElement("svg",Vre({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),ce.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),ce.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))});Mge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Mge.displayName="Plus";const QCt=Mge;function Hre(){return Hre=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},Hre.apply(this,arguments)}function XCt(n,e){if(n==null)return{};var t=ZCt(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 ZCt(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 Fge=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=XCt(n,["color","size"]);return ce.createElement("svg",Hre({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),ce.createElement("polyline",{points:"17 1 21 5 17 9"}),ce.createElement("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),ce.createElement("polyline",{points:"7 23 3 19 7 15"}),ce.createElement("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}))});Fge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Fge.displayName="Repeat";const SH=Fge;function Wre(){return Wre=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},Wre.apply(this,arguments)}function JCt(n,e){if(n==null)return{};var t=ewt(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 ewt(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 Bge=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=JCt(n,["color","size"]);return ce.createElement("svg",Wre({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),ce.createElement("circle",{cx:"12",cy:"12",r:"3"}),ce.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"}))});Bge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Bge.displayName="Settings";const $ge=Bge;function zre(){return zre=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},zre.apply(this,arguments)}function twt(n,e){if(n==null)return{};var t=nwt(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 nwt(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 Vge=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=twt(n,["color","size"]);return ce.createElement("svg",zre({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),ce.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"}),ce.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"}),ce.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"}),ce.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"}),ce.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"}),ce.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"}),ce.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"}),ce.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"}))});Vge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Vge.displayName="Slack";const iwt=Vge;function Ure(){return Ure=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},Ure.apply(this,arguments)}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}var Hge=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=rwt(n,["color","size"]);return ce.createElement("svg",Ure({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),ce.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),ce.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))});Hge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Hge.displayName="Smartphone";const swt=Hge;function jre(){return jre=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},jre.apply(this,arguments)}function awt(n,e){if(n==null)return{};var t=lwt(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 lwt(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 Wge=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=awt(n,["color","size"]);return ce.createElement("svg",jre({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),ce.createElement("polyline",{points:"3 6 5 6 21 6"}),ce.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"}),ce.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),ce.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}))});Wge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Wge.displayName="Trash2";const cwt=Wge;function qre(){return qre=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},qre.apply(this,arguments)}function uwt(n,e){if(n==null)return{};var t=dwt(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 dwt(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 zge=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=uwt(n,["color","size"]);return ce.createElement("svg",qre({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),ce.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"}))});zge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};zge.displayName="Twitter";const hwt=zge;function Gre(){return Gre=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},Gre.apply(this,arguments)}function fwt(n,e){if(n==null)return{};var t=pwt(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 pwt(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 Uge=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=fwt(n,["color","size"]);return ce.createElement("svg",Gre({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),ce.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),ce.createElement("circle",{cx:"9",cy:"7",r:"4"}),ce.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),ce.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}))});Uge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};Uge.displayName="Users";const gwt=Uge;function Kre(){return Kre=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},Kre.apply(this,arguments)}function mwt(n,e){if(n==null)return{};var t=_wt(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 _wt(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 jge=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=mwt(n,["color","size"]);return ce.createElement("svg",Kre({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),ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))});jge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};jge.displayName="X";const qm=jge;function Yre(){return Yre=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},Yre.apply(this,arguments)}function vwt(n,e){if(n==null)return{};var t=bwt(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 bwt(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 qge=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=vwt(n,["color","size"]);return ce.createElement("svg",Yre({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),ce.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"}),ce.createElement("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"}))});qge.propTypes={color:et.string,size:et.oneOfType([et.string,et.number])};qge.displayName="Youtube";const ywt=qge;var e9e={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})()})(e9e);var Cwt=e9e.exports;const zt=nl(Cwt);/**
* 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 t9e={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 Ss(){var t,i,r,o,s;const n=Va();return((r=(i=(t=Nc(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)||t9e.accent}var Af=function(){return Af=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},Af.apply(this,arguments)};function yR(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 CR(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 nTe(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 MD(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 wwt(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var al="-ms-",XP="-moz-",qs="-webkit-",n9e="comm",Zj="rule",Gge="decl",Swt="@import",i9e="@keyframes",Ewt="@layer",xwt=Math.abs,Kge=String.fromCharCode,Qre=Object.assign;function Twt(n,e){return Vu(n,0)^45?(((e<<2^Vu(n,0))<<2^Vu(n,1))<<2^Vu(n,2))<<2^Vu(n,3):0}function r9e(n){return n.trim()}function ay(n,e){return(n=e.exec(n))?n[0]:n}function Eo(n,e,t){return n.replace(e,t)}function g$(n,e){return n.indexOf(e)}function Vu(n,e){return n.charCodeAt(e)|0}function FD(n,e,t){return n.slice(e,t)}function tb(n){return n.length}function o9e(n){return n.length}function sP(n,e){return e.push(n),n}function kwt(n,e){return n.map(e).join("")}function iTe(n,e){return n.filter(function(t){return!ay(t,e)})}var Jj=1,BD=1,s9e=0,Nm=0,zc=0,wR="";function eq(n,e,t,i,r,o,s,a){return{value:n,root:e,parent:t,type:i,props:r,children:o,line:Jj,column:BD,length:s,return:"",siblings:a}}function pC(n,e){return Qre(eq("",null,null,"",null,null,0,n.siblings),n,{length:-n.length},e)}function PI(n){for(;n.root;)n=pC(n.root,{children:[n]});sP(n,n.siblings)}function Iwt(){return zc}function Lwt(){return zc=Nm>0?Vu(wR,--Nm):0,BD--,zc===10&&(BD=1,Jj--),zc}function sv(){return zc=Nm<s9e?Vu(wR,Nm++):0,BD++,zc===10&&(BD=1,Jj++),zc}function tT(){return Vu(wR,Nm)}function m$(){return Nm}function tq(n,e){return FD(wR,n,e)}function Xre(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 Dwt(n){return Jj=BD=1,s9e=tb(wR=n),Nm=0,[]}function Awt(n){return wR="",n}function LZ(n){return r9e(tq(Nm-1,Zre(n===91?n+2:n===40?n+1:n)))}function Rwt(n){for(;(zc=tT())&&zc<33;)sv();return Xre(n)>2||Xre(zc)>3?"":" "}function Nwt(n,e){for(;--e&&sv()&&!(zc<48||zc>102||zc>57&&zc<65||zc>70&&zc<97););return tq(n,m$()+(e<6&&tT()==32&&sv()==32))}function Zre(n){for(;sv();)switch(zc){case n:return Nm;case 34:case 39:n!==34&&n!==39&&Zre(zc);break;case 40:n===41&&Zre(n);break;case 92:sv();break}return Nm}function Owt(n,e){for(;sv()&&n+zc!==47+10;)if(n+zc===42+42&&tT()===47)break;return"/*"+tq(e,Nm-1)+"*"+Kge(n===47?n:sv())}function Pwt(n){for(;!Xre(tT());)sv();return tq(n,Nm)}function Mwt(n){return Awt(_$("",null,null,null,[""],n=Dwt(n),0,[0],n))}function _$(n,e,t,i,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,m=1,v=1,_=1,b=0,y="",C=r,E=o,x=i,k=y;v;)switch(g=b,b=sv()){case 40:if(g!=108&&Vu(k,d-1)==58){g$(k+=Eo(LZ(b),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:k+=LZ(b);break;case 9:case 10:case 13:case 32:k+=Rwt(g);break;case 92:k+=Nwt(m$()-1,7);continue;case 47:switch(tT()){case 42:case 47:sP(Fwt(Owt(sv(),m$()),e,t,l),l);break;default:k+="/"}break;case 123*m:a[c++]=tb(k)*_;case 125*m:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+u:_==-1&&(k=Eo(k,/\f/g,"")),f>0&&tb(k)-d&&sP(f>32?oTe(k+";",i,t,d-1,l):oTe(Eo(k," ","")+";",i,t,d-2,l),l);break;case 59:k+=";";default:if(sP(x=rTe(k,e,t,c,u,r,a,y,C=[],E=[],d,o),o),b===123)if(u===0)_$(k,e,x,x,C,o,d,a,E);else switch(h===99&&Vu(k,3)===110?100:h){case 100:case 108:case 109:case 115:_$(n,x,x,i&&sP(rTe(n,x,x,0,0,r,a,y,r,C=[],d,E),E),r,E,d,a,i?C:E);break;default:_$(k,x,x,x,[""],E,0,a,E)}}c=u=f=0,m=_=1,y=k="",d=s;break;case 58:d=1+tb(k),f=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&Lwt()==125)continue}switch(k+=Kge(b),b*m){case 38:_=u>0?1:(k+="\f",-1);break;case 44:a[c++]=(tb(k)-1)*_,_=1;break;case 64:tT()===45&&(k+=LZ(sv())),h=tT(),u=d=tb(y=k+=Pwt(m$())),b++;break;case 45:g===45&&tb(k)==2&&(m=0)}}return o}function rTe(n,e,t,i,r,o,s,a,l,c,u,d){for(var h=r-1,f=r===0?o:[""],g=o9e(f),m=0,v=0,_=0;m<i;++m)for(var b=0,y=FD(n,h+1,h=xwt(v=s[m])),C=n;b<g;++b)(C=r9e(v>0?f[b]+" "+y:Eo(y,/&\f/g,f[b])))&&(l[_++]=C);return eq(n,e,t,r===0?Zj:a,l,c,u,d)}function Fwt(n,e,t,i){return eq(n,e,t,n9e,Kge(Iwt()),FD(n,2,-2),0,i)}function oTe(n,e,t,i,r){return eq(n,e,t,Gge,FD(n,0,i),FD(n,i+1,-1),i,r)}function a9e(n,e,t){switch(Twt(n,e)){case 5103:return qs+"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 qs+n+n;case 4789:return XP+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return qs+n+XP+n+al+n+n;case 5936:switch(Vu(n,e+11)){case 114:return qs+n+al+Eo(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return qs+n+al+Eo(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return qs+n+al+Eo(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return qs+n+al+n+n;case 6165:return qs+n+al+"flex-"+n+n;case 5187:return qs+n+Eo(n,/(\w+).+(:[^]+)/,qs+"box-$1$2"+al+"flex-$1$2")+n;case 5443:return qs+n+al+"flex-item-"+Eo(n,/flex-|-self/g,"")+(ay(n,/flex-|baseline/)?"":al+"grid-row-"+Eo(n,/flex-|-self/g,""))+n;case 4675:return qs+n+al+"flex-line-pack"+Eo(n,/align-content|flex-|-self/g,"")+n;case 5548:return qs+n+al+Eo(n,"shrink","negative")+n;case 5292:return qs+n+al+Eo(n,"basis","preferred-size")+n;case 6060:return qs+"box-"+Eo(n,"-grow","")+qs+n+al+Eo(n,"grow","positive")+n;case 4554:return qs+Eo(n,/([^-])(transform)/g,"$1"+qs+"$2")+n;case 6187:return Eo(Eo(Eo(n,/(zoom-|grab)/,qs+"$1"),/(image-set)/,qs+"$1"),n,"")+n;case 5495:case 3959:return Eo(n,/(image-set\([^]*)/,qs+"$1$`$1");case 4968:return Eo(Eo(n,/(.+:)(flex-)?(.*)/,qs+"box-pack:$3"+al+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+qs+n+n;case 4200:if(!ay(n,/flex-|baseline/))return al+"grid-column-align"+FD(n,e)+n;break;case 2592:case 3360:return al+Eo(n,"template-","")+n;case 4384:case 3616:return t&&t.some(function(i,r){return e=r,ay(i.props,/grid-\w+-end/)})?~g$(n+(t=t[e].value),"span")?n:al+Eo(n,"-start","")+n+al+"grid-row-span:"+(~g$(t,"span")?ay(t,/\d+/):+ay(t,/\d+/)-+ay(n,/\d+/))+";":al+Eo(n,"-start","")+n;case 4896:case 4128:return t&&t.some(function(i){return ay(i.props,/grid-\w+-start/)})?n:al+Eo(Eo(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return Eo(n,/(.+)-inline(.+)/,qs+"$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(tb(n)-1-e>6)switch(Vu(n,e+1)){case 109:if(Vu(n,e+4)!==45)break;case 102:return Eo(n,/(.+:)(.+)-([^]+)/,"$1"+qs+"$2-$3$1"+XP+(Vu(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~g$(n,"stretch")?a9e(Eo(n,"stretch","fill-available"),e,t)+n:n}break;case 5152:case 5920:return Eo(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(i,r,o,s,a,l,c){return al+r+":"+o+c+(s?al+r+"-span:"+(a?l:+l-+o)+c:"")+n});case 4949:if(Vu(n,e+6)===121)return Eo(n,":",":"+qs)+n;break;case 6444:switch(Vu(n,Vu(n,14)===45?18:11)){case 120:return Eo(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+qs+(Vu(n,14)===45?"inline-":"")+"box$3$1"+qs+"$2$3$1"+al+"$2box$3")+n;case 100:return Eo(n,":",":"+al)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Eo(n,"scroll-","scroll-snap-")+n}return n}function EH(n,e){for(var t="",i=0;i<n.length;i++)t+=e(n[i],i,n,e)||"";return t}function Bwt(n,e,t,i){switch(n.type){case Ewt:if(n.children.length)break;case Swt:case Gge:return n.return=n.return||n.value;case n9e:return"";case i9e:return n.return=n.value+"{"+EH(n.children,i)+"}";case Zj:if(!tb(n.value=n.props.join(",")))return""}return tb(t=EH(n.children,i))?n.return=n.value+"{"+t+"}":""}function $wt(n){var e=o9e(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 Vwt(n){return function(e){e.root||(e=e.return)&&n(e)}}function Hwt(n,e,t,i){if(n.length>-1&&!n.return)switch(n.type){case Gge:n.return=a9e(n.value,n.length,t);return;case i9e:return EH([pC(n,{value:Eo(n.value,"@","@"+qs)})],i);case Zj:if(n.length)return kwt(t=n.props,function(r){switch(ay(r,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":PI(pC(n,{props:[Eo(r,/:(read-\w+)/,":"+XP+"$1")]})),PI(pC(n,{props:[r]})),Qre(n,{props:iTe(t,i)});break;case"::placeholder":PI(pC(n,{props:[Eo(r,/:(plac\w+)/,":"+qs+"input-$1")]})),PI(pC(n,{props:[Eo(r,/:(plac\w+)/,":"+XP+"$1")]})),PI(pC(n,{props:[Eo(r,/:(plac\w+)/,al+"input-$1")]})),PI(pC(n,{props:[r]})),Qre(n,{props:iTe(t,i)});break}return""})}}var l9e={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},$D=typeof process<"u"&&process.env!==void 0&&({}.REACT_APP_SC_ATTR||{}.SC_ATTR)||"data-styled",Yge=typeof window<"u"&&"HTMLElement"in window,Wwt=!!(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),nq=Object.freeze([]),VD=Object.freeze({});function zwt(n,e,t){return t===void 0&&(t=VD),n.theme!==t.theme&&n.theme||e||t.theme}var c9e=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"]),Uwt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,jwt=/(^-|-$)/g;function sTe(n){return n.replace(Uwt,"-").replace(jwt,"")}var qwt=/(a)(d)/gi,aTe=function(n){return String.fromCharCode(n+(n>25?39:97))};function Jre(n){var e,t="";for(e=Math.abs(n);e>52;e=e/52|0)t=aTe(e%52)+t;return(aTe(e%52)+t).replace(qwt,"$1-$2")}var DZ,U2=function(n,e){for(var t=e.length;t;)n=33*n^e.charCodeAt(--t);return n},u9e=function(n){return U2(5381,n)};function Gwt(n){return Jre(u9e(n)>>>0)}function Kwt(n){return n.displayName||n.name||"Component"}function AZ(n){return typeof n=="string"&&!0}var d9e=typeof Symbol=="function"&&Symbol.for,h9e=d9e?Symbol.for("react.memo"):60115,Ywt=d9e?Symbol.for("react.forward_ref"):60112,Qwt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Xwt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},f9e={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Zwt=((DZ={})[Ywt]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},DZ[h9e]=f9e,DZ);function lTe(n){return("type"in(e=n)&&e.type.$$typeof)===h9e?f9e:"$$typeof"in n?Zwt[n.$$typeof]:Qwt;var e}var Jwt=Object.defineProperty,eSt=Object.getOwnPropertyNames,cTe=Object.getOwnPropertySymbols,tSt=Object.getOwnPropertyDescriptor,nSt=Object.getPrototypeOf,uTe=Object.prototype;function p9e(n,e,t){if(typeof e!="string"){if(uTe){var i=nSt(e);i&&i!==uTe&&p9e(n,i,t)}var r=eSt(e);cTe&&(r=r.concat(cTe(e)));for(var o=lTe(n),s=lTe(e),a=0;a<r.length;++a){var l=r[a];if(!(l in Xwt||t&&t[l]||s&&l in s||o&&l in o)){var c=tSt(e,l);try{Jwt(n,l,c)}catch{}}}}return n}function HD(n){return typeof n=="function"}function Qge(n){return typeof n=="object"&&"styledComponentId"in n}function Ox(n,e){return n&&e?"".concat(n," ").concat(e):n||e||""}function dTe(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 O4(n){return n!==null&&typeof n=="object"&&n.constructor.name===Object.name&&!("props"in n&&n.$$typeof)}function eoe(n,e,t){if(t===void 0&&(t=!1),!t&&!O4(n)&&!Array.isArray(n))return e;if(Array.isArray(e))for(var i=0;i<e.length;i++)n[i]=eoe(n[i],e[i]);else if(O4(e))for(var i in e)n[i]=eoe(n[i],e[i]);return n}function Xge(n,e){Object.defineProperty(n,"toString",{value:e})}function bF(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 iSt=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 bF(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}(),v$=new Map,xH=new Map,RZ=1,y8=function(n){if(v$.has(n))return v$.get(n);for(;xH.has(RZ);)RZ++;var e=RZ++;return v$.set(n,e),xH.set(e,n),e},rSt=function(n,e){v$.set(n,e),xH.set(e,n)},oSt="style[".concat($D,"][").concat("data-styled-version",'="').concat("6.1.0",'"]'),sSt=new RegExp("^".concat($D,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),aSt=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)},lSt=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(sSt);if(l){var c=0|parseInt(l[1],10),u=l[2];c!==0&&(rSt(u,c),aSt(n,u,l[3]),n.getTag().insertRules(c,r)),r.length=0}else r.push(a)}}};function cSt(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var g9e=function(n){var e=document.head,t=n||e,i=document.createElement("style"),r=function(a){var l=Array.from(a.querySelectorAll("style[".concat($D,"]")));return l[l.length-1]}(t),o=r!==void 0?r.nextSibling:null;i.setAttribute($D,"active"),i.setAttribute("data-styled-version","6.1.0");var s=cSt();return s&&i.setAttribute("nonce",s),t.insertBefore(i,o),i},uSt=function(){function n(e){this.element=g9e(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 bF(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}(),dSt=function(){function n(e){this.element=g9e(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}(),hSt=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}(),hTe=Yge,fSt={isServer:!Yge,useCSSOMInjection:!Wwt},m9e=function(){function n(e,t,i){e===void 0&&(e=VD),t===void 0&&(t={});var r=this;this.options=Af(Af({},fSt),e),this.gs=t,this.names=new Map(i),this.server=!!e.isServer,!this.server&&Yge&&hTe&&(hTe=!1,function(o){for(var s=document.querySelectorAll(oSt),a=0,l=s.length;a<l;a++){var c=s[a];c&&c.getAttribute($D)!=="active"&&(lSt(o,c),c.parentNode&&c.parentNode.removeChild(c))}}(this)),Xge(this,function(){return function(o){for(var s=o.getTag(),a=s.length,l="",c=function(d){var h=function(_){return xH.get(_)}(d);if(h===void 0)return"continue";var f=o.names.get(h),g=s.getGroup(d);if(f===void 0||g.length===0)return"continue";var m="".concat($D,".g").concat(d,'[id="').concat(h,'"]'),v="";f!==void 0&&f.forEach(function(_){_.length>0&&(v+="".concat(_,","))}),l+="".concat(g).concat(m,'{content:"').concat(v,'"}').concat(`/*!sc*/
`)},u=0;u<a;u++)c(u);return l}(r)})}return n.registerId=function(e){return y8(e)},n.prototype.reconstructWithOptions=function(e,t){return t===void 0&&(t=!0),new n(Af(Af({},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 hSt(r):i?new uSt(r):new dSt(r)}(this.options),new iSt(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(y8(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(y8(e),i)},n.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},n.prototype.clearRules=function(e){this.getTag().clearGroup(y8(e)),this.clearNames(e)},n.prototype.clearTag=function(){this.tag=void 0},n}(),pSt=/&/g,gSt=/^\s*\/\/.*$/gm;function _9e(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=_9e(t.children,e)),t})}function mSt(n){var e,t,i,r=n===void 0?VD:n,o=r.options,s=o===void 0?VD:o,a=r.plugins,l=a===void 0?nq:a,c=function(h,f,g){return g===t||g.startsWith(t)&&g.endsWith(t)&&g.replaceAll(t,"").length>0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===Zj&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(pSt,t).replace(i,c))}),s.prefix&&u.push(Hwt),u.push(Bwt);var d=function(h,f,g,m){f===void 0&&(f=""),g===void 0&&(g=""),m===void 0&&(m="&"),e=m,t=f,i=new RegExp("\\".concat(t,"\\b"),"g");var v=h.replace(gSt,""),_=Mwt(g||f?"".concat(g," ").concat(f," { ").concat(v," }"):v);s.namespace&&(_=_9e(_,s.namespace));var b=[];return EH(_,$wt(u.concat(Vwt(function(y){return b.push(y)})))),b};return d.hash=l.length?l.reduce(function(h,f){return f.name||bF(15),U2(h,f.name)},5381).toString():"",d}var _St=new m9e,toe=mSt(),v9e=ce.createContext({shouldForwardProp:void 0,styleSheet:_St,stylis:toe});v9e.Consumer;ce.createContext(void 0);function fTe(){return w.useContext(v9e)}var vSt=function(){function n(e,t){var i=this;this.inject=function(r,o){o===void 0&&(o=toe);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,Xge(this,function(){throw bF(12,String(i.name))})}return n.prototype.getName=function(e){return e===void 0&&(e=toe),this.name+e.hash},n}(),bSt=function(n){return n>="A"&&n<="Z"};function pTe(n){for(var e="",t=0;t<n.length;t++){var i=n[t];if(t===1&&i==="-"&&n[0]==="-")return n;bSt(i)?e+="-"+i.toLowerCase():e+=i}return e.startsWith("ms-")?"-"+e:e}var b9e=function(n){return n==null||n===!1||n===""},y9e=function(n){var e,t,i=[];for(var r in n){var o=n[r];n.hasOwnProperty(r)&&!b9e(o)&&(Array.isArray(o)&&o.isCss||HD(o)?i.push("".concat(pTe(r),":"),o,";"):O4(o)?i.push.apply(i,MD(MD(["".concat(r," {")],y9e(o),!1),["}"],!1)):i.push("".concat(pTe(r),": ").concat((e=r,(t=o)==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in l9e||e.startsWith("--")?String(t).trim():"".concat(t,"px")),";")))}return i};function nT(n,e,t,i){if(b9e(n))return[];if(Qge(n))return[".".concat(n.styledComponentId)];if(HD(n)){if(!HD(o=n)||o.prototype&&o.prototype.isReactComponent||!e)return[n];var r=n(e);return nT(r,e,t,i)}var o;return n instanceof vSt?t?(n.inject(t,i),[n.getName(i)]):[n]:O4(n)?y9e(n):Array.isArray(n)?Array.prototype.concat.apply(nq,n.map(function(s){return nT(s,e,t,i)})):[n.toString()]}function ySt(n){for(var e=0;e<n.length;e+=1){var t=n[e];if(HD(t)&&!Qge(t))return!1}return!0}var CSt=u9e("6.1.0"),wSt=function(){function n(e,t,i){this.rules=e,this.staticRulesId="",this.isStatic=(i===void 0||i.isStatic)&&ySt(e),this.componentId=t,this.baseHash=U2(CSt,t),this.baseStyle=i,m9e.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=Ox(r,this.staticRulesId);else{var o=dTe(nT(this.rules,e,t,i)),s=Jre(U2(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=Ox(r,s),this.staticRulesId=s}else{for(var l=U2(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=dTe(nT(d,e,t,i));l=U2(l,h+u),c+=h}}if(c){var f=Jre(l>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,i(c,".".concat(f),void 0,this.componentId)),r=Ox(r,f)}}return r},n}(),C9e=ce.createContext(void 0);C9e.Consumer;var NZ={};function SSt(n,e,t){var i=Qge(n),r=n,o=!AZ(n),s=e.attrs,a=s===void 0?nq:s,l=e.componentId,c=l===void 0?function(y,C){var E=typeof y!="string"?"sc":sTe(y);NZ[E]=(NZ[E]||0)+1;var x="".concat(E,"-").concat(Gwt("6.1.0"+E+NZ[E]));return C?"".concat(C,"-").concat(x):x}(e.displayName,e.parentComponentId):l,u=e.displayName;u===void 0&&function(y){return AZ(y)?"styled.".concat(y):"Styled(".concat(Kwt(y),")")}(n);var d=e.displayName&&e.componentId?"".concat(sTe(e.displayName),"-").concat(e.componentId):e.componentId||c,h=i&&r.attrs?r.attrs.concat(a).filter(Boolean):a,f=e.shouldForwardProp;if(i&&r.shouldForwardProp){var g=r.shouldForwardProp;if(e.shouldForwardProp){var m=e.shouldForwardProp;f=function(y,C){return g(y,C)&&m(y,C)}}else f=g}var v=new wSt(t,d,i?r.componentStyle:void 0);function _(y,C){return function(E,x,k){var L=E.attrs,D=E.componentStyle,A=E.defaultProps,N=E.foldedComponentIds,P=E.styledComponentId,M=E.target,B=ce.useContext(C9e),F=fTe(),U=E.shouldForwardProp||F.shouldForwardProp,H=function(Q,Ne,Ve){for(var Ye,ye=Af(Af({},Ne),{className:void 0,theme:Ve}),He=0;He<Q.length;He+=1){var Pe=HD(Ye=Q[He])?Ye(ye):Ye;for(var Ge in Pe)ye[Ge]=Ge==="className"?Ox(ye[Ge],Pe[Ge]):Ge==="style"?Af(Af({},ye[Ge]),Pe[Ge]):Pe[Ge]}return Ne.className&&(ye.className=Ox(ye.className,Ne.className)),ye}(L,x,zwt(x,B,A)||VD),W=H.as||M,q={};for(var V in H)H[V]===void 0||V[0]==="$"||V==="as"||V==="theme"||(V==="forwardedAs"?q.as=H.forwardedAs:U&&!U(V,W)||(q[V]=H[V]));var re=function(Q,Ne){var Ve=fTe(),Ye=Q.generateAndInjectStyles(Ne,Ve.styleSheet,Ve.stylis);return Ye}(D,H),oe=Ox(N,P);return re&&(oe+=" "+re),H.className&&(oe+=" "+H.className),q[AZ(W)&&!c9e.has(W)?"class":"className"]=oe,q.ref=k,w.createElement(W,q)}(b,y,C)}var b=ce.forwardRef(_);return b.attrs=h,b.componentStyle=v,b.shouldForwardProp=f,b.foldedComponentIds=i?Ox(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 E=[],x=1;x<arguments.length;x++)E[x-1]=arguments[x];for(var k=0,L=E;k<L.length;k++)eoe(C,L[k],!0);return C}({},r.defaultProps,y):y}}),Xge(b,function(){return".".concat(b.styledComponentId)}),o&&p9e(b,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),b}function gTe(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 mTe=function(n){return Object.assign(n,{isCss:!0})};function ESt(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(HD(n)||O4(n)){var i=n;return mTe(nT(gTe(nq,MD([i],e,!0))))}var r=n;return e.length===0&&r.length===1&&typeof r[0]=="string"?nT(r):mTe(nT(gTe(r,e)))}function noe(n,e,t){if(t===void 0&&(t=VD),!e)throw bF(1,e);var i=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return n(e,t,ESt.apply(void 0,MD([r],o,!1)))};return i.attrs=function(r){return noe(n,e,Af(Af({},t),{attrs:Array.prototype.concat(t.attrs,r).filter(Boolean)}))},i.withConfig=function(r){return noe(n,e,Af(Af({},t),r))},i}var w9e=function(n){return noe(SSt,n)},rl=w9e;c9e.forEach(function(n){rl[n]=w9e(n)});const xSt={type:"primary",behavior:"submit"},TSt=rl(k1)`
color: ${n=>n.theme.color} !important;
background-color: ${n=>n.theme.backgroundColor} !important;
border-color: ${n=>n.theme.borderColor} !important;
`,kSt=rl.button`
color: ${n=>n.theme.color} !important;
background-color: ${n=>n.theme.backgroundColor} !important;
border-color: ${n=>n.theme.borderColor} !important;
`;function un(n){n={...xSt,...n};const e=si(),t=Ss(),i={backgroundColor:n.type==="primary"?t:n.noBackgroundColor?"transparent":"white",color:n.type!=="primary"&&n.type!=="secondary"?t:""};return n.to?p(TSt,{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:zt(`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?p(ds,{variant:"light"}):n.children}):p(kSt,{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:zt(`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?p(ds,{variant:"light"}):n.children})}const ISt=rl.input`
background-color: ${n=>n.theme.backgroundColor};
`;function Oh(n){const e=si();return O("div",{className:"relative flex items-start",children:[p("div",{className:"flex items-center h-5",children:p(ISt,{theme:{backgroundColor:e.$2},ref:n.innerRef,value:n.value,id:n.id,"aria-describedby":"comments-description",type:"checkbox",className:zt("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})}),p("div",{className:"ml-3 text-sm",children:p("label",{htmlFor:n.id,className:"font-medium cursor-pointer",style:{color:e.$3},children:n.label})})]})}function LSt(){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 Rk(n){var e=LSt();return function(){var i=Rm(n),r;if(e){var o=Rm(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return dR(this,r)}}var Hf="top",Om="bottom",Pm="right",Wf="left",Zge="auto",yF=[Hf,Om,Pm,Wf],WD="start",P4="end",DSt="clippingParents",S9e="viewport",JN="popper",ASt="reference",_Te=yF.reduce(function(n,e){return n.concat([e+"-"+WD,e+"-"+P4])},[]),E9e=[].concat(yF,[Zge]).reduce(function(n,e){return n.concat([e,e+"-"+WD,e+"-"+P4])},[]),RSt="beforeRead",NSt="read",OSt="afterRead",PSt="beforeMain",MSt="main",FSt="afterMain",BSt="beforeWrite",$St="write",VSt="afterWrite",HSt=[RSt,NSt,OSt,PSt,MSt,FSt,BSt,$St,VSt];function e0(n){return n?(n.nodeName||"").toLowerCase():null}function fg(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function NT(n){var e=fg(n).Element;return n instanceof e||n instanceof Element}function Cm(n){var e=fg(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Jge(n){if(typeof ShadowRoot>"u")return!1;var e=fg(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function WSt(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];!Cm(o)||!e0(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 zSt(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},{});!Cm(r)||!e0(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}const eme={name:"applyStyles",enabled:!0,phase:"write",fn:WSt,effect:zSt,requires:["computeStyles"]};function qb(n){return n.split("-")[0]}var iT=Math.max,TH=Math.min,zD=Math.round;function ioe(){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 x9e(){return!/^((?!chrome|android).)*safari/i.test(ioe())}function UD(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),r=1,o=1;e&&Cm(n)&&(r=n.offsetWidth>0&&zD(i.width)/n.offsetWidth||1,o=n.offsetHeight>0&&zD(i.height)/n.offsetHeight||1);var s=NT(n)?fg(n):window,a=s.visualViewport,l=!x9e()&&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 tme(n){var e=UD(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 T9e(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Jge(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function f1(n){return fg(n).getComputedStyle(n)}function USt(n){return["table","td","th"].indexOf(e0(n))>=0}function jS(n){return((NT(n)?n.ownerDocument:n.document)||window.document).documentElement}function iq(n){return e0(n)==="html"?n:n.assignedSlot||n.parentNode||(Jge(n)?n.host:null)||jS(n)}function vTe(n){return!Cm(n)||f1(n).position==="fixed"?null:n.offsetParent}function jSt(n){var e=/firefox/i.test(ioe()),t=/Trident/i.test(ioe());if(t&&Cm(n)){var i=f1(n);if(i.position==="fixed")return null}var r=iq(n);for(Jge(r)&&(r=r.host);Cm(r)&&["html","body"].indexOf(e0(r))<0;){var o=f1(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 CF(n){for(var e=fg(n),t=vTe(n);t&&USt(t)&&f1(t).position==="static";)t=vTe(t);return t&&(e0(t)==="html"||e0(t)==="body"&&f1(t).position==="static")?e:t||jSt(n)||e}function nme(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function ZP(n,e,t){return iT(n,TH(e,t))}function qSt(n,e,t){var i=ZP(n,e,t);return i>t?t:i}function k9e(){return{top:0,right:0,bottom:0,left:0}}function I9e(n){return Object.assign({},k9e(),n)}function L9e(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var GSt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,I9e(typeof e!="number"?e:L9e(e,yF))};function KSt(n){var e,t=n.state,i=n.name,r=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=qb(t.placement),l=nme(a),c=[Wf,Pm].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=GSt(r.padding,t),h=tme(o),f=l==="y"?Hf:Wf,g=l==="y"?Om:Pm,m=t.rects.reference[u]+t.rects.reference[l]-s[l]-t.rects.popper[u],v=s[l]-t.rects.reference[l],_=CF(o),b=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,y=m/2-v/2,C=d[f],E=b-h[u]-d[g],x=b/2-h[u]/2+y,k=ZP(C,x,E),L=l;t.modifiersData[i]=(e={},e[L]=k,e.centerOffset=k-x,e)}}function YSt(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)||T9e(e.elements.popper,r)&&(e.elements.arrow=r))}const QSt={name:"arrow",enabled:!0,phase:"main",fn:KSt,effect:YSt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jD(n){return n.split("-")[1]}var XSt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ZSt(n,e){var t=n.x,i=n.y,r=e.devicePixelRatio||1;return{x:zD(t*r)/r||0,y:zD(i*r)/r||0}}function bTe(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,f=h===void 0?0:h,g=s.y,m=g===void 0?0:g,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var _=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=Wf,C=Hf,E=window;if(c){var x=CF(t),k="clientHeight",L="clientWidth";if(x===fg(t)&&(x=jS(t),f1(x).position!=="static"&&a==="absolute"&&(k="scrollHeight",L="scrollWidth")),x=x,r===Hf||(r===Wf||r===Pm)&&o===P4){C=Om;var D=d&&x===E&&E.visualViewport?E.visualViewport.height:x[k];m-=D-i.height,m*=l?1:-1}if(r===Wf||(r===Hf||r===Om)&&o===P4){y=Pm;var A=d&&x===E&&E.visualViewport?E.visualViewport.width:x[L];f-=A-i.width,f*=l?1:-1}}var N=Object.assign({position:a},c&&XSt),P=u===!0?ZSt({x:f,y:m},fg(t)):{x:f,y:m};if(f=P.x,m=P.y,l){var M;return Object.assign({},N,(M={},M[C]=b?"0":"",M[y]=_?"0":"",M.transform=(E.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",M))}return Object.assign({},N,(e={},e[C]=b?m+"px":"",e[y]=_?f+"px":"",e.transform="",e))}function JSt(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:qb(e.placement),variation:jD(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,bTe(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,bTe(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 eEt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JSt,data:{}};var C8={passive:!0};function tEt(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=fg(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,C8)}),a&&l.addEventListener("resize",t.update,C8),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,C8)}),a&&l.removeEventListener("resize",t.update,C8)}}const nEt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:tEt,data:{}};var iEt={left:"right",right:"left",bottom:"top",top:"bottom"};function b$(n){return n.replace(/left|right|bottom|top/g,function(e){return iEt[e]})}var rEt={start:"end",end:"start"};function yTe(n){return n.replace(/start|end/g,function(e){return rEt[e]})}function ime(n){var e=fg(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function rme(n){return UD(jS(n)).left+ime(n).scrollLeft}function oEt(n,e){var t=fg(n),i=jS(n),r=t.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=x9e();(c||!c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+rme(n),y:l}}function sEt(n){var e,t=jS(n),i=ime(n),r=(e=n.ownerDocument)==null?void 0:e.body,o=iT(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=iT(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+rme(n),l=-i.scrollTop;return f1(r||t).direction==="rtl"&&(a+=iT(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function ome(n){var e=f1(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function D9e(n){return["html","body","#document"].indexOf(e0(n))>=0?n.ownerDocument.body:Cm(n)&&ome(n)?n:D9e(iq(n))}function JP(n,e){var t;e===void 0&&(e=[]);var i=D9e(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),o=fg(i),s=r?[o].concat(o.visualViewport||[],ome(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(JP(iq(s)))}function roe(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function aEt(n,e){var t=UD(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 CTe(n,e,t){return e===S9e?roe(oEt(n,t)):NT(e)?aEt(e,t):roe(sEt(jS(n)))}function lEt(n){var e=JP(iq(n)),t=["absolute","fixed"].indexOf(f1(n).position)>=0,i=t&&Cm(n)?CF(n):n;return NT(i)?e.filter(function(r){return NT(r)&&T9e(r,i)&&e0(r)!=="body"}):[]}function cEt(n,e,t,i){var r=e==="clippingParents"?lEt(n):[].concat(e),o=[].concat(r,[t]),s=o[0],a=o.reduce(function(l,c){var u=CTe(n,c,i);return l.top=iT(u.top,l.top),l.right=TH(u.right,l.right),l.bottom=TH(u.bottom,l.bottom),l.left=iT(u.left,l.left),l},CTe(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 A9e(n){var e=n.reference,t=n.element,i=n.placement,r=i?qb(i):null,o=i?jD(i):null,s=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(r){case Hf:l={x:s,y:e.y-t.height};break;case Om:l={x:s,y:e.y+e.height};break;case Pm:l={x:e.x+e.width,y:a};break;case Wf:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=r?nme(r):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case WD:l[c]=l[c]-(e[u]/2-t[u]/2);break;case P4:l[c]=l[c]+(e[u]/2-t[u]/2);break}}return l}function M4(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?DSt:a,c=t.rootBoundary,u=c===void 0?S9e:c,d=t.elementContext,h=d===void 0?JN:d,f=t.altBoundary,g=f===void 0?!1:f,m=t.padding,v=m===void 0?0:m,_=I9e(typeof v!="number"?v:L9e(v,yF)),b=h===JN?ASt:JN,y=n.rects.popper,C=n.elements[g?b:h],E=cEt(NT(C)?C:C.contextElement||jS(n.elements.popper),l,u,s),x=UD(n.elements.reference),k=A9e({reference:x,element:y,strategy:"absolute",placement:r}),L=roe(Object.assign({},y,k)),D=h===JN?L:x,A={top:E.top-D.top+_.top,bottom:D.bottom-E.bottom+_.bottom,left:E.left-D.left+_.left,right:D.right-E.right+_.right},N=n.modifiersData.offset;if(h===JN&&N){var P=N[r];Object.keys(A).forEach(function(M){var B=[Pm,Om].indexOf(M)>=0?1:-1,F=[Hf,Om].indexOf(M)>=0?"y":"x";A[M]+=P[F]*B})}return A}function uEt(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?E9e:l,u=jD(i),d=u?a?_Te:_Te.filter(function(g){return jD(g)===u}):yF,h=d.filter(function(g){return c.indexOf(g)>=0});h.length===0&&(h=d);var f=h.reduce(function(g,m){return g[m]=M4(n,{placement:m,boundary:r,rootBoundary:o,padding:s})[qb(m)],g},{});return Object.keys(f).sort(function(g,m){return f[g]-f[m]})}function dEt(n){if(qb(n)===Zge)return[];var e=b$(n);return[yTe(n),e,yTe(e)]}function hEt(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,f=t.flipVariations,g=f===void 0?!0:f,m=t.allowedAutoPlacements,v=e.options.placement,_=qb(v),b=_===v,y=l||(b||!g?[b$(v)]:dEt(v)),C=[v].concat(y).reduce(function(Ne,Ve){return Ne.concat(qb(Ve)===Zge?uEt(e,{placement:Ve,boundary:u,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:m}):Ve)},[]),E=e.rects.reference,x=e.rects.popper,k=new Map,L=!0,D=C[0],A=0;A<C.length;A++){var N=C[A],P=qb(N),M=jD(N)===WD,B=[Hf,Om].indexOf(P)>=0,F=B?"width":"height",U=M4(e,{placement:N,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),H=B?M?Pm:Wf:M?Om:Hf;E[F]>x[F]&&(H=b$(H));var W=b$(H),q=[];if(o&&q.push(U[P]<=0),a&&q.push(U[H]<=0,U[W]<=0),q.every(function(Ne){return Ne})){D=N,L=!1;break}k.set(N,q)}if(L)for(var V=g?3:1,re=function(Ve){var Ye=C.find(function(ye){var He=k.get(ye);if(He)return He.slice(0,Ve).every(function(Pe){return Pe})});if(Ye)return D=Ye,"break"},oe=V;oe>0;oe--){var Q=re(oe);if(Q==="break")break}e.placement!==D&&(e.modifiersData[i]._skip=!0,e.placement=D,e.reset=!0)}}const fEt={name:"flip",enabled:!0,phase:"main",fn:hEt,requiresIfExists:["offset"],data:{_skip:!1}};function wTe(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 STe(n){return[Hf,Pm,Om,Wf].some(function(e){return n[e]>=0})}function pEt(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=M4(e,{elementContext:"reference"}),a=M4(e,{altBoundary:!0}),l=wTe(s,i),c=wTe(a,r,o),u=STe(l),d=STe(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 gEt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pEt};function mEt(n,e,t){var i=qb(n),r=[Wf,Hf].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,[Wf,Pm].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function _Et(n){var e=n.state,t=n.options,i=n.name,r=t.offset,o=r===void 0?[0,0]:r,s=E9e.reduce(function(u,d){return u[d]=mEt(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 vEt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_Et};function bEt(n){var e=n.state,t=n.name;e.modifiersData[t]=A9e({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const yEt={name:"popperOffsets",enabled:!0,phase:"read",fn:bEt,data:{}};function CEt(n){return n==="x"?"y":"x"}function wEt(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,f=h===void 0?!0:h,g=t.tetherOffset,m=g===void 0?0:g,v=M4(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),_=qb(e.placement),b=jD(e.placement),y=!b,C=nme(_),E=CEt(C),x=e.modifiersData.popperOffsets,k=e.rects.reference,L=e.rects.popper,D=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,A=typeof D=="number"?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),N=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(x){if(o){var M,B=C==="y"?Hf:Wf,F=C==="y"?Om:Pm,U=C==="y"?"height":"width",H=x[C],W=H+v[B],q=H-v[F],V=f?-L[U]/2:0,re=b===WD?k[U]:L[U],oe=b===WD?-L[U]:-k[U],Q=e.elements.arrow,Ne=f&&Q?tme(Q):{width:0,height:0},Ve=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:k9e(),Ye=Ve[B],ye=Ve[F],He=ZP(0,k[U],Ne[U]),Pe=y?k[U]/2-V-He-Ye-A.mainAxis:re-He-Ye-A.mainAxis,Ge=y?-k[U]/2+V+He+ye+A.mainAxis:oe+He+ye+A.mainAxis,Fe=e.elements.arrow&&CF(e.elements.arrow),bt=Fe?C==="y"?Fe.clientTop||0:Fe.clientLeft||0:0,Mt=(M=N==null?void 0:N[C])!=null?M:0,Ft=H+Pe-Mt-bt,Yt=H+Ge-Mt,ln=ZP(f?TH(W,Ft):W,H,f?iT(q,Yt):q);x[C]=ln,P[C]=ln-H}if(a){var Et,mt=C==="x"?Hf:Wf,Lt=C==="x"?Om:Pm,be=x[E],Te=E==="y"?"height":"width",se=be+v[mt],Y=be-v[Lt],X=[Hf,Wf].indexOf(_)!==-1,le=(Et=N==null?void 0:N[E])!=null?Et:0,te=X?se:be-k[Te]-L[Te]-le+A.altAxis,me=X?be+k[Te]+L[Te]-le-A.altAxis:Y,Me=f&&X?qSt(te,be,me):ZP(f?te:se,be,f?me:Y);x[E]=Me,P[E]=Me-be}e.modifiersData[i]=P}}const SEt={name:"preventOverflow",enabled:!0,phase:"main",fn:wEt,requiresIfExists:["offset"]};function EEt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function xEt(n){return n===fg(n)||!Cm(n)?ime(n):EEt(n)}function TEt(n){var e=n.getBoundingClientRect(),t=zD(e.width)/n.offsetWidth||1,i=zD(e.height)/n.offsetHeight||1;return t!==1||i!==1}function kEt(n,e,t){t===void 0&&(t=!1);var i=Cm(e),r=Cm(e)&&TEt(e),o=jS(e),s=UD(n,r,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((e0(e)!=="body"||ome(o))&&(a=xEt(e)),Cm(e)?(l=UD(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=rme(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function IEt(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 LEt(n){var e=IEt(n);return HSt.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function DEt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function AEt(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 ETe={placement:"bottom",modifiers:[],strategy:"absolute"};function xTe(){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 REt(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,o=r===void 0?ETe:r;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},ETe,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],h=!1,f={state:u,setOptions:function(_){var b=typeof _=="function"?_(u.options):_;m(),u.options=Object.assign({},o,u.options,b),u.scrollParents={reference:NT(a)?JP(a):a.contextElement?JP(a.contextElement):[],popper:JP(l)};var y=LEt(AEt([].concat(i,u.options.modifiers)));return u.orderedModifiers=y.filter(function(C){return C.enabled}),g(),f.update()},forceUpdate:function(){if(!h){var _=u.elements,b=_.reference,y=_.popper;if(xTe(b,y)){u.rects={reference:kEt(b,CF(y),u.options.strategy==="fixed"),popper:tme(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(A){return u.modifiersData[A.name]=Object.assign({},A.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var E=u.orderedModifiers[C],x=E.fn,k=E.options,L=k===void 0?{}:k,D=E.name;typeof x=="function"&&(u=x({state:u,options:L,name:D,instance:f})||u)}}}},update:DEt(function(){return new Promise(function(v){f.forceUpdate(),v(u)})}),destroy:function(){m(),h=!0}};if(!xTe(a,l))return f;f.setOptions(c).then(function(v){!h&&c.onFirstUpdate&&c.onFirstUpdate(v)});function g(){u.orderedModifiers.forEach(function(v){var _=v.name,b=v.options,y=b===void 0?{}:b,C=v.effect;if(typeof C=="function"){var E=C({state:u,name:_,instance:f,options:y}),x=function(){};d.push(E||x)}})}function m(){d.forEach(function(v){return v()}),d=[]}return f}}var NEt=[nEt,yEt,eEt,eme,vEt,fEt,SEt,QSt,gEt],R9e=REt({defaultModifiers:NEt});function nt(n){const e=Ss(),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}):p(St,{})}var N9e={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},TTe=ce.createContext&&ce.createContext(N9e),Tw=globalThis&&globalThis.__assign||function(){return Tw=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},Tw.apply(this,arguments)},OEt=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 O9e(n){return n&&n.map(function(e,t){return ce.createElement(e.tag,Tw({key:t},e.attr),O9e(e.child))})}function Hn(n){return function(e){return ce.createElement(PEt,Tw({attr:Tw({},n.attr)},e),O9e(n.child))}}function PEt(n){var e=function(t){var i=n.attr,r=n.size,o=n.title,s=OEt(n,["attr","size","title"]),a=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),ce.createElement("svg",Tw({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,s,{className:l,style:Tw(Tw({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&ce.createElement("title",null,o),n.children)};return TTe!==void 0?ce.createElement(TTe.Consumer,null,function(t){return e(t)}):e(N9e)}function MEt(n){return Hn({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 wTr(n){return Hn({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 STr(n){return Hn({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 FEt(n){return Hn({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 el(n){return Hn({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 sme(n){return Hn({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 ETr(n){return Hn({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 qD(n){return Hn({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 kTe(n){return Hn({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 xTr(n){return Hn({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 kH(n){return Hn({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 BEt(n){return Hn({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 $Et(n){return Hn({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 ame(n){return Hn({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 lme(n){return Hn({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 TTr(n){return Hn({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 kTr(n){return Hn({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 ITr(n){return Hn({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 P9e(n){return Hn({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 Lc(n){return Hn({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 cme(n){return Hn({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 LTr(n){return Hn({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 VEt(n){return Hn({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 Ly(n){return Hn({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 HEt(n){return Hn({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 ume(n){return Hn({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 rq(n){return Hn({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 M9e(n){return Hn({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 WEt(n){return Hn({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 DTr(n){return Hn({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 F9e(n){return Hn({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 Dc(n){return Hn({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 ATr(n){return Hn({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 zEt(n){return Hn({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 RTr(n){return Hn({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 UEt(n){return Hn({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 jEt(n){return Hn({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 dme(n){return Hn({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 NTr(n){return Hn({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 qEt(n){return Hn({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 B9e(n){return Hn({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 hme(n){return Hn({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 sS(n){return Hn({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 GEt(n){return Hn({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 KEt(n){return Hn({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 Nk(n){return Hn({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 t0(n){return Hn({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 wF(n){return Hn({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 OTr(n){return Hn({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 PTr(n){return Hn({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 oq(n){return Hn({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 MTr(n){return Hn({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 SR(n){return Hn({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 YEt(n){return Hn({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 FTr(n){return Hn({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 BTr(n){return Hn({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 p1(n){return Hn({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 $Tr(n){return Hn({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 VTr(n){return Hn({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 HTr(n){return Hn({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 fme(n){return Hn({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 QEt(n){return Hn({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 $9e(n){return Hn({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 XEt(n){return Hn({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 IH(n){return Hn({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 ZEt(n){return Hn({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 JEt(n){return Hn({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 V9e(n){return Hn({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 WTr(n){return Hn({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 Fs(n){const[e,t]=w.useState(!0),i=si();return p("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1},className:zt(`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:p("div",{className:"mx-4",children:p("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1,borderColor:i.$4},className:zt("text-sm",{"text-red-700":n.type==="danger","text-yellow-700":n.type==="warning","text-green-700":n.type==="success"}),children:O("div",{className:"flex items-center justify-between space-x-2",style:{backgroundColor:i.$1,borderColor:i.$4},children:[p("div",{className:"w-full break-all",style:{backgroundColor:i.$1,borderColor:i.$4},children:n.children}),!n.disableClosing&&p("button",{type:"button",children:p(qm,{onClick:()=>t(!1)})})]})})})})}var ext=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function txt(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,f=n.value,g=Ku(n,ext),m=w.useState(a!==void 0?a:t),v=cn(m,2),_=v[0],b=v[1],y=w.useState(l!==void 0?l:r),C=cn(y,2),E=C[0],x=C[1],k=w.useState(f!==void 0?f:s),L=cn(k,2),D=L[0],A=L[1],N=w.useCallback(function(W,q){typeof c=="function"&&c(W,q),A(W)},[c]),P=w.useCallback(function(W,q){var V;typeof u=="function"&&(V=u(W,q)),b(V!==void 0?V:W)},[u]),M=w.useCallback(function(){typeof h=="function"&&h(),x(!0)},[h]),B=w.useCallback(function(){typeof d=="function"&&d(),x(!1)},[d]),F=a!==void 0?a:_,U=l!==void 0?l:E,H=f!==void 0?f:D;return pt(pt({},g),{},{inputValue:F,menuIsOpen:U,onChange:N,onInputChange:P,onMenuClose:B,onMenuOpen:M,value:H})}function nxt(n){if(Array.isArray(n))return Bie(n)}function ixt(){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 no(n){return nxt(n)||X6e(n)||Epe(n)||ixt()}function rxt(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 oxt(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 sxt=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(oxt(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=rxt(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}(),qd="-ms-",LH="-moz-",As="-webkit-",H9e="comm",pme="rule",gme="decl",axt="@import",W9e="@keyframes",lxt="@layer",cxt=Math.abs,sq=String.fromCharCode,uxt=Object.assign;function dxt(n,e){return hd(n,0)^45?(((e<<2^hd(n,0))<<2^hd(n,1))<<2^hd(n,2))<<2^hd(n,3):0}function z9e(n){return n.trim()}function hxt(n,e){return(n=e.exec(n))?n[0]:n}function Rs(n,e,t){return n.replace(e,t)}function ooe(n,e){return n.indexOf(e)}function hd(n,e){return n.charCodeAt(e)|0}function F4(n,e,t){return n.slice(e,t)}function nb(n){return n.length}function mme(n){return n.length}function w8(n,e){return e.push(n),n}function fxt(n,e){return n.map(e).join("")}var aq=1,GD=1,U9e=0,Kf=0,Uc=0,ER="";function lq(n,e,t,i,r,o,s){return{value:n,root:e,parent:t,type:i,props:r,children:o,line:aq,column:GD,length:s,return:""}}function eO(n,e){return uxt(lq("",null,null,"",null,null,0),n,{length:-n.length},e)}function pxt(){return Uc}function gxt(){return Uc=Kf>0?hd(ER,--Kf):0,GD--,Uc===10&&(GD=1,aq--),Uc}function ng(){return Uc=Kf<U9e?hd(ER,Kf++):0,GD++,Uc===10&&(GD=1,aq++),Uc}function Gb(){return hd(ER,Kf)}function y$(){return Kf}function SF(n,e){return F4(ER,n,e)}function B4(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 j9e(n){return aq=GD=1,U9e=nb(ER=n),Kf=0,[]}function q9e(n){return ER="",n}function C$(n){return z9e(SF(Kf-1,soe(n===91?n+2:n===40?n+1:n)))}function mxt(n){for(;(Uc=Gb())&&Uc<33;)ng();return B4(n)>2||B4(Uc)>3?"":" "}function _xt(n,e){for(;--e&&ng()&&!(Uc<48||Uc>102||Uc>57&&Uc<65||Uc>70&&Uc<97););return SF(n,y$()+(e<6&&Gb()==32&&ng()==32))}function soe(n){for(;ng();)switch(Uc){case n:return Kf;case 34:case 39:n!==34&&n!==39&&soe(Uc);break;case 40:n===41&&soe(n);break;case 92:ng();break}return Kf}function vxt(n,e){for(;ng()&&n+Uc!==47+10;)if(n+Uc===42+42&&Gb()===47)break;return"/*"+SF(e,Kf-1)+"*"+sq(n===47?n:ng())}function bxt(n){for(;!B4(Gb());)ng();return SF(n,Kf)}function G9e(n){return q9e(w$("",null,null,null,[""],n=j9e(n),0,[0],n))}function w$(n,e,t,i,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,m=1,v=1,_=1,b=0,y="",C=r,E=o,x=i,k=y;v;)switch(g=b,b=ng()){case 40:if(g!=108&&hd(k,d-1)==58){ooe(k+=Rs(C$(b),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:k+=C$(b);break;case 9:case 10:case 13:case 32:k+=mxt(g);break;case 92:k+=_xt(y$()-1,7);continue;case 47:switch(Gb()){case 42:case 47:w8(yxt(vxt(ng(),y$()),e,t),l);break;default:k+="/"}break;case 123*m:a[c++]=nb(k)*_;case 125*m:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+u:_==-1&&(k=Rs(k,/\f/g,"")),f>0&&nb(k)-d&&w8(f>32?LTe(k+";",i,t,d-1):LTe(Rs(k," ","")+";",i,t,d-2),l);break;case 59:k+=";";default:if(w8(x=ITe(k,e,t,c,u,r,a,y,C=[],E=[],d),o),b===123)if(u===0)w$(k,e,x,x,C,o,d,a,E);else switch(h===99&&hd(k,3)===110?100:h){case 100:case 108:case 109:case 115:w$(n,x,x,i&&w8(ITe(n,x,x,0,0,r,a,y,r,C=[],d),E),r,E,d,a,i?C:E);break;default:w$(k,x,x,x,[""],E,0,a,E)}}c=u=f=0,m=_=1,y=k="",d=s;break;case 58:d=1+nb(k),f=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&gxt()==125)continue}switch(k+=sq(b),b*m){case 38:_=u>0?1:(k+="\f",-1);break;case 44:a[c++]=(nb(k)-1)*_,_=1;break;case 64:Gb()===45&&(k+=C$(ng())),h=Gb(),u=d=nb(y=k+=bxt(y$())),b++;break;case 45:g===45&&nb(k)==2&&(m=0)}}return o}function ITe(n,e,t,i,r,o,s,a,l,c,u){for(var d=r-1,h=r===0?o:[""],f=mme(h),g=0,m=0,v=0;g<i;++g)for(var _=0,b=F4(n,d+1,d=cxt(m=s[g])),y=n;_<f;++_)(y=z9e(m>0?h[_]+" "+b:Rs(b,/&\f/g,h[_])))&&(l[v++]=y);return lq(n,e,t,r===0?pme:a,l,c,u)}function yxt(n,e,t){return lq(n,e,t,H9e,sq(pxt()),F4(n,2,-2),0)}function LTe(n,e,t,i){return lq(n,e,t,gme,F4(n,0,i),F4(n,i+1,-1),i)}function rT(n,e){for(var t="",i=mme(n),r=0;r<i;r++)t+=e(n[r],r,n,e)||"";return t}function K9e(n,e,t,i){switch(n.type){case lxt:if(n.children.length)break;case axt:case gme:return n.return=n.return||n.value;case H9e:return"";case W9e:return n.return=n.value+"{"+rT(n.children,i)+"}";case pme:n.value=n.props.join(",")}return nb(t=rT(n.children,i))?n.return=n.value+"{"+t+"}":""}function Cxt(n){var e=mme(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 wxt(n){return function(e){e.root||(e=e.return)&&n(e)}}var Sxt=function(e,t,i){for(var r=0,o=0;r=o,o=Gb(),r===38&&o===12&&(t[i]=1),!B4(o);)ng();return SF(e,Kf)},Ext=function(e,t){var i=-1,r=44;do switch(B4(r)){case 0:r===38&&Gb()===12&&(t[i]=1),e[i]+=Sxt(Kf-1,t,i);break;case 2:e[i]+=C$(r);break;case 4:if(r===44){e[++i]=Gb()===58?"&\f":"",t[i]=e[i].length;break}default:e[i]+=sq(r)}while(r=ng());return e},xxt=function(e,t){return q9e(Ext(j9e(e),t))},DTe=new WeakMap,Txt=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&&!DTe.get(i))&&!r){DTe.set(e,!0);for(var o=[],s=xxt(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]}}},kxt=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Y9e(n,e){switch(dxt(n,e)){case 5103:return As+"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 As+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return As+n+LH+n+qd+n+n;case 6828:case 4268:return As+n+qd+n+n;case 6165:return As+n+qd+"flex-"+n+n;case 5187:return As+n+Rs(n,/(\w+).+(:[^]+)/,As+"box-$1$2"+qd+"flex-$1$2")+n;case 5443:return As+n+qd+"flex-item-"+Rs(n,/flex-|-self/,"")+n;case 4675:return As+n+qd+"flex-line-pack"+Rs(n,/align-content|flex-|-self/,"")+n;case 5548:return As+n+qd+Rs(n,"shrink","negative")+n;case 5292:return As+n+qd+Rs(n,"basis","preferred-size")+n;case 6060:return As+"box-"+Rs(n,"-grow","")+As+n+qd+Rs(n,"grow","positive")+n;case 4554:return As+Rs(n,/([^-])(transform)/g,"$1"+As+"$2")+n;case 6187:return Rs(Rs(Rs(n,/(zoom-|grab)/,As+"$1"),/(image-set)/,As+"$1"),n,"")+n;case 5495:case 3959:return Rs(n,/(image-set\([^]*)/,As+"$1$`$1");case 4968:return Rs(Rs(n,/(.+:)(flex-)?(.*)/,As+"box-pack:$3"+qd+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+As+n+n;case 4095:case 3583:case 4068:case 2532:return Rs(n,/(.+)-inline(.+)/,As+"$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(nb(n)-1-e>6)switch(hd(n,e+1)){case 109:if(hd(n,e+4)!==45)break;case 102:return Rs(n,/(.+:)(.+)-([^]+)/,"$1"+As+"$2-$3$1"+LH+(hd(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~ooe(n,"stretch")?Y9e(Rs(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(hd(n,e+1)!==115)break;case 6444:switch(hd(n,nb(n)-3-(~ooe(n,"!important")&&10))){case 107:return Rs(n,":",":"+As)+n;case 101:return Rs(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+As+(hd(n,14)===45?"inline-":"")+"box$3$1"+As+"$2$3$1"+qd+"$2box$3")+n}break;case 5936:switch(hd(n,e+11)){case 114:return As+n+qd+Rs(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return As+n+qd+Rs(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return As+n+qd+Rs(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return As+n+qd+n+n}return n}var Ixt=function(e,t,i,r){if(e.length>-1&&!e.return)switch(e.type){case gme:e.return=Y9e(e.value,e.length);break;case W9e:return rT([eO(e,{value:Rs(e.value,"@","@"+As)})],r);case pme:if(e.length)return fxt(e.props,function(o){switch(hxt(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return rT([eO(e,{props:[Rs(o,/:(read-\w+)/,":"+LH+"$1")]})],r);case"::placeholder":return rT([eO(e,{props:[Rs(o,/:(plac\w+)/,":"+As+"input-$1")]}),eO(e,{props:[Rs(o,/:(plac\w+)/,":"+LH+"$1")]}),eO(e,{props:[Rs(o,/:(plac\w+)/,qd+"input-$1")]})],r)}return""})}},Lxt=[Ixt],Dxt=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 v=m.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var r=e.stylisPlugins||Lxt,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(m){for(var v=m.getAttribute("data-emotion").split(" "),_=1;_<v.length;_++)o[v[_]]=!0;a.push(m)});var l,c=[Txt,kxt];{var u,d=[K9e,wxt(function(m){u.insert(m)})],h=Cxt(c.concat(r,d)),f=function(v){return rT(G9e(v),h)};l=function(v,_,b,y){u=b,f(v?v+"{"+_.styles+"}":_.styles),y&&(g.inserted[_.name]=!0)}}var g={key:t,sheet:new sxt({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 g.sheet.hydrate(a),g},Axt=!0;function Rxt(n,e,t){var i="";return t.split(" ").forEach(function(r){n[r]!==void 0?e.push(n[r]+";"):i+=r+" "}),i}var Q9e=function(e,t,i){var r=e.key+"-"+t.name;(i===!1||Axt===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},Nxt=function(e,t,i){Q9e(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 Oxt(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 Pxt=/[A-Z]|^ms/g,Mxt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,X9e=function(e){return e.charCodeAt(1)===45},ATe=function(e){return e!=null&&typeof e!="boolean"},OZ=wwt(function(n){return X9e(n)?n:n.replace(Pxt,"-$&").toLowerCase()}),RTe=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Mxt,function(i,r,o){return ib={name:r,styles:o,next:ib},r})}return l9e[e]!==1&&!X9e(e)&&typeof t=="number"&&t!==0?t+"px":t};function $4(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 ib={name:t.name,styles:t.styles,next:ib},t.name;if(t.styles!==void 0){var i=t.next;if(i!==void 0)for(;i!==void 0;)ib={name:i.name,styles:i.styles,next:ib},i=i.next;var r=t.styles+";";return r}return Fxt(n,e,t)}case"function":{if(n!==void 0){var o=ib,s=t(n);return ib=o,$4(n,e,s)}break}}if(e==null)return t;var a=e[t];return a!==void 0?a:t}function Fxt(n,e,t){var i="";if(Array.isArray(t))for(var r=0;r<t.length;r++)i+=$4(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]+"}":ATe(s)&&(i+=OZ(o)+":"+RTe(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++)ATe(s[a])&&(i+=OZ(o)+":"+RTe(o,s[a])+";");else{var l=$4(n,e,s);switch(o){case"animation":case"animationName":{i+=OZ(o)+":"+l+";";break}default:i+=o+"{"+l+"}"}}}return i}var NTe=/label:\s*([^\s;\n{]+)\s*(;|$)/g,ib,Z9e=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="";ib=void 0;var s=e[0];s==null||s.raw===void 0?(r=!1,o+=$4(i,t,s)):o+=s[0];for(var a=1;a<e.length;a++)o+=$4(i,t,e[a]),r&&(o+=s[a]);NTe.lastIndex=0;for(var l="",c;(c=NTe.exec(o))!==null;)l+="-"+c[1];var u=Oxt(o)+l;return{name:u,styles:o,next:ib}},Bxt=function(e){return e()},$xt=Lm["useInsertionEffect"]?Lm["useInsertionEffect"]:!1,Vxt=$xt||Bxt,_me={}.hasOwnProperty,J9e=w.createContext(typeof HTMLElement<"u"?Dxt({key:"css"}):null);J9e.Provider;var Hxt=function(e){return w.forwardRef(function(t,i){var r=w.useContext(J9e);return e(t,r,i)})},Wxt=w.createContext({}),aoe="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",zxt=function(e,t){var i={};for(var r in t)_me.call(t,r)&&(i[r]=t[r]);return i[aoe]=e,i},Uxt=function(e){var t=e.cache,i=e.serialized,r=e.isStringTag;return Q9e(t,i,r),Vxt(function(){return Nxt(t,i,r)}),null},jxt=Hxt(function(n,e,t){var i=n.css;typeof i=="string"&&e.registered[i]!==void 0&&(i=e.registered[i]);var r=n[aoe],o=[i],s="";typeof n.className=="string"?s=Rxt(e.registered,o,n.className):n.className!=null&&(s=n.className+" ");var a=Z9e(o,void 0,w.useContext(Wxt));s+=e.key+"-"+a.name;var l={};for(var c in n)_me.call(n,c)&&c!=="css"&&c!==aoe&&(l[c]=n[c]);return l.ref=t,l.className=s,w.createElement(w.Fragment,null,w.createElement(Uxt,{cache:e,serialized:a,isStringTag:typeof r=="string"}),w.createElement(r,l))}),qxt=jxt,kr=function(e,t){var i=arguments;if(t==null||!_me.call(t,"css"))return w.createElement.apply(void 0,i);var r=i.length,o=new Array(r);o[0]=qxt,o[1]=zxt(e,t);for(var s=2;s<r;s++)o[s]=i[s];return w.createElement.apply(null,o)};function vme(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return Z9e(e)}var Gxt=function(){var e=vme.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 Kxt(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}const Yxt=Math.min,Qxt=Math.max,DH=Math.round,S8=Math.floor,AH=n=>({x:n,y:n});function Xxt(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function e7e(n){return n7e(n)?(n.nodeName||"").toLowerCase():"#document"}function av(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function t7e(n){var e;return(e=(n7e(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function n7e(n){return n instanceof Node||n instanceof av(n).Node}function loe(n){return n instanceof Element||n instanceof av(n).Element}function bme(n){return n instanceof HTMLElement||n instanceof av(n).HTMLElement}function OTe(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof av(n).ShadowRoot}function i7e(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=yme(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function Zxt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Jxt(n){return["html","body","#document"].includes(e7e(n))}function yme(n){return av(n).getComputedStyle(n)}function eTt(n){if(e7e(n)==="html")return n;const e=n.assignedSlot||n.parentNode||OTe(n)&&n.host||t7e(n);return OTe(e)?e.host:e}function r7e(n){const e=eTt(n);return Jxt(e)?n.ownerDocument?n.ownerDocument.body:n.body:bme(e)&&i7e(e)?e:r7e(e)}function RH(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=r7e(n),o=r===((i=n.ownerDocument)==null?void 0:i.body),s=av(r);return o?e.concat(s,s.visualViewport||[],i7e(r)?r:[],s.frameElement&&t?RH(s.frameElement):[]):e.concat(r,RH(r,[],t))}function tTt(n){const e=yme(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=bme(n),o=r?n.offsetWidth:t,s=r?n.offsetHeight:i,a=DH(t)!==o||DH(i)!==s;return a&&(t=o,i=s),{width:t,height:i,$:a}}function Cme(n){return loe(n)?n:n.contextElement}function PZ(n){const e=Cme(n);if(!bme(e))return AH(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:o}=tTt(e);let s=(o?DH(t.width):t.width)/i,a=(o?DH(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nTt=AH(0);function iTt(n){const e=av(n);return!Zxt()||!e.visualViewport?nTt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function rTt(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==av(n)?!1:e}function PTe(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=Cme(n);let s=AH(1);e&&(i?loe(i)&&(s=PZ(i)):s=PZ(n));const a=rTt(o,t,i)?iTt(o):AH(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=av(o),f=i&&loe(i)?av(i):i;let g=h.frameElement;for(;g&&i&&f!==h;){const m=PZ(g),v=g.getBoundingClientRect(),_=yme(g),b=v.left+(g.clientLeft+parseFloat(_.paddingLeft))*m.x,y=v.top+(g.clientTop+parseFloat(_.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=y,g=av(g).frameElement}}return Xxt({width:u,height:d,x:l,y:c})}function oTt(n,e){let t=null,i;const r=t7e(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 f=S8(u),g=S8(r.clientWidth-(c+d)),m=S8(r.clientHeight-(u+h)),v=S8(c),b={rootMargin:-f+"px "+-g+"px "+-m+"px "+-v+"px",threshold:Qxt(0,Yxt(1,l))||1};let y=!0;function C(E){const x=E[0].intersectionRatio;if(x!==l){if(!y)return s();x?s(!1,x):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 sTt(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=Cme(n),u=r||o?[...c?RH(c):[],...RH(e)]:[];u.forEach(_=>{r&&_.addEventListener("scroll",t,{passive:!0}),o&&_.addEventListener("resize",t)});const d=c&&a?oTt(c,t):null;let h=-1,f=null;s&&(f=new ResizeObserver(_=>{let[b]=_;b&&b.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(e)})),t()}),c&&!l&&f.observe(c),f.observe(e));let g,m=l?PTe(n):null;l&&v();function v(){const _=PTe(n);m&&(_.x!==m.x||_.y!==m.y||_.width!==m.width||_.height!==m.height)&&t(),m=_,g=requestAnimationFrame(v)}return t(),()=>{u.forEach(_=>{r&&_.removeEventListener("scroll",t),o&&_.removeEventListener("resize",t)}),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(g)}}var coe=w.useLayoutEffect,aTt=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],NH=function(){};function lTt(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function cTt(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(lTt(n,s)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var MTe=function(e){return vTt(e)?e.filter(Boolean):Zr(e)==="object"&&e!==null?[e]:[]},o7e=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=Ku(e,aTt);return pt({},t)},tc=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 cq(n){return[document.documentElement,document.body,window].indexOf(n)>-1}function uTt(n){return cq(n)?window.innerHeight:n.clientHeight}function s7e(n){return cq(n)?window.pageYOffset:n.scrollTop}function OH(n,e){if(cq(n)){window.scrollTo(0,e);return}n.scrollTop=e}function dTt(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 hTt(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}function E8(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:NH,r=s7e(n),o=e-r,s=10,a=0;function l(){a+=s;var c=hTt(a,r,o,t);OH(n,c),a<t?window.requestAnimationFrame(l):i(n)}l()}function FTe(n,e){var t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetHeight/3;i.bottom+r>t.bottom?OH(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+r,n.scrollHeight)):i.top-r<t.top&&OH(n,Math.max(e.offsetTop-r,0))}function fTt(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 BTe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function pTt(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var a7e=!1,gTt={get passive(){return a7e=!0}},x8=typeof window<"u"?window:{};x8.addEventListener&&x8.removeEventListener&&(x8.addEventListener("p",NH,gTt),x8.removeEventListener("p",NH,!1));var mTt=a7e;function _Tt(n){return n!=null}function vTt(n){return Array.isArray(n)}function T8(n,e,t){return n?e:t}var bTt=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=cn(s,1),l=a[0];return!i.includes(l)});return o.reduce(function(s,a){var l=cn(a,2),c=l[0],u=l[1];return s[c]=u,s},{})},yTt=["children","innerProps"],CTt=["children","innerProps"];function wTt(n){var e=n.maxHeight,t=n.menuEl,i=n.minHeight,r=n.placement,o=n.shouldScroll,s=n.isFixedPosition,a=n.controlHeight,l=dTt(t),c={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,h=t.getBoundingClientRect(),f=h.bottom,g=h.height,m=h.top,v=t.offsetParent.getBoundingClientRect(),_=v.top,b=s?window.innerHeight:uTt(l),y=s7e(l),C=parseInt(getComputedStyle(t).marginBottom,10),E=parseInt(getComputedStyle(t).marginTop,10),x=_-E,k=b-m,L=x+y,D=d-y-m,A=f-b+y+C,N=y+m-E,P=160;switch(r){case"auto":case"bottom":if(k>=g)return{placement:"bottom",maxHeight:e};if(D>=g&&!s)return o&&E8(l,A,P),{placement:"bottom",maxHeight:e};if(!s&&D>=i||s&&k>=i){o&&E8(l,A,P);var M=s?k-C:D-C;return{placement:"bottom",maxHeight:M}}if(r==="auto"||s){var B=e,F=s?x:L;return F>=i&&(B=Math.min(F-C-a,e)),{placement:"top",maxHeight:B}}if(r==="bottom")return o&&OH(l,A),{placement:"bottom",maxHeight:e};break;case"top":if(x>=g)return{placement:"top",maxHeight:e};if(L>=g&&!s)return o&&E8(l,N,P),{placement:"top",maxHeight:e};if(!s&&L>=i||s&&x>=i){var U=e;return(!s&&L>=i||s&&x>=i)&&(U=s?x-E:L-E),o&&E8(l,N,P),{placement:"top",maxHeight:U}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function STt(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var l7e=function(e){return e==="auto"?"bottom":e},ETt=function(e,t){var i,r=e.placement,o=e.theme,s=o.borderRadius,a=o.spacing,l=o.colors;return pt((i={label:"menu"},it(i,STt(r),"100%"),it(i,"position","absolute"),it(i,"width","100%"),it(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})},c7e=w.createContext(null),xTt=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(c7e)||{},u=c.setPortalPlacement,d=w.useRef(null),h=w.useState(r),f=cn(h,2),g=f[0],m=f[1],v=w.useState(null),_=cn(v,2),b=_[0],y=_[1],C=l.spacing.controlHeight;return coe(function(){var E=d.current;if(E){var x=s==="fixed",k=a&&!x,L=wTt({maxHeight:r,menuEl:E,minHeight:i,placement:o,shouldScroll:k,isFixedPosition:x,controlHeight:C});m(L.maxHeight),y(L.placement),u==null||u(L.placement)}},[r,o,s,a,i,u,C]),t({ref:d,placerProps:pt(pt({},e),{},{placement:b||l7e(o),maxHeight:g})})},TTt=function(e){var t=e.children,i=e.innerRef,r=e.innerProps;return kr("div",Tt({},tc(e,"menu",{menu:!0}),{ref:i},r),t)},kTt=TTt,ITt=function(e,t){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return pt({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},LTt=function(e){var t=e.children,i=e.innerProps,r=e.innerRef,o=e.isMulti;return kr("div",Tt({},tc(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),t)},u7e=function(e,t){var i=e.theme,r=i.spacing.baseUnit,o=i.colors;return pt({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},DTt=u7e,ATt=u7e,RTt=function(e){var t=e.children,i=t===void 0?"No options":t,r=e.innerProps,o=Ku(e,yTt);return kr("div",Tt({},tc(pt(pt({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},NTt=function(e){var t=e.children,i=t===void 0?"Loading...":t,r=e.innerProps,o=Ku(e,CTt);return kr("div",Tt({},tc(pt(pt({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},OTt=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}},PTt=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(l7e(s)),d=cn(u,2),h=d[0],f=d[1],g=w.useMemo(function(){return{setPortalPlacement:f}},[]),m=w.useState(null),v=cn(m,2),_=v[0],b=v[1],y=w.useCallback(function(){if(r){var k=fTt(r),L=a==="fixed"?0:window.pageYOffset,D=k[h]+L;(D!==(_==null?void 0:_.offset)||k.left!==(_==null?void 0:_.rect.left)||k.width!==(_==null?void 0:_.rect.width))&&b({offset:D,rect:k})}},[r,a,h,_==null?void 0:_.offset,_==null?void 0:_.rect.left,_==null?void 0:_.rect.width]);coe(function(){y()},[y]);var C=w.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=sTt(r,l.current,y,{elementResize:"ResizeObserver"in window}))},[r,y]);coe(function(){C()},[C]);var E=w.useCallback(function(k){l.current=k,C()},[C]);if(!t&&a!=="fixed"||!_)return null;var x=kr("div",Tt({ref:E},tc(pt(pt({},e),{},{offset:_.offset,position:a,rect:_.rect}),"menuPortal",{"menu-portal":!0}),o),i);return kr(c7e.Provider,{value:g},t?op.createPortal(x,t):x)},MTt=function(e){var t=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},FTt=function(e){var t=e.children,i=e.innerProps,r=e.isDisabled,o=e.isRtl;return kr("div",Tt({},tc(e,"container",{"--is-disabled":r,"--is-rtl":o}),i),t)},BTt=function(e,t){var i=e.theme.spacing,r=e.isMulti,o=e.hasValue,s=e.selectProps.controlShouldRenderValue;return pt({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")})},$Tt=function(e){var t=e.children,i=e.innerProps,r=e.isMulti,o=e.hasValue;return kr("div",Tt({},tc(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),t)},VTt=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},HTt=function(e){var t=e.children,i=e.innerProps;return kr("div",Tt({},tc(e,"indicatorsContainer",{indicators:!0}),i),t)},$Te,WTt=["size"],zTt=["innerProps","isRtl","size"],UTt={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},d7e=function(e){var t=e.size,i=Ku(e,WTt);return kr("svg",Tt({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:UTt},i))},wme=function(e){return kr(d7e,Tt({size:20},e),kr("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"}))},h7e=function(e){return kr(d7e,Tt({size:20},e),kr("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"}))},f7e=function(e,t){var i=e.isFocused,r=e.theme,o=r.spacing.baseUnit,s=r.colors;return pt({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:i?s.neutral60:s.neutral20,padding:o*2,":hover":{color:i?s.neutral80:s.neutral40}})},jTt=f7e,qTt=function(e){var t=e.children,i=e.innerProps;return kr("div",Tt({},tc(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),t||kr(h7e,null))},GTt=f7e,KTt=function(e){var t=e.children,i=e.innerProps;return kr("div",Tt({},tc(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),t||kr(wme,null))},YTt=function(e,t){var i=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,s=r.colors;return pt({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:i?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},QTt=function(e){var t=e.innerProps;return kr("span",Tt({},t,tc(e,"indicatorSeparator",{"indicator-separator":!0})))},XTt=Gxt($Te||($Te=Kxt([`
0%, 80%, 100% { opacity: 0; }
40% { opacity: 1; }
`]))),ZTt=function(e,t){var i=e.isFocused,r=e.size,o=e.theme,s=o.colors,a=o.spacing.baseUnit;return pt({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})},MZ=function(e){var t=e.delay,i=e.offset;return kr("span",{css:vme({animation:"".concat(XTt," 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"},"","")})},JTt=function(e){var t=e.innerProps,i=e.isRtl,r=e.size,o=r===void 0?4:r,s=Ku(e,zTt);return kr("div",Tt({},tc(pt(pt({},s),{},{innerProps:t,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),kr(MZ,{delay:0,offset:i}),kr(MZ,{delay:160,offset:!0}),kr(MZ,{delay:320,offset:!i}))},ekt=function(e,t){var i=e.isDisabled,r=e.isFocused,o=e.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return pt({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}})},tkt=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,o=e.innerRef,s=e.innerProps,a=e.menuIsOpen;return kr("div",Tt({ref:o},tc(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":a}),s,{"aria-disabled":i||void 0}),t)},nkt=tkt,ikt=["data"],rkt=function(e,t){var i=e.theme.spacing;return t?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},okt=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 kr("div",Tt({},tc(e,"group",{group:!0}),l),kr(s,Tt({},a,{selectProps:d,theme:u,getStyles:r,getClassNames:o,cx:i}),c),kr("div",null,t))},skt=function(e,t){var i=e.theme,r=i.colors,o=i.spacing;return pt({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"})},akt=function(e){var t=o7e(e);t.data;var i=Ku(t,ikt);return kr("div",Tt({},tc(e,"groupHeading",{"group-heading":!0}),i))},lkt=okt,ckt=["innerRef","isDisabled","isHidden","inputClassName"],ukt=function(e,t){var i=e.isDisabled,r=e.value,o=e.theme,s=o.spacing,a=o.colors;return pt(pt({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},dkt),t?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},p7e={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},dkt={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":pt({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},p7e)},hkt=function(e){return pt({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},p7e)},fkt=function(e){var t=e.cx,i=e.value,r=o7e(e),o=r.innerRef,s=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=Ku(r,ckt);return kr("div",Tt({},tc(e,"input",{"input-container":!0}),{"data-value":i||""}),kr("input",Tt({className:t({input:!0},l),ref:o,style:hkt(a),disabled:s},c)))},pkt=fkt,gkt=function(e,t){var i=e.theme,r=i.spacing,o=i.borderRadius,s=i.colors;return pt({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},mkt=function(e,t){var i=e.theme,r=i.borderRadius,o=i.colors,s=e.cropWithEllipsis;return pt({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})},_kt=function(e,t){var i=e.theme,r=i.spacing,o=i.borderRadius,s=i.colors,a=e.isFocused;return pt({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}})},g7e=function(e){var t=e.children,i=e.innerProps;return kr("div",i,t)},vkt=g7e,bkt=g7e;function ykt(n){var e=n.children,t=n.innerProps;return kr("div",Tt({role:"button"},t),e||kr(wme,{size:14}))}var Ckt=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 kr(c,{data:r,innerProps:pt(pt({},tc(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},kr(u,{data:r,innerProps:pt({},tc(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),kr(d,{data:r,innerProps:pt(pt({},tc(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},wkt=Ckt,Skt=function(e,t){var i=e.isDisabled,r=e.isFocused,o=e.isSelected,s=e.theme,a=s.spacing,l=s.colors;return pt({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}})},Ekt=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,o=e.isSelected,s=e.innerRef,a=e.innerProps;return kr("div",Tt({},tc(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:s,"aria-disabled":i},a),t)},xkt=Ekt,Tkt=function(e,t){var i=e.theme,r=i.spacing,o=i.colors;return pt({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},kkt=function(e){var t=e.children,i=e.innerProps;return kr("div",Tt({},tc(e,"placeholder",{placeholder:!0}),i),t)},Ikt=kkt,Lkt=function(e,t){var i=e.isDisabled,r=e.theme,o=r.spacing,s=r.colors;return pt({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})},Dkt=function(e){var t=e.children,i=e.isDisabled,r=e.innerProps;return kr("div",Tt({},tc(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),t)},Akt=Dkt,Rkt={ClearIndicator:KTt,Control:nkt,DropdownIndicator:qTt,DownChevron:h7e,CrossIcon:wme,Group:lkt,GroupHeading:akt,IndicatorsContainer:HTt,IndicatorSeparator:QTt,Input:pkt,LoadingIndicator:JTt,Menu:kTt,MenuList:LTt,MenuPortal:PTt,LoadingMessage:NTt,NoOptionsMessage:RTt,MultiValue:wkt,MultiValueContainer:vkt,MultiValueLabel:bkt,MultiValueRemove:ykt,Option:xkt,Placeholder:Ikt,SelectContainer:FTt,SingleValue:Akt,ValueContainer:$Tt},Nkt=function(e){return pt(pt({},Rkt),e.components)},VTe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Okt(n,e){return!!(n===e||VTe(n)&&VTe(e))}function Pkt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!Okt(n[t],e[t]))return!1;return!0}function bu(n,e){e===void 0&&(e=Pkt);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 Mkt={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"},Fkt=function(e){return kr("span",Tt({css:Mkt},e))},HTe=Fkt,Bkt={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(g,m){return g&&g.length?"".concat(g.indexOf(m)+1," of ").concat(g.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:"",".")}},$kt=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,f=l.isMulti,g=l.isOptionDisabled,m=l.isSearchable,v=l.menuIsOpen,_=l.options,b=l.screenReaderStatus,y=l.tabSelectsValue,C=l["aria-label"],E=l["aria-live"],x=w.useMemo(function(){return pt(pt({},Bkt),u||{})},[u]),k=w.useMemo(function(){var B="";if(t&&x.onChange){var F=t.option,U=t.options,H=t.removedValue,W=t.removedValues,q=t.value,V=function(ye){return Array.isArray(ye)?null:ye},re=H||F||V(q),oe=re?d(re):"",Q=U||W||void 0,Ne=Q?Q.map(d):[],Ve=pt({isDisabled:re&&g(re,a),label:oe,labels:Ne},t);B=x.onChange(Ve)}return B},[t,x,g,a,d]),L=w.useMemo(function(){var B="",F=i||r,U=!!(i&&a&&a.includes(i));if(F&&x.onFocus){var H={focused:F,label:d(F),isDisabled:g(F,a),isSelected:U,options:o,context:F===i?"menu":"value",selectValue:a};B=x.onFocus(H)}return B},[i,r,d,g,x,o,a]),D=w.useMemo(function(){var B="";if(v&&_.length&&x.onFilter){var F=b({count:o.length});B=x.onFilter({inputValue:h,resultsMessage:F})}return B},[o,h,v,x,_,b]),A=w.useMemo(function(){var B="";if(x.guidance){var F=r?"value":v?"menu":"input";B=x.guidance({"aria-label":C,context:F,isDisabled:i&&g(i,a),isMulti:f,isSearchable:m,tabSelectsValue:y})}return B},[C,i,r,f,g,m,v,x,a,y]),N="".concat(L," ").concat(D," ").concat(A),P=kr(w.Fragment,null,kr("span",{id:"aria-selection"},k),kr("span",{id:"aria-context"},N)),M=(t==null?void 0:t.action)==="initial-input-focus";return kr(w.Fragment,null,kr(HTe,{id:c},M&&P),kr(HTe,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text"},s&&!M&&P))},Vkt=$kt,uoe=[{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ⓩźẑżžẓẕƶȥɀⱬꝣ"}],Hkt=new RegExp("["+uoe.map(function(n){return n.letters}).join("")+"]","g"),m7e={};for(var FZ=0;FZ<uoe.length;FZ++)for(var BZ=uoe[FZ],$Z=0;$Z<BZ.letters.length;$Z++)m7e[BZ.letters[$Z]]=BZ.base;var _7e=function(e){return e.replace(Hkt,function(t){return m7e[t]})},Wkt=bu(_7e),WTe=function(e){return e.replace(/^\s+|\s+$/g,"")},zkt=function(e){return"".concat(e.label," ").concat(e.value)},Ukt=function(e){return function(t,i){if(t.data.__isNew__)return!0;var r=pt({ignoreCase:!0,ignoreAccents:!0,stringify:zkt,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,s=r.ignoreAccents,a=r.stringify,l=r.trim,c=r.matchFrom,u=l?WTe(i):i,d=l?WTe(a(t)):a(t);return o&&(u=u.toLowerCase(),d=d.toLowerCase()),s&&(u=Wkt(u),d=_7e(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},jkt=["innerRef"];function qkt(n){var e=n.innerRef,t=Ku(n,jkt),i=bTt(t,"onExited","in","enter","exit","appear");return kr("input",Tt({ref:e},i,{css:vme({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 Gkt=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Kkt(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,E=b.clientHeight,x=c.current,k=_>0,L=C-E-y,D=!1;L>_&&s.current&&(i&&i(v),s.current=!1),k&&a.current&&(o&&o(v),a.current=!1),k&&_>L?(t&&!s.current&&t(v),x.scrollTop=C,D=!0,s.current=!0):!k&&-_>y&&(r&&!a.current&&r(v),x.scrollTop=0,D=!0,a.current=!0),D&&Gkt(v)}},[t,i,r,o]),d=w.useCallback(function(v){u(v,v.deltaY)},[u]),h=w.useCallback(function(v){l.current=v.changedTouches[0].clientY},[]),f=w.useCallback(function(v){var _=l.current-v.changedTouches[0].clientY;u(v,_)},[u]),g=w.useCallback(function(v){if(v){var _=mTt?{passive:!1}:!1;v.addEventListener("wheel",d,_),v.addEventListener("touchstart",h,_),v.addEventListener("touchmove",f,_)}},[f,h,d]),m=w.useCallback(function(v){v&&(v.removeEventListener("wheel",d,!1),v.removeEventListener("touchstart",h,!1),v.removeEventListener("touchmove",f,!1))},[f,h,d]);return w.useEffect(function(){if(e){var v=c.current;return g(v),function(){m(v)}}},[e,g,m]),function(v){c.current=v}}var zTe=["boxSizing","height","overflow","paddingRight","position"],UTe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jTe(n){n.preventDefault()}function qTe(n){n.stopPropagation()}function GTe(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function KTe(){return"ontouchstart"in window||navigator.maxTouchPoints}var YTe=!!(typeof window<"u"&&window.document&&window.document.createElement),tO=0,MI={capture:!1,passive:!1};function Ykt(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(YTe){var c=document.body,u=c&&c.style;if(i&&zTe.forEach(function(g){var m=u&&u[g];r.current[g]=m}),i&&tO<1){var d=parseInt(r.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,f=window.innerWidth-h+d||0;Object.keys(UTe).forEach(function(g){var m=UTe[g];u&&(u[g]=m)}),u&&(u.paddingRight="".concat(f,"px"))}c&&KTe()&&(c.addEventListener("touchmove",jTe,MI),l&&(l.addEventListener("touchstart",GTe,MI),l.addEventListener("touchmove",qTe,MI))),tO+=1}},[i]),a=w.useCallback(function(l){if(YTe){var c=document.body,u=c&&c.style;tO=Math.max(tO-1,0),i&&tO<1&&zTe.forEach(function(d){var h=r.current[d];u&&(u[d]=h)}),c&&KTe()&&(c.removeEventListener("touchmove",jTe,MI),l&&(l.removeEventListener("touchstart",GTe,MI),l.removeEventListener("touchmove",qTe,MI)))}},[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 Qkt=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Xkt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Zkt(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=Kkt({isEnabled:r,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),u=Ykt({isEnabled:t}),d=function(f){c(f),u(f)};return kr(w.Fragment,null,t&&kr("div",{onClick:Qkt,css:Xkt}),e(d))}var Jkt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},eIt=function(e){var t=e.name,i=e.onFocus;return kr("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:Jkt,value:"",onChange:function(){}})},tIt=eIt,nIt=function(e){return e.label},iIt=function(e){return e.label},rIt=function(e){return e.value},oIt=function(e){return!!e.isDisabled},sIt={clearIndicator:GTt,container:MTt,control:ekt,dropdownIndicator:jTt,group:rkt,groupHeading:skt,indicatorsContainer:VTt,indicatorSeparator:YTt,input:ukt,loadingIndicator:ZTt,loadingMessage:ATt,menu:ETt,menuList:ITt,menuPortal:OTt,multiValue:gkt,multiValueLabel:mkt,multiValueRemove:_kt,noOptionsMessage:DTt,option:Skt,placeholder:Tkt,singleValue:Lkt,valueContainer:BTt},aIt={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%)"},lIt=4,v7e=4,cIt=38,uIt=v7e*2,dIt={baseUnit:v7e,controlHeight:cIt,menuGutter:uIt},VZ={borderRadius:lIt,colors:aIt,spacing:dIt},hIt={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:BTe(),captureMenuScroll:!BTe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Ukt(),formatGroupLabel:nIt,getOptionLabel:iIt,getOptionValue:rIt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:oIt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!pTt(),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 QTe(n,e,t,i){var r=w7e(n,e,t),o=S7e(n,e,t),s=C7e(n,e),a=PH(n,e);return{type:"option",data:e,isDisabled:r,isSelected:o,label:s,value:a,index:i}}function b7e(n,e){return n.options.map(function(t,i){if("options"in t){var r=t.options.map(function(s,a){return QTe(n,s,e,a)}).filter(function(s){return XTe(n,s)});return r.length>0?{type:"group",data:t,options:r,index:i}:void 0}var o=QTe(n,t,e,i);return XTe(n,o)?o:void 0}).filter(_Tt)}function y7e(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,no(t.options.map(function(i){return i.data}))):e.push(t.data),e},[])}function fIt(n,e){return y7e(b7e(n,e))}function XTe(n,e){var t=n.inputValue,i=t===void 0?"":t,r=e.data,o=e.isSelected,s=e.label,a=e.value;return(!x7e(n)||!o)&&E7e(n,{label:s,value:a,data:r},i)}function pIt(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 gIt(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var C7e=function(e,t){return e.getOptionLabel(t)},PH=function(e,t){return e.getOptionValue(t)};function w7e(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function S7e(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var i=PH(n,e);return t.some(function(r){return PH(n,r)===i})}function E7e(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var x7e=function(e){var t=e.hideSelectedOptions,i=e.isMulti;return t===void 0?i:t},mIt=1,T7e=function(n){Tv(t,n);var e=Rk(t);function t(i){var r;if(El(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,f=u.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:f}),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,f=u&&r.isOptionSelected(a,h),g=r.isOptionDisabled(a,h);if(f){var m=r.getOptionValue(a);r.setValue(h.filter(function(v){return r.getOptionValue(v)!==m}),"deselect-option",a)}else if(!g)u?r.setValue([].concat(no(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(f){return r.getOptionValue(f)!==u}),h=T8(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(T8(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=T8(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 cTt.apply(void 0,[r.props.classNamePrefix].concat(l))},r.getOptionLabel=function(a){return C7e(r.props,a)},r.getOptionValue=function(a){return PH(r.props,a)},r.getStyles=function(a,l){var c=r.props.unstyled,u=sIt[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 Nkt(r.props)},r.buildCategorizedOptions=function(){return b7e(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return y7e(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,l){r.setState({ariaSelection:pt({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&&cq(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 x7e(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,f=l.isClearable,g=l.isDisabled,m=l.menuIsOpen,v=l.onKeyDown,_=l.tabSelectsValue,b=l.openMenuOnFocus,y=r.state,C=y.focusedOption,E=y.focusedValue,x=y.selectValue;if(!g&&!(typeof v=="function"&&(v(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(E)r.removeValue(E);else{if(!u)return;c?r.popValue():f&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!m||!_||!C||b&&r.isOptionSelected(C,x))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()):f&&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||++mIt),r.state.selectValue=MTe(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 xl(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&&FTe(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&&(FTe(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(VZ):pt(pt({},VZ),this.props.theme):VZ}},{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,f=d.isRtl,g=d.options,m=this.hasValue();return{clearValue:r,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:m,isMulti:h,isRtl:f,options:g,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 w7e(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return S7e(this.props,r,o)}},{key:"filterOption",value:function(r,o){return E7e(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,f=this.getComponents(),g=f.Input,m=this.state,v=m.inputIsHidden,_=m.ariaSelection,b=this.commonProps,y=a||this.getElementId("input"),C=pt(pt(pt({"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()?(_==null?void 0:_.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?w.createElement(g,Tt({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:y,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},C)):w.createElement(qkt,Tt({id:y,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:NH,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,f=this.props,g=f.controlShouldRenderValue,m=f.isDisabled,v=f.isMulti,_=f.inputValue,b=f.placeholder,y=this.state,C=y.selectValue,E=y.focusedValue,x=y.isFocused;if(!this.hasValue()||!g)return _?null:w.createElement(d,Tt({},h,{key:"placeholder",isDisabled:m,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return C.map(function(L,D){var A=L===E,N="".concat(r.getOptionLabel(L),"-").concat(r.getOptionValue(L));return w.createElement(s,Tt({},h,{components:{Container:a,Label:l,Remove:c},isFocused:A,isDisabled:m,key:N,index:D,removeProps:{onClick:function(){return r.removeValue(L)},onTouchEnd:function(){return r.removeValue(L)},onMouseDown:function(M){M.preventDefault()}},data:L}),r.formatOptionLabel(L,"value"))});if(_)return null;var k=C[0];return w.createElement(u,Tt({},h,{data:k,isDisabled:m}),this.formatOptionLabel(k,"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,Tt({},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,Tt({},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,Tt({},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,Tt({},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,f=o.Option,g=this.commonProps,m=this.state.focusedOption,v=this.props,_=v.captureMenuScroll,b=v.inputValue,y=v.isLoading,C=v.loadingMessage,E=v.minMenuHeight,x=v.maxMenuHeight,k=v.menuIsOpen,L=v.menuPlacement,D=v.menuPosition,A=v.menuPortalTarget,N=v.menuShouldBlockScroll,P=v.menuShouldScrollIntoView,M=v.noOptionsMessage,B=v.onMenuScrollToTop,F=v.onMenuScrollToBottom;if(!k)return null;var U=function(Q,Ne){var Ve=Q.type,Ye=Q.data,ye=Q.isDisabled,He=Q.isSelected,Pe=Q.label,Ge=Q.value,Fe=m===Ye,bt=ye?void 0:function(){return r.onOptionHover(Ye)},Mt=ye?void 0:function(){return r.selectOption(Ye)},Ft="".concat(r.getElementId("option"),"-").concat(Ne),Yt={id:Ft,onClick:Mt,onMouseMove:bt,onMouseOver:bt,tabIndex:-1};return w.createElement(f,Tt({},g,{innerProps:Yt,data:Ye,isDisabled:ye,isSelected:He,key:Ft,label:Pe,type:Ve,value:Ge,isFocused:Fe,innerRef:Fe?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(Q.data,"menu"))},H;if(this.hasOptions())H=this.getCategorizedOptions().map(function(oe){if(oe.type==="group"){var Q=oe.data,Ne=oe.options,Ve=oe.index,Ye="".concat(r.getElementId("group"),"-").concat(Ve),ye="".concat(Ye,"-heading");return w.createElement(s,Tt({},g,{key:Ye,data:Q,options:Ne,Heading:a,headingProps:{id:ye,data:oe.data},label:r.formatGroupLabel(oe.data)}),oe.options.map(function(He){return U(He,"".concat(Ve,"-").concat(He.index))}))}else if(oe.type==="option")return U(oe,"".concat(oe.index))});else if(y){var W=C({inputValue:b});if(W===null)return null;H=w.createElement(d,g,W)}else{var q=M({inputValue:b});if(q===null)return null;H=w.createElement(h,g,q)}var V={minMenuHeight:E,maxMenuHeight:x,menuPlacement:L,menuPosition:D,menuShouldScrollIntoView:P},re=w.createElement(xTt,Tt({},g,V),function(oe){var Q=oe.ref,Ne=oe.placerProps,Ve=Ne.placement,Ye=Ne.maxHeight;return w.createElement(l,Tt({},g,V,{innerRef:Q,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove,id:r.getElementId("listbox")},isLoading:y,placement:Ve}),w.createElement(Zkt,{captureEnabled:_,onTopArrive:B,onBottomArrive:F,lockEnabled:N},function(ye){return w.createElement(c,Tt({},g,{innerRef:function(Pe){r.getMenuListRef(Pe),ye(Pe)},isLoading:y,maxHeight:Ye,focusedOption:m}),H)}))});return A||D==="fixed"?w.createElement(u,Tt({},g,{appendTo:A,controlElement:this.controlRef,menuPlacement:L,menuPosition:D}),re):re}},{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(tIt,{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 f=d.length>0?d.map(function(m,v){return w.createElement("input",{key:"i-".concat(v),name:c,type:"hidden",value:r.getOptionValue(m)})}):w.createElement("input",{name:c,type:"hidden",value:""});return w.createElement("div",null,f)}else{var g=d[0]?this.getOptionValue(d[0]):"";return w.createElement("input",{name:c,type:"hidden",value:g})}}},{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(Vkt,Tt({},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,f=c.menuIsOpen,g=this.state.isFocused,m=this.commonProps=this.getCommonProps();return w.createElement(a,Tt({},m,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:g}),this.renderLiveRegion(),w.createElement(o,Tt({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:g,menuIsOpen:f}),w.createElement(l,Tt({},m,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),w.createElement(s,Tt({},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,f=r.value,g=r.menuIsOpen,m=r.inputValue,v=r.isMulti,_=MTe(f),b={};if(s&&(f!==s.value||h!==s.options||g!==s.menuIsOpen||m!==s.inputValue)){var y=g?fIt(r,_):[],C=a?pIt(o,_):null,E=gIt(o,y);b={selectValue:_,focusedOption:E,focusedValue:C,clearFocusValueOnUpdate:!1}}var x=l!=null&&r!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},k=c,L=u&&d;return u&&!L&&(k={value:T8(v,_,_[0]||null),options:_,action:"initial-input-focus"},L=!d),(c==null?void 0:c.action)==="initial-input-focus"&&(k=null),pt(pt(pt({},b),x),{},{prevProps:r,ariaSelection:k,prevWasFocused:L})}}]),t}(w.Component);T7e.defaultProps=hIt;var _It=w.forwardRef(function(n,e){var t=txt(n);return w.createElement(T7e,Tt({ref:e},t))}),_v=_It;function En(n){const e=si(),{blankOptionValue:t,withBlank:i,children:r,value:o,defaultValue:s,customSelector:a,onValueChange:l,className:c,disabled:u,cypressRef:d,dismissable:h=!0}=n,f=p("option",{value:t??""}),g=ce.Children.map([i?f:[],r],b=>w.isValidElement(b)&&{label:Array.isArray(b.props.children)?b.props.children.join(""):b.props.children,value:b.props.value}),m=g==null?void 0:g.find(b=>b.value===o),v=g==null?void 0:g.find(b=>b.value===s),_={input:b=>({...b,color:e.$3}),singleValue:b=>({...b,color:e.$3}),menu:b=>({...b,width:"max-content",minWidth:"100%",backgroundColor:e.$4,borderColor:e.$4}),control:(b,{isDisabled:y})=>({...b,borderRadius:"3px",backgroundColor:e.$1,color:e.$3,borderColor:e.$5,cursor:y?"not-allowed":"pointer",pointerEvents:y?"auto":"unset"}),option:(b,{isSelected:y,isFocused:C})=>({...b,display:"flex",alignItems:"center",color:e.$3,backgroundColor:y||C?e.$7:e.$1,":hover":{backgroundColor:e.$7},minHeight:"1.875rem"})};return O("div",{className:zt({"space-y-2":!!a}),children:[n.label&&O(pg,{className:"mb-2",for:n.id,children:[n.label,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),a?p(_v,{className:c,options:g,defaultValue:v,value:m,onChange:b=>b===null?l==null?void 0:l(t??""):l==null?void 0:l(b.value),isDisabled:u,styles:_,isSearchable:!1,isClearable:h,"data-cy":d}):O("select",{onChange:b=>{n.onValueChange&&n.onValueChange(b.target.value),n.onChange&&n.onChange(b)},id:n.id,className:zt(`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&&p("option",{value:n.blankOptionValue??""}),n.children]}),n.errorMessage&&p(Fs,{className:"mt-2",type:"danger",children:n.errorMessage})]})}const vIt=Ro(null);var uq={},bIt="Expected a function",ZTe=0/0,yIt="[object Symbol]",CIt=/^\s+|\s+$/g,wIt=/^[-+]0x[0-9a-f]+$/i,SIt=/^0b[01]+$/i,EIt=/^0o[0-7]+$/i,xIt=parseInt,TIt=typeof Po=="object"&&Po&&Po.Object===Object&&Po,kIt=typeof self=="object"&&self&&self.Object===Object&&self,IIt=TIt||kIt||Function("return this")(),LIt=Object.prototype,DIt=LIt.toString,AIt=Math.max,RIt=Math.min,HZ=function(){return IIt.Date.now()};function NIt(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(bIt);e=JTe(e)||0,doe(t)&&(u=!!t.leading,d="maxWait"in t,o=d?AIt(JTe(t.maxWait)||0,e):o,h="trailing"in t?!!t.trailing:h);function f(x){var k=i,L=r;return i=r=void 0,c=x,s=n.apply(L,k),s}function g(x){return c=x,a=setTimeout(_,e),u?f(x):s}function m(x){var k=x-l,L=x-c,D=e-k;return d?RIt(D,o-L):D}function v(x){var k=x-l,L=x-c;return l===void 0||k>=e||k<0||d&&L>=o}function _(){var x=HZ();if(v(x))return b(x);a=setTimeout(_,m(x))}function b(x){return a=void 0,h&&i?f(x):(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(HZ())}function E(){var x=HZ(),k=v(x);if(i=arguments,r=this,l=x,k){if(a===void 0)return g(l);if(d)return a=setTimeout(_,e),f(l)}return a===void 0&&(a=setTimeout(_,e)),s}return E.cancel=y,E.flush=C,E}function doe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function OIt(n){return!!n&&typeof n=="object"}function PIt(n){return typeof n=="symbol"||OIt(n)&&DIt.call(n)==yIt}function JTe(n){if(typeof n=="number")return n;if(PIt(n))return ZTe;if(doe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=doe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(CIt,"");var t=SIt.test(n);return t||EIt.test(n)?xIt(n.slice(2),t?2:8):wIt.test(n)?ZTe:+n}var MIt=NIt;function hoe(n){"@babel/helpers - typeof";return hoe=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},hoe(n)}Object.defineProperty(uq,"__esModule",{value:!0});uq.DebounceInput=void 0;var eke=k7e(w),FIt=k7e(MIt),BIt=["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"];function k7e(n){return n&&n.__esModule?n:{default:n}}function $It(n,e){if(n==null)return{};var t=VIt(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 VIt(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 tke(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 jg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tke(Object(t),!0).forEach(function(i){LC(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):tke(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function HIt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function nke(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 WIt(n,e,t){return e&&nke(n.prototype,e),t&&nke(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function zIt(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&&foe(n,e)}function foe(n,e){return foe=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},foe(n,e)}function UIt(n){var e=qIt();return function(){var i=MH(n),r;if(e){var o=MH(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return jIt(this,r)}}function jIt(n,e){if(e&&(hoe(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GE(n)}function GE(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function qIt(){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 MH(n){return MH=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},MH(n)}function LC(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var I7e=function(n){zIt(t,n);var e=UIt(t);function t(i){var r;HIt(this,t),r=e.call(this,i),LC(GE(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(jg(jg({},s),{},{target:jg(jg({},s.target),{},{value:""})}))})}),LC(GE(r),"onKeyDown",function(s){s.key==="Enter"&&r.forceNotify(s);var a=r.props.onKeyDown;a&&(s.persist(),a(s))}),LC(GE(r),"onBlur",function(s){r.forceNotify(s);var a=r.props.onBlur;a&&(s.persist(),a(s))}),LC(GE(r),"createNotifier",function(s){if(s<0)r.notify=function(){return null};else if(s===0)r.notify=r.doNotify;else{var a=(0,FIt.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()}}}),LC(GE(r),"doNotify",function(){var s=r.props.onChange;s.apply(void 0,arguments)}),LC(GE(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(jg(jg({},s),{},{target:jg(jg({},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 WIt(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=$It(r,BIt),h=this.state.value,f;s?f={onKeyDown:this.onKeyDown}:l?f={onKeyDown:l}:f={};var g;a?g={onBlur:this.onBlur}:c?g={onBlur:c}:g={};var m=u?{ref:u}:{};return eke.default.createElement(o,jg(jg(jg(jg({},d),{},{onChange:this.onChange,value:h},f),g),m))}}]),t}(eke.default.PureComponent);uq.DebounceInput=I7e;LC(I7e,"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 GIt=uq,poe=GIt.DebounceInput;poe.DebounceInput=poe;var KIt=poe;function YIt(n){return Hn({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 QIt(n){return Hn({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 XIt(n){return Hn({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 pg(n){const e=si();return p("label",{className:`text-sm font-medium block ${n.className}`,htmlFor:n.for,style:{color:e.$3},children:n.children})}function Ze(n){const e=si(),t=_l({overwrite:!1}),i=n.type==="password",[r,o]=w.useState(!0),s=w.useMemo(()=>n.type==="password"&&r?"password":n.type==="password"&&!r?"text":n.type,[n.type,r]);return O("section",{style:{width:n.width},children:[n.label&&O(pg,{className:zt("mb-2",{"whitespace-nowrap":n.withoutLabelWrapping}),for:n.id,children:[n.label,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),O("div",{className:"relative",children:[p(KIt.DebounceInput,{style:{backgroundColor:e.$1,borderColor:e.$5,color:e.$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:s,className:zt(`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(a.target.value=a.target.value===""&&n.type==="number"?"0":a.target.value,n.element==="textarea"&&t.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"&&t.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}),i&&p("span",{className:"absolute top-1/4 right-3 cursor-pointer",children:r?p(QIt,{className:"text-gray-400",fontSize:19,onClick:()=>o(!1)}):p(YIt,{className:"text-gray-400",fontSize:19,onClick:()=>o(!0)})})]}),n.errorMessage&&p(Fs,{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 xR=Ro({prevent:!1,actionKey:void 0}),L7e=Ro({lastLocation:"",nonPreventedLocations:[]});function ZIt(){const n=ml(),e=Wi(Sme),[t,i]=us(xR),[r,o]=us(L7e);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 Sme=Ro(!1),D7e=Ro(void 0);function TR(n){const{disablePrevention:e}=n||{},t=ki(),[i,r]=us(xR),o=Wi(Sme),s=Wi(D7e);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 qi(n){const e=Ss(),{prevent:t}=Gi(xR),i=TR(),{withoutDefaultStyling:r,setBaseFont:o}=n,s={color:e};return n.external?p("a",{target:"_blank",href:n.to,className:zt(`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}):p(k1,{className:zt(`${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 A7e(n){const e=Ss();return O("fieldset",{children:[p("legend",{className:"sr-only",children:"Notification method"}),p("div",{className:"space-y-4 sm:flex sm:items-center sm:space-y-0 sm:space-x-10",children:n.options.map(t=>O("div",{className:"flex items-center",onChange:i=>{var r;return(r=n.onValueChange)==null?void 0:r.call(n,i.target.value)},children:[p("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}}),p("label",{htmlFor:t.id,className:zt("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))})]})}function FI(n,e,t){let i=t.initialDeps??[],r;return()=>{var o,s,a,l;let c;t.key&&((o=t.debug)!=null&&o.call(t))&&(c=Date.now());const u=n();if(!(u.length!==i.length||u.some((f,g)=>i[g]!==f)))return r;i=u;let h;if(t.key&&((s=t.debug)!=null&&s.call(t))&&(h=Date.now()),r=e(...u),t.key&&((a=t.debug)!=null&&a.call(t))){const f=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-h)*100)/100,m=g/16,v=(_,b)=>{for(_=String(_);_.length<b;)_=" "+_;return _};console.info(`%c⏱ ${v(g,5)} /${v(f,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(l=t==null?void 0:t.onChange)==null||l.call(t,r),r}}function WZ(n,e){if(n===void 0)throw new Error(`Unexpected undefined${e?`: ${e}`:""}`);return n}const JIt=(n,e)=>Math.abs(n-e)<1,e2t=(n,e,t)=>{let i;return function(...r){n.clearTimeout(i),i=n.setTimeout(()=>e.apply(this,r),t)}},t2t=n=>n,n2t=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),i=[];for(let r=e;r<=t;r++)i.push(r);return i},i2t=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;const r=s=>{const{width:a,height:l}=s;e({width:Math.round(a),height:Math.round(l)})};if(r(t.getBoundingClientRect()),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){r({width:l.inlineSize,height:l.blockSize});return}}r(t.getBoundingClientRect())});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},ike={passive:!0},r2t=typeof window>"u"?!0:"onscrollend"in window,o2t=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;let r=0;const o=r2t?()=>{}:e2t(i,()=>{e(r,!1)},n.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:u,isRtl:d}=n.options;r=u?t.scrollLeft*(d&&-1||1):t.scrollTop,o(),e(r,c)},a=s(!0),l=s(!1);return l(),t.addEventListener("scroll",a,ike),t.addEventListener("scrollend",l,ike),()=>{t.removeEventListener("scroll",a),t.removeEventListener("scrollend",l)}},s2t=(n,e,t)=>{if(e!=null&&e.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(n.getBoundingClientRect()[t.options.horizontal?"width":"height"])},a2t=(n,{adjustments:e=0,behavior:t},i)=>{var r,o;const s=n+e;(o=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[i.options.horizontal?"left":"top"]:s,behavior:t})};class l2t{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),t=null},observe:r=>{var o;return(o=i())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=i())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,r])=>{typeof r>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:t2t,rangeExtractor:n2t,onChange:()=>{},measureElement:s2t,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,...t}},this.notify=t=>{var i,r;(r=(i=this.options).onChange)==null||r.call(i,this,t)},this.maybeNotify=FI(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const r=new Map,o=new Map;for(let s=i-1;s>=0;s--){const a=t[s];if(r.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=FI(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,i,r,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=FI(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<t;u++){const d=o(u),h=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),f=h?h.end+this.options.gap:i+r,g=a.get(d),m=typeof g=="number"?g:this.options.estimateSize(u),v=f+m,_=h?h.lane:u%this.options.lanes;c[u]={index:u,start:f,size:m,end:v,key:d,lane:_}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=FI(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,i,r)=>this.range=t.length>0&&i>0?c2t({measurements:t,outerSize:i,scrollOffset:r}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=FI(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,i,r,o)=>i===null?[]:t({startIndex:i.startIndex,endIndex:i.endIndex,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,r=t.getAttribute(i);return r?parseInt(r,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this._measureElement=(t,i)=>{const r=this.indexFromElement(t),o=this.measurementsCache[r];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,i,this))},this.resizeItem=(t,i)=>{const r=this.measurementsCache[t];if(!r)return;const o=this.itemSizeCache.get(r.key)??r.size,s=i-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,i)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((i,r)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=FI(()=>[this.getIndexes(),this.getMeasurements()],(t,i)=>{const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=i[a];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return WZ(i[R7e(0,i.length-1,r=>WZ(i[r]).start,t)])},this.getOffsetForAlignment=(t,i)=>{const r=this.getSize(),o=this.getScrollOffset();i==="auto"&&(t<=o?i="start":t>=o+r?i="end":i="start"),i==="start"?t=t:i==="end"?t=t-r:i==="center"&&(t=t-r/2);const s=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-r;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const o=this.getSize(),s=this.getScrollOffset();if(i==="auto")if(r.end>=s+o-this.options.scrollPaddingEnd)i="end";else if(r.start<=s+this.options.scrollPaddingStart)i="start";else return[s,i];const a=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,i),i]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:i="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,i),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:i="auto",behavior:r}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(t,i);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[c]=WZ(this.getOffsetForIndex(t,a));JIt(c,this.getScrollOffset())||this.scrollToIndex(t,{align:a,behavior:r})}else this.scrollToIndex(t,{align:a,behavior:r})}))},this.scrollBy=(t,{behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:i})},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let r;return i.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((t=i[i.length-1])==null?void 0:t.end)??0:Math.max(...i.slice(-this.options.lanes).map(o=>o.end)),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const R7e=(n,e,t,i)=>{for(;n<=e;){const r=(n+e)/2|0,o=t(r);if(o<i)n=r+1;else if(o>i)e=r-1;else return r}return n>0?n-1:0};function c2t({measurements:n,outerSize:e,scrollOffset:t}){const i=n.length-1,o=R7e(0,i,a=>n[a].start,t);let s=o;for(;s<i&&n[s].end<t+e;)s++;return{startIndex:o,endIndex:s}}const u2t=typeof document<"u"?w.useLayoutEffect:w.useEffect;function d2t(n){const e=w.useReducer(()=>({}),{})[1],t={...n,onChange:(r,o)=>{var s;o?op.flushSync(e):e(),(s=n.onChange)==null||s.call(n,r,o)}},[i]=w.useState(()=>new l2t(t));return i.setOptions(t),w.useEffect(()=>i._didMount(),[]),u2t(()=>i._willUpdate()),i}function h2t(n){return d2t({observeElementRect:i2t,observeElementOffset:o2t,scrollToFn:a2t,...n})}var f2t=Object.defineProperty,p2t=(n,e,t)=>e in n?f2t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zZ=(n,e,t)=>(p2t(n,typeof e!="symbol"?e+"":e,t),t);let g2t=class{constructor(){zZ(this,"current",this.detect()),zZ(this,"handoffState","pending"),zZ(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"}},Gy=new g2t,Zs=(n,e)=>{Gy.isServer?w.useEffect(n,e):w.useLayoutEffect(n,e)};function ig(n){let e=w.useRef(n);return Zs(()=>{e.current=n},[n]),e}function Eme(n,e){let[t,i]=w.useState(n),r=ig(n);return Zs(()=>i(r.current),[r,i,...e]),t}let Yn=function(n){let e=ig(n);return ce.useCallback((...t)=>e.current(...t),[e])};function N7e(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,Yn(c=>(o||r(c),e==null?void 0:e(c)))]}function dq(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(e=>setTimeout(()=>{throw e}))}function gg(){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 dq(()=>{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=gg();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 L1(){let[n]=w.useState(gg);return w.useEffect(()=>()=>n.dispose(),[n]),n}function m2t(){let n=typeof document>"u";return"useSyncExternalStore"in Lm?(e=>e.useSyncExternalStore)(Lm)(()=>()=>{},()=>!1,()=>!n):!1}function kR(){let n=m2t(),[e,t]=w.useState(Gy.isHandoffComplete);return e&&Gy.isHandoffComplete===!1&&t(!1),w.useEffect(()=>{e!==!0&&t(!0)},[e]),w.useEffect(()=>Gy.handoff(),[]),n?!1:e}var rke;let nc=(rke=ce.useId)!=null?rke:function(){let n=kR(),[e,t]=ce.useState(n?()=>Gy.nextId():null);return Zs(()=>{e===null&&t(Gy.nextId())},[e]),e!=null?""+e:void 0};function Ms(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,Ms),i}function EF(n){return Gy.isServer?null:n instanceof Node?n.ownerDocument:n!=null&&n.hasOwnProperty("current")&&n.current instanceof Node?n.current.ownerDocument:document}let goe=["[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 bd=(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))(bd||{}),V4=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(V4||{}),_2t=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(_2t||{});function xF(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(goe)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var hq=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(hq||{});function fq(n,e=0){var t;return n===((t=EF(n))==null?void 0:t.body)?!1:Ms(e,{0(){return n.matches(goe)},1(){let i=n;for(;i!==null;){if(i.matches(goe))return!0;i=i.parentElement}return!1}})}function O7e(n){let e=EF(n);gg().nextFrame(()=>{e&&!fq(e.activeElement,0)&&kw(n)})}var v2t=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(v2t||{});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 kw(n){n==null||n.focus({preventScroll:!0})}let b2t=["textarea","input"].join(",");function y2t(n){var e,t;return(t=(e=n==null?void 0:n.matches)==null?void 0:e.call(n,b2t))!=null?t:!1}function xme(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 C2t(n,e){return hm(xF(),e,{relativeTo:n})}function hm(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?xme(n):n:xF(n);r.length>0&&s.length>1&&(s=s.filter(f=>!r.includes(f))),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 f=l+u;if(e&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}h=s[f],h==null||h.focus(c),u+=a}while(h!==o.activeElement);return e&6&&y2t(h)&&h.select(),2}function P7e(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function w2t(){return/Android/gi.test(window.navigator.userAgent)}function M7e(){return P7e()||w2t()}function k8(n,e,t){let i=ig(e);w.useEffect(()=>{function r(o){i.current(o)}return document.addEventListener(n,r,t),()=>document.removeEventListener(n,r,t)},[n,t])}function F7e(n,e,t){let i=ig(e);w.useEffect(()=>{function r(o){i.current(o)}return window.addEventListener(n,r,t),()=>window.removeEventListener(n,r,t)},[n,t])}function pq(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!fq(l,hq.Loose)&&l.tabIndex!==-1&&s.preventDefault(),e(s,l)}let o=w.useRef(null);k8("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),k8("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),k8("click",s=>{M7e()||o.current&&(r(s,()=>o.current),o.current=null)},!0),k8("touchend",s=>r(s,()=>s.target instanceof HTMLElement?s.target:null),!0),F7e("blur",s=>r(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function C0(...n){return w.useMemo(()=>EF(...n),[...n])}function oke(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 gq(n,e){let[t,i]=w.useState(()=>oke(n));return Zs(()=>{i(oke(n))},[n.type,n.as]),Zs(()=>{t||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&i("button")},[t,e]),t}let B7e=Symbol();function $7e(n,e=!0){return Object.assign(n,{[B7e]:e})}function Ia(...n){let e=w.useRef(n);w.useEffect(()=>{e.current=n},[n]);let t=Yn(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[B7e]))?void 0:t}function ske(n){return[n.screenX,n.screenY]}function V7e(){let n=w.useRef([-1,-1]);return{wasMoved(e){let t=ske(e);return n.current[0]===t[0]&&n.current[1]===t[1]?!1:(n.current=t,!0)},update(e){n.current=ske(e)}}}function H7e({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]),Zs(()=>{if(!n||!i)return;let s=EF(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 H4(n,e){let t=w.useRef([]),i=Yn(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 FH(...n){return Array.from(new Set(n.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}var Mm=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Mm||{}),YC=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(YC||{});function Js({ourProps:n,theirProps:e,slot:t,defaultTag:i,features:r,visible:o=!0,name:s,mergeRefs:a}){a=a??E2t;let l=W7e(e,n);if(o)return I8(l,t,i,s,a);let c=r??0;if(c&2){let{static:u=!1,...d}=l;if(u)return I8(d,t,i,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Ms(u?0:1,{0(){return null},1(){return I8({...d,hidden:!0,style:{display:"none"}},t,i,s,a)}})}return I8(l,t,i,s,a)}function I8(n,e={},t,i,r){let{as:o=t,children:s,refName:a="ref",...l}=UZ(n,["unmount","static"]),c=n.ref!==void 0?{[a]:n.ref}:{},u=typeof s=="function"?s(e):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e));let d={};if(e){let h=!1,f=[];for(let[g,m]of Object.entries(e))typeof m=="boolean"&&(h=!0),m===!0&&f.push(g);h&&(d["data-headlessui-state"]=f.join(" "))}if(o===w.Fragment&&Object.keys(BH(l)).length>0){if(!w.isValidElement(u)||Array.isArray(u)&&u.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(l).map(m=>` - ${m}`).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(m=>` - ${m}`).join(`
`)].join(`
`));let h=u.props,f=typeof(h==null?void 0:h.className)=="function"?(...m)=>FH(h==null?void 0:h.className(...m),l.className):FH(h==null?void 0:h.className,l.className),g=f?{className:f}:{};return w.cloneElement(u,Object.assign({},W7e(u.props,BH(UZ(l,["ref"]))),d,c,{ref:r(u.ref,c.ref)},g))}return w.createElement(o,Object.assign({},UZ(l,["ref"]),o!==w.Fragment&&c,o!==w.Fragment&&d),u)}function S2t(){let n=w.useRef([]),e=w.useCallback(t=>{for(let i of n.current)i!=null&&(typeof i=="function"?i(t):i.current=t)},[]);return(...t)=>{if(!t.every(i=>i==null))return n.current=t,e}}function E2t(...n){return n.every(e=>e==null)?void 0:e=>{for(let t of n)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function W7e(...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 ea(n){var e;return Object.assign(w.forwardRef(n),{displayName:(e=n.displayName)!=null?e:n.name})}function BH(n){let e=Object.assign({},n);for(let t in e)e[t]===void 0&&delete e[t];return e}function UZ(n,e=[]){let t=Object.assign({},n);for(let i of e)i in t&&delete t[i];return t}let x2t="div";var n0=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(n0||{});function T2t(n,e){var t;let{features:i=1,...r}=n,o={ref:e,"aria-hidden":(i&2)===2?!0:(t=r["aria-hidden"])!=null?t:void 0,hidden:(i&4)===4?!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",...(i&4)===4&&(i&2)!==2&&{display:"none"}}};return Js({ourProps:o,theirProps:r,slot:{},defaultTag:x2t,name:"Hidden"})}let g1=ea(T2t),Tme=w.createContext(null);Tme.displayName="OpenClosedContext";var Oa=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(Oa||{});function Ok(){return w.useContext(Tme)}function mq({value:n,children:e}){return ce.createElement(Tme.Provider,{value:n},e)}function k2t(n){function e(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let hb=[];k2t(()=>{function n(e){e.target instanceof HTMLElement&&e.target!==document.body&&hb[0]!==e.target&&(hb.unshift(e.target),hb=hb.filter(t=>t!=null&&t.isConnected),hb.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 IR(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&&I2t(t)?!1:i}function I2t(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function L2t(n){throw new Error("Unexpected object: "+n)}var la=(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))(la||{});function moe(n,e){let t=e.resolveItems();if(t.length<=0)return null;let i=e.resolveActiveIndex(),r=i??-1;switch(n.focus){case 0:{for(let o=0;o<t.length;++o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 1:{for(let o=r-1;o>=0;--o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 2:{for(let o=r+1;o<t.length;++o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 3:{for(let o=t.length-1;o>=0;--o)if(!e.resolveDisabled(t[o],o,t))return o;return i}case 4:{for(let o=0;o<t.length;++o)if(e.resolveId(t[o],o,t)===n.id)return o;return i}case 5:return null;default:L2t(n)}}function z7e(n={},e=null,t=[]){for(let[i,r]of Object.entries(n))j7e(t,U7e(e,i),r);return t}function U7e(n,e){return n?n+"["+e+"]":e}function j7e(n,e,t){if(Array.isArray(t))for(let[i,r]of t.entries())j7e(n,U7e(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,""]):z7e(t,e,n)}function D2t(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)}}var Ao=(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))(Ao||{}),A2t=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(A2t||{}),R2t=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(R2t||{}),N2t=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(N2t||{}),O2t=(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[n.SetActivationTrigger=6]="SetActivationTrigger",n[n.UpdateVirtualOptions=7]="UpdateVirtualOptions",n))(O2t||{});function jZ(n,e=t=>t){let t=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,i=e(n.options.slice()),r=i.length>0&&i[0].dataRef.current.order!==null?i.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):xme(i,s=>s.dataRef.current.domRef.current),o=t?r.indexOf(t):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let P2t={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,t;if((e=n.dataRef.current)!=null&&e.disabled||n.comboboxState===0)return n;if((t=n.dataRef.current)!=null&&t.value){let i=n.dataRef.current.calculateIndex(n.dataRef.current.value);if(i!==-1)return{...n,activeOptionIndex:i,comboboxState:0}}return{...n,comboboxState:0}},2(n,e){var t,i,r,o,s;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;if(n.virtual){let u=e.focus===la.Specific?e.idx:moe(e,{resolveItems:()=>n.virtual.options,resolveActiveIndex:()=>{var h,f;return(f=(h=n.activeOptionIndex)!=null?h:n.virtual.options.findIndex(g=>!n.virtual.disabled(g)))!=null?f:null},resolveDisabled:n.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),d=(o=e.trigger)!=null?o:2;return n.activeOptionIndex===u&&n.activationTrigger===d?n:{...n,activeOptionIndex:u,activationTrigger:d}}let a=jZ(n);if(a.activeOptionIndex===null){let u=a.options.findIndex(d=>!d.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=e.focus===la.Specific?e.idx:moe(e,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=e.trigger)!=null?s:2;return n.activeOptionIndex===l&&n.activationTrigger===c?n:{...n,...a,activeOptionIndex:l,activationTrigger:c}},3:(n,e)=>{var t,i,r;if((t=n.dataRef.current)!=null&&t.virtual)return{...n,options:[...n.options,e.payload]};let o=e.payload,s=jZ(n,l=>(l.push(o),l));n.activeOptionIndex===null&&(i=n.dataRef.current)!=null&&i.isSelected(e.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...n,...s,activationTrigger:2};return(r=n.dataRef.current)!=null&&r.__demoMode&&n.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(n,e)=>{var t;if((t=n.dataRef.current)!=null&&t.virtual)return{...n,options:n.options.filter(r=>r.id!==e.id)};let i=jZ(n,r=>{let o=r.findIndex(s=>s.id===e.id);return o!==-1&&r.splice(o,1),r});return{...n,...i,activationTrigger:2}},5:(n,e)=>n.labelId===e.id?n:{...n,labelId:e.id},6:(n,e)=>n.activationTrigger===e.trigger?n:{...n,activationTrigger:e.trigger},7:(n,e)=>{var t;if(((t=n.virtual)==null?void 0:t.options)===e.options)return n;let i=n.activeOptionIndex;if(n.activeOptionIndex!==null){let r=e.options.indexOf(n.virtual.options[n.activeOptionIndex]);r!==-1?i=r:i=null}return{...n,activeOptionIndex:i,virtual:Object.assign({},n.virtual,{options:e.options})}}},kme=w.createContext(null);kme.displayName="ComboboxActionsContext";function TF(n){let e=w.useContext(kme);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,TF),t}return e}let q7e=w.createContext(null);function M2t(n){var e;let t=Pk("VirtualProvider"),[i,r]=w.useMemo(()=>{let l=t.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[t.optionsRef.current]),o=h2t({scrollPaddingStart:i,scrollPaddingEnd:r,count:t.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=t.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=w.useState(0);return Zs(()=>{a(l=>l+1)},[(e=t.virtual)==null?void 0:e.options]),ce.createElement(q7e.Provider,{value:o},ce.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&{}.JEST_WORKER_ID!==void 0||t.activationTrigger===0)return;t.activeOptionIndex!==null&&t.virtual.options.length>t.activeOptionIndex&&o.scrollToIndex(t.activeOptionIndex)}}},o.getVirtualItems().map(l=>{var c;return ce.createElement(w.Fragment,{key:l.key},ce.cloneElement((c=n.children)==null?void 0:c.call(n,{option:t.virtual.options[l.index],open:t.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":t.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let Ime=w.createContext(null);Ime.displayName="ComboboxDataContext";function Pk(n){let e=w.useContext(Ime);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Pk),t}return e}function F2t(n,e){return Ms(e.type,P2t,n,e)}let B2t=w.Fragment;function $2t(n,e){let{value:t,defaultValue:i,onChange:r,form:o,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:d=!1,immediate:h=!1,virtual:f=null,...g}=n,m=!1,v=null,[_=d?[]:void 0,b]=N7e(t,r,i),[y,C]=w.useReducer(F2t,{dataRef:w.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=w.useRef(!1),x=w.useRef({static:!1,hold:!1}),k=w.useRef(null),L=w.useRef(null),D=w.useRef(null),A=w.useRef(null),N=Yn(typeof a=="string"?(Pe,Ge)=>{let Fe=a;return(Pe==null?void 0:Pe[Fe])===(Ge==null?void 0:Ge[Fe])}:a??((Pe,Ge)=>Pe===Ge)),P=Yn(Pe=>y.options.findIndex(Ge=>N(Ge.dataRef.current.value,Pe))),M=w.useCallback(Pe=>Ms(F.mode,{1:()=>_.some(Ge=>N(Ge,Pe)),0:()=>N(_,Pe)}),[_]),B=Yn(Pe=>y.activeOptionIndex===P(Pe)),F=w.useMemo(()=>({...y,immediate:m,optionsPropsRef:x,labelRef:k,inputRef:L,buttonRef:D,optionsRef:A,value:_,defaultValue:i,disabled:l,mode:d?1:0,virtual:y.virtual,get activeOptionIndex(){if(E.current&&y.activeOptionIndex===null&&y.options.length>0){let Pe=y.options.findIndex(Ge=>!Ge.dataRef.current.disabled);if(Pe!==-1)return Pe}return y.activeOptionIndex},calculateIndex:P,compare:N,isSelected:M,isActive:B,nullable:u,__demoMode:c}),[_,i,l,d,u,c,y,v]);Zs(()=>{},[v,void 0]),Zs(()=>{y.dataRef.current=F},[F]),pq([F.buttonRef,F.inputRef,F.optionsRef],()=>Ve.closeCombobox(),F.comboboxState===0);let U=w.useMemo(()=>{var Pe,Ge,Fe;return{open:F.comboboxState===0,disabled:l,activeIndex:F.activeOptionIndex,activeOption:F.activeOptionIndex===null?null:F.virtual?F.virtual.options[(Pe=F.activeOptionIndex)!=null?Pe:0]:(Fe=(Ge=F.options[F.activeOptionIndex])==null?void 0:Ge.dataRef.current.value)!=null?Fe:null,value:_}},[F,l,_]),H=Yn(()=>{if(F.activeOptionIndex!==null){if(F.virtual)Q(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:Pe}=F.options[F.activeOptionIndex];Q(Pe.current.value)}Ve.goToOption(la.Specific,F.activeOptionIndex)}}),W=Yn(()=>{C({type:0}),E.current=!0}),q=Yn(()=>{C({type:1}),E.current=!1}),V=Yn((Pe,Ge,Fe)=>(E.current=!1,Pe===la.Specific?C({type:2,focus:la.Specific,idx:Ge,trigger:Fe}):C({type:2,focus:Pe,trigger:Fe}))),re=Yn((Pe,Ge)=>(C({type:3,payload:{id:Pe,dataRef:Ge}}),()=>{F.isActive(Ge.current.value)&&(E.current=!0),C({type:4,id:Pe})})),oe=Yn(Pe=>(C({type:5,id:Pe}),()=>C({type:5,id:null}))),Q=Yn(Pe=>Ms(F.mode,{0(){return b==null?void 0:b(Pe)},1(){let Ge=F.value.slice(),Fe=Ge.findIndex(bt=>N(bt,Pe));return Fe===-1?Ge.push(Pe):Ge.splice(Fe,1),b==null?void 0:b(Ge)}})),Ne=Yn(Pe=>{C({type:6,trigger:Pe})}),Ve=w.useMemo(()=>({onChange:Q,registerOption:re,registerLabel:oe,goToOption:V,closeCombobox:q,openCombobox:W,setActivationTrigger:Ne,selectActiveOption:H}),[]),Ye=e===null?{}:{ref:e},ye=w.useRef(null),He=L1();return w.useEffect(()=>{ye.current&&i!==void 0&&He.addEventListener(ye.current,"reset",()=>{b==null||b(i)})},[ye,b]),ce.createElement(kme.Provider,{value:Ve},ce.createElement(Ime.Provider,{value:F},ce.createElement(mq,{value:Ms(F.comboboxState,{0:Oa.Open,1:Oa.Closed})},s!=null&&_!=null&&z7e({[s]:_}).map(([Pe,Ge],Fe)=>ce.createElement(g1,{features:n0.Hidden,ref:Fe===0?bt=>{var Mt;ye.current=(Mt=bt==null?void 0:bt.closest("form"))!=null?Mt:null}:void 0,...BH({key:Pe,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,disabled:l,name:Pe,value:Ge})})),Js({ourProps:Ye,theirProps:g,slot:U,defaultTag:B2t,name:"Combobox"}))))}let V2t="input";function H2t(n,e){var t,i,r,o,s;let a=nc(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:d="text",...h}=n,f=Pk("Combobox.Input"),g=TF("Combobox.Input"),m=Ia(f.inputRef,e),v=C0(f.inputRef),_=w.useRef(!1),b=L1(),y=Yn(()=>{g.onChange(null),f.optionsRef.current&&(f.optionsRef.current.scrollTop=0),g.goToOption(la.Nothing)}),C=function(){var F;return typeof u=="function"&&f.value!==void 0?(F=u(f.value))!=null?F:"":typeof f.value=="string"?f.value:""}();H4(([F,U],[H,W])=>{if(_.current)return;let q=f.inputRef.current;q&&((W===0&&U===1||F!==H)&&(q.value=F),requestAnimationFrame(()=>{if(_.current||!q||(v==null?void 0:v.activeElement)!==q)return;let{selectionStart:V,selectionEnd:re}=q;Math.abs((re??0)-(V??0))===0&&V===0&&q.setSelectionRange(q.value.length,q.value.length)}))},[C,f.comboboxState,v]),H4(([F],[U])=>{if(F===0&&U===1){if(_.current)return;let H=f.inputRef.current;if(!H)return;let W=H.value,{selectionStart:q,selectionEnd:V,selectionDirection:re}=H;H.value="",H.value=W,re!==null?H.setSelectionRange(q,V,re):H.setSelectionRange(q,V)}},[f.comboboxState]);let E=w.useRef(!1),x=Yn(()=>{E.current=!0}),k=Yn(()=>{b.nextFrame(()=>{E.current=!1})}),L=Yn(F=>{switch(_.current=!0,F.key){case Ao.Enter:if(_.current=!1,f.comboboxState!==0||E.current)return;if(F.preventDefault(),F.stopPropagation(),f.activeOptionIndex===null){g.closeCombobox();return}g.selectActiveOption(),f.mode===0&&g.closeCombobox();break;case Ao.ArrowDown:return _.current=!1,F.preventDefault(),F.stopPropagation(),Ms(f.comboboxState,{0:()=>g.goToOption(la.Next),1:()=>g.openCombobox()});case Ao.ArrowUp:return _.current=!1,F.preventDefault(),F.stopPropagation(),Ms(f.comboboxState,{0:()=>g.goToOption(la.Previous),1:()=>{g.openCombobox(),b.nextFrame(()=>{f.value||g.goToOption(la.Last)})}});case Ao.Home:if(F.shiftKey)break;return _.current=!1,F.preventDefault(),F.stopPropagation(),g.goToOption(la.First);case Ao.PageUp:return _.current=!1,F.preventDefault(),F.stopPropagation(),g.goToOption(la.First);case Ao.End:if(F.shiftKey)break;return _.current=!1,F.preventDefault(),F.stopPropagation(),g.goToOption(la.Last);case Ao.PageDown:return _.current=!1,F.preventDefault(),F.stopPropagation(),g.goToOption(la.Last);case Ao.Escape:return _.current=!1,f.comboboxState!==0?void 0:(F.preventDefault(),f.optionsRef.current&&!f.optionsPropsRef.current.static&&F.stopPropagation(),f.nullable&&f.mode===0&&f.value===null&&y(),g.closeCombobox());case Ao.Tab:if(_.current=!1,f.comboboxState!==0)return;f.mode===0&&f.activationTrigger!==1&&g.selectActiveOption(),g.closeCombobox();break}}),D=Yn(F=>{c==null||c(F),f.nullable&&f.mode===0&&F.target.value===""&&y(),g.openCombobox()}),A=Yn(F=>{var U,H,W;let q=(U=F.relatedTarget)!=null?U:hb.find(V=>V!==F.currentTarget);if(_.current=!1,!((H=f.optionsRef.current)!=null&&H.contains(q))&&!((W=f.buttonRef.current)!=null&&W.contains(q))&&f.comboboxState===0)return F.preventDefault(),f.mode===0&&(f.nullable&&f.value===null?y():f.activationTrigger!==1&&g.selectActiveOption()),g.closeCombobox()}),N=Yn(F=>{var U,H,W;let q=(U=F.relatedTarget)!=null?U:hb.find(V=>V!==F.currentTarget);(H=f.buttonRef.current)!=null&&H.contains(q)||(W=f.optionsRef.current)!=null&&W.contains(q)||f.disabled||f.immediate&&f.comboboxState!==0&&(g.openCombobox(),b.nextFrame(()=>{g.setActivationTrigger(1)}))}),P=Eme(()=>{if(f.labelId)return[f.labelId].join(" ")},[f.labelId]),M=w.useMemo(()=>({open:f.comboboxState===0,disabled:f.disabled}),[f]),B={ref:m,id:l,role:"combobox",type:d,"aria-controls":(t=f.optionsRef.current)==null?void 0:t.id,"aria-expanded":f.comboboxState===0,"aria-activedescendant":f.activeOptionIndex===null?void 0:f.virtual?(i=f.options.find(F=>{var U;return!((U=f.virtual)!=null&&U.disabled(F.dataRef.current.value))&&f.compare(F.dataRef.current.value,f.virtual.options[f.activeOptionIndex])}))==null?void 0:i.id:(r=f.options[f.activeOptionIndex])==null?void 0:r.id,"aria-labelledby":P,"aria-autocomplete":"list",defaultValue:(s=(o=n.defaultValue)!=null?o:f.defaultValue!==void 0?u==null?void 0:u(f.defaultValue):null)!=null?s:f.defaultValue,disabled:f.disabled,onCompositionStart:x,onCompositionEnd:k,onKeyDown:L,onChange:D,onFocus:N,onBlur:A};return Js({ourProps:B,theirProps:h,slot:M,defaultTag:V2t,name:"Combobox.Input"})}let W2t="button";function z2t(n,e){var t;let i=Pk("Combobox.Button"),r=TF("Combobox.Button"),o=Ia(i.buttonRef,e),s=nc(),{id:a=`headlessui-combobox-button-${s}`,...l}=n,c=L1(),u=Yn(m=>{switch(m.key){case Ao.ArrowDown:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&r.openCombobox(),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case Ao.ArrowUp:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&(r.openCombobox(),c.nextFrame(()=>{i.value||r.goToOption(la.Last)})),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case Ao.Escape:return i.comboboxState!==0?void 0:(m.preventDefault(),i.optionsRef.current&&!i.optionsPropsRef.current.static&&m.stopPropagation(),r.closeCombobox(),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})}));default:return}}),d=Yn(m=>{if(IR(m.currentTarget))return m.preventDefault();i.comboboxState===0?r.closeCombobox():(m.preventDefault(),r.openCombobox()),c.nextFrame(()=>{var v;return(v=i.inputRef.current)==null?void 0:v.focus({preventScroll:!0})})}),h=Eme(()=>{if(i.labelId)return[i.labelId,a].join(" ")},[i.labelId,a]),f=w.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled,value:i.value}),[i]),g={ref:o,id:a,type:gq(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 Js({ourProps:g,theirProps:l,slot:f,defaultTag:W2t,name:"Combobox.Button"})}let U2t="label";function j2t(n,e){let t=nc(),{id:i=`headlessui-combobox-label-${t}`,...r}=n,o=Pk("Combobox.Label"),s=TF("Combobox.Label"),a=Ia(o.labelRef,e);Zs(()=>s.registerLabel(i),[i]);let l=Yn(()=>{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 Js({ourProps:{ref:a,id:i,onClick:l},theirProps:r,slot:c,defaultTag:U2t,name:"Combobox.Label"})}let q2t="ul",G2t=Mm.RenderStrategy|Mm.Static;function K2t(n,e){let t=nc(),{id:i=`headlessui-combobox-options-${t}`,hold:r=!1,...o}=n,s=Pk("Combobox.Options"),a=Ia(s.optionsRef,e),l=Ok(),c=(()=>l!==null?(l&Oa.Open)===Oa.Open:s.comboboxState===0)();Zs(()=>{var f;s.optionsPropsRef.current.static=(f=n.static)!=null?f:!1},[s.optionsPropsRef,n.static]),Zs(()=>{s.optionsPropsRef.current.hold=r},[s.optionsPropsRef,r]),H7e({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(f){return f.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let u=Eme(()=>{var f,g;return(g=s.labelId)!=null?g:(f=s.buttonRef.current)==null?void 0:f.id},[s.labelId,s.buttonRef.current]),d=w.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:i,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(o,{children:ce.createElement(M2t,null,o.children)}),Js({ourProps:h,theirProps:o,slot:d,defaultTag:q2t,features:G2t,visible:c,name:"Combobox.Options"})}let Y2t="li";function Q2t(n,e){var t;let i=nc(),{id:r=`headlessui-combobox-option-${i}`,disabled:o=!1,value:s,order:a=null,...l}=n,c=Pk("Combobox.Option"),u=TF("Combobox.Option"),d=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((t=c.options[c.activeOptionIndex])==null?void 0:t.id)===r,h=c.isSelected(s),f=w.useRef(null),g=ig({disabled:o,value:s,domRef:f,order:a}),m=w.useContext(q7e),v=Ia(e,f,m?m.measureElement:null),_=Yn(()=>u.onChange(s));Zs(()=>u.registerOption(r,g),[g,r]);let b=w.useRef(!(c.virtual||c.__demoMode));Zs(()=>{if(!c.virtual||!c.__demoMode)return;let A=gg();return A.requestAnimationFrame(()=>{b.current=!0}),A.dispose},[c.virtual,c.__demoMode]),Zs(()=>{if(!b.current||c.comboboxState!==0||!d||c.activationTrigger===0)return;let A=gg();return A.requestAnimationFrame(()=>{var N,P;(P=(N=f.current)==null?void 0:N.scrollIntoView)==null||P.call(N,{block:"nearest"})}),A.dispose},[f,d,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let y=Yn(A=>{var N;if(o||(N=c.virtual)!=null&&N.disabled(s))return A.preventDefault();_(),M7e()||requestAnimationFrame(()=>{var P;return(P=c.inputRef.current)==null?void 0:P.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=Yn(()=>{var A;if(o||(A=c.virtual)!=null&&A.disabled(s))return u.goToOption(la.Nothing);let N=c.calculateIndex(s);u.goToOption(la.Specific,N)}),E=V7e(),x=Yn(A=>E.update(A)),k=Yn(A=>{var N;if(!E.wasMoved(A)||o||(N=c.virtual)!=null&&N.disabled(s)||d)return;let P=c.calculateIndex(s);u.goToOption(la.Specific,P,0)}),L=Yn(A=>{var N;E.wasMoved(A)&&(o||(N=c.virtual)!=null&&N.disabled(s)||d&&(c.optionsPropsRef.current.hold||u.goToOption(la.Nothing)))}),D=w.useMemo(()=>({active:d,selected:h,disabled:o}),[d,h,o]);return Js({ourProps:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:y,onFocus:C,onPointerEnter:x,onMouseEnter:x,onPointerMove:k,onMouseMove:k,onPointerLeave:L,onMouseLeave:L},theirProps:l,slot:D,defaultTag:Y2t,name:"Combobox.Option"})}let X2t=ea($2t),Z2t=ea(z2t),J2t=ea(H2t),eLt=ea(j2t),tLt=ea(K2t),nLt=ea(Q2t),F_=Object.assign(X2t,{Input:J2t,Button:Z2t,Label:eLt,Options:tLt,Option:nLt});function Lme(n,e,t,i){let r=ig(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 kF(){let n=w.useRef(!1);return Zs(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function G7e(n){let e=Yn(n),t=w.useRef(!1);w.useEffect(()=>(t.current=!1,()=>{t.current=!0,dq(()=>{t.current&&e()})}),[e])}var jp=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(jp||{});function Dme(){let n=w.useRef(0);return F7e("keydown",e=>{e.key==="Tab"&&(n.current=e.shiftKey?1:0)},!0),n}function K7e(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 iLt="div";var Y7e=(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))(Y7e||{});function rLt(n,e){let t=w.useRef(null),i=Ia(t,e),{initialFocus:r,containers:o,features:s=30,...a}=n;kR()||(s=1);let l=C0(t);aLt({ownerDocument:l},!!(s&16));let c=lLt({ownerDocument:l,container:t,initialFocus:r},!!(s&2));cLt({ownerDocument:l,container:t,containers:o,previousActiveElement:c},!!(s&8));let u=Dme(),d=Yn(m=>{let v=t.current;v&&(_=>_())(()=>{Ms(u.current,{[jp.Forwards]:()=>{hm(v,bd.First,{skipElements:[m.relatedTarget]})},[jp.Backwards]:()=>{hm(v,bd.Last,{skipElements:[m.relatedTarget]})}})})}),h=L1(),f=w.useRef(!1),g={ref:i,onKeyDown(m){m.key=="Tab"&&(f.current=!0,h.requestAnimationFrame(()=>{f.current=!1}))},onBlur(m){let v=K7e(o);t.current instanceof HTMLElement&&v.add(t.current);let _=m.relatedTarget;_ instanceof HTMLElement&&_.dataset.headlessuiFocusGuard!=="true"&&(Q7e(v,_)||(f.current?hm(t.current,Ms(u.current,{[jp.Forwards]:()=>bd.Next,[jp.Backwards]:()=>bd.Previous})|bd.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&kw(m.target)))}};return ce.createElement(ce.Fragment,null,!!(s&4)&&ce.createElement(g1,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:n0.Focusable}),Js({ourProps:g,theirProps:a,defaultTag:iLt,name:"FocusTrap"}),!!(s&4)&&ce.createElement(g1,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:n0.Focusable}))}let oLt=ea(rLt),nO=Object.assign(oLt,{features:Y7e});function sLt(n=!0){let e=w.useRef(hb.slice());return H4(([t],[i])=>{i===!0&&t===!1&&dq(()=>{e.current.splice(0)}),i===!1&&t===!0&&(e.current=hb.slice())},[n,hb,e]),Yn(()=>{var t;return(t=e.current.find(i=>i!=null&&i.isConnected))!=null?t:null})}function aLt({ownerDocument:n},e){let t=sLt(e);H4(()=>{e||(n==null?void 0:n.activeElement)===(n==null?void 0:n.body)&&kw(t())},[e]),G7e(()=>{e&&kw(t())})}function lLt({ownerDocument:n,container:e,initialFocus:t},i){let r=w.useRef(null),o=kF();return H4(()=>{if(!i)return;let s=e.current;s&&dq(()=>{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?kw(t.current):hm(s,bd.First)===V4.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),r.current=n==null?void 0:n.activeElement})},[i]),r}function cLt({ownerDocument:n,container:e,containers:t,previousActiveElement:i},r){let o=kF();Lme(n==null?void 0:n.defaultView,"focus",s=>{if(!r||!o.current)return;let a=K7e(t);e.current instanceof HTMLElement&&a.add(e.current);let l=i.current;if(!l)return;let c=s.target;c&&c instanceof HTMLElement?Q7e(a,c)?(i.current=c,kw(c)):(s.preventDefault(),s.stopPropagation(),kw(l)):kw(i.current)},!0)}function Q7e(n,e){for(let t of n)if(t.contains(e))return!0;return!1}let X7e=w.createContext(!1);function uLt(){return w.useContext(X7e)}function _oe(n){return ce.createElement(X7e.Provider,{value:n.force},n.children)}function dLt(n){let e=uLt(),t=w.useContext(Z7e),i=C0(n),[r,o]=w.useState(()=>{if(!e&&t!==null||Gy.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 hLt=w.Fragment;function fLt(n,e){let t=n,i=w.useRef(null),r=Ia($7e(u=>{i.current=u}),e),o=C0(i),s=dLt(i),[a]=w.useState(()=>{var u;return Gy.isServer?null:(u=o==null?void 0:o.createElement("div"))!=null?u:null}),l=w.useContext(voe),c=kR();return Zs(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),Zs(()=>{if(a&&l)return l.register(a)},[l,a]),G7e(()=>{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:op.createPortal(Js({ourProps:{ref:r},theirProps:t,defaultTag:hLt,name:"Portal"}),a):null}let pLt=w.Fragment,Z7e=w.createContext(null);function gLt(n,e){let{target:t,...i}=n,r={ref:Ia(e)};return ce.createElement(Z7e.Provider,{value:t},Js({ourProps:r,theirProps:i,defaultTag:pLt,name:"Popover.Group"}))}let voe=w.createContext(null);function J7e(){let n=w.useContext(voe),e=w.useRef([]),t=Yn(o=>(e.current.push(o),n&&n.register(o),()=>i(o))),i=Yn(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 ce.createElement(voe.Provider,{value:r},o)},[r])]}let mLt=ea(fLt),_Lt=ea(gLt),boe=Object.assign(mLt,{Group:_Lt});function vLt(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const bLt=typeof Object.is=="function"?Object.is:vLt,{useState:yLt,useEffect:CLt,useLayoutEffect:wLt,useDebugValue:SLt}=Lm;function ELt(n,e,t){const i=e(),[{inst:r},o]=yLt({inst:{value:i,getSnapshot:e}});return wLt(()=>{r.value=i,r.getSnapshot=e,qZ(r)&&o({inst:r})},[n,i,e]),CLt(()=>(qZ(r)&&o({inst:r}),n(()=>{qZ(r)&&o({inst:r})})),[n]),SLt(i),i}function qZ(n){const e=n.getSnapshot,t=n.value;try{const i=e();return!bLt(t,i)}catch{return!0}}function xLt(n,e,t){return e()}const TLt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kLt=!TLt,ILt=kLt?xLt:ELt,LLt="useSyncExternalStore"in Lm?(n=>n.useSyncExternalStore)(Lm):ILt;function DLt(n){return LLt(n.subscribe,n.getSnapshot,n.getSnapshot)}function ALt(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 RLt(){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 NLt(){return P7e()?{before({doc:n,d:e,meta:t}){function i(r){return t.containers.flatMap(o=>o()).some(o=>o.contains(r))}e.microTask(()=>{var r;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let a=gg();a.style(n.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>a.dispose()))}let o=(r=window.scrollY)!=null?r:window.pageYOffset,s=null;e.addEventListener(n,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=n.querySelector(c);u&&!i(u)&&(s=u)}catch{}},!0),e.addEventListener(n,"touchstart",a=>{if(a.target instanceof HTMLElement)if(i(a.target)){let l=a.target;for(;l.parentElement&&i(l.parentElement);)l=l.parentElement;e.style(l,"overscrollBehavior","contain")}else e.style(a.target,"touchAction","none")}),e.addEventListener(n,"touchmove",a=>{if(a.target instanceof HTMLElement)if(i(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()},{passive:!1}),e.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;o!==l&&window.scrollTo(0,o),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function OLt(){return{before({doc:n,d:e}){e.style(n.documentElement,"overflow","hidden")}}}function PLt(n){let e={};for(let t of n)Object.assign(e,t(e));return e}let Px=ALt(()=>new Map,{PUSH(n,e){var t;let i=(t=this.get(n))!=null?t:{doc:n,count:0,d:gg(),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:PLt(t)},r=[NLt(),RLt(),OLt()];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)}});Px.subscribe(()=>{let n=Px.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)&&Px.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&Px.dispatch("TEARDOWN",t)}});function MLt(n,e,t){let i=DLt(Px),r=n?i.get(n):void 0,o=r?r.count>0:!1;return Zs(()=>{if(!(!n||!e))return Px.dispatch("PUSH",n,t),()=>Px.dispatch("POP",n,t)},[e,n]),o}let GZ=new Map,iO=new Map;function ake(n,e=!0){Zs(()=>{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=iO.get(i))!=null?s:1;if(a===1?iO.delete(i):iO.set(i,a-1),a!==1)return;let l=GZ.get(i);l&&(l["aria-hidden"]===null?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden",l["aria-hidden"]),i.inert=l.inert,GZ.delete(i))}let o=(t=iO.get(i))!=null?t:0;return iO.set(i,o+1),o!==0||(GZ.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),i.setAttribute("aria-hidden","true"),i.inert=!0),r},[n,e])}function e$e({defaultContainers:n=[],portals:e,mainTreeNodeRef:t}={}){var i;let r=w.useRef((i=t==null?void 0:t.current)!=null?i:null),o=C0(r),s=Yn(()=>{var a,l,c;let u=[];for(let d of n)d!==null&&(d instanceof HTMLElement?u.push(d):"current"in d&&d.current instanceof HTMLElement&&u.push(d.current));if(e!=null&&e.current)for(let d of e.current)u.push(d);for(let d of(a=o==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])d!==document.body&&d!==document.head&&d instanceof HTMLElement&&d.id!=="headlessui-portal-root"&&(d.contains(r.current)||d.contains((c=(l=r.current)==null?void 0:l.getRootNode())==null?void 0:c.host)||u.some(h=>d.contains(h))||u.push(d));return u});return{resolveContainers:s,contains:Yn(a=>s().some(l=>l.contains(a))),mainTreeNodeRef:r,MainTreeNode:w.useMemo(()=>function(){return t!=null?null:ce.createElement(g1,{features:n0.Hidden,ref:r})},[r,t])}}function FLt(){let n=w.useRef(null);return{mainTreeNodeRef:n,MainTreeNode:w.useMemo(()=>function(){return ce.createElement(g1,{features:n0.Hidden,ref:n})},[n])}}let Ame=w.createContext(()=>{});Ame.displayName="StackContext";var yoe=(n=>(n[n.Add=0]="Add",n[n.Remove=1]="Remove",n))(yoe||{});function BLt(){return w.useContext(Ame)}function $Lt({children:n,onUpdate:e,type:t,element:i,enabled:r}){let o=BLt(),s=Yn((...a)=>{e==null||e(...a),o(...a)});return Zs(()=>{let a=r===void 0||r===!0;return a&&s(0,t,i),()=>{a&&s(1,t,i)}},[s,t,i,r]),ce.createElement(Ame.Provider,{value:s},n)}let t$e=w.createContext(null);function n$e(){let n=w.useContext(t$e);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,n$e),e}return n}function i$e(){let[n,e]=w.useState([]);return[n.length>0?n.join(" "):void 0,w.useMemo(()=>function(t){let i=Yn(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 ce.createElement(t$e.Provider,{value:r},t.children)},[e])]}let VLt="p";function HLt(n,e){let t=nc(),{id:i=`headlessui-description-${t}`,...r}=n,o=n$e(),s=Ia(e);Zs(()=>o.register(i),[i,o.register]);let a={ref:s,...o.props,id:i};return Js({ourProps:a,theirProps:r,slot:o.slot||{},defaultTag:VLt,name:o.name||"Description"})}let WLt=ea(HLt),r$e=Object.assign(WLt,{});var zLt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(zLt||{}),ULt=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(ULt||{});let jLt={0(n,e){return n.titleId===e.id?n:{...n,titleId:e.id}}},$H=w.createContext(null);$H.displayName="DialogContext";function IF(n){let e=w.useContext($H);if(e===null){let t=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,IF),t}return e}function qLt(n,e,t=()=>[document.body]){MLt(n,e,i=>{var r;return{containers:[...(r=i.containers)!=null?r:[],t]}})}function GLt(n,e){return Ms(e.type,jLt,n,e)}let KLt="div",YLt=Mm.RenderStrategy|Mm.Static;function QLt(n,e){let t=nc(),{id:i=`headlessui-dialog-${t}`,open:r,onClose:o,initialFocus:s,role:a="dialog",__demoMode:l=!1,...c}=n,[u,d]=w.useState(0),h=w.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(h.current||(h.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let f=Ok();r===void 0&&f!==null&&(r=(f&Oa.Open)===Oa.Open);let g=w.useRef(null),m=Ia(g,e),v=C0(g),_=n.hasOwnProperty("open")||f!==null,b=n.hasOwnProperty("onClose");if(!_&&!b)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(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof r!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let y=r?0:1,[C,E]=w.useReducer(GLt,{titleId:null,descriptionId:null,panelRef:w.createRef()}),x=Yn(()=>o(!1)),k=Yn(Fe=>E({type:0,id:Fe})),L=kR()?l?!1:y===0:!1,D=u>1,A=w.useContext($H)!==null,[N,P]=J7e(),M={get current(){var Fe;return(Fe=C.panelRef.current)!=null?Fe:g.current}},{resolveContainers:B,mainTreeNodeRef:F,MainTreeNode:U}=e$e({portals:N,defaultContainers:[M]}),H=D?"parent":"leaf",W=f!==null?(f&Oa.Closing)===Oa.Closing:!1,q=(()=>A||W?!1:L)(),V=w.useCallback(()=>{var Fe,bt;return(bt=Array.from((Fe=v==null?void 0:v.querySelectorAll("body > *"))!=null?Fe:[]).find(Mt=>Mt.id==="headlessui-portal-root"?!1:Mt.contains(F.current)&&Mt instanceof HTMLElement))!=null?bt:null},[F]);ake(V,q);let re=(()=>D?!0:L)(),oe=w.useCallback(()=>{var Fe,bt;return(bt=Array.from((Fe=v==null?void 0:v.querySelectorAll("[data-headlessui-portal]"))!=null?Fe:[]).find(Mt=>Mt.contains(F.current)&&Mt instanceof HTMLElement))!=null?bt:null},[F]);ake(oe,re);let Q=(()=>!(!L||D))();pq(B,Fe=>{Fe.preventDefault(),x()},Q);let Ne=(()=>!(D||y!==0))();Lme(v==null?void 0:v.defaultView,"keydown",Fe=>{Ne&&(Fe.defaultPrevented||Fe.key===Ao.Escape&&(Fe.preventDefault(),Fe.stopPropagation(),x()))});let Ve=(()=>!(W||y!==0||A))();qLt(v,Ve,B),w.useEffect(()=>{if(y!==0||!g.current)return;let Fe=new ResizeObserver(bt=>{for(let Mt of bt){let Ft=Mt.target.getBoundingClientRect();Ft.x===0&&Ft.y===0&&Ft.width===0&&Ft.height===0&&x()}});return Fe.observe(g.current),()=>Fe.disconnect()},[y,g,x]);let[Ye,ye]=i$e(),He=w.useMemo(()=>[{dialogState:y,close:x,setTitleId:k},C],[y,C,x,k]),Pe=w.useMemo(()=>({open:y===0}),[y]),Ge={ref:m,id:i,role:a,"aria-modal":y===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":Ye};return ce.createElement($Lt,{type:"Dialog",enabled:y===0,element:g,onUpdate:Yn((Fe,bt)=>{bt==="Dialog"&&Ms(Fe,{[yoe.Add]:()=>d(Mt=>Mt+1),[yoe.Remove]:()=>d(Mt=>Mt-1)})})},ce.createElement(_oe,{force:!0},ce.createElement(boe,null,ce.createElement($H.Provider,{value:He},ce.createElement(boe.Group,{target:g},ce.createElement(_oe,{force:!1},ce.createElement(ye,{slot:Pe,name:"Dialog.Description"},ce.createElement(nO,{initialFocus:s,containers:B,features:L?Ms(H,{parent:nO.features.RestoreFocus,leaf:nO.features.All&~nO.features.FocusLock}):nO.features.None},ce.createElement(P,null,Js({ourProps:Ge,theirProps:c,slot:Pe,defaultTag:KLt,features:YLt,visible:y===0,name:"Dialog"}))))))))),ce.createElement(U,null))}let XLt="div";function ZLt(n,e){let t=nc(),{id:i=`headlessui-dialog-overlay-${t}`,...r}=n,[{dialogState:o,close:s}]=IF("Dialog.Overlay"),a=Ia(e),l=Yn(u=>{if(u.target===u.currentTarget){if(IR(u.currentTarget))return u.preventDefault();u.preventDefault(),u.stopPropagation(),s()}}),c=w.useMemo(()=>({open:o===0}),[o]);return Js({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:l},theirProps:r,slot:c,defaultTag:XLt,name:"Dialog.Overlay"})}let JLt="div";function eDt(n,e){let t=nc(),{id:i=`headlessui-dialog-backdrop-${t}`,...r}=n,[{dialogState:o},s]=IF("Dialog.Backdrop"),a=Ia(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 ce.createElement(_oe,{force:!0},ce.createElement(boe,null,Js({ourProps:{ref:a,id:i,"aria-hidden":!0},theirProps:r,slot:l,defaultTag:JLt,name:"Dialog.Backdrop"})))}let tDt="div";function nDt(n,e){let t=nc(),{id:i=`headlessui-dialog-panel-${t}`,...r}=n,[{dialogState:o},s]=IF("Dialog.Panel"),a=Ia(e,s.panelRef),l=w.useMemo(()=>({open:o===0}),[o]),c=Yn(u=>{u.stopPropagation()});return Js({ourProps:{ref:a,id:i,onClick:c},theirProps:r,slot:l,defaultTag:tDt,name:"Dialog.Panel"})}let iDt="h2";function rDt(n,e){let t=nc(),{id:i=`headlessui-dialog-title-${t}`,...r}=n,[{dialogState:o,setTitleId:s}]=IF("Dialog.Title"),a=Ia(e);w.useEffect(()=>(s(i),()=>s(null)),[i,s]);let l=w.useMemo(()=>({open:o===0}),[o]);return Js({ourProps:{ref:a,id:i},theirProps:r,slot:l,defaultTag:iDt,name:"Dialog.Title"})}let oDt=ea(QLt),sDt=ea(eDt),aDt=ea(nDt),lDt=ea(ZLt),cDt=ea(rDt),eM=Object.assign(oDt,{Backdrop:sDt,Panel:aDt,Overlay:lDt,Title:cDt,Description:r$e}),lke=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function cke(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 lke.test(s)&&(s=s.replace(lke,"")),s}function uDt(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():cke(o).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return cke(n).trim()}function dDt(n){let e=w.useRef(""),t=w.useRef("");return Yn(()=>{let i=n.current;if(!i)return"";let r=i.innerText;if(e.current===r)return t.current;let o=uDt(i).trim().toLowerCase();return e.current=r,t.current=o,o})}var hDt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(hDt||{}),fDt=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(fDt||{}),pDt=(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))(pDt||{});function KZ(n,e=t=>t){let t=n.activeItemIndex!==null?n.items[n.activeItemIndex]:null,i=xme(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 gDt={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=KZ(n),r=moe(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=KZ(n,i=>[...i,{id:e.id,dataRef:e.dataRef}]);return{...n,...t}},6:(n,e)=>{let t=KZ(n,i=>{let r=i.findIndex(o=>o.id===e.id);return r!==-1&&i.splice(r,1),i});return{...n,...t,activationTrigger:1}}},Rme=w.createContext(null);Rme.displayName="MenuContext";function _q(n){let e=w.useContext(Rme);if(e===null){let t=new Error(`<${n} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,_q),t}return e}function mDt(n,e){return Ms(e.type,gDt,n,e)}let _Dt=w.Fragment;function vDt(n,e){let{__demoMode:t=!1,...i}=n,r=w.useReducer(mDt,{__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=Ia(e);pq([a,s],(f,g)=>{var m;l({type:1}),fq(g,hq.Loose)||(f.preventDefault(),(m=a.current)==null||m.focus())},o===0);let u=Yn(()=>{l({type:1})}),d=w.useMemo(()=>({open:o===0,close:u}),[o,u]),h={ref:c};return ce.createElement(Rme.Provider,{value:r},ce.createElement(mq,{value:Ms(o,{0:Oa.Open,1:Oa.Closed})},Js({ourProps:h,theirProps:i,slot:d,defaultTag:_Dt,name:"Menu"})))}let bDt="button";function yDt(n,e){var t;let i=nc(),{id:r=`headlessui-menu-button-${i}`,...o}=n,[s,a]=_q("Menu.Button"),l=Ia(s.buttonRef,e),c=L1(),u=Yn(m=>{switch(m.key){case Ao.Space:case Ao.Enter:case Ao.ArrowDown:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:la.First}));break;case Ao.ArrowUp:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:la.Last}));break}}),d=Yn(m=>{switch(m.key){case Ao.Space:m.preventDefault();break}}),h=Yn(m=>{if(IR(m.currentTarget))return m.preventDefault();n.disabled||(s.menuState===0?(a({type:1}),c.nextFrame(()=>{var v;return(v=s.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})})):(m.preventDefault(),a({type:0})))}),f=w.useMemo(()=>({open:s.menuState===0}),[s]),g={ref:l,id:r,type:gq(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 Js({ourProps:g,theirProps:o,slot:f,defaultTag:bDt,name:"Menu.Button"})}let CDt="div",wDt=Mm.RenderStrategy|Mm.Static;function SDt(n,e){var t,i;let r=nc(),{id:o=`headlessui-menu-items-${r}`,...s}=n,[a,l]=_q("Menu.Items"),c=Ia(a.itemsRef,e),u=C0(a.itemsRef),d=L1(),h=Ok(),f=(()=>h!==null?(h&Oa.Open)===Oa.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]),H7e({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 g=Yn(b=>{var y,C;switch(d.dispose(),b.key){case Ao.Space:if(a.searchQuery!=="")return b.preventDefault(),b.stopPropagation(),l({type:3,value:b.key});case Ao.Enter:if(b.preventDefault(),b.stopPropagation(),l({type:1}),a.activeItemIndex!==null){let{dataRef:E}=a.items[a.activeItemIndex];(C=(y=E.current)==null?void 0:y.domRef.current)==null||C.click()}O7e(a.buttonRef.current);break;case Ao.ArrowDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:la.Next});case Ao.ArrowUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:la.Previous});case Ao.Home:case Ao.PageUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:la.First});case Ao.End:case Ao.PageDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:la.Last});case Ao.Escape:b.preventDefault(),b.stopPropagation(),l({type:1}),gg().nextFrame(()=>{var E;return(E=a.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})});break;case Ao.Tab:b.preventDefault(),b.stopPropagation(),l({type:1}),gg().nextFrame(()=>{C2t(a.buttonRef.current,b.shiftKey?bd.Previous:bd.Next)});break;default:b.key.length===1&&(l({type:3,value:b.key}),d.setTimeout(()=>l({type:4}),350));break}}),m=Yn(b=>{switch(b.key){case Ao.Space:b.preventDefault();break}}),v=w.useMemo(()=>({open:a.menuState===0}),[a]),_={"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:g,onKeyUp:m,role:"menu",tabIndex:0,ref:c};return Js({ourProps:_,theirProps:s,slot:v,defaultTag:CDt,features:wDt,visible:f,name:"Menu.Items"})}let EDt=w.Fragment;function xDt(n,e){let t=nc(),{id:i=`headlessui-menu-item-${t}`,disabled:r=!1,...o}=n,[s,a]=_q("Menu.Item"),l=s.activeItemIndex!==null?s.items[s.activeItemIndex].id===i:!1,c=w.useRef(null),u=Ia(e,c);Zs(()=>{if(s.__demoMode||s.menuState!==0||!l||s.activationTrigger===0)return;let E=gg();return E.requestAnimationFrame(()=>{var x,k;(k=(x=c.current)==null?void 0:x.scrollIntoView)==null||k.call(x,{block:"nearest"})}),E.dispose},[s.__demoMode,c,l,s.menuState,s.activationTrigger,s.activeItemIndex]);let d=dDt(c),h=w.useRef({disabled:r,domRef:c,get textValue(){return d()}});Zs(()=>{h.current.disabled=r},[h,r]),Zs(()=>(a({type:5,id:i,dataRef:h}),()=>a({type:6,id:i})),[h,i]);let f=Yn(()=>{a({type:1})}),g=Yn(E=>{if(r)return E.preventDefault();a({type:1}),O7e(s.buttonRef.current)}),m=Yn(()=>{if(r)return a({type:2,focus:la.Nothing});a({type:2,focus:la.Specific,id:i})}),v=V7e(),_=Yn(E=>v.update(E)),b=Yn(E=>{v.wasMoved(E)&&(r||l||a({type:2,focus:la.Specific,id:i,trigger:0}))}),y=Yn(E=>{v.wasMoved(E)&&(r||l&&a({type:2,focus:la.Nothing}))}),C=w.useMemo(()=>({active:l,disabled:r,close:f}),[l,r,f]);return Js({ourProps:{id:i,ref:u,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,disabled:void 0,onClick:g,onFocus:m,onPointerEnter:_,onMouseEnter:_,onPointerMove:b,onMouseMove:b,onPointerLeave:y,onMouseLeave:y},theirProps:o,slot:C,defaultTag:EDt,name:"Menu.Item"})}let TDt=ea(vDt),kDt=ea(yDt),IDt=ea(SDt),LDt=ea(xDt),J1=Object.assign(TDt,{Button:kDt,Items:IDt,Item:LDt});var DDt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(DDt||{}),ADt=(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))(ADt||{});let RDt={0:n=>{let e={...n,popoverState:Ms(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}}},Nme=w.createContext(null);Nme.displayName="PopoverContext";function vq(n){let e=w.useContext(Nme);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,vq),t}return e}let Ome=w.createContext(null);Ome.displayName="PopoverAPIContext";function Pme(n){let e=w.useContext(Ome);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Pme),t}return e}let Mme=w.createContext(null);Mme.displayName="PopoverGroupContext";function o$e(){return w.useContext(Mme)}let bq=w.createContext(null);bq.displayName="PopoverPanelContext";function NDt(){return w.useContext(bq)}function ODt(n,e){return Ms(e.type,RDt,n,e)}let PDt="div";function MDt(n,e){var t;let{__demoMode:i=!1,...r}=n,o=w.useRef(null),s=Ia(e,$7e(U=>{o.current=U})),a=w.useRef([]),l=w.useReducer(ODt,{__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:f,beforePanelSentinel:g,afterPanelSentinel:m},v]=l,_=C0((t=o.current)!=null?t:u),b=w.useMemo(()=>{if(!u||!h)return!1;for(let oe of document.querySelectorAll("body > *"))if(Number(oe==null?void 0:oe.contains(u))^Number(oe==null?void 0:oe.contains(h)))return!0;let U=xF(),H=U.indexOf(u),W=(H+U.length-1)%U.length,q=(H+1)%U.length,V=U[W],re=U[q];return!h.contains(V)&&!h.contains(re)},[u,h]),y=ig(d),C=ig(f),E=w.useMemo(()=>({buttonId:y,panelId:C,close:()=>v({type:1})}),[y,C,v]),x=o$e(),k=x==null?void 0:x.registerPopover,L=Yn(()=>{var U;return(U=x==null?void 0:x.isFocusWithinPopoverGroup())!=null?U:(_==null?void 0:_.activeElement)&&((u==null?void 0:u.contains(_.activeElement))||(h==null?void 0:h.contains(_.activeElement)))});w.useEffect(()=>k==null?void 0:k(E),[k,E]);let[D,A]=J7e(),N=e$e({mainTreeNodeRef:x==null?void 0:x.mainTreeNodeRef,portals:D,defaultContainers:[u,h]});Lme(_==null?void 0:_.defaultView,"focus",U=>{var H,W,q,V;U.target!==window&&U.target instanceof HTMLElement&&c===0&&(L()||u&&h&&(N.contains(U.target)||(W=(H=g.current)==null?void 0:H.contains)!=null&&W.call(H,U.target)||(V=(q=m.current)==null?void 0:q.contains)!=null&&V.call(q,U.target)||v({type:1})))},!0),pq(N.resolveContainers,(U,H)=>{v({type:1}),fq(H,hq.Loose)||(U.preventDefault(),u==null||u.focus())},c===0);let P=Yn(U=>{v({type:1});let H=(()=>U?U instanceof HTMLElement?U:"current"in U&&U.current instanceof HTMLElement?U.current:u:u)();H==null||H.focus()}),M=w.useMemo(()=>({close:P,isPortalled:b}),[P,b]),B=w.useMemo(()=>({open:c===0,close:P}),[c,P]),F={ref:s};return ce.createElement(bq.Provider,{value:null},ce.createElement(Nme.Provider,{value:l},ce.createElement(Ome.Provider,{value:M},ce.createElement(mq,{value:Ms(c,{0:Oa.Open,1:Oa.Closed})},ce.createElement(A,null,Js({ourProps:F,theirProps:r,slot:B,defaultTag:PDt,name:"Popover"}),ce.createElement(N.MainTreeNode,null))))))}let FDt="button";function BDt(n,e){let t=nc(),{id:i=`headlessui-popover-button-${t}`,...r}=n,[o,s]=vq("Popover.Button"),{isPortalled:a}=Pme("Popover.Button"),l=w.useRef(null),c=`headlessui-focus-sentinel-${nc()}`,u=o$e(),d=u==null?void 0:u.closeOthers,h=NDt()!==null;w.useEffect(()=>{if(!h)return s({type:3,buttonId:i}),()=>{s({type:3,buttonId:null})}},[h,i,s]);let[f]=w.useState(()=>Symbol()),g=Ia(l,e,h?null:N=>{if(N)o.buttons.current.push(f);else{let P=o.buttons.current.indexOf(f);P!==-1&&o.buttons.current.splice(P,1)}o.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),N&&s({type:2,button:N})}),m=Ia(l,e),v=C0(l),_=Yn(N=>{var P,M,B;if(h){if(o.popoverState===1)return;switch(N.key){case Ao.Space:case Ao.Enter:N.preventDefault(),(M=(P=N.target).click)==null||M.call(P),s({type:1}),(B=o.button)==null||B.focus();break}}else switch(N.key){case Ao.Space:case Ao.Enter:N.preventDefault(),N.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),s({type:0});break;case Ao.Escape:if(o.popoverState!==0)return d==null?void 0:d(o.buttonId);if(!l.current||v!=null&&v.activeElement&&!l.current.contains(v.activeElement))return;N.preventDefault(),N.stopPropagation(),s({type:1});break}}),b=Yn(N=>{h||N.key===Ao.Space&&N.preventDefault()}),y=Yn(N=>{var P,M;IR(N.currentTarget)||n.disabled||(h?(s({type:1}),(P=o.button)==null||P.focus()):(N.preventDefault(),N.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),s({type:0}),(M=o.button)==null||M.focus()))}),C=Yn(N=>{N.preventDefault(),N.stopPropagation()}),E=o.popoverState===0,x=w.useMemo(()=>({open:E}),[E]),k=gq(n,l),L=h?{ref:m,type:k,onKeyDown:_,onClick:y}:{ref:g,id:o.buttonId,type:k,"aria-expanded":o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:_,onKeyUp:b,onClick:y,onMouseDown:C},D=Dme(),A=Yn(()=>{let N=o.panel;if(!N)return;function P(){Ms(D.current,{[jp.Forwards]:()=>hm(N,bd.First),[jp.Backwards]:()=>hm(N,bd.Last)})===V4.Error&&hm(xF().filter(M=>M.dataset.headlessuiFocusGuard!=="true"),Ms(D.current,{[jp.Forwards]:bd.Next,[jp.Backwards]:bd.Previous}),{relativeTo:o.button})}P()});return ce.createElement(ce.Fragment,null,Js({ourProps:L,theirProps:r,slot:x,defaultTag:FDt,name:"Popover.Button"}),E&&!h&&a&&ce.createElement(g1,{id:c,features:n0.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:A}))}let $Dt="div",VDt=Mm.RenderStrategy|Mm.Static;function HDt(n,e){let t=nc(),{id:i=`headlessui-popover-overlay-${t}`,...r}=n,[{popoverState:o},s]=vq("Popover.Overlay"),a=Ia(e),l=Ok(),c=(()=>l!==null?(l&Oa.Open)===Oa.Open:o===0)(),u=Yn(h=>{if(IR(h.currentTarget))return h.preventDefault();s({type:1})}),d=w.useMemo(()=>({open:o===0}),[o]);return Js({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:u},theirProps:r,slot:d,defaultTag:$Dt,features:VDt,visible:c,name:"Popover.Overlay"})}let WDt="div",zDt=Mm.RenderStrategy|Mm.Static;function UDt(n,e){let t=nc(),{id:i=`headlessui-popover-panel-${t}`,focus:r=!1,...o}=n,[s,a]=vq("Popover.Panel"),{close:l,isPortalled:c}=Pme("Popover.Panel"),u=`headlessui-focus-sentinel-before-${nc()}`,d=`headlessui-focus-sentinel-after-${nc()}`,h=w.useRef(null),f=Ia(h,e,L=>{a({type:4,panel:L})}),g=C0(h),m=S2t();Zs(()=>(a({type:5,panelId:i}),()=>{a({type:5,panelId:null})}),[i,a]);let v=Ok(),_=(()=>v!==null?(v&Oa.Open)===Oa.Open:s.popoverState===0)(),b=Yn(L=>{var D;switch(L.key){case Ao.Escape:if(s.popoverState!==0||!h.current||g!=null&&g.activeElement&&!h.current.contains(g.activeElement))return;L.preventDefault(),L.stopPropagation(),a({type:1}),(D=s.button)==null||D.focus();break}});w.useEffect(()=>{var L;n.static||s.popoverState===1&&((L=n.unmount)==null||L)&&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 L=g==null?void 0:g.activeElement;h.current.contains(L)||hm(h.current,bd.First)},[s.__demoMode,r,h,s.popoverState]);let y=w.useMemo(()=>({open:s.popoverState===0,close:l}),[s,l]),C={ref:f,id:i,onKeyDown:b,onBlur:r&&s.popoverState===0?L=>{var D,A,N,P,M;let B=L.relatedTarget;B&&h.current&&((D=h.current)!=null&&D.contains(B)||(a({type:1}),((N=(A=s.beforePanelSentinel.current)==null?void 0:A.contains)!=null&&N.call(A,B)||(M=(P=s.afterPanelSentinel.current)==null?void 0:P.contains)!=null&&M.call(P,B))&&B.focus({preventScroll:!0})))}:void 0,tabIndex:-1},E=Dme(),x=Yn(()=>{let L=h.current;if(!L)return;function D(){Ms(E.current,{[jp.Forwards]:()=>{var A;hm(L,bd.First)===V4.Error&&((A=s.afterPanelSentinel.current)==null||A.focus())},[jp.Backwards]:()=>{var A;(A=s.button)==null||A.focus({preventScroll:!0})}})}D()}),k=Yn(()=>{let L=h.current;if(!L)return;function D(){Ms(E.current,{[jp.Forwards]:()=>{var A;if(!s.button)return;let N=xF(),P=N.indexOf(s.button),M=N.slice(0,P+1),B=[...N.slice(P+1),...M];for(let F of B.slice())if(F.dataset.headlessuiFocusGuard==="true"||(A=s.panel)!=null&&A.contains(F)){let U=B.indexOf(F);U!==-1&&B.splice(U,1)}hm(B,bd.First,{sorted:!1})},[jp.Backwards]:()=>{var A;hm(L,bd.Previous)===V4.Error&&((A=s.button)==null||A.focus())}})}D()});return ce.createElement(bq.Provider,{value:i},_&&c&&ce.createElement(g1,{id:u,ref:s.beforePanelSentinel,features:n0.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:x}),Js({mergeRefs:m,ourProps:C,theirProps:o,slot:y,defaultTag:WDt,features:zDt,visible:_,name:"Popover.Panel"}),_&&c&&ce.createElement(g1,{id:d,ref:s.afterPanelSentinel,features:n0.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:k}))}let jDt="div";function qDt(n,e){let t=w.useRef(null),i=Ia(t,e),[r,o]=w.useState([]),s=FLt(),a=Yn(m=>{o(v=>{let _=v.indexOf(m);if(_!==-1){let b=v.slice();return b.splice(_,1),b}return v})}),l=Yn(m=>(o(v=>[...v,m]),()=>a(m))),c=Yn(()=>{var m;let v=EF(t);if(!v)return!1;let _=v.activeElement;return(m=t.current)!=null&&m.contains(_)?!0:r.some(b=>{var y,C;return((y=v.getElementById(b.buttonId.current))==null?void 0:y.contains(_))||((C=v.getElementById(b.panelId.current))==null?void 0:C.contains(_))})}),u=Yn(m=>{for(let v of r)v.buttonId.current!==m&&v.close()}),d=w.useMemo(()=>({registerPopover:l,unregisterPopover:a,isFocusWithinPopoverGroup:c,closeOthers:u,mainTreeNodeRef:s.mainTreeNodeRef}),[l,a,c,u,s.mainTreeNodeRef]),h=w.useMemo(()=>({}),[]),f=n,g={ref:i};return ce.createElement(Mme.Provider,{value:d},Js({ourProps:g,theirProps:f,slot:h,defaultTag:jDt,name:"Popover.Group"}),ce.createElement(s.MainTreeNode,null))}let GDt=ea(MDt),KDt=ea(BDt),YDt=ea(HDt),QDt=ea(UDt),XDt=ea(qDt),YZ=Object.assign(GDt,{Button:KDt,Overlay:YDt,Panel:QDt,Group:XDt}),s$e=w.createContext(null);function a$e(){let n=w.useContext(s$e);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,a$e),e}return n}function ZDt(){let[n,e]=w.useState([]);return[n.length>0?n.join(" "):void 0,w.useMemo(()=>function(t){let i=Yn(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 ce.createElement(s$e.Provider,{value:r},t.children)},[e])]}let JDt="label";function eAt(n,e){let t=nc(),{id:i=`headlessui-label-${t}`,passive:r=!1,...o}=n,s=a$e(),a=Ia(e);Zs(()=>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),Js({ourProps:l,theirProps:o,slot:s.slot||{},defaultTag:JDt,name:s.name||"Label"})}let tAt=ea(eAt),nAt=Object.assign(tAt,{});function iAt(n=0){let[e,t]=w.useState(n),i=kF(),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 Fme=w.createContext(null);Fme.displayName="GroupContext";let rAt=w.Fragment;function oAt(n){var e;let[t,i]=w.useState(null),[r,o]=ZDt(),[s,a]=i$e(),l=w.useMemo(()=>({switch:t,setSwitch:i,labelledby:r,describedby:s}),[t,i,r,s]),c={},u=n;return ce.createElement(a,{name:"Switch.Description"},ce.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}))}}},ce.createElement(Fme.Provider,{value:l},Js({ourProps:c,theirProps:u,defaultTag:rAt,name:"Switch.Group"}))))}let sAt="button";function aAt(n,e){var t;let i=nc(),{id:r=`headlessui-switch-${i}`,checked:o,defaultChecked:s=!1,onChange:a,disabled:l=!1,name:c,value:u,form:d,...h}=n,f=w.useContext(Fme),g=w.useRef(null),m=Ia(g,e,f===null?null:f.setSwitch),[v,_]=N7e(o,a,s),b=Yn(()=>_==null?void 0:_(!v)),y=Yn(D=>{if(IR(D.currentTarget))return D.preventDefault();D.preventDefault(),b()}),C=Yn(D=>{D.key===Ao.Space?(D.preventDefault(),b()):D.key===Ao.Enter&&D2t(D.currentTarget)}),E=Yn(D=>D.preventDefault()),x=w.useMemo(()=>({checked:v}),[v]),k={id:r,ref:m,role:"switch",type:gq(n,g),tabIndex:n.tabIndex===-1?0:(t=n.tabIndex)!=null?t:0,"aria-checked":v,"aria-labelledby":f==null?void 0:f.labelledby,"aria-describedby":f==null?void 0:f.describedby,disabled:l,onClick:y,onKeyUp:C,onKeyPress:E},L=L1();return w.useEffect(()=>{var D;let A=(D=g.current)==null?void 0:D.closest("form");A&&s!==void 0&&L.addEventListener(A,"reset",()=>{_(s)})},[g,_]),ce.createElement(ce.Fragment,null,c!=null&&v&&ce.createElement(g1,{features:n0.Hidden,...BH({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:l,form:d,checked:v,name:c,value:u})}),Js({ourProps:k,theirProps:h,slot:x,defaultTag:sAt,name:"Switch"}))}let lAt=ea(aAt),cAt=oAt,Coe=Object.assign(lAt,{Group:cAt,Label:nAt,Description:r$e});function uAt(n){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,n(...t)}}function QZ(n,...e){n&&e.length>0&&n.classList.add(...e)}function XZ(n,...e){n&&e.length>0&&n.classList.remove(...e)}function dAt(n,e){let t=gg();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 hAt(n,e,t,i){let r=t?"enter":"leave",o=gg(),s=i!==void 0?uAt(i):()=>{};r==="enter"&&(n.removeAttribute("hidden"),n.style.display="");let a=Ms(r,{enter:()=>e.enter,leave:()=>e.leave}),l=Ms(r,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),c=Ms(r,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return XZ(n,...e.base,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),QZ(n,...e.base,...a,...c),o.nextFrame(()=>{XZ(n,...e.base,...a,...c),QZ(n,...e.base,...a,...l),dAt(n,()=>(XZ(n,...e.base,...a),QZ(n,...e.base,...e.entered),s()))}),o.dispose}function fAt({immediate:n,container:e,direction:t,classes:i,onStart:r,onStop:o}){let s=kF(),a=L1(),l=ig(t);Zs(()=>{n&&(l.current="enter")},[n]),Zs(()=>{let c=gg();a.add(c.dispose);let u=e.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),r.current(l.current),c.add(hAt(u,i.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[t])}function eC(n=""){return n.split(/\s+/).filter(e=>e.length>1)}let yq=w.createContext(null);yq.displayName="TransitionContext";var pAt=(n=>(n.Visible="visible",n.Hidden="hidden",n))(pAt||{});function gAt(){let n=w.useContext(yq);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function mAt(){let n=w.useContext(Cq);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Cq=w.createContext(null);Cq.displayName="NestingContext";function wq(n){return"children"in n?wq(n.children):n.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function l$e(n,e){let t=ig(n),i=w.useRef([]),r=kF(),o=L1(),s=Yn((f,g=YC.Hidden)=>{let m=i.current.findIndex(({el:v})=>v===f);m!==-1&&(Ms(g,{[YC.Unmount](){i.current.splice(m,1)},[YC.Hidden](){i.current[m].state="hidden"}}),o.microTask(()=>{var v;!wq(i)&&r.current&&((v=t.current)==null||v.call(t))}))}),a=Yn(f=>{let g=i.current.find(({el:m})=>m===f);return g?g.state!=="visible"&&(g.state="visible"):i.current.push({el:f,state:"visible"}),()=>s(f,YC.Unmount)}),l=w.useRef([]),c=w.useRef(Promise.resolve()),u=w.useRef({enter:[],leave:[],idle:[]}),d=Yn((f,g,m)=>{l.current.splice(0),e&&(e.chains.current[g]=e.chains.current[g].filter(([v])=>v!==f)),e==null||e.chains.current[g].push([f,new Promise(v=>{l.current.push(v)})]),e==null||e.chains.current[g].push([f,new Promise(v=>{Promise.all(u.current[g].map(([_,b])=>b)).then(()=>v())})]),g==="enter"?c.current=c.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(g)):m(g)}),h=Yn((f,g,m)=>{Promise.all(u.current[g].splice(0).map(([v,_])=>_)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>m(g))});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 _At(){}let vAt=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function uke(n){var e;let t={};for(let i of vAt)t[i]=(e=n[i])!=null?e:_At;return t}function bAt(n){let e=w.useRef(uke(n));return w.useEffect(()=>{e.current=uke(n)},[n]),e}let yAt="div",c$e=Mm.RenderStrategy;function CAt(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:f,leaveTo:g,...m}=n,v=w.useRef(null),_=Ia(v,e),b=(t=m.unmount)==null||t?YC.Unmount:YC.Hidden,{show:y,appear:C,initial:E}=gAt(),[x,k]=w.useState(y?"visible":"hidden"),L=mAt(),{register:D,unregister:A}=L;w.useEffect(()=>D(v),[D,v]),w.useEffect(()=>{if(b===YC.Hidden&&v.current){if(y&&x!=="visible"){k("visible");return}return Ms(x,{hidden:()=>A(v),visible:()=>D(v)})}},[x,v,D,A,y,b]);let N=ig({base:eC(m.className),enter:eC(l),enterFrom:eC(c),enterTo:eC(u),entered:eC(d),leave:eC(h),leaveFrom:eC(f),leaveTo:eC(g)}),P=bAt({beforeEnter:r,afterEnter:o,beforeLeave:s,afterLeave:a}),M=kR();w.useEffect(()=>{if(M&&x==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,x,M]);let B=E&&!C,F=C&&y&&E,U=(()=>!M||B?"idle":y?"enter":"leave")(),H=iAt(0),W=Yn(Ne=>Ms(Ne,{enter:()=>{H.addFlag(Oa.Opening),P.current.beforeEnter()},leave:()=>{H.addFlag(Oa.Closing),P.current.beforeLeave()},idle:()=>{}})),q=Yn(Ne=>Ms(Ne,{enter:()=>{H.removeFlag(Oa.Opening),P.current.afterEnter()},leave:()=>{H.removeFlag(Oa.Closing),P.current.afterLeave()},idle:()=>{}})),V=l$e(()=>{k("hidden"),A(v)},L),re=w.useRef(!1);fAt({immediate:F,container:v,classes:N,direction:U,onStart:ig(Ne=>{re.current=!0,V.onStart(v,Ne,W)}),onStop:ig(Ne=>{re.current=!1,V.onStop(v,Ne,q),Ne==="leave"&&!wq(V)&&(k("hidden"),A(v))})});let oe=m,Q={ref:_};return F?oe={...oe,className:FH(m.className,...N.current.enter,...N.current.enterFrom)}:re.current&&(oe.className=FH(m.className,(i=v.current)==null?void 0:i.className),oe.className===""&&delete oe.className),ce.createElement(Cq.Provider,{value:V},ce.createElement(mq,{value:Ms(x,{visible:Oa.Open,hidden:Oa.Closed})|H.flags},Js({ourProps:Q,theirProps:oe,defaultTag:yAt,features:c$e,visible:x==="visible",name:"Transition.Child"})))}function wAt(n,e){let{show:t,appear:i=!1,unmount:r=!0,...o}=n,s=w.useRef(null),a=Ia(s,e);kR();let l=Ok();if(t===void 0&&l!==null&&(t=(l&Oa.Open)===Oa.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=l$e(()=>{u("hidden")}),[h,f]=w.useState(!0),g=w.useRef([t]);Zs(()=>{h!==!1&&g.current[g.current.length-1]!==t&&(g.current.push(t),f(!1))},[g,t]);let m=w.useMemo(()=>({show:t,appear:i,initial:h}),[t,i,h]);w.useEffect(()=>{if(t)u("visible");else if(!wq(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 v={unmount:r},_=Yn(()=>{var y;h&&f(!1),(y=n.beforeEnter)==null||y.call(n)}),b=Yn(()=>{var y;h&&f(!1),(y=n.beforeLeave)==null||y.call(n)});return ce.createElement(Cq.Provider,{value:d},ce.createElement(yq.Provider,{value:m},Js({ourProps:{...v,as:w.Fragment,children:ce.createElement(u$e,{ref:a,...v,...o,beforeEnter:_,beforeLeave:b})},theirProps:{},defaultTag:w.Fragment,features:c$e,visible:c==="visible",name:"Transition"})))}function SAt(n,e){let t=w.useContext(yq)!==null,i=Ok()!==null;return ce.createElement(ce.Fragment,null,!t&&i?ce.createElement(woe,{ref:e,...n}):ce.createElement(u$e,{ref:e,...n}))}let woe=ea(wAt),u$e=ea(CAt),EAt=ea(SAt),Dy=Object.assign(woe,{Child:EAt,Root:woe});const xAt=rl(Coe)`
&:focus {
outline: 2px solid ${n=>n.theme.ringColor};
}
border-color: ${n=>n.theme.borderColor};
background-color: ${n=>n.theme.backgroundColor};
`;function kt(n){const e=si(),t=Ss(),[i,r]=w.useState(!1),[o,s]=w.useState(!1);return w.useEffect(()=>{r(!!n.checked),s(!!n.disabled)},[n.checked,n.disabled]),O(Coe.Group,{as:"div",className:"flex items-center",children:[p(xAt,{theme:{ringColor:e.$5,borderColor:e.$5,backgroundColor:i?t:e.$5},className:zt("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:p("span",{"aria-hidden":"true",className:zt(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&&p(Coe.Label,{as:"span",className:"ml-3",children:p("span",{className:"text-sm",children:n.label})})]})}function Bme(n){const e=si();return n.pages.length===0?null:p("nav",{className:"flex","aria-label":"Breadcrumb",style:{color:e.$3,opacity:e.$10},children:O("ol",{role:"list",className:"flex items-center space-x-4",children:[p("li",{children:p("div",{children:O(qi,{to:"/dashboard",withoutDefaultStyling:!0,children:[p(J8e,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),p("span",{className:"sr-only",children:"Home"})]})})}),n.pages.map(t=>p("li",{children:O("div",{className:"flex items-center",children:[p(Xj,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),p(qi,{to:t.href,className:"ml-4 text-sm font-medium",withoutDefaultStyling:!0,children:t.name})]})},t.name))]})})}const TAt="/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 kAt={logo:TAt};/**
* 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 Sq(){var t,i;const n=Zi(),e=Ti();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)||kAt.logo}function IAt(){var t;const n=Ti(),[e]=ve();return((t=n==null?void 0:n.settings)==null?void 0:t.name)||e("untitled_company")}const LAt=rl.button`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,DAt=rl(k1)`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function gt(n){const e=si(),{prevent:t}=Gi(xR),i=TR({disablePrevention:n.disablePreventNavigation}),{actionKey:r}=n;return n.to?O(DAt,{theme:{color:e.$3,hoverColor:e.$7},to:n.to,className:zt({"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,p("div",{className:zt({"ml-2":n.icon}),children:n.children})]}):O(LAt,{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:zt({"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&&p("div",{children:n.icon}),p("div",{className:zt({"ml-2":n.icon}),children:n.children})]})}function AAt(n){const{renderFragmentOnly:e,children:t}=n;return e?p(St,{children:t}):p(Dy.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 Or(n){const[e,t]=w.useState(!1);w.useEffect(()=>{t(n.visible)},[n.visible]);const i=si();return p(Dy.Root,{show:e,as:w.Fragment,children:p(eM,{as:"div",className:"fixed z-10 inset-0 overflow-y-auto",onClose:r=>{!n.disableClosing&&t(r),!n.disableClosing&&n.onClose(r)},initialFocus:n.initialFocusRef,children:O("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[p(Dy.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:p(eM.Overlay,{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),p("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),p(AAt,{renderFragmentOnly:!!n.renderTransitionChildAsFragment&&e,children:O("div",{style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},className:zt("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:[O("div",{className:"flex flex-col justify-between items-start",style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},children:[O("div",{className:"flex w-full justify-between",children:[p(eM.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&&p(qm,{className:"cursor-pointer",onClick:()=>n.onClose(!1),fontSize:22,"data-cy":n.closeButtonCypressRef})]}),p("div",{className:"mt-2",children:n.text&&p("p",{style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},className:"text-sm",children:n.text})})]}),n.children&&p("div",{style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},className:zt("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 RAt(n){const[e]=ve(),t=zi(),i=ki(),{id:r}=il(),o=ml(),s=si(),a=Co(),[l,c]=w.useState(!1),u=(h,f,g)=>{if(t(_F({type:vR.TOKEN,user:f,token:g})),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||(he.processing(),c(!0),$e("POST",Ae("/api/v1/companies")).then(()=>{$e("POST",Ae("/api/v1/refresh")).then(h=>{const f=h.data.data,g=f.length-1,m=f[g];t(y0(f)),he.success("created_new_company"),n.setIsModalOpen(!1),u(g,m.user,m.token.token)}).finally(()=>localStorage.setItem("COMPANY-EDIT-OPENED","false"))}).finally(()=>c(!1)))};return O(Or,{title:e("add_company"),visible:n.isModalOpen,onClose:()=>n.setIsModalOpen(!1),backgroundColor:"white",children:[p("span",{className:"text-lg",style:{backgroundColor:s.$2,color:s.$3,colorScheme:s.$0},children:e("are_you_sure")}),O("div",{className:"flex justify-end space-x-4 mt-5",children:[p(un,{className:"text-gray-900",onClick:()=>n.setIsModalOpen(!1),type:"minimal",children:p("span",{className:"text-base mx-3",children:e("cancel")})}),p(un,{onClick:d,children:p("span",{className:"text-base mx-3",children:e("yes")})})]})]})}var d$e={exports:{}},h$e={};const Cp=vfe(t1t),rO=vfe(tyt),NAt=vfe(uyt);(function(n){var e,t,i=Po&&Po.__generator||function(Qe,Ct){var Gt,Jt,ut,Le,st={label:0,sent:function(){if(1&ut[0])throw ut[1];return ut[1]},trys:[],ops:[]};return Le={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(Le[Symbol.iterator]=function(){return this}),Le;function ze(Ee){return function(tt){return function(xt){if(Gt)throw new TypeError("Generator is already executing.");for(;st;)try{if(Gt=1,Jt&&(ut=2&xt[0]?Jt.return:xt[0]?Jt.throw||((ut=Jt.return)&&ut.call(Jt),0):Jt.next)&&!(ut=ut.call(Jt,xt[1])).done)return ut;switch(Jt=0,ut&&(xt=[2&xt[0],ut.value]),xt[0]){case 0:case 1:ut=xt;break;case 4:return st.label++,{value:xt[1],done:!1};case 5:st.label++,Jt=xt[1],xt=[0];continue;case 7:xt=st.ops.pop(),st.trys.pop();continue;default:if(!((ut=(ut=st.trys).length>0&&ut[ut.length-1])||xt[0]!==6&&xt[0]!==2)){st=0;continue}if(xt[0]===3&&(!ut||xt[1]>ut[0]&&xt[1]<ut[3])){st.label=xt[1];break}if(xt[0]===6&&st.label<ut[1]){st.label=ut[1],ut=xt;break}if(ut&&st.label<ut[2]){st.label=ut[2],st.ops.push(xt);break}ut[2]&&st.ops.pop(),st.trys.pop();continue}xt=Ct.call(Qe,st)}catch(lt){xt=[6,lt],Jt=0}finally{Gt=ut=0}if(5&xt[0])throw xt[1];return{value:xt[0]?xt[1]:void 0,done:!0}}([Ee,tt])}}},r=Po&&Po.__spreadArray||function(Qe,Ct){for(var Gt=0,Jt=Ct.length,ut=Qe.length;Gt<Jt;Gt++,ut++)Qe[ut]=Ct[Gt];return Qe},o=Object.create,s=Object.defineProperty,a=Object.defineProperties,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,m=function(Qe,Ct,Gt){return Ct in Qe?s(Qe,Ct,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Qe[Ct]=Gt},v=function(Qe,Ct){for(var Gt in Ct||(Ct={}))f.call(Ct,Gt)&&m(Qe,Gt,Ct[Gt]);if(d)for(var Jt=0,ut=d(Ct);Jt<ut.length;Jt++)g.call(Ct,Gt=ut[Jt])&&m(Qe,Gt,Ct[Gt]);return Qe},_=function(Qe,Ct){return a(Qe,c(Ct))},b=function(Qe){return s(Qe,"__esModule",{value:!0})},y=function(Qe,Ct){var Gt={};for(var Jt in Qe)f.call(Qe,Jt)&&Ct.indexOf(Jt)<0&&(Gt[Jt]=Qe[Jt]);if(Qe!=null&&d)for(var ut=0,Le=d(Qe);ut<Le.length;ut++)Ct.indexOf(Jt=Le[ut])<0&&g.call(Qe,Jt)&&(Gt[Jt]=Qe[Jt]);return Gt},C=function(Qe){return function(Ct,Gt,Jt){if(Gt&&typeof Gt=="object"||typeof Gt=="function")for(var ut=function(ze){f.call(Ct,ze)||ze==="default"||s(Ct,ze,{get:function(){return Gt[ze]},enumerable:!(Jt=l(Gt,ze))||Jt.enumerable})},Le=0,st=u(Gt);Le<st.length;Le++)ut(st[Le]);return Ct}(b(s(Qe!=null?o(h(Qe)):{},"default",Qe&&Qe.__esModule&&"default"in Qe?{get:function(){return Qe.default},enumerable:!0}:{value:Qe,enumerable:!0})),Qe)},E=function(Qe,Ct,Gt){return new Promise(function(Jt,ut){var Le=function(Ee){try{ze(Gt.next(Ee))}catch(tt){ut(tt)}},st=function(Ee){try{ze(Gt.throw(Ee))}catch(tt){ut(tt)}},ze=function(Ee){return Ee.done?Jt(Ee.value):Promise.resolve(Ee.value).then(Le,st)};ze((Gt=Gt.apply(Qe,Ct)).next())})};b(n),function(Qe,Ct){for(var Gt in Ct)s(Qe,Gt,{get:Ct[Gt],enumerable:!0})}(n,{QueryStatus:function(){return e},buildCreateApi:function(){return Ke},copyWithStructuralSharing:function(){return L},coreModule:function(){return di},coreModuleName:function(){return rn},createApi:function(){return Wr},defaultSerializeQueryArgs:function(){return ne},fakeBaseQuery:function(){return Je},fetchBaseQuery:function(){return B},retry:function(){return W},setupListeners:function(){return Ve},skipSelector:function(){return Me},skipToken:function(){return me}}),(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var x=function(Qe){return[].concat.apply([],Qe)},k=C(Cp).isPlainObject;function L(Qe,Ct){if(Qe===Ct||!(k(Qe)&&k(Ct)||Array.isArray(Qe)&&Array.isArray(Ct)))return Ct;for(var Gt=Object.keys(Ct),Jt=Object.keys(Qe),ut=Gt.length===Jt.length,Le=Array.isArray(Ct)?[]:{},st=0,ze=Gt;st<ze.length;st++){var Ee=ze[st];Le[Ee]=L(Qe[Ee],Ct[Ee]),ut&&(ut=Qe[Ee]===Le[Ee])}return ut?Qe:Le}var D=C(Cp),A=function(){for(var Qe=[],Ct=0;Ct<arguments.length;Ct++)Qe[Ct]=arguments[Ct];return fetch.apply(void 0,Qe)},N=function(Qe){return Qe.status>=200&&Qe.status<=299},P=function(Qe){return/ion\/(vnd\.api\+)?json/.test(Qe.get("content-type")||"")};function M(Qe){if(!(0,D.isPlainObject)(Qe))return Qe;for(var Ct=v({},Qe),Gt=0,Jt=Object.entries(Ct);Gt<Jt.length;Gt++){var ut=Jt[Gt];ut[1]===void 0&&delete Ct[ut[0]]}return Ct}function B(Qe){var Ct=this;Qe===void 0&&(Qe={});var Gt=Qe.baseUrl,Jt=Qe.prepareHeaders,ut=Jt===void 0?function(mn){return mn}:Jt,Le=Qe.fetchFn,st=Le===void 0?A:Le,ze=Qe.paramsSerializer,Ee=Qe.isJsonContentType,tt=Ee===void 0?P:Ee,xt=Qe.jsonContentType,lt=xt===void 0?"application/json":xt,gn=Qe.jsonReplacer,Ln=Qe.timeout,ri=Qe.responseHandler,mi=Qe.validateStatus,Vi=y(Qe,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&st===A&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(mn,oi){return E(Ct,null,function(){var dr,gr,ta,ma,za,ts,fs,$o,Tl,ac,xi,co,vo,Ws,Vo,zs,No,Yr,uo,Lr,Br,so,Ki,ti,yi,Qn,li,Si,Yi,Tn,xn,Xn,vt,$t,yn,ni;return i(this,function(Gn){switch(Gn.label){case 0:return dr=oi.signal,gr=oi.getState,ta=oi.extra,ma=oi.endpoint,za=oi.forced,ts=oi.type,Tl=($o=typeof mn=="string"?{url:mn}:mn).url,xi=(ac=$o.headers)===void 0?new Headers(Vi.headers):ac,vo=(co=$o.params)===void 0?void 0:co,Vo=(Ws=$o.responseHandler)===void 0?ri??"json":Ws,No=(zs=$o.validateStatus)===void 0?mi??N:zs,uo=(Yr=$o.timeout)===void 0?Ln:Yr,Lr=y($o,["url","headers","params","responseHandler","validateStatus","timeout"]),Br=v(_(v({},Vi),{signal:dr}),Lr),xi=new Headers(M(xi)),so=Br,[4,ut(xi,{getState:gr,extra:ta,endpoint:ma,forced:za,type:ts})];case 1:so.headers=Gn.sent()||xi,Ki=function(fi){return typeof fi=="object"&&((0,D.isPlainObject)(fi)||Array.isArray(fi)||typeof fi.toJSON=="function")},!Br.headers.has("content-type")&&Ki(Br.body)&&Br.headers.set("content-type",lt),Ki(Br.body)&&tt(Br.headers)&&(Br.body=JSON.stringify(Br.body,gn)),vo&&(ti=~Tl.indexOf("?")?"&":"?",yi=ze?ze(vo):new URLSearchParams(M(vo)),Tl+=ti+yi),Tl=function(fi,$r){if(!fi)return $r;if(!$r)return fi;if(function(eo){return new RegExp("(^|:)//").test(eo)}($r))return $r;var ho=fi.endsWith("/")||!$r.startsWith("?")?"/":"";return fi=function(eo){return eo.replace(/\/$/,"")}(fi),""+fi+ho+function(eo){return eo.replace(/^\//,"")}($r)}(Gt,Tl),Qn=new Request(Tl,Br),li=new Request(Tl,Br),fs={request:li},Yi=!1,Tn=uo&&setTimeout(function(){Yi=!0,oi.abort()},uo),Gn.label=2;case 2:return Gn.trys.push([2,4,5,6]),[4,st(Qn)];case 3:return Si=Gn.sent(),[3,6];case 4:return xn=Gn.sent(),[2,{error:{status:Yi?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(xn)},meta:fs}];case 5:return Tn&&clearTimeout(Tn),[7];case 6:Xn=Si.clone(),fs.response=Xn,$t="",Gn.label=7;case 7:return Gn.trys.push([7,9,,10]),[4,Promise.all([qn(Si,Vo).then(function(fi){return vt=fi},function(fi){return yn=fi}),Xn.text().then(function(fi){return $t=fi},function(){})])];case 8:if(Gn.sent(),yn)throw yn;return[3,10];case 9:return ni=Gn.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Si.status,data:$t,error:String(ni)},meta:fs}];case 10:return[2,No(Si,vt)?{data:vt,meta:fs}:{error:{status:Si.status,data:vt},meta:fs}]}})})};function qn(mn,oi){return E(this,null,function(){var dr;return i(this,function(gr){switch(gr.label){case 0:return typeof oi=="function"?[2,oi(mn)]:(oi==="content-type"&&(oi=tt(mn.headers)?"json":"text"),oi!=="json"?[3,2]:[4,mn.text()]);case 1:return[2,(dr=gr.sent()).length?JSON.parse(dr):null];case 2:return[2,mn.text()]}})})}}var F=function(Qe,Ct){Ct===void 0&&(Ct=void 0),this.value=Qe,this.meta=Ct};function U(Qe,Ct){return Qe===void 0&&(Qe=0),Ct===void 0&&(Ct=5),E(this,null,function(){var Gt,Jt;return i(this,function(ut){switch(ut.label){case 0:return Gt=Math.min(Qe,Ct),Jt=~~((Math.random()+.4)*(300<<Gt)),[4,new Promise(function(Le){return setTimeout(function(st){return Le(st)},Jt)})];case 1:return ut.sent(),[2]}})})}var H={},W=Object.assign(function(Qe,Ct){return function(Gt,Jt,ut){return E(void 0,null,function(){var Le,st,ze,Ee,tt,xt,lt;return i(this,function(gn){switch(gn.label){case 0:Le=[5,(Ct||H).maxRetries,(ut||H).maxRetries].filter(function(Ln){return Ln!==void 0}),st=Le.slice(-1)[0],ze=function(Ln,ri,mi){return mi.attempt<=st},Ee=v(v({maxRetries:st,backoff:U,retryCondition:ze},Ct),ut),tt=0,gn.label=1;case 1:gn.label=2;case 2:return gn.trys.push([2,4,,6]),[4,Qe(Gt,Jt,ut)];case 3:if((xt=gn.sent()).error)throw new F(xt);return[2,xt];case 4:if(lt=gn.sent(),tt++,lt.throwImmediately){if(lt instanceof F)return[2,lt.value];throw lt}return lt instanceof F&&!Ee.retryCondition(lt.value.error,Gt,{attempt:tt,baseQueryApi:Jt,extraOptions:ut})?[2,lt.value]:[4,Ee.backoff(tt,Ee.maxRetries)];case 5:return gn.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(Qe){throw Object.assign(new F({error:Qe}),{throwImmediately:!0})}}),q=C(Cp),V=(0,q.createAction)("__rtkq/focused"),re=(0,q.createAction)("__rtkq/unfocused"),oe=(0,q.createAction)("__rtkq/online"),Q=(0,q.createAction)("__rtkq/offline"),Ne=!1;function Ve(Qe,Ct){return Ct?Ct(Qe,{onFocus:V,onFocusLost:re,onOffline:Q,onOnline:oe}):(Gt=function(){return Qe(V())},Jt=function(){return Qe(oe())},ut=function(){return Qe(Q())},Le=function(){window.document.visibilityState==="visible"?Gt():Qe(re())},Ne||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",Le,!1),window.addEventListener("focus",Gt,!1),window.addEventListener("online",Jt,!1),window.addEventListener("offline",ut,!1),Ne=!0),function(){window.removeEventListener("focus",Gt),window.removeEventListener("visibilitychange",Le),window.removeEventListener("online",Jt),window.removeEventListener("offline",ut),Ne=!1});var Gt,Jt,ut,Le}var Ye,ye,He=C(Cp);function Pe(Qe){return Qe.type===Ye.query}function Ge(Qe,Ct,Gt,Jt,ut,Le){return typeof Qe=="function"?Qe(Ct,Gt,Jt,ut).map(Fe).map(Le):Array.isArray(Qe)?Qe.map(Fe).map(Le):[]}function Fe(Qe){return typeof Qe=="string"?{type:Qe}:Qe}(ye=Ye||(Ye={})).query="query",ye.mutation="mutation";var bt=C(Cp);function Mt(Qe){return Qe!=null}var Ft=Symbol("forceQueryFn"),Yt=function(Qe){return typeof Qe[Ft]=="function"},ln=C(Cp),Et=C(rO),mt=C(Cp);function Lt(Qe){return Qe}function be(Qe,Ct,Gt,Jt){return Ge(Gt[Qe.meta.arg.endpointName][Ct],(0,ln.isFulfilled)(Qe)?Qe.payload:void 0,(0,ln.isRejectedWithValue)(Qe)?Qe.payload:void 0,Qe.meta.arg.originalArgs,"baseQueryMeta"in Qe.meta?Qe.meta.baseQueryMeta:void 0,Jt)}var Te=C(rO),se=C(rO);function Y(Qe,Ct,Gt){var Jt=Qe[Ct];Jt&&Gt(Jt)}function X(Qe){var Ct;return(Ct="arg"in Qe?Qe.arg.fixedCacheKey:Qe.fixedCacheKey)!=null?Ct:Qe.requestId}function le(Qe,Ct,Gt){var Jt=Qe[X(Ct)];Jt&&Gt(Jt)}var te={},me=Symbol.for("RTKQ/skipToken"),Me=me,rt={status:e.uninitialized},It=(0,He.createNextState)(rt,function(){}),Qt=(0,He.createNextState)(rt,function(){}),pe=C(Cp),We=WeakMap?new WeakMap:void 0,ne=function(Qe){var Ct=Qe.endpointName,Gt=Qe.queryArgs,Jt="",ut=We==null?void 0:We.get(Gt);if(typeof ut=="string")Jt=ut;else{var Le=JSON.stringify(Gt,function(st,ze){return(0,pe.isPlainObject)(ze)?Object.keys(ze).sort().reduce(function(Ee,tt){return Ee[tt]=ze[tt],Ee},{}):ze});(0,pe.isPlainObject)(Gt)&&(We==null||We.set(Gt,Le)),Jt=Le}return Ct+"("+Jt+")"},Se=C(Cp),Ie=C(NAt);function Ke(){for(var Qe=[],Ct=0;Ct<arguments.length;Ct++)Qe[Ct]=arguments[Ct];return function(Gt){var Jt=(0,Ie.defaultMemoize)(function(Ee){var tt,xt;return(xt=Gt.extractRehydrationInfo)==null?void 0:xt.call(Gt,Ee,{reducerPath:(tt=Gt.reducerPath)!=null?tt:"api"})}),ut=_(v({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},Gt),{extractRehydrationInfo:Jt,serializeQueryArgs:function(Ee){var tt=ne;if("serializeQueryArgs"in Ee.endpointDefinition){var xt=Ee.endpointDefinition.serializeQueryArgs;tt=function(lt){var gn=xt(lt);return typeof gn=="string"?gn:ne(_(v({},lt),{queryArgs:gn}))}}else Gt.serializeQueryArgs&&(tt=Gt.serializeQueryArgs);return tt(Ee)},tagTypes:r([],Gt.tagTypes||[])}),Le={endpointDefinitions:{},batch:function(Ee){Ee()},apiUid:(0,Se.nanoid)(),extractRehydrationInfo:Jt,hasRehydrationInfo:(0,Ie.defaultMemoize)(function(Ee){return Jt(Ee)!=null})},st={injectEndpoints:function(Ee){for(var tt=Ee.endpoints({query:function(qn){return _(v({},qn),{type:Ye.query})},mutation:function(qn){return _(v({},qn),{type:Ye.mutation})}}),xt=0,lt=Object.entries(tt);xt<lt.length;xt++){var gn=lt[xt],Ln=gn[0],ri=gn[1];if(Ee.overrideExisting||!(Ln in Le.endpointDefinitions)){Le.endpointDefinitions[Ln]=ri;for(var mi=0,Vi=ze;mi<Vi.length;mi++)Vi[mi].injectEndpoint(Ln,ri)}}return st},enhanceEndpoints:function(Ee){var tt=Ee.addTagTypes,xt=Ee.endpoints;if(tt)for(var lt=0,gn=tt;lt<gn.length;lt++){var Ln=gn[lt];ut.tagTypes.includes(Ln)||ut.tagTypes.push(Ln)}if(xt)for(var ri=0,mi=Object.entries(xt);ri<mi.length;ri++){var Vi=mi[ri],qn=Vi[0],mn=Vi[1];typeof mn=="function"?mn(Le.endpointDefinitions[qn]):Object.assign(Le.endpointDefinitions[qn]||{},mn)}return st}},ze=Qe.map(function(Ee){return Ee.init(st,ut,Le)});return st.injectEndpoints({endpoints:Gt.endpoints})}}function Je(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var ot,wt=C(Cp),pn=function(Qe){var Ct=Qe.reducerPath,Gt=Qe.api,Jt=Qe.context,ut=Qe.internalState,Le=Gt.internalActions,st=Le.removeQueryResult,ze=Le.unsubscribeQueryResult;function Ee(lt){var gn=ut.currentSubscriptions[lt];return!!gn&&!function(Ln){for(var ri in Ln)return!1;return!0}(gn)}var tt={};function xt(lt,gn,Ln,ri){var mi,Vi=Jt.endpointDefinitions[gn],qn=(mi=Vi==null?void 0:Vi.keepUnusedDataFor)!=null?mi:ri.keepUnusedDataFor;if(qn!==1/0){var mn=Math.max(0,Math.min(qn,2147482647e-3));if(!Ee(lt)){var oi=tt[lt];oi&&clearTimeout(oi),tt[lt]=setTimeout(function(){Ee(lt)||Ln.dispatch(st({queryCacheKey:lt})),delete tt[lt]},1e3*mn)}}}return function(lt,gn,Ln){var ri;if(ze.match(lt)){var mi=gn.getState()[Ct];xt(za=lt.payload.queryCacheKey,(ri=mi.queries[za])==null?void 0:ri.endpointName,gn,mi.config)}if(Gt.util.resetApiState.match(lt))for(var Vi=0,qn=Object.entries(tt);Vi<qn.length;Vi++){var mn=qn[Vi],oi=mn[0],dr=mn[1];dr&&clearTimeout(dr),delete tt[oi]}if(Jt.hasRehydrationInfo(lt)){mi=gn.getState()[Ct];for(var gr=Jt.extractRehydrationInfo(lt).queries,ta=0,ma=Object.entries(gr);ta<ma.length;ta++){var za,ts=ma[ta],fs=ts[1];xt(za=ts[0],fs==null?void 0:fs.endpointName,gn,mi.config)}}}},Kn=C(Cp),Cn=function(Qe){var Ct=Qe.reducerPath,Gt=Qe.context,Jt=Qe.context.endpointDefinitions,ut=Qe.mutationThunk,Le=Qe.api,st=Qe.assertTagType,ze=Qe.refetchQuery,Ee=Le.internalActions.removeQueryResult,tt=(0,Kn.isAnyOf)((0,Kn.isFulfilled)(ut),(0,Kn.isRejectedWithValue)(ut));function xt(lt,gn){var Ln=gn.getState(),ri=Ln[Ct],mi=Le.util.selectInvalidatedBy(Ln,lt);Gt.batch(function(){for(var Vi,qn=0,mn=Array.from(mi.values());qn<mn.length;qn++){var oi=mn[qn].queryCacheKey,dr=ri.queries[oi],gr=(Vi=ri.subscriptions[oi])!=null?Vi:{};dr&&(Object.keys(gr).length===0?gn.dispatch(Ee({queryCacheKey:oi})):dr.status!==e.uninitialized&&gn.dispatch(ze(dr,oi)))}})}return function(lt,gn){tt(lt)&&xt(be(lt,"invalidatesTags",Jt,st),gn),Le.util.invalidateTags.match(lt)&&xt(Ge(lt.payload,void 0,void 0,void 0,void 0,st),gn)}},hn=function(Qe){var Ct=Qe.reducerPath,Gt=Qe.queryThunk,Jt=Qe.api,ut=Qe.refetchQuery,Le=Qe.internalState,st={};function ze(lt,gn){var Ln=lt.queryCacheKey,ri=gn.getState()[Ct].queries[Ln];if(ri&&ri.status!==e.uninitialized){var mi=xt(Le.currentSubscriptions[Ln]);if(Number.isFinite(mi)){var Vi=st[Ln];Vi!=null&&Vi.timeout&&(clearTimeout(Vi.timeout),Vi.timeout=void 0);var qn=Date.now()+mi,mn=st[Ln]={nextPollTimestamp:qn,pollingInterval:mi,timeout:setTimeout(function(){mn.timeout=void 0,gn.dispatch(ut(ri,Ln))},mi)}}}}function Ee(lt,gn){var Ln=lt.queryCacheKey,ri=gn.getState()[Ct].queries[Ln];if(ri&&ri.status!==e.uninitialized){var mi=xt(Le.currentSubscriptions[Ln]);if(Number.isFinite(mi)){var Vi=st[Ln],qn=Date.now()+mi;(!Vi||qn<Vi.nextPollTimestamp)&&ze({queryCacheKey:Ln},gn)}else tt(Ln)}}function tt(lt){var gn=st[lt];gn!=null&&gn.timeout&&clearTimeout(gn.timeout),delete st[lt]}function xt(lt){lt===void 0&&(lt={});var gn=Number.POSITIVE_INFINITY;for(var Ln in lt)lt[Ln].pollingInterval&&(gn=Math.min(lt[Ln].pollingInterval,gn));return gn}return function(lt,gn){(Jt.internalActions.updateSubscriptionOptions.match(lt)||Jt.internalActions.unsubscribeQueryResult.match(lt))&&Ee(lt.payload,gn),(Gt.pending.match(lt)||Gt.rejected.match(lt)&&lt.meta.condition)&&Ee(lt.meta.arg,gn),(Gt.fulfilled.match(lt)||Gt.rejected.match(lt)&&!lt.meta.condition)&&ze(lt.meta.arg,gn),Jt.util.resetApiState.match(lt)&&function(){for(var Ln=0,ri=Object.keys(st);Ln<ri.length;Ln++)tt(ri[Ln])}()}},bn=C(Cp),Wn=new Error("Promise never resolved before cacheEntryRemoved."),Ei=function(Qe){var Ct=Qe.api,Gt=Qe.reducerPath,Jt=Qe.context,ut=Qe.queryThunk,Le=Qe.mutationThunk,st=(0,bn.isAsyncThunkAction)(ut),ze=(0,bn.isAsyncThunkAction)(Le),Ee=(0,bn.isFulfilled)(ut,Le),tt={};function xt(lt,gn,Ln,ri,mi){var Vi=Jt.endpointDefinitions[lt],qn=Vi==null?void 0:Vi.onCacheEntryAdded;if(qn){var mn={},oi=new Promise(function(ts){mn.cacheEntryRemoved=ts}),dr=Promise.race([new Promise(function(ts){mn.valueResolved=ts}),oi.then(function(){throw Wn})]);dr.catch(function(){}),tt[Ln]=mn;var gr=Ct.endpoints[lt].select(Vi.type===Ye.query?gn:Ln),ta=ri.dispatch(function(ts,fs,$o){return $o}),ma=_(v({},ri),{getCacheEntry:function(){return gr(ri.getState())},requestId:mi,extra:ta,updateCachedData:Vi.type===Ye.query?function(ts){return ri.dispatch(Ct.util.updateQueryData(lt,gn,ts))}:void 0,cacheDataLoaded:dr,cacheEntryRemoved:oi}),za=qn(gn,ma);Promise.resolve(za).catch(function(ts){if(ts!==Wn)throw ts})}}return function(lt,gn,Ln){var ri=function(gr){return st(gr)?gr.meta.arg.queryCacheKey:ze(gr)?gr.meta.requestId:Ct.internalActions.removeQueryResult.match(gr)?gr.payload.queryCacheKey:Ct.internalActions.removeMutationResult.match(gr)?X(gr.payload):""}(lt);if(ut.pending.match(lt)){var mi=Ln[Gt].queries[ri],Vi=gn.getState()[Gt].queries[ri];!mi&&Vi&&xt(lt.meta.arg.endpointName,lt.meta.arg.originalArgs,ri,gn,lt.meta.requestId)}else if(Le.pending.match(lt))(Vi=gn.getState()[Gt].mutations[ri])&&xt(lt.meta.arg.endpointName,lt.meta.arg.originalArgs,ri,gn,lt.meta.requestId);else if(Ee(lt))(dr=tt[ri])!=null&&dr.valueResolved&&(dr.valueResolved({data:lt.payload,meta:lt.meta.baseQueryMeta}),delete dr.valueResolved);else if(Ct.internalActions.removeQueryResult.match(lt)||Ct.internalActions.removeMutationResult.match(lt))(dr=tt[ri])&&(delete tt[ri],dr.cacheEntryRemoved());else if(Ct.util.resetApiState.match(lt))for(var qn=0,mn=Object.entries(tt);qn<mn.length;qn++){var oi=mn[qn],dr=oi[1];delete tt[oi[0]],dr.cacheEntryRemoved()}}},er=C(Cp),ur=function(Qe){var Ct=Qe.api,Gt=Qe.context,Jt=Qe.queryThunk,ut=Qe.mutationThunk,Le=(0,er.isPending)(Jt,ut),st=(0,er.isRejected)(Jt,ut),ze=(0,er.isFulfilled)(Jt,ut),Ee={};return function(tt,xt){var lt,gn,Ln;if(Le(tt)){var ri=tt.meta,mi=ri.requestId,Vi=ri.arg,qn=Vi.endpointName,mn=Vi.originalArgs,oi=Gt.endpointDefinitions[qn],dr=oi==null?void 0:oi.onQueryStarted;if(dr){var gr={},ta=new Promise(function(ac,xi){gr.resolve=ac,gr.reject=xi});ta.catch(function(){}),Ee[mi]=gr;var ma=Ct.endpoints[qn].select(oi.type===Ye.query?mn:mi),za=xt.dispatch(function(ac,xi,co){return co}),ts=_(v({},xt),{getCacheEntry:function(){return ma(xt.getState())},requestId:mi,extra:za,updateCachedData:oi.type===Ye.query?function(ac){return xt.dispatch(Ct.util.updateQueryData(qn,mn,ac))}:void 0,queryFulfilled:ta});dr(mn,ts)}}else if(ze(tt)){var fs=tt.meta,$o=fs.baseQueryMeta;(lt=Ee[mi=fs.requestId])==null||lt.resolve({data:tt.payload,meta:$o}),delete Ee[mi]}else if(st(tt)){var Tl=tt.meta;$o=Tl.baseQueryMeta,(Ln=Ee[mi=Tl.requestId])==null||Ln.reject({error:(gn=tt.payload)!=null?gn:tt.error,isUnhandledError:!Tl.rejectedWithValue,meta:$o}),delete Ee[mi]}}},Jr=function(Qe){var Ct=Qe.api,Gt=Qe.context.apiUid;return function(Jt,ut){Ct.util.resetApiState.match(Jt)&&ut.dispatch(Ct.internalActions.middlewareRegistered(Gt))}},$i=C(rO),xs=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof Po<"u"?Po:globalThis):function(Qe){return(ot||(ot=Promise.resolve())).then(Qe).catch(function(Ct){return setTimeout(function(){throw Ct},0)})};function wr(Qe){for(var Ct=[],Gt=1;Gt<arguments.length;Gt++)Ct[Gt-1]=arguments[Gt];Object.assign.apply(Object,r([Qe],Ct))}var Ji=C(rO),rn=Symbol(),di=function(){return{name:rn,init:function(Qe,Ct,Gt){var Jt=Ct.baseQuery,ut=Ct.reducerPath,Le=Ct.serializeQueryArgs,st=Ct.keepUnusedDataFor,ze=Ct.refetchOnMountOrArgChange,Ee=Ct.refetchOnFocus,tt=Ct.refetchOnReconnect;(0,Ji.enablePatches)();var xt=function(xi){return xi};Object.assign(Qe,{reducerPath:ut,endpoints:{},internalActions:{onOnline:oe,onOffline:Q,onFocus:V,onFocusLost:re},util:{}});var lt=function(xi){var co=this,vo=xi.reducerPath,Ws=xi.baseQuery,Vo=xi.context.endpointDefinitions,zs=xi.serializeQueryArgs,No=xi.api,Yr=xi.assertTagType,uo=function(ti,yi){return E(co,[ti,yi],function(Qn,li){var Si,Yi,Tn,xn,Xn,vt,$t,yn,ni,Gn,fi,$r,ho,eo=li.signal,Ua=li.abort,Dr=li.rejectWithValue,Rn=li.fulfillWithValue,Ts=li.dispatch,kl=li.getState,tu=li.extra;return i(this,function(ps){switch(ps.label){case 0:Si=Vo[Qn.endpointName],ps.label=1;case 1:return ps.trys.push([1,8,,13]),Yi=Lt,Tn=void 0,xn={signal:eo,abort:Ua,dispatch:Ts,getState:kl,extra:tu,endpoint:Qn.endpointName,type:Qn.type,forced:Qn.type==="query"?Lr(Qn,kl()):void 0},(Xn=Qn.type==="query"?Qn[Ft]:void 0)?(Tn=Xn(),[3,6]):[3,2];case 2:return Si.query?[4,Ws(Si.query(Qn.originalArgs),xn,Si.extraOptions)]:[3,4];case 3:return Tn=ps.sent(),Si.transformResponse&&(Yi=Si.transformResponse),[3,6];case 4:return[4,Si.queryFn(Qn.originalArgs,xn,Si.extraOptions,function(Hl){return Ws(Hl,xn,Si.extraOptions)})];case 5:Tn=ps.sent(),ps.label=6;case 6:if(Tn.error)throw new F(Tn.error,Tn.meta);return vt=Rn,[4,Yi(Tn.data,Tn.meta,Qn.originalArgs)];case 7:return[2,vt.apply(void 0,[ps.sent(),($r={fulfilledTimeStamp:Date.now(),baseQueryMeta:Tn.meta},$r[mt.SHOULD_AUTOBATCH]=!0,$r)])];case 8:if($t=ps.sent(),!((yn=$t)instanceof F))return[3,12];ni=Lt,Si.query&&Si.transformErrorResponse&&(ni=Si.transformErrorResponse),ps.label=9;case 9:return ps.trys.push([9,11,,12]),Gn=Dr,[4,ni(yn.value,yn.meta,Qn.originalArgs)];case 10:return[2,Gn.apply(void 0,[ps.sent(),(ho={baseQueryMeta:yn.meta},ho[mt.SHOULD_AUTOBATCH]=!0,ho)])];case 11:return fi=ps.sent(),yn=fi,[3,12];case 12:throw console.error(yn),yn;case 13:return[2]}})})};function Lr(ti,yi){var Qn,li,Si,Yi,Tn=(li=(Qn=yi[vo])==null?void 0:Qn.queries)==null?void 0:li[ti.queryCacheKey],xn=(Si=yi[vo])==null?void 0:Si.config.refetchOnMountOrArgChange,Xn=Tn==null?void 0:Tn.fulfilledTimeStamp,vt=(Yi=ti.forceRefetch)!=null?Yi:ti.subscribe&&xn;return!!vt&&(vt===!0||(Number(new Date)-Number(Xn))/1e3>=vt)}var Br=(0,mt.createAsyncThunk)(vo+"/executeQuery",uo,{getPendingMeta:function(){var ti;return(ti={startedTimeStamp:Date.now()})[mt.SHOULD_AUTOBATCH]=!0,ti},condition:function(ti,yi){var Qn,li,Si,Yi=(0,yi.getState)(),Tn=(li=(Qn=Yi[vo])==null?void 0:Qn.queries)==null?void 0:li[ti.queryCacheKey],xn=Tn==null?void 0:Tn.fulfilledTimeStamp,Xn=ti.originalArgs,vt=Tn==null?void 0:Tn.originalArgs,$t=Vo[ti.endpointName];return!(!Yt(ti)&&((Tn==null?void 0:Tn.status)==="pending"||!Lr(ti,Yi)&&(!Pe($t)||!((Si=$t==null?void 0:$t.forceRefetch)!=null&&Si.call($t,{currentArg:Xn,previousArg:vt,endpointState:Tn,state:Yi})))&&xn))},dispatchConditionRejection:!0}),so=(0,mt.createAsyncThunk)(vo+"/executeMutation",uo,{getPendingMeta:function(){var ti;return(ti={startedTimeStamp:Date.now()})[mt.SHOULD_AUTOBATCH]=!0,ti}});function Ki(ti){return function(yi){var Qn,li;return((li=(Qn=yi==null?void 0:yi.meta)==null?void 0:Qn.arg)==null?void 0:li.endpointName)===ti}}return{queryThunk:Br,mutationThunk:so,prefetch:function(ti,yi,Qn){return function(li,Si){var Yi=function($t){return"force"in $t}(Qn)&&Qn.force,Tn=function($t){return"ifOlderThan"in $t}(Qn)&&Qn.ifOlderThan,xn=function($t){return $t===void 0&&($t=!0),No.endpoints[ti].initiate(yi,{forceRefetch:$t})},Xn=No.endpoints[ti].select(yi)(Si());if(Yi)li(xn());else if(Tn){var vt=Xn==null?void 0:Xn.fulfilledTimeStamp;if(!vt)return void li(xn());(Number(new Date)-Number(new Date(vt)))/1e3>=Tn&&li(xn())}else li(xn(!1))}},updateQueryData:function(ti,yi,Qn,li){return li===void 0&&(li=!0),function(Si,Yi){var Tn,xn,Xn,vt=No.endpoints[ti].select(yi)(Yi()),$t={patches:[],inversePatches:[],undo:function(){return Si(No.util.patchQueryData(ti,yi,$t.inversePatches,li))}};if(vt.status===e.uninitialized)return $t;if("data"in vt)if((0,Et.isDraftable)(vt.data)){var yn=(0,Et.produceWithPatches)(vt.data,Qn),ni=yn[0],Gn=yn[2];(Tn=$t.patches).push.apply(Tn,yn[1]),(xn=$t.inversePatches).push.apply(xn,Gn),Xn=ni}else Xn=Qn(vt.data),$t.patches.push({op:"replace",path:[],value:Xn}),$t.inversePatches.push({op:"replace",path:[],value:vt.data});return Si(No.util.patchQueryData(ti,yi,$t.patches,li)),$t}},upsertQueryData:function(ti,yi,Qn){return function(li){var Si;return li(No.endpoints[ti].initiate(yi,((Si={subscribe:!1,forceRefetch:!0})[Ft]=function(){return{data:Qn}},Si)))}},patchQueryData:function(ti,yi,Qn,li){return function(Si,Yi){var Tn=Vo[ti],xn=zs({queryArgs:yi,endpointDefinition:Tn,endpointName:ti});if(Si(No.internalActions.queryResultPatched({queryCacheKey:xn,patches:Qn})),li){var Xn=No.endpoints[ti].select(yi)(Yi()),vt=Ge(Tn.providesTags,Xn.data,void 0,yi,{},Yr);Si(No.internalActions.updateProvidedBy({queryCacheKey:xn,providedTags:vt}))}}},buildMatchThunkActions:function(ti,yi){return{matchPending:(0,ln.isAllOf)((0,ln.isPending)(ti),Ki(yi)),matchFulfilled:(0,ln.isAllOf)((0,ln.isFulfilled)(ti),Ki(yi)),matchRejected:(0,ln.isAllOf)((0,ln.isRejected)(ti),Ki(yi))}}}}({baseQuery:Jt,reducerPath:ut,context:Gt,api:Qe,serializeQueryArgs:Le,assertTagType:xt}),gn=lt.queryThunk,Ln=lt.mutationThunk,ri=lt.patchQueryData,mi=lt.updateQueryData,Vi=lt.upsertQueryData,qn=lt.prefetch,mn=lt.buildMatchThunkActions,oi=function(xi){var co=xi.reducerPath,vo=xi.queryThunk,Ws=xi.mutationThunk,Vo=xi.context,zs=Vo.endpointDefinitions,No=Vo.apiUid,Yr=Vo.extractRehydrationInfo,uo=Vo.hasRehydrationInfo,Lr=xi.assertTagType,Br=xi.config,so=(0,bt.createAction)(co+"/resetApiState"),Ki=(0,bt.createSlice)({name:co+"/queries",initialState:te,reducers:{removeQueryResult:{reducer:function(Tn,xn){delete Tn[xn.payload.queryCacheKey]},prepare:(0,bt.prepareAutoBatched)()},queryResultPatched:{reducer:function(Tn,xn){var Xn=xn.payload,vt=Xn.patches;Y(Tn,Xn.queryCacheKey,function($t){$t.data=(0,se.applyPatches)($t.data,vt.concat())})},prepare:(0,bt.prepareAutoBatched)()}},extraReducers:function(Tn){Tn.addCase(vo.pending,function(xn,Xn){var vt,$t=Xn.meta,yn=Xn.meta.arg,ni=Yt(yn);(yn.subscribe||ni)&&(xn[vt=yn.queryCacheKey]!=null||(xn[vt]={status:e.uninitialized,endpointName:yn.endpointName})),Y(xn,yn.queryCacheKey,function(Gn){Gn.status=e.pending,Gn.requestId=ni&&Gn.requestId?Gn.requestId:$t.requestId,yn.originalArgs!==void 0&&(Gn.originalArgs=yn.originalArgs),Gn.startedTimeStamp=$t.startedTimeStamp})}).addCase(vo.fulfilled,function(xn,Xn){var vt=Xn.meta,$t=Xn.payload;Y(xn,vt.arg.queryCacheKey,function(yn){var ni;if(yn.requestId===vt.requestId||Yt(vt.arg)){var Gn=zs[vt.arg.endpointName].merge;if(yn.status=e.fulfilled,Gn)if(yn.data!==void 0){var fi=vt.fulfilledTimeStamp,$r=vt.arg,ho=vt.baseQueryMeta,eo=vt.requestId,Ua=(0,bt.createNextState)(yn.data,function(Dr){return Gn(Dr,$t,{arg:$r.originalArgs,baseQueryMeta:ho,fulfilledTimeStamp:fi,requestId:eo})});yn.data=Ua}else yn.data=$t;else yn.data=(ni=zs[vt.arg.endpointName].structuralSharing)==null||ni?L((0,Te.isDraft)(yn.data)?(0,se.original)(yn.data):yn.data,$t):$t;delete yn.error,yn.fulfilledTimeStamp=vt.fulfilledTimeStamp}})}).addCase(vo.rejected,function(xn,Xn){var vt=Xn.meta,$t=vt.condition,yn=vt.requestId,ni=Xn.error,Gn=Xn.payload;Y(xn,vt.arg.queryCacheKey,function(fi){if(!$t){if(fi.requestId!==yn)return;fi.status=e.rejected,fi.error=Gn??ni}})}).addMatcher(uo,function(xn,Xn){for(var vt=Yr(Xn).queries,$t=0,yn=Object.entries(vt);$t<yn.length;$t++){var ni=yn[$t],Gn=ni[1];(Gn==null?void 0:Gn.status)!==e.fulfilled&&(Gn==null?void 0:Gn.status)!==e.rejected||(xn[ni[0]]=Gn)}})}}),ti=(0,bt.createSlice)({name:co+"/mutations",initialState:te,reducers:{removeMutationResult:{reducer:function(Tn,xn){var Xn=X(xn.payload);Xn in Tn&&delete Tn[Xn]},prepare:(0,bt.prepareAutoBatched)()}},extraReducers:function(Tn){Tn.addCase(Ws.pending,function(xn,Xn){var vt=Xn.meta,$t=vt.requestId,yn=vt.arg,ni=vt.startedTimeStamp;yn.track&&(xn[X(Xn.meta)]={requestId:$t,status:e.pending,endpointName:yn.endpointName,startedTimeStamp:ni})}).addCase(Ws.fulfilled,function(xn,Xn){var vt=Xn.payload,$t=Xn.meta;$t.arg.track&&le(xn,$t,function(yn){yn.requestId===$t.requestId&&(yn.status=e.fulfilled,yn.data=vt,yn.fulfilledTimeStamp=$t.fulfilledTimeStamp)})}).addCase(Ws.rejected,function(xn,Xn){var vt=Xn.payload,$t=Xn.error,yn=Xn.meta;yn.arg.track&&le(xn,yn,function(ni){ni.requestId===yn.requestId&&(ni.status=e.rejected,ni.error=vt??$t)})}).addMatcher(uo,function(xn,Xn){for(var vt=Yr(Xn).mutations,$t=0,yn=Object.entries(vt);$t<yn.length;$t++){var ni=yn[$t],Gn=ni[0],fi=ni[1];(fi==null?void 0:fi.status)!==e.fulfilled&&(fi==null?void 0:fi.status)!==e.rejected||Gn===(fi==null?void 0:fi.requestId)||(xn[Gn]=fi)}})}}),yi=(0,bt.createSlice)({name:co+"/invalidation",initialState:te,reducers:{updateProvidedBy:{reducer:function(Tn,xn){for(var Xn,vt,$t,yn,ni=xn.payload,Gn=ni.queryCacheKey,fi=ni.providedTags,$r=0,ho=Object.values(Tn);$r<ho.length;$r++)for(var eo=0,Ua=Object.values(ho[$r]);eo<Ua.length;eo++){var Dr=Ua[eo],Rn=Dr.indexOf(Gn);Rn!==-1&&Dr.splice(Rn,1)}for(var Ts=0,kl=fi;Ts<kl.length;Ts++){var tu=kl[Ts],ps=tu.type,Hl=tu.id,Wl=(yn=(vt=(Xn=Tn[ps])!=null?Xn:Tn[ps]={})[$t=Hl||"__internal_without_id"])!=null?yn:vt[$t]=[];Wl.includes(Gn)||Wl.push(Gn)}},prepare:(0,bt.prepareAutoBatched)()}},extraReducers:function(Tn){Tn.addCase(Ki.actions.removeQueryResult,function(xn,Xn){for(var vt=Xn.payload.queryCacheKey,$t=0,yn=Object.values(xn);$t<yn.length;$t++)for(var ni=0,Gn=Object.values(yn[$t]);ni<Gn.length;ni++){var fi=Gn[ni],$r=fi.indexOf(vt);$r!==-1&&fi.splice($r,1)}}).addMatcher(uo,function(xn,Xn){for(var vt,$t,yn,ni,Gn=Yr(Xn).provided,fi=0,$r=Object.entries(Gn);fi<$r.length;fi++)for(var ho=$r[fi],eo=ho[0],Ua=0,Dr=Object.entries(ho[1]);Ua<Dr.length;Ua++)for(var Rn=Dr[Ua],Ts=Rn[0],kl=Rn[1],tu=(ni=($t=(vt=xn[eo])!=null?vt:xn[eo]={})[yn=Ts||"__internal_without_id"])!=null?ni:$t[yn]=[],ps=0,Hl=kl;ps<Hl.length;ps++){var Wl=Hl[ps];tu.includes(Wl)||tu.push(Wl)}}).addMatcher((0,bt.isAnyOf)((0,bt.isFulfilled)(vo),(0,bt.isRejectedWithValue)(vo)),function(xn,Xn){var vt=be(Xn,"providesTags",zs,Lr);yi.caseReducers.updateProvidedBy(xn,yi.actions.updateProvidedBy({queryCacheKey:Xn.meta.arg.queryCacheKey,providedTags:vt}))})}}),Qn=(0,bt.createSlice)({name:co+"/subscriptions",initialState:te,reducers:{updateSubscriptionOptions:function(Tn,xn){},unsubscribeQueryResult:function(Tn,xn){},internal_probeSubscription:function(Tn,xn){}}}),li=(0,bt.createSlice)({name:co+"/internalSubscriptions",initialState:te,reducers:{subscriptionsUpdated:{reducer:function(Tn,xn){return(0,se.applyPatches)(Tn,xn.payload)},prepare:(0,bt.prepareAutoBatched)()}}}),Si=(0,bt.createSlice)({name:co+"/config",initialState:v({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},Br),reducers:{middlewareRegistered:function(Tn,xn){Tn.middlewareRegistered=Tn.middlewareRegistered!=="conflict"&&No===xn.payload||"conflict"}},extraReducers:function(Tn){Tn.addCase(oe,function(xn){xn.online=!0}).addCase(Q,function(xn){xn.online=!1}).addCase(V,function(xn){xn.focused=!0}).addCase(re,function(xn){xn.focused=!1}).addMatcher(uo,function(xn){return v({},xn)})}}),Yi=(0,bt.combineReducers)({queries:Ki.reducer,mutations:ti.reducer,provided:yi.reducer,subscriptions:li.reducer,config:Si.reducer});return{reducer:function(Tn,xn){return Yi(so.match(xn)?void 0:Tn,xn)},actions:_(v(v(v(v(v(v({},Si.actions),Ki.actions),Qn.actions),li.actions),ti.actions),yi.actions),{unsubscribeMutationResult:ti.actions.removeMutationResult,resetApiState:so})}}({context:Gt,queryThunk:gn,mutationThunk:Ln,reducerPath:ut,assertTagType:xt,config:{refetchOnFocus:Ee,refetchOnReconnect:tt,refetchOnMountOrArgChange:ze,keepUnusedDataFor:st,reducerPath:ut}}),dr=oi.reducer,gr=oi.actions;wr(Qe.util,{patchQueryData:ri,updateQueryData:mi,upsertQueryData:Vi,prefetch:qn,resetApiState:gr.resetApiState}),wr(Qe.internalActions,gr);var ta=function(xi){var co=xi.reducerPath,vo=xi.queryThunk,Ws=xi.api,Vo=xi.context,zs=Vo.apiUid,No={invalidateTags:(0,wt.createAction)(co+"/invalidateTags")},Yr=[Jr,pn,Cn,hn,Ei,ur];return{middleware:function(Lr){var Br=!1,so=_(v({},xi),{internalState:{currentSubscriptions:{}},refetchQuery:uo}),Ki=Yr.map(function(Qn){return Qn(so)}),ti=function(Qn){var li=Qn.api,Si=Qn.queryThunk,Yi=Qn.internalState,Tn=li.reducerPath+"/subscriptions",xn=null,Xn=!1,vt=li.internalActions,$t=vt.updateSubscriptionOptions,yn=vt.unsubscribeQueryResult;return function(ni,Gn){var fi,$r;if(xn||(xn=JSON.parse(JSON.stringify(Yi.currentSubscriptions))),li.util.resetApiState.match(ni))return xn=Yi.currentSubscriptions={},[!0,!1];if(li.internalActions.internal_probeSubscription.match(ni)){var ho=ni.payload;return[!1,!!((fi=Yi.currentSubscriptions[ho.queryCacheKey])!=null&&fi[ho.requestId])]}var eo=function(Rn,Ts){var kl,tu,ps,Hl,Wl,Og,A0,vl,s_;if($t.match(Ts)){var bh=Ts.payload,Pg=bh.queryCacheKey,ku=bh.requestId;return(kl=Rn==null?void 0:Rn[Pg])!=null&&kl[ku]&&(Rn[Pg][ku]=bh.options),!0}if(yn.match(Ts)){var nu=Ts.payload;return ku=nu.requestId,Rn[Pg=nu.queryCacheKey]&&delete Rn[Pg][ku],!0}if(li.internalActions.removeQueryResult.match(Ts))return delete Rn[Ts.payload.queryCacheKey],!0;if(Si.pending.match(Ts)){var R0=Ts.meta;if(ku=R0.requestId,(rf=R0.arg).subscribe)return(Mg=(ps=Rn[tu=rf.queryCacheKey])!=null?ps:Rn[tu]={})[ku]=(Wl=(Hl=rf.subscriptionOptions)!=null?Hl:Mg[ku])!=null?Wl:{},!0}if(Si.rejected.match(Ts)){var Mg,Fg=Ts.meta,rf=Fg.arg;if(ku=Fg.requestId,Fg.condition&&rf.subscribe)return(Mg=(A0=Rn[Og=rf.queryCacheKey])!=null?A0:Rn[Og]={})[ku]=(s_=(vl=rf.subscriptionOptions)!=null?vl:Mg[ku])!=null?s_:{},!0}return!1}(Yi.currentSubscriptions,ni);if(eo){Xn||(xs(function(){var Rn=JSON.parse(JSON.stringify(Yi.currentSubscriptions)),Ts=(0,$i.produceWithPatches)(xn,function(){return Rn});Gn.next(li.internalActions.subscriptionsUpdated(Ts[1])),xn=Rn,Xn=!1}),Xn=!0);var Ua=!!(($r=ni.type)!=null&&$r.startsWith(Tn)),Dr=Si.rejected.match(ni)&&ni.meta.condition&&!!ni.meta.arg.subscribe;return[!Ua&&!Dr,!1]}return[!0,!1]}}(so),yi=function(Qn){var li=Qn.reducerPath,Si=Qn.context,Yi=Qn.refetchQuery,Tn=Qn.internalState,xn=Qn.api.internalActions.removeQueryResult;function Xn(vt,$t){var yn=vt.getState()[li],ni=yn.queries,Gn=Tn.currentSubscriptions;Si.batch(function(){for(var fi=0,$r=Object.keys(Gn);fi<$r.length;fi++){var ho=$r[fi],eo=ni[ho],Ua=Gn[ho];Ua&&eo&&(Object.values(Ua).some(function(Dr){return Dr[$t]===!0})||Object.values(Ua).every(function(Dr){return Dr[$t]===void 0})&&yn.config[$t])&&(Object.keys(Ua).length===0?vt.dispatch(xn({queryCacheKey:ho})):eo.status!==e.uninitialized&&vt.dispatch(Yi(eo,ho)))}})}return function(vt,$t){V.match(vt)&&Xn($t,"refetchOnFocus"),oe.match(vt)&&Xn($t,"refetchOnReconnect")}}(so);return function(Qn){return function(li){Br||(Br=!0,Lr.dispatch(Ws.internalActions.middlewareRegistered(zs)));var Si,Yi=_(v({},Lr),{next:Qn}),Tn=Lr.getState(),xn=ti(li,Yi,Tn),Xn=xn[1];if(Si=xn[0]?Qn(li):Xn,Lr.getState()[co]&&(yi(li,Yi,Tn),function(yn){return!!yn&&typeof yn.type=="string"&&yn.type.startsWith(co+"/")}(li)||Vo.hasRehydrationInfo(li)))for(var vt=0,$t=Ki;vt<$t.length;vt++)(0,$t[vt])(li,Yi,Tn);return Si}}},actions:No};function uo(Lr,Br,so){return so===void 0&&(so={}),vo(v({type:"query",endpointName:Lr.endpointName,originalArgs:Lr.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:Br},so))}}({reducerPath:ut,context:Gt,queryThunk:gn,mutationThunk:Ln,api:Qe,assertTagType:xt}),ma=ta.middleware;wr(Qe.util,ta.actions),wr(Qe,{reducer:dr,middleware:ma});var za=function(xi){var co=xi.serializeQueryArgs,vo=xi.reducerPath,Ws=function(Yr){return It},Vo=function(Yr){return Qt};return{buildQuerySelector:function(Yr,uo){return function(Lr){var Br=co({queryArgs:Lr,endpointDefinition:uo,endpointName:Yr});return(0,He.createSelector)(Lr===me?Ws:function(so){var Ki,ti,yi;return(yi=(ti=(Ki=No(so))==null?void 0:Ki.queries)==null?void 0:ti[Br])!=null?yi:It},zs)}},buildMutationSelector:function(){return function(Yr){var uo,Lr;return Lr=typeof Yr=="object"?(uo=X(Yr))!=null?uo:me:Yr,(0,He.createSelector)(Lr===me?Vo:function(Br){var so,Ki,ti;return(ti=(Ki=(so=No(Br))==null?void 0:so.mutations)==null?void 0:Ki[Lr])!=null?ti:Qt},zs)}},selectInvalidatedBy:function(Yr,uo){for(var Lr,Br=Yr[vo],so=new Set,Ki=0,ti=uo.map(Fe);Ki<ti.length;Ki++){var yi=ti[Ki],Qn=Br.provided[yi.type];if(Qn)for(var li=0,Si=(Lr=yi.id!==void 0?Qn[yi.id]:x(Object.values(Qn)))!=null?Lr:[];li<Si.length;li++)so.add(Si[li])}return x(Array.from(so.values()).map(function(Yi){var Tn=Br.queries[Yi];return Tn?[{queryCacheKey:Yi,endpointName:Tn.endpointName,originalArgs:Tn.originalArgs}]:[]}))}};function zs(Yr){return v(v({},Yr),{status:uo=Yr.status,isUninitialized:uo===e.uninitialized,isLoading:uo===e.pending,isSuccess:uo===e.fulfilled,isError:uo===e.rejected});var uo}function No(Yr){return Yr[vo]}}({serializeQueryArgs:Le,reducerPath:ut}),ts=za.buildQuerySelector,fs=za.buildMutationSelector;wr(Qe.util,{selectInvalidatedBy:za.selectInvalidatedBy});var $o=function(xi){var co=xi.serializeQueryArgs,vo=xi.queryThunk,Ws=xi.mutationThunk,Vo=xi.api,zs=xi.context,No=new Map,Yr=new Map,uo=Vo.internalActions,Lr=uo.unsubscribeQueryResult,Br=uo.removeMutationResult,so=uo.updateSubscriptionOptions;return{buildInitiateQuery:function(Ki,ti){var yi=function(Qn,li){var Si=li===void 0?{}:li,Yi=Si.subscribe,Tn=Yi===void 0||Yi,xn=Si.forceRefetch,Xn=Si.subscriptionOptions,vt=Si[Ft];return function($t,yn){var ni,Gn,fi=co({queryArgs:Qn,endpointDefinition:ti,endpointName:Ki}),$r=vo(((ni={type:"query",subscribe:Tn,forceRefetch:xn,subscriptionOptions:Xn,endpointName:Ki,originalArgs:Qn,queryCacheKey:fi})[Ft]=vt,ni)),ho=Vo.endpoints[Ki].select(Qn),eo=$t($r),Ua=ho(yn()),Dr=eo.requestId,Rn=eo.abort,Ts=Ua.requestId!==Dr,kl=(Gn=No.get($t))==null?void 0:Gn[fi],tu=function(){return ho(yn())},ps=Object.assign(vt?eo.then(tu):Ts&&!kl?Promise.resolve(Ua):Promise.all([kl,eo]).then(tu),{arg:Qn,requestId:Dr,subscriptionOptions:Xn,queryCacheKey:fi,abort:Rn,unwrap:function(){return E(this,null,function(){var Wl;return i(this,function(Og){switch(Og.label){case 0:return[4,ps];case 1:if((Wl=Og.sent()).isError)throw Wl.error;return[2,Wl.data]}})})},refetch:function(){return $t(yi(Qn,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){Tn&&$t(Lr({queryCacheKey:fi,requestId:Dr}))},updateSubscriptionOptions:function(Wl){ps.subscriptionOptions=Wl,$t(so({endpointName:Ki,requestId:Dr,queryCacheKey:fi,options:Wl}))}});if(!kl&&!Ts&&!vt){var Hl=No.get($t)||{};Hl[fi]=ps,No.set($t,Hl),ps.then(function(){delete Hl[fi],Object.keys(Hl).length||No.delete($t)})}return ps}};return yi},buildInitiateMutation:function(Ki){return function(ti,yi){var Qn=yi===void 0?{}:yi,li=Qn.track,Si=li===void 0||li,Yi=Qn.fixedCacheKey;return function(Tn,xn){var Xn=Ws({type:"mutation",endpointName:Ki,originalArgs:ti,track:Si,fixedCacheKey:Yi}),vt=Tn(Xn),$t=vt.requestId,yn=vt.abort,ni=vt.unwrap,Gn=vt.unwrap().then(function(eo){return{data:eo}}).catch(function(eo){return{error:eo}}),fi=function(){Tn(Br({requestId:$t,fixedCacheKey:Yi}))},$r=Object.assign(Gn,{arg:vt.arg,requestId:$t,abort:yn,unwrap:ni,unsubscribe:fi,reset:fi}),ho=Yr.get(Tn)||{};return Yr.set(Tn,ho),ho[$t]=$r,$r.then(function(){delete ho[$t],Object.keys(ho).length||Yr.delete(Tn)}),Yi&&(ho[Yi]=$r,$r.then(function(){ho[Yi]===$r&&(delete ho[Yi],Object.keys(ho).length||Yr.delete(Tn))})),$r}}},getRunningQueryThunk:function(Ki,ti){return function(yi){var Qn,li=co({queryArgs:ti,endpointDefinition:zs.endpointDefinitions[Ki],endpointName:Ki});return(Qn=No.get(yi))==null?void 0:Qn[li]}},getRunningMutationThunk:function(Ki,ti){return function(yi){var Qn;return(Qn=Yr.get(yi))==null?void 0:Qn[ti]}},getRunningQueriesThunk:function(){return function(Ki){return Object.values(No.get(Ki)||{}).filter(Mt)}},getRunningMutationsThunk:function(){return function(Ki){return Object.values(Yr.get(Ki)||{}).filter(Mt)}},getRunningOperationPromises:function(){var Ki=function(ti){return Array.from(ti.values()).flatMap(function(yi){return yi?Object.values(yi):[]})};return r(r([],Ki(No)),Ki(Yr)).filter(Mt)},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:gn,mutationThunk:Ln,api:Qe,serializeQueryArgs:Le,context:Gt}),Tl=$o.buildInitiateQuery,ac=$o.buildInitiateMutation;return wr(Qe.util,{getRunningOperationPromises:$o.getRunningOperationPromises,getRunningOperationPromise:$o.removalWarning,getRunningMutationThunk:$o.getRunningMutationThunk,getRunningMutationsThunk:$o.getRunningMutationsThunk,getRunningQueryThunk:$o.getRunningQueryThunk,getRunningQueriesThunk:$o.getRunningQueriesThunk}),{name:rn,injectEndpoint:function(xi,co){var vo,Ws=Qe;(vo=Ws.endpoints)[xi]!=null||(vo[xi]={}),Pe(co)?wr(Ws.endpoints[xi],{name:xi,select:ts(xi,co),initiate:Tl(xi,co)},mn(gn,xi)):co.type===Ye.mutation&&wr(Ws.endpoints[xi],{name:xi,select:fs(),initiate:ac(xi)},mn(Ln,xi))}}}}},Wr=Ke(di())})(h$e);d$e.exports=h$e;var OAt=d$e.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 PAt={api:{},latestQueryUrl:""},f$e=_R({name:"companyDocuments",initialState:PAt,reducers:{updateLatestQueryUrl:(n,e)=>{n.latestQueryUrl=e.payload.url}}});f$e.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 MAt={currentPage:1,filter:""},p$e=_R({name:"products",initialState:MAt,reducers:{updateCurrentPage:(n,e)=>{n.currentPage=e.payload.number},updateFilter:(n,e)=>{n.filter=e.payload.filter}}});p$e.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 FAt={colors:{primary:"#117DC0"},darkMode:!1,activeSettings:{name:"",level:"company"}},g$e=_R({name:"settings",initialState:FAt,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:UTr,setDarkMode:jTr,setActiveSettings:LF}=g$e.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 VH=m8e({reducer:{companyUsers:V8e.reducer,companyDocuments:f$e.reducer,user:H8e.reducer,products:p$e.reducer,settings:g$e.reducer},middleware:n=>n({serializableCheck:!1})});OAt.setupListeners(VH.dispatch);function BAt(n){return Hn({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 $At(n){return Hn({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 $me(n){return Hn({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 VAt(n){return Hn({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 qTr(n){return Hn({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 qp(n){return Hn({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 dke(n){return Hn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"}}]})(n)}function HAt(n){return Hn({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 WAt(n){return Hn({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 Eq(){return Nc(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 hs(){const n=Eq();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 Fo(){const n=Eq();return{isAdmin:!!(n!=null&&n.is_admin),isOwner:!!(n!=null&&n.is_owner||n!=null&&n.is_owner)}}function m$e(){var C,E;const[n]=ve(),e=zi(),t=ki(),i=Nc(x=>x.companyUsers),{id:r}=il(),o=fR(),s=Sq(),a=Va(),l=ml(),c=si(),u=IAt(),d=Co(),{isAdmin:h,isOwner:f}=Fo(),g=Ti(),[m,v]=w.useState(!1),[_,b]=w.useState(!1),y=x=>{if(e(_F({type:vR.TOKEN,user:i.api[x].user,token:i.api[x].token.token})),localStorage.setItem("X-CURRENT-INDEX",x.toString()),localStorage.setItem("COMPANY-EDIT-OPENED","false"),sessionStorage.setItem("COMPANY-ACTIVITY-SHOWN","false"),d.invalidateQueries(),r){const k="/"+(l.pathname.includes("/settings/gateways")?"settings/online_payments":l.pathname.split("/")[1]||"dashboard");t(k)}window.location.reload()};return w.useEffect(()=>{i.api.length<10&&v(!0),d1()&&v(!1)},[g]),O(St,{children:[p(RAt,{isModalOpen:_,setIsModalOpen:b}),O(J1,{as:"div",className:"relative inline-block text-left w-full","data-cy":"companyDropdown",children:[O(J1.Button,{className:"flex items-center justify-between w-full rounded font-medium pl-2",children:[O("div",{className:"flex items-center justify-center space-x-3",children:[p("img",{className:"w-8",src:s,alt:"Company logo"}),O("div",{className:"flex flex-col items-between",children:[p("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))&&O("span",{className:"text-xs text-start w-28 truncate",children:[a.first_name," ",a.last_name]})]})]}),p(bR,{size:18,className:"text-gray-300"})]}),p(Dy,{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:O(J1.Items,{style:{backgroundColor:c.$1,borderColor:c.$4},className:"border origin-top-right absolute left-0 mt-2 w-56 rounded shadow-lg",children:[p("div",{className:"py-1",children:p(J1.Item,{children:O(gt,{children:[p("p",{className:"text-sm",children:n("signed_in_as")}),p("p",{className:"text-sm font-medium truncate",children:a==null?void 0:a.email})]})})}),p("div",{className:"py-1",children:((C=i==null?void 0:i.api)==null?void 0:C.length)>=1&&((E=i==null?void 0:i.api)==null?void 0:E.map((x,k)=>p(J1.Item,{children:p(gt,{actionKey:"switchCompany",onClick:()=>y(k),children:O("div",{className:"flex items-center space-x-3",children:[p("span",{children:x.company.settings.name||n("untitled_company")}),i.currentIndex===k&&p(Qj,{size:18})]})})},k)))}),O("div",{className:"py-1",children:[m&&o&&(h||f)&&p(J1.Item,{children:p(gt,{className:"flex items-center",onClick:()=>b(!0),icon:p(nt,{element:qp,size:22}),children:p("span",{children:n("add_company")})})}),(h||f)&&p(J1.Item,{children:p(gt,{to:"/settings/account_management",icon:p(nt,{element:$Et,size:22}),children:n("account_management")})}),p(J1.Item,{children:p(gt,{to:"/logout",icon:p(nt,{element:BEt,size:22}),children:n("logout")})})]})]})})]})]})}var zAt="tippy-box",_$e="tippy-content",UAt="tippy-backdrop",v$e="tippy-arrow",b$e="tippy-svg-arrow",KE={passive:!0,capture:!0},y$e=function(){return document.body};function ZZ(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Vme(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function C$e(n,e){return typeof n=="function"?n.apply(void 0,e):n}function hke(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function jAt(n){return n.split(/\s+/).filter(Boolean)}function v2(n){return[].concat(n)}function fke(n,e){n.indexOf(e)===-1&&n.push(e)}function qAt(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function GAt(n){return n.split("-")[0]}function HH(n){return[].slice.call(n)}function pke(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function tM(){return document.createElement("div")}function xq(n){return["Element","Fragment"].some(function(e){return Vme(n,e)})}function KAt(n){return Vme(n,"NodeList")}function YAt(n){return Vme(n,"MouseEvent")}function QAt(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function XAt(n){return xq(n)?[n]:KAt(n)?HH(n):Array.isArray(n)?n:HH(document.querySelectorAll(n))}function JZ(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function gke(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function ZAt(n){var e,t=v2(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function JAt(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=GAt(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,f=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-i+d>l,v=i-o.bottom-h>l,_=o.left-t+f>l,b=t-o.right-g>l;return m||v||_||b})}function eJ(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function mke(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 rb={isTouch:!1},_ke=0;function eRt(){rb.isTouch||(rb.isTouch=!0,window.performance&&document.addEventListener("mousemove",w$e))}function w$e(){var n=performance.now();n-_ke<20&&(rb.isTouch=!1,document.removeEventListener("mousemove",w$e)),_ke=n}function tRt(){var n=document.activeElement;if(QAt(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function nRt(){document.addEventListener("touchstart",eRt,KE),window.addEventListener("blur",tRt)}var iRt=typeof window<"u"&&typeof document<"u",rRt=iRt?!!window.msCrypto:!1,oRt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},sRt={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},X_=Object.assign({appendTo:y$e,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},oRt,sRt),aRt=Object.keys(X_),lRt=function(e){var t=Object.keys(e);t.forEach(function(i){X_[i]=e[i]})};function S$e(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=X_[o])!=null?a:s}return i},{});return Object.assign({},n,t)}function cRt(n,e){var t=e?Object.keys(S$e(Object.assign({},X_,{plugins:e}))):aRt,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 vke(n,e){var t=Object.assign({},e,{content:C$e(e.content,[n])},e.ignoreAttributes?{}:cRt(n,e.plugins));return t.aria=Object.assign({},X_.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 uRt=function(){return"innerHTML"};function Soe(n,e){n[uRt()]=e}function bke(n){var e=tM();return n===!0?e.className=v$e:(e.className=b$e,xq(n)?e.appendChild(n):Soe(e,n)),e}function yke(n,e){xq(e.content)?(Soe(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Soe(n,e.content):n.textContent=e.content)}function Eoe(n){var e=n.firstElementChild,t=HH(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(_$e)}),arrow:t.find(function(i){return i.classList.contains(v$e)||i.classList.contains(b$e)}),backdrop:t.find(function(i){return i.classList.contains(UAt)})}}function E$e(n){var e=tM(),t=tM();t.className=zAt,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=tM();i.className=_$e,i.setAttribute("data-state","hidden"),yke(i,n.props),e.appendChild(t),t.appendChild(i),r(n.props,n.props);function r(o,s){var a=Eoe(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)&&yke(c,n.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(bke(s.arrow))):l.appendChild(bke(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:r}}E$e.$$tippy=!0;var dRt=1,L8=[],tJ=[];function hRt(n,e){var t=vke(n,Object.assign({},X_,S$e(pke(e)))),i,r,o,s=!1,a=!1,l=!1,c=!1,u,d,h,f=[],g=hke(Ft,t.interactiveDebounce),m,v=dRt++,_=null,b=qAt(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:v,reference:n,popper:tM(),popperInstance:_,props:t,state:y,plugins:b,clearDelayTimeouts:te,setProps:me,setContent:Me,show:rt,hide:It,hideWithInteractivity:Qt,enable:X,disable:le,unmount:pe,destroy:We};if(!t.render)return C;var E=t.render(C),x=E.popper,k=E.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+C.id,C.popper=x,n._tippy=C,x._tippy=C;var L=b.map(function(ne){return ne.fn(C)}),D=n.hasAttribute("aria-expanded");return Fe(),V(),H(),W("onCreate",[C]),t.showOnCreate&&se(),x.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&B().addEventListener("mousemove",g)}),C;function A(){var ne=C.props.touch;return Array.isArray(ne)?ne:[ne,0]}function N(){return A()[0]==="hold"}function P(){var ne;return!!((ne=C.props.render)!=null&&ne.$$tippy)}function M(){return m||n}function B(){var ne=M().parentNode;return ne?ZAt(ne):document}function F(){return Eoe(x)}function U(ne){return C.state.isMounted&&!C.state.isVisible||rb.isTouch||u&&u.type==="focus"?0:ZZ(C.props.delay,ne?0:1,X_.delay)}function H(ne){ne===void 0&&(ne=!1),x.style.pointerEvents=C.props.interactive&&!ne?"":"none",x.style.zIndex=""+C.props.zIndex}function W(ne,Se,Ie){if(Ie===void 0&&(Ie=!0),L.forEach(function(Je){Je[ne]&&Je[ne].apply(Je,Se)}),Ie){var Ke;(Ke=C.props)[ne].apply(Ke,Se)}}function q(){var ne=C.props.aria;if(ne.content){var Se="aria-"+ne.content,Ie=x.id,Ke=v2(C.props.triggerTarget||n);Ke.forEach(function(Je){var ot=Je.getAttribute(Se);if(C.state.isVisible)Je.setAttribute(Se,ot?ot+" "+Ie:Ie);else{var wt=ot&&ot.replace(Ie,"").trim();wt?Je.setAttribute(Se,wt):Je.removeAttribute(Se)}})}}function V(){if(!(D||!C.props.aria.expanded)){var ne=v2(C.props.triggerTarget||n);ne.forEach(function(Se){C.props.interactive?Se.setAttribute("aria-expanded",C.state.isVisible&&Se===M()?"true":"false"):Se.removeAttribute("aria-expanded")})}}function re(){B().removeEventListener("mousemove",g),L8=L8.filter(function(ne){return ne!==g})}function oe(ne){if(!(rb.isTouch&&(l||ne.type==="mousedown"))){var Se=ne.composedPath&&ne.composedPath()[0]||ne.target;if(!(C.props.interactive&&mke(x,Se))){if(v2(C.props.triggerTarget||n).some(function(Ie){return mke(Ie,Se)})){if(rb.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else W("onClickOutside",[C,ne]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ye())}}}function Q(){l=!0}function Ne(){l=!1}function Ve(){var ne=B();ne.addEventListener("mousedown",oe,!0),ne.addEventListener("touchend",oe,KE),ne.addEventListener("touchstart",Ne,KE),ne.addEventListener("touchmove",Q,KE)}function Ye(){var ne=B();ne.removeEventListener("mousedown",oe,!0),ne.removeEventListener("touchend",oe,KE),ne.removeEventListener("touchstart",Ne,KE),ne.removeEventListener("touchmove",Q,KE)}function ye(ne,Se){Pe(ne,function(){!C.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&Se()})}function He(ne,Se){Pe(ne,Se)}function Pe(ne,Se){var Ie=F().box;function Ke(Je){Je.target===Ie&&(eJ(Ie,"remove",Ke),Se())}if(ne===0)return Se();eJ(Ie,"remove",d),eJ(Ie,"add",Ke),d=Ke}function Ge(ne,Se,Ie){Ie===void 0&&(Ie=!1);var Ke=v2(C.props.triggerTarget||n);Ke.forEach(function(Je){Je.addEventListener(ne,Se,Ie),f.push({node:Je,eventType:ne,handler:Se,options:Ie})})}function Fe(){N()&&(Ge("touchstart",Mt,{passive:!0}),Ge("touchend",Yt,{passive:!0})),jAt(C.props.trigger).forEach(function(ne){if(ne!=="manual")switch(Ge(ne,Mt),ne){case"mouseenter":Ge("mouseleave",Yt);break;case"focus":Ge(rRt?"focusout":"blur",ln);break;case"focusin":Ge("focusout",ln);break}})}function bt(){f.forEach(function(ne){var Se=ne.node,Ie=ne.eventType,Ke=ne.handler,Je=ne.options;Se.removeEventListener(Ie,Ke,Je)}),f=[]}function Mt(ne){var Se,Ie=!1;if(!(!C.state.isEnabled||Et(ne)||a)){var Ke=((Se=u)==null?void 0:Se.type)==="focus";u=ne,m=ne.currentTarget,V(),!C.state.isVisible&&YAt(ne)&&L8.forEach(function(Je){return Je(ne)}),ne.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||s)&&C.props.hideOnClick!==!1&&C.state.isVisible?Ie=!0:se(ne),ne.type==="click"&&(s=!Ie),Ie&&!Ke&&Y(ne)}}function Ft(ne){var Se=ne.target,Ie=M().contains(Se)||x.contains(Se);if(!(ne.type==="mousemove"&&Ie)){var Ke=Te().concat(x).map(function(Je){var ot,wt=Je._tippy,pn=(ot=wt.popperInstance)==null?void 0:ot.state;return pn?{popperRect:Je.getBoundingClientRect(),popperState:pn,props:t}:null}).filter(Boolean);JAt(Ke,ne)&&(re(),Y(ne))}}function Yt(ne){var Se=Et(ne)||C.props.trigger.indexOf("click")>=0&&s;if(!Se){if(C.props.interactive){C.hideWithInteractivity(ne);return}Y(ne)}}function ln(ne){C.props.trigger.indexOf("focusin")<0&&ne.target!==M()||C.props.interactive&&ne.relatedTarget&&x.contains(ne.relatedTarget)||Y(ne)}function Et(ne){return rb.isTouch?N()!==ne.type.indexOf("touch")>=0:!1}function mt(){Lt();var ne=C.props,Se=ne.popperOptions,Ie=ne.placement,Ke=ne.offset,Je=ne.getReferenceClientRect,ot=ne.moveTransition,wt=P()?Eoe(x).arrow:null,pn=Je?{getBoundingClientRect:Je,contextElement:Je.contextElement||M()}:n,Kn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(bn){var Wn=bn.state;if(P()){var Ei=F(),er=Ei.box;["placement","reference-hidden","escaped"].forEach(function(ur){ur==="placement"?er.setAttribute("data-placement",Wn.placement):Wn.attributes.popper["data-popper-"+ur]?er.setAttribute("data-"+ur,""):er.removeAttribute("data-"+ur)}),Wn.attributes.popper={}}}},Cn=[{name:"offset",options:{offset:Ke}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},Kn];P()&&wt&&Cn.push({name:"arrow",options:{element:wt,padding:3}}),Cn.push.apply(Cn,(Se==null?void 0:Se.modifiers)||[]),C.popperInstance=R9e(pn,x,Object.assign({},Se,{placement:Ie,onFirstUpdate:h,modifiers:Cn}))}function Lt(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function be(){var ne=C.props.appendTo,Se,Ie=M();C.props.interactive&&ne===y$e||ne==="parent"?Se=Ie.parentNode:Se=C$e(ne,[Ie]),Se.contains(x)||Se.appendChild(x),C.state.isMounted=!0,mt()}function Te(){return HH(x.querySelectorAll("[data-tippy-root]"))}function se(ne){C.clearDelayTimeouts(),ne&&W("onTrigger",[C,ne]),Ve();var Se=U(!0),Ie=A(),Ke=Ie[0],Je=Ie[1];rb.isTouch&&Ke==="hold"&&Je&&(Se=Je),Se?i=setTimeout(function(){C.show()},Se):C.show()}function Y(ne){if(C.clearDelayTimeouts(),W("onUntrigger",[C,ne]),!C.state.isVisible){Ye();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ne.type)>=0&&s)){var Se=U(!1);Se?r=setTimeout(function(){C.state.isVisible&&C.hide()},Se):o=requestAnimationFrame(function(){C.hide()})}}function X(){C.state.isEnabled=!0}function le(){C.hide(),C.state.isEnabled=!1}function te(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function me(ne){if(!C.state.isDestroyed){W("onBeforeUpdate",[C,ne]),bt();var Se=C.props,Ie=vke(n,Object.assign({},Se,pke(ne),{ignoreAttributes:!0}));C.props=Ie,Fe(),Se.interactiveDebounce!==Ie.interactiveDebounce&&(re(),g=hke(Ft,Ie.interactiveDebounce)),Se.triggerTarget&&!Ie.triggerTarget?v2(Se.triggerTarget).forEach(function(Ke){Ke.removeAttribute("aria-expanded")}):Ie.triggerTarget&&n.removeAttribute("aria-expanded"),V(),H(),k&&k(Se,Ie),C.popperInstance&&(mt(),Te().forEach(function(Ke){requestAnimationFrame(Ke._tippy.popperInstance.forceUpdate)})),W("onAfterUpdate",[C,ne])}}function Me(ne){C.setProps({content:ne})}function rt(){var ne=C.state.isVisible,Se=C.state.isDestroyed,Ie=!C.state.isEnabled,Ke=rb.isTouch&&!C.props.touch,Je=ZZ(C.props.duration,0,X_.duration);if(!(ne||Se||Ie||Ke)&&!M().hasAttribute("disabled")&&(W("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,P()&&(x.style.visibility="visible"),H(),Ve(),C.state.isMounted||(x.style.transition="none"),P()){var ot=F(),wt=ot.box,pn=ot.content;JZ([wt,pn],0)}h=function(){var Cn;if(!(!C.state.isVisible||c)){if(c=!0,x.offsetHeight,x.style.transition=C.props.moveTransition,P()&&C.props.animation){var hn=F(),bn=hn.box,Wn=hn.content;JZ([bn,Wn],Je),gke([bn,Wn],"visible")}q(),V(),fke(tJ,C),(Cn=C.popperInstance)==null||Cn.forceUpdate(),W("onMount",[C]),C.props.animation&&P()&&He(Je,function(){C.state.isShown=!0,W("onShown",[C])})}},be()}}function It(){var ne=!C.state.isVisible,Se=C.state.isDestroyed,Ie=!C.state.isEnabled,Ke=ZZ(C.props.duration,1,X_.duration);if(!(ne||Se||Ie)&&(W("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,s=!1,P()&&(x.style.visibility="hidden"),re(),Ye(),H(!0),P()){var Je=F(),ot=Je.box,wt=Je.content;C.props.animation&&(JZ([ot,wt],Ke),gke([ot,wt],"hidden"))}q(),V(),C.props.animation?P()&&ye(Ke,C.unmount):C.unmount()}}function Qt(ne){B().addEventListener("mousemove",g),fke(L8,g),g(ne)}function pe(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Lt(),Te().forEach(function(ne){ne._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),tJ=tJ.filter(function(ne){return ne!==C}),C.state.isMounted=!1,W("onHidden",[C]))}function We(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),bt(),delete n._tippy,C.state.isDestroyed=!0,W("onDestroy",[C]))}}function DF(n,e){e===void 0&&(e={});var t=X_.plugins.concat(e.plugins||[]);nRt();var i=Object.assign({},e,{plugins:t}),r=XAt(n),o=r.reduce(function(s,a){var l=a&&hRt(a,i);return l&&s.push(l),s},[]);return xq(n)?o[0]:o}DF.defaultProps=X_;DF.setDefaultProps=lRt;DF.currentInput=rb;Object.assign({},eme,{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)}});DF.setDefaultProps({render:E$e});function x$e(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 T$e=typeof window<"u"&&typeof document<"u";function xoe(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function Cke(){return T$e&&document.createElement("div")}function fRt(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function k$e(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(!k$e(n[t],e[t]))return!1}else return!1;return!0}else return!1}function pRt(n){var e=[];return n.forEach(function(t){e.find(function(i){return k$e(t,i)})||e.push(t)}),e}function gRt(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:pRt([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var nJ=T$e?w.useLayoutEffect:w.useEffect;function mRt(n){var e=w.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function wke(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var _Rt={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()||wke(t,"add",e.props.className)}function o(){i()&&wke(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:o,onAfterUpdate:r}}};function vRt(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 f=x$e(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=s!==void 0,v=w.useState(!1),_=v[0],b=v[1],y=w.useState({}),C=y[0],E=y[1],x=w.useState(),k=x[0],L=x[1],D=mRt(function(){return{container:Cke(),renders:1}}),A=Object.assign({ignoreAttributes:h},f,{content:D.container});g&&(A.trigger="manual",A.hideOnClick=!1),m&&(u=!0);var N=A,P=A.plugins||[];a&&(N=Object.assign({},A,{plugins:m&&s.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(U,H){var W=s.data.children.find(function(q){var V=q.instance;return V.reference===H.currentTarget});U.state.$$activeSingletonInstance=W.instance,L(W.content)}}}}]):P,render:function(){return{popper:D.container}}}));var M=[l].concat(i?[i.type]:[]);return nJ(function(){var B=l;l&&l.hasOwnProperty("current")&&(B=l.current);var F=n(B||D.ref||Cke(),Object.assign({},N,{plugins:[_Rt].concat(A.plugins||[])}));return D.instance=F,u&&F.disable(),o&&F.show(),m&&s.hook({instance:F,content:r,props:N,setSingletonContent:L}),b(!0),function(){F.destroy(),s==null||s.cleanup(F)}},M),nJ(function(){var B;if(D.renders===1){D.renders++;return}var F=D.instance;F.setProps(gRt(F.props,N)),(B=F.popperInstance)==null||B.forceUpdate(),u?F.disable():F.enable(),g&&(o?F.show():F.hide()),m&&s.hook({instance:F,content:r,props:N,setSingletonContent:L})}),nJ(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(U){var H=U.name;return H!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(H){var W,q=H.state,V=(W=q.modifiersData)==null?void 0:W.hide;(C.placement!==q.placement||C.referenceHidden!==(V==null?void 0:V.isReferenceHidden)||C.escaped!==(V==null?void 0:V.hasPopperEscaped))&&E({placement:q.placement,referenceHidden:V==null?void 0:V.isReferenceHidden,escaped:V==null?void 0:V.hasPopperEscaped}),q.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(M)),ce.createElement(ce.Fragment,null,i?w.cloneElement(i,{ref:function(F){D.ref=F,xoe(i.ref,F)}}):null,_&&op.createPortal(a?a(fRt(C),k,D.instance):r,D.container))}return e}var bRt=function(n,e){return w.forwardRef(function(i,r){var o=i.children,s=x$e(i,["children"]);return ce.createElement(n,Object.assign({},e,s),o?w.cloneElement(o,{ref:function(l){xoe(r,l),xoe(o.ref,l)}}):null)})},yRt=bRt(vRt(DF));const BI=yRt;/**
* 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 Mk(){var e;const n=Nc(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.account}var CRt=function(e){return wRt(e)&&!SRt(e)};function wRt(n){return!!n&&typeof n=="object"}function SRt(n){var e=Object.prototype.toString.call(n);return e==="[object RegExp]"||e==="[object Date]"||TRt(n)}var ERt=typeof Symbol=="function"&&Symbol.for,xRt=ERt?Symbol.for("react.element"):60103;function TRt(n){return n.$$typeof===xRt}function kRt(n){return Array.isArray(n)?[]:{}}function WH(n,e){return e.clone!==!1&&e.isMergeableObject(n)?W4(kRt(n),n,e):n}function IRt(n,e,t){return n.concat(e).map(function(i){return WH(i,t)})}function LRt(n,e,t){var i={};return t.isMergeableObject(n)&&Object.keys(n).forEach(function(r){i[r]=WH(n[r],t)}),Object.keys(e).forEach(function(r){!t.isMergeableObject(e[r])||!n[r]?i[r]=WH(e[r],t):i[r]=W4(n[r],e[r],t)}),i}function W4(n,e,t){t=t||{},t.arrayMerge=t.arrayMerge||IRt,t.isMergeableObject=t.isMergeableObject||CRt;var i=Array.isArray(e),r=Array.isArray(n),o=i===r;return o?i?t.arrayMerge(n,e,t):LRt(n,e,t):WH(e,t)}W4.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,r){return W4(i,r,t)},{})};var Toe=W4,DRt=typeof global=="object"&&global&&global.Object===Object&&global;const I$e=DRt;var ARt=typeof self=="object"&&self&&self.Object===Object&&self,RRt=I$e||ARt||Function("return this")();const w0=RRt;var NRt=w0.Symbol;const aS=NRt;var L$e=Object.prototype,ORt=L$e.hasOwnProperty,PRt=L$e.toString,oO=aS?aS.toStringTag:void 0;function MRt(n){var e=ORt.call(n,oO),t=n[oO];try{n[oO]=void 0;var i=!0}catch{}var r=PRt.call(n);return i&&(e?n[oO]=t:delete n[oO]),r}var FRt=Object.prototype,BRt=FRt.toString;function $Rt(n){return BRt.call(n)}var VRt="[object Null]",HRt="[object Undefined]",Ske=aS?aS.toStringTag:void 0;function Fk(n){return n==null?n===void 0?HRt:VRt:Ske&&Ske in Object(n)?MRt(n):$Rt(n)}function D$e(n,e){return function(t){return n(e(t))}}var WRt=D$e(Object.getPrototypeOf,Object);const Hme=WRt;function Bk(n){return n!=null&&typeof n=="object"}var zRt="[object Object]",URt=Function.prototype,jRt=Object.prototype,A$e=URt.toString,qRt=jRt.hasOwnProperty,GRt=A$e.call(Object);function Eke(n){if(!Bk(n)||Fk(n)!=zRt)return!1;var e=Hme(n);if(e===null)return!0;var t=qRt.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&A$e.call(t)==GRt}var xke=Array.isArray,Tke=Object.keys,KRt=Object.prototype.hasOwnProperty,YRt=typeof Element<"u";function koe(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){var t=xke(n),i=xke(e),r,o,s;if(t&&i){if(o=n.length,o!=e.length)return!1;for(r=o;r--!==0;)if(!koe(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=Tke(n);if(o=d.length,o!==Tke(e).length)return!1;for(r=o;r--!==0;)if(!KRt.call(e,d[r]))return!1;if(YRt&&n instanceof Element&&e instanceof Element)return n===e;for(r=o;r--!==0;)if(s=d[r],!(s==="_owner"&&n.$$typeof)&&!koe(n[s],e[s]))return!1;return!0}return n!==n&&e!==e}var QRt=function(e,t){try{return koe(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 YE=nl(QRt);var XRt=!0;function ZRt(n,e){if(!XRt){if(n)return;var t="Warning: "+e;typeof console<"u"&&console.warn(t);try{throw Error(t)}catch{}}}function JRt(){this.__data__=[],this.size=0}function R$e(n,e){return n===e||n!==n&&e!==e}function Tq(n,e){for(var t=n.length;t--;)if(R$e(n[t][0],e))return t;return-1}var eNt=Array.prototype,tNt=eNt.splice;function nNt(n){var e=this.__data__,t=Tq(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():tNt.call(e,t,1),--this.size,!0}function iNt(n){var e=this.__data__,t=Tq(e,n);return t<0?void 0:e[t][1]}function rNt(n){return Tq(this.__data__,n)>-1}function oNt(n,e){var t=this.__data__,i=Tq(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function D1(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])}}D1.prototype.clear=JRt;D1.prototype.delete=nNt;D1.prototype.get=iNt;D1.prototype.has=rNt;D1.prototype.set=oNt;function sNt(){this.__data__=new D1,this.size=0}function aNt(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function lNt(n){return this.__data__.get(n)}function cNt(n){return this.__data__.has(n)}function AF(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var uNt="[object AsyncFunction]",dNt="[object Function]",hNt="[object GeneratorFunction]",fNt="[object Proxy]";function N$e(n){if(!AF(n))return!1;var e=Fk(n);return e==dNt||e==hNt||e==uNt||e==fNt}var pNt=w0["__core-js_shared__"];const iJ=pNt;var kke=function(){var n=/[^.]+$/.exec(iJ&&iJ.keys&&iJ.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function gNt(n){return!!kke&&kke in n}var mNt=Function.prototype,_Nt=mNt.toString;function $k(n){if(n!=null){try{return _Nt.call(n)}catch{}try{return n+""}catch{}}return""}var vNt=/[\\^$.*+?()[\]{}|]/g,bNt=/^\[object .+?Constructor\]$/,yNt=Function.prototype,CNt=Object.prototype,wNt=yNt.toString,SNt=CNt.hasOwnProperty,ENt=RegExp("^"+wNt.call(SNt).replace(vNt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xNt(n){if(!AF(n)||gNt(n))return!1;var e=N$e(n)?ENt:bNt;return e.test($k(n))}function TNt(n,e){return n==null?void 0:n[e]}function Vk(n,e){var t=TNt(n,e);return xNt(t)?t:void 0}var kNt=Vk(w0,"Map");const z4=kNt;var INt=Vk(Object,"create");const U4=INt;function LNt(){this.__data__=U4?U4(null):{},this.size=0}function DNt(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var ANt="__lodash_hash_undefined__",RNt=Object.prototype,NNt=RNt.hasOwnProperty;function ONt(n){var e=this.__data__;if(U4){var t=e[n];return t===ANt?void 0:t}return NNt.call(e,n)?e[n]:void 0}var PNt=Object.prototype,MNt=PNt.hasOwnProperty;function FNt(n){var e=this.__data__;return U4?e[n]!==void 0:MNt.call(e,n)}var BNt="__lodash_hash_undefined__";function $Nt(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=U4&&e===void 0?BNt:e,this}function OT(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])}}OT.prototype.clear=LNt;OT.prototype.delete=DNt;OT.prototype.get=ONt;OT.prototype.has=FNt;OT.prototype.set=$Nt;function VNt(){this.size=0,this.__data__={hash:new OT,map:new(z4||D1),string:new OT}}function HNt(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function kq(n,e){var t=n.__data__;return HNt(e)?t[typeof e=="string"?"string":"hash"]:t.map}function WNt(n){var e=kq(this,n).delete(n);return this.size-=e?1:0,e}function zNt(n){return kq(this,n).get(n)}function UNt(n){return kq(this,n).has(n)}function jNt(n,e){var t=kq(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function qS(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])}}qS.prototype.clear=VNt;qS.prototype.delete=WNt;qS.prototype.get=zNt;qS.prototype.has=UNt;qS.prototype.set=jNt;var qNt=200;function GNt(n,e){var t=this.__data__;if(t instanceof D1){var i=t.__data__;if(!z4||i.length<qNt-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new qS(i)}return t.set(n,e),this.size=t.size,this}function LR(n){var e=this.__data__=new D1(n);this.size=e.size}LR.prototype.clear=sNt;LR.prototype.delete=aNt;LR.prototype.get=lNt;LR.prototype.has=cNt;LR.prototype.set=GNt;function KNt(n,e){for(var t=-1,i=n==null?0:n.length;++t<i&&e(n[t],t,n)!==!1;);return n}var YNt=function(){try{var n=Vk(Object,"defineProperty");return n({},"",{}),n}catch{}}();const Ike=YNt;function O$e(n,e,t){e=="__proto__"&&Ike?Ike(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var QNt=Object.prototype,XNt=QNt.hasOwnProperty;function P$e(n,e,t){var i=n[e];(!(XNt.call(n,e)&&R$e(i,t))||t===void 0&&!(e in n))&&O$e(n,e,t)}function Iq(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?O$e(t,a,l):P$e(t,a,l)}return t}function ZNt(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var JNt="[object Arguments]";function Lke(n){return Bk(n)&&Fk(n)==JNt}var M$e=Object.prototype,eOt=M$e.hasOwnProperty,tOt=M$e.propertyIsEnumerable,nOt=Lke(function(){return arguments}())?Lke:function(n){return Bk(n)&&eOt.call(n,"callee")&&!tOt.call(n,"callee")};const iOt=nOt;var rOt=Array.isArray;const RF=rOt;function oOt(){return!1}var F$e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dke=F$e&&typeof module=="object"&&module&&!module.nodeType&&module,sOt=Dke&&Dke.exports===F$e,Ake=sOt?w0.Buffer:void 0,aOt=Ake?Ake.isBuffer:void 0,lOt=aOt||oOt;const B$e=lOt;var cOt=9007199254740991,uOt=/^(?:0|[1-9]\d*)$/;function dOt(n,e){var t=typeof n;return e=e??cOt,!!e&&(t=="number"||t!="symbol"&&uOt.test(n))&&n>-1&&n%1==0&&n<e}var hOt=9007199254740991;function $$e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=hOt}var fOt="[object Arguments]",pOt="[object Array]",gOt="[object Boolean]",mOt="[object Date]",_Ot="[object Error]",vOt="[object Function]",bOt="[object Map]",yOt="[object Number]",COt="[object Object]",wOt="[object RegExp]",SOt="[object Set]",EOt="[object String]",xOt="[object WeakMap]",TOt="[object ArrayBuffer]",kOt="[object DataView]",IOt="[object Float32Array]",LOt="[object Float64Array]",DOt="[object Int8Array]",AOt="[object Int16Array]",ROt="[object Int32Array]",NOt="[object Uint8Array]",OOt="[object Uint8ClampedArray]",POt="[object Uint16Array]",MOt="[object Uint32Array]",cl={};cl[IOt]=cl[LOt]=cl[DOt]=cl[AOt]=cl[ROt]=cl[NOt]=cl[OOt]=cl[POt]=cl[MOt]=!0;cl[fOt]=cl[pOt]=cl[TOt]=cl[gOt]=cl[kOt]=cl[mOt]=cl[_Ot]=cl[vOt]=cl[bOt]=cl[yOt]=cl[COt]=cl[wOt]=cl[SOt]=cl[EOt]=cl[xOt]=!1;function FOt(n){return Bk(n)&&$$e(n.length)&&!!cl[Fk(n)]}function Wme(n){return function(e){return n(e)}}var V$e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nM=V$e&&typeof module=="object"&&module&&!module.nodeType&&module,BOt=nM&&nM.exports===V$e,rJ=BOt&&I$e.process,$Ot=function(){try{var n=nM&&nM.require&&nM.require("util").types;return n||rJ&&rJ.binding&&rJ.binding("util")}catch{}}();const KD=$Ot;var Rke=KD&&KD.isTypedArray,VOt=Rke?Wme(Rke):FOt;const HOt=VOt;var WOt=Object.prototype,zOt=WOt.hasOwnProperty;function H$e(n,e){var t=RF(n),i=!t&&iOt(n),r=!t&&!i&&B$e(n),o=!t&&!i&&!r&&HOt(n),s=t||i||r||o,a=s?ZNt(n.length,String):[],l=a.length;for(var c in n)(e||zOt.call(n,c))&&!(s&&(c=="length"||r&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||dOt(c,l)))&&a.push(c);return a}var UOt=Object.prototype;function zme(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||UOt;return n===t}var jOt=D$e(Object.keys,Object);const qOt=jOt;var GOt=Object.prototype,KOt=GOt.hasOwnProperty;function YOt(n){if(!zme(n))return qOt(n);var e=[];for(var t in Object(n))KOt.call(n,t)&&t!="constructor"&&e.push(t);return e}function W$e(n){return n!=null&&$$e(n.length)&&!N$e(n)}function Ume(n){return W$e(n)?H$e(n):YOt(n)}function QOt(n,e){return n&&Iq(e,Ume(e),n)}function XOt(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var ZOt=Object.prototype,JOt=ZOt.hasOwnProperty;function ePt(n){if(!AF(n))return XOt(n);var e=zme(n),t=[];for(var i in n)i=="constructor"&&(e||!JOt.call(n,i))||t.push(i);return t}function jme(n){return W$e(n)?H$e(n,!0):ePt(n)}function tPt(n,e){return n&&Iq(e,jme(e),n)}var z$e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Nke=z$e&&typeof module=="object"&&module&&!module.nodeType&&module,nPt=Nke&&Nke.exports===z$e,Oke=nPt?w0.Buffer:void 0,Pke=Oke?Oke.allocUnsafe:void 0;function iPt(n,e){if(e)return n.slice();var t=n.length,i=Pke?Pke(t):new n.constructor(t);return n.copy(i),i}function U$e(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}function rPt(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 j$e(){return[]}var oPt=Object.prototype,sPt=oPt.propertyIsEnumerable,Mke=Object.getOwnPropertySymbols,aPt=Mke?function(n){return n==null?[]:(n=Object(n),rPt(Mke(n),function(e){return sPt.call(n,e)}))}:j$e;const qme=aPt;function lPt(n,e){return Iq(n,qme(n),e)}function q$e(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var cPt=Object.getOwnPropertySymbols,uPt=cPt?function(n){for(var e=[];n;)q$e(e,qme(n)),n=Hme(n);return e}:j$e;const G$e=uPt;function dPt(n,e){return Iq(n,G$e(n),e)}function K$e(n,e,t){var i=e(n);return RF(n)?i:q$e(i,t(n))}function hPt(n){return K$e(n,Ume,qme)}function fPt(n){return K$e(n,jme,G$e)}var pPt=Vk(w0,"DataView");const Ioe=pPt;var gPt=Vk(w0,"Promise");const Loe=gPt;var mPt=Vk(w0,"Set");const Doe=mPt;var _Pt=Vk(w0,"WeakMap");const Aoe=_Pt;var Fke="[object Map]",vPt="[object Object]",Bke="[object Promise]",$ke="[object Set]",Vke="[object WeakMap]",Hke="[object DataView]",bPt=$k(Ioe),yPt=$k(z4),CPt=$k(Loe),wPt=$k(Doe),SPt=$k(Aoe),QE=Fk;(Ioe&&QE(new Ioe(new ArrayBuffer(1)))!=Hke||z4&&QE(new z4)!=Fke||Loe&&QE(Loe.resolve())!=Bke||Doe&&QE(new Doe)!=$ke||Aoe&&QE(new Aoe)!=Vke)&&(QE=function(n){var e=Fk(n),t=e==vPt?n.constructor:void 0,i=t?$k(t):"";if(i)switch(i){case bPt:return Hke;case yPt:return Fke;case CPt:return Bke;case wPt:return $ke;case SPt:return Vke}return e});const Gme=QE;var EPt=Object.prototype,xPt=EPt.hasOwnProperty;function TPt(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&xPt.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var kPt=w0.Uint8Array;const Wke=kPt;function Kme(n){var e=new n.constructor(n.byteLength);return new Wke(e).set(new Wke(n)),e}function IPt(n,e){var t=e?Kme(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var LPt=/\w*$/;function DPt(n){var e=new n.constructor(n.source,LPt.exec(n));return e.lastIndex=n.lastIndex,e}var zke=aS?aS.prototype:void 0,Uke=zke?zke.valueOf:void 0;function APt(n){return Uke?Object(Uke.call(n)):{}}function RPt(n,e){var t=e?Kme(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var NPt="[object Boolean]",OPt="[object Date]",PPt="[object Map]",MPt="[object Number]",FPt="[object RegExp]",BPt="[object Set]",$Pt="[object String]",VPt="[object Symbol]",HPt="[object ArrayBuffer]",WPt="[object DataView]",zPt="[object Float32Array]",UPt="[object Float64Array]",jPt="[object Int8Array]",qPt="[object Int16Array]",GPt="[object Int32Array]",KPt="[object Uint8Array]",YPt="[object Uint8ClampedArray]",QPt="[object Uint16Array]",XPt="[object Uint32Array]";function ZPt(n,e,t){var i=n.constructor;switch(e){case HPt:return Kme(n);case NPt:case OPt:return new i(+n);case WPt:return IPt(n,t);case zPt:case UPt:case jPt:case qPt:case GPt:case KPt:case YPt:case QPt:case XPt:return RPt(n,t);case PPt:return new i;case MPt:case $Pt:return new i(n);case FPt:return DPt(n);case BPt:return new i;case VPt:return APt(n)}}var jke=Object.create,JPt=function(){function n(){}return function(e){if(!AF(e))return{};if(jke)return jke(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();const eMt=JPt;function tMt(n){return typeof n.constructor=="function"&&!zme(n)?eMt(Hme(n)):{}}var nMt="[object Map]";function iMt(n){return Bk(n)&&Gme(n)==nMt}var qke=KD&&KD.isMap,rMt=qke?Wme(qke):iMt;const oMt=rMt;var sMt="[object Set]";function aMt(n){return Bk(n)&&Gme(n)==sMt}var Gke=KD&&KD.isSet,lMt=Gke?Wme(Gke):aMt;const cMt=lMt;var uMt=1,dMt=2,hMt=4,Y$e="[object Arguments]",fMt="[object Array]",pMt="[object Boolean]",gMt="[object Date]",mMt="[object Error]",Q$e="[object Function]",_Mt="[object GeneratorFunction]",vMt="[object Map]",bMt="[object Number]",X$e="[object Object]",yMt="[object RegExp]",CMt="[object Set]",wMt="[object String]",SMt="[object Symbol]",EMt="[object WeakMap]",xMt="[object ArrayBuffer]",TMt="[object DataView]",kMt="[object Float32Array]",IMt="[object Float64Array]",LMt="[object Int8Array]",DMt="[object Int16Array]",AMt="[object Int32Array]",RMt="[object Uint8Array]",NMt="[object Uint8ClampedArray]",OMt="[object Uint16Array]",PMt="[object Uint32Array]",ja={};ja[Y$e]=ja[fMt]=ja[xMt]=ja[TMt]=ja[pMt]=ja[gMt]=ja[kMt]=ja[IMt]=ja[LMt]=ja[DMt]=ja[AMt]=ja[vMt]=ja[bMt]=ja[X$e]=ja[yMt]=ja[CMt]=ja[wMt]=ja[SMt]=ja[RMt]=ja[NMt]=ja[OMt]=ja[PMt]=!0;ja[mMt]=ja[Q$e]=ja[EMt]=!1;function S$(n,e,t,i,r,o){var s,a=e&uMt,l=e&dMt,c=e&hMt;if(t&&(s=r?t(n,i,r,o):t(n)),s!==void 0)return s;if(!AF(n))return n;var u=RF(n);if(u){if(s=TPt(n),!a)return U$e(n,s)}else{var d=Gme(n),h=d==Q$e||d==_Mt;if(B$e(n))return iPt(n,a);if(d==X$e||d==Y$e||h&&!r){if(s=l||h?{}:tMt(n),!a)return l?dPt(n,tPt(s,n)):lPt(n,QOt(s,n))}else{if(!ja[d])return r?n:{};s=ZPt(n,d,a)}}o||(o=new LR);var f=o.get(n);if(f)return f;o.set(n,s),cMt(n)?n.forEach(function(v){s.add(S$(v,e,t,v,n,o))}):oMt(n)&&n.forEach(function(v,_){s.set(_,S$(v,e,t,_,n,o))});var g=c?l?fPt:hPt:l?jme:Ume,m=u?void 0:g(n);return KNt(m||n,function(v,_){m&&(_=v,v=n[_]),P$e(s,_,S$(v,e,t,_,n,o))}),s}var MMt=4;function Kke(n){return S$(n,MMt)}function Z$e(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 FMt="[object Symbol]";function Yme(n){return typeof n=="symbol"||Bk(n)&&Fk(n)==FMt}var BMt="Expected a function";function Qme(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(BMt);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(Qme.Cache||qS),t}Qme.Cache=qS;var $Mt=500;function VMt(n){var e=Qme(n,function(i){return t.size===$Mt&&t.clear(),i}),t=e.cache;return e}var HMt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,WMt=/\\(\\)?/g,zMt=VMt(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(HMt,function(t,i,r,o){e.push(r?o.replace(WMt,"$1"):i||t)}),e});const UMt=zMt;var jMt=1/0;function qMt(n){if(typeof n=="string"||Yme(n))return n;var e=n+"";return e=="0"&&1/n==-jMt?"-0":e}var GMt=1/0,Yke=aS?aS.prototype:void 0,Qke=Yke?Yke.toString:void 0;function J$e(n){if(typeof n=="string")return n;if(RF(n))return Z$e(n,J$e)+"";if(Yme(n))return Qke?Qke.call(n):"";var e=n+"";return e=="0"&&1/n==-GMt?"-0":e}function KMt(n){return n==null?"":J$e(n)}function eVe(n){return RF(n)?Z$e(n,qMt):Yme(n)?[n]:U$e(UMt(KMt(n)))}function Ou(){return Ou=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},Ou.apply(this,arguments)}function tVe(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 Lq=w.createContext(void 0);Lq.displayName="FormikContext";Lq.Provider;Lq.Consumer;function YMt(){var n=w.useContext(Lq);return n||ZRt(!1),n}var m_=function(e){return typeof e=="function"},Dq=function(e){return e!==null&&typeof e=="object"},QMt=function(e){return String(Math.floor(Number(e)))===e},oJ=function(e){return Object.prototype.toString.call(e)==="[object String]"},sJ=function(e){return Dq(e)&&m_(e.then)};function Lp(n,e,t,i){i===void 0&&(i=0);for(var r=eVe(e);n&&i<r.length;)n=n[r[i++]];return i!==r.length&&!n||n===void 0?t:n}function oT(n,e,t){for(var i=Kke(n),r=i,o=0,s=eVe(e);o<s.length-1;o++){var a=s[o],l=Lp(n,s.slice(0,o+1));if(l&&(Dq(l)||Array.isArray(l)))r=r[a]=Kke(l);else{var c=s[o+1];r=r[a]=QMt(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 nVe(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];Dq(a)?t.get(a)||(t.set(a,!0),i[s]=Array.isArray(a)?[]:{},nVe(a,e,t,i[s])):i[s]=e}return i}function XMt(n,e){switch(e.type){case"SET_VALUES":return Ou({},n,{values:e.payload});case"SET_TOUCHED":return Ou({},n,{touched:e.payload});case"SET_ERRORS":return YE(n.errors,e.payload)?n:Ou({},n,{errors:e.payload});case"SET_STATUS":return Ou({},n,{status:e.payload});case"SET_ISSUBMITTING":return Ou({},n,{isSubmitting:e.payload});case"SET_ISVALIDATING":return Ou({},n,{isValidating:e.payload});case"SET_FIELD_VALUE":return Ou({},n,{values:oT(n.values,e.payload.field,e.payload.value)});case"SET_FIELD_TOUCHED":return Ou({},n,{touched:oT(n.touched,e.payload.field,e.payload.value)});case"SET_FIELD_ERROR":return Ou({},n,{errors:oT(n.errors,e.payload.field,e.payload.value)});case"RESET_FORM":return Ou({},n,e.payload);case"SET_FORMIK_STATE":return e.payload(n);case"SUBMIT_ATTEMPT":return Ou({},n,{touched:nVe(n.values,!0),isSubmitting:!0,submitCount:n.submitCount+1});case"SUBMIT_FAILURE":return Ou({},n,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Ou({},n,{isSubmitting:!1});default:return n}}var DE={},D8={};function Gm(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=tVe(n,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),h=Ou({validateOnChange:t,validateOnBlur:r,validateOnMount:s,onSubmit:u},d),f=w.useRef(h.initialValues),g=w.useRef(h.initialErrors||DE),m=w.useRef(h.initialTouched||D8),v=w.useRef(h.initialStatus),_=w.useRef(!1),b=w.useRef({});w.useEffect(function(){return _.current=!0,function(){_.current=!1}},[]);var y=w.useState(0),C=y[1],E=w.useRef({values:h.initialValues,errors:h.initialErrors||DE,touched:h.initialTouched||D8,status:h.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),x=E.current,k=w.useCallback(function(se){var Y=E.current;E.current=XMt(Y,se),Y!==E.current&&C(function(X){return X+1})},[]),L=w.useCallback(function(se,Y){return new Promise(function(X,le){var te=h.validate(se,Y);te==null?X(DE):sJ(te)?te.then(function(me){X(me||DE)},function(me){le(me)}):X(te)})},[h.validate]),D=w.useCallback(function(se,Y){var X=h.validationSchema,le=m_(X)?X(Y):X,te=Y&&le.validateAt?le.validateAt(Y,se):JMt(se,le);return new Promise(function(me,Me){te.then(function(){me(DE)},function(rt){rt.name==="ValidationError"?me(ZMt(rt)):Me(rt)})})},[h.validationSchema]),A=w.useCallback(function(se,Y){return new Promise(function(X){return X(b.current[se].validate(Y))})},[]),N=w.useCallback(function(se){var Y=Object.keys(b.current).filter(function(le){return m_(b.current[le].validate)}),X=Y.length>0?Y.map(function(le){return A(le,Lp(se,le))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(X).then(function(le){return le.reduce(function(te,me,Me){return me==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||me&&(te=oT(te,Y[Me],me)),te},{})})},[A]),P=w.useCallback(function(se){return Promise.all([N(se),h.validationSchema?D(se):{},h.validate?L(se):{}]).then(function(Y){var X=Y[0],le=Y[1],te=Y[2],me=Toe.all([X,le,te],{arrayMerge:e4t});return me})},[h.validate,h.validationSchema,N,L,D]),M=qg(function(se){return se===void 0&&(se=x.values),k({type:"SET_ISVALIDATING",payload:!0}),P(se).then(function(Y){return _.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:Y})),Y})});w.useEffect(function(){s&&_.current===!0&&YE(f.current,h.initialValues)&&M(f.current)},[s,M]);var B=w.useCallback(function(se){var Y=se&&se.values?se.values:f.current,X=se&&se.errors?se.errors:g.current?g.current:h.initialErrors||{},le=se&&se.touched?se.touched:m.current?m.current:h.initialTouched||{},te=se&&se.status?se.status:v.current?v.current:h.initialStatus;f.current=Y,g.current=X,m.current=le,v.current=te;var me=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!se&&!!se.isSubmitting,errors:X,touched:le,status:te,values:Y,isValidating:!!se&&!!se.isValidating,submitCount:se&&se.submitCount&&typeof se.submitCount=="number"?se.submitCount:0}})};if(h.onReset){var Me=h.onReset(x.values,Mt);sJ(Me)?Me.then(me):me()}else me()},[h.initialErrors,h.initialStatus,h.initialTouched,h.onReset]);w.useEffect(function(){_.current===!0&&!YE(f.current,h.initialValues)&&c&&(f.current=h.initialValues,B(),s&&M(f.current))},[c,h.initialValues,B,s,M]),w.useEffect(function(){c&&_.current===!0&&!YE(g.current,h.initialErrors)&&(g.current=h.initialErrors||DE,k({type:"SET_ERRORS",payload:h.initialErrors||DE}))},[c,h.initialErrors]),w.useEffect(function(){c&&_.current===!0&&!YE(m.current,h.initialTouched)&&(m.current=h.initialTouched||D8,k({type:"SET_TOUCHED",payload:h.initialTouched||D8}))},[c,h.initialTouched]),w.useEffect(function(){c&&_.current===!0&&!YE(v.current,h.initialStatus)&&(v.current=h.initialStatus,k({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var F=qg(function(se){if(b.current[se]&&m_(b.current[se].validate)){var Y=Lp(x.values,se),X=b.current[se].validate(Y);return sJ(X)?(k({type:"SET_ISVALIDATING",payload:!0}),X.then(function(le){return le}).then(function(le){k({type:"SET_FIELD_ERROR",payload:{field:se,value:le}}),k({type:"SET_ISVALIDATING",payload:!1})})):(k({type:"SET_FIELD_ERROR",payload:{field:se,value:X}}),Promise.resolve(X))}else if(h.validationSchema)return k({type:"SET_ISVALIDATING",payload:!0}),D(x.values,se).then(function(le){return le}).then(function(le){k({type:"SET_FIELD_ERROR",payload:{field:se,value:Lp(le,se)}}),k({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),U=w.useCallback(function(se,Y){var X=Y.validate;b.current[se]={validate:X}},[]),H=w.useCallback(function(se){delete b.current[se]},[]),W=qg(function(se,Y){k({type:"SET_TOUCHED",payload:se});var X=Y===void 0?r:Y;return X?M(x.values):Promise.resolve()}),q=w.useCallback(function(se){k({type:"SET_ERRORS",payload:se})},[]),V=qg(function(se,Y){var X=m_(se)?se(x.values):se;k({type:"SET_VALUES",payload:X});var le=Y===void 0?t:Y;return le?M(X):Promise.resolve()}),re=w.useCallback(function(se,Y){k({type:"SET_FIELD_ERROR",payload:{field:se,value:Y}})},[]),oe=qg(function(se,Y,X){k({type:"SET_FIELD_VALUE",payload:{field:se,value:Y}});var le=X===void 0?t:X;return le?M(oT(x.values,se,Y)):Promise.resolve()}),Q=w.useCallback(function(se,Y){var X=Y,le=se,te;if(!oJ(se)){se.persist&&se.persist();var me=se.target?se.target:se.currentTarget,Me=me.type,rt=me.name,It=me.id,Qt=me.value,pe=me.checked,We=me.outerHTML,ne=me.options,Se=me.multiple;X=Y||rt||It,le=/number|range/.test(Me)?(te=parseFloat(Qt),isNaN(te)?"":te):/checkbox/.test(Me)?n4t(Lp(x.values,X),pe,Qt):ne&&Se?t4t(ne):Qt}X&&oe(X,le)},[oe,x.values]),Ne=qg(function(se){if(oJ(se))return function(Y){return Q(Y,se)};Q(se)}),Ve=qg(function(se,Y,X){Y===void 0&&(Y=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:se,value:Y}});var le=X===void 0?r:X;return le?M(x.values):Promise.resolve()}),Ye=w.useCallback(function(se,Y){se.persist&&se.persist();var X=se.target,le=X.name,te=X.id,me=X.outerHTML,Me=Y||le||te;Ve(Me,!0)},[Ve]),ye=qg(function(se){if(oJ(se))return function(Y){return Ye(Y,se)};Ye(se)}),He=w.useCallback(function(se){m_(se)?k({type:"SET_FORMIK_STATE",payload:se}):k({type:"SET_FORMIK_STATE",payload:function(){return se}})},[]),Pe=w.useCallback(function(se){k({type:"SET_STATUS",payload:se})},[]),Ge=w.useCallback(function(se){k({type:"SET_ISSUBMITTING",payload:se})},[]),Fe=qg(function(){return k({type:"SUBMIT_ATTEMPT"}),M().then(function(se){var Y=se instanceof Error,X=!Y&&Object.keys(se).length===0;if(X){var le;try{if(le=Ft(),le===void 0)return}catch(te){throw te}return Promise.resolve(le).then(function(te){return _.current&&k({type:"SUBMIT_SUCCESS"}),te}).catch(function(te){if(_.current)throw k({type:"SUBMIT_FAILURE"}),te})}else if(_.current&&(k({type:"SUBMIT_FAILURE"}),Y))throw se})}),bt=qg(function(se){se&&se.preventDefault&&m_(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&m_(se.stopPropagation)&&se.stopPropagation(),Fe().catch(function(Y){console.warn("Warning: An unhandled error was caught from submitForm()",Y)})}),Mt={resetForm:B,validateForm:M,validateField:F,setErrors:q,setFieldError:re,setFieldTouched:Ve,setFieldValue:oe,setStatus:Pe,setSubmitting:Ge,setTouched:W,setValues:V,setFormikState:He,submitForm:Fe},Ft=qg(function(){return u(x.values,Mt)}),Yt=qg(function(se){se&&se.preventDefault&&m_(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&m_(se.stopPropagation)&&se.stopPropagation(),B()}),ln=w.useCallback(function(se){return{value:Lp(x.values,se),error:Lp(x.errors,se),touched:!!Lp(x.touched,se),initialValue:Lp(f.current,se),initialTouched:!!Lp(m.current,se),initialError:Lp(g.current,se)}},[x.errors,x.touched,x.values]),Et=w.useCallback(function(se){return{setValue:function(X,le){return oe(se,X,le)},setTouched:function(X,le){return Ve(se,X,le)},setError:function(X){return re(se,X)}}},[oe,Ve,re]),mt=w.useCallback(function(se){var Y=Dq(se),X=Y?se.name:se,le=Lp(x.values,X),te={name:X,value:le,onChange:Ne,onBlur:ye};if(Y){var me=se.type,Me=se.value,rt=se.as,It=se.multiple;me==="checkbox"?Me===void 0?te.checked=!!le:(te.checked=!!(Array.isArray(le)&&~le.indexOf(Me)),te.value=Me):me==="radio"?(te.checked=le===Me,te.value=Me):rt==="select"&&It&&(te.value=te.value||[],te.multiple=!0)}return te},[ye,Ne,x.values]),Lt=w.useMemo(function(){return!YE(f.current,x.values)},[f.current,x.values]),be=w.useMemo(function(){return typeof a<"u"?Lt?x.errors&&Object.keys(x.errors).length===0:a!==!1&&m_(a)?a(h):a:x.errors&&Object.keys(x.errors).length===0},[a,Lt,x.errors,h]),Te=Ou({},x,{initialValues:f.current,initialErrors:g.current,initialTouched:m.current,initialStatus:v.current,handleBlur:ye,handleChange:Ne,handleReset:Yt,handleSubmit:bt,resetForm:B,setErrors:q,setFormikState:He,setFieldTouched:Ve,setFieldValue:oe,setFieldError:re,setStatus:Pe,setSubmitting:Ge,setTouched:W,setValues:V,submitForm:Fe,validateForm:M,validateField:F,isValid:be,dirty:Lt,unregisterField:H,registerField:U,getFieldProps:mt,getFieldMeta:ln,getFieldHelpers:Et,validateOnBlur:r,validateOnChange:t,validateOnMount:s});return Te}function ZMt(n){var e={};if(n.inner){if(n.inner.length===0)return oT(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;Lp(e,s.path)||(e=oT(e,s.path,s.message))}}return e}function JMt(n,e,t,i){t===void 0&&(t=!1);var r=Roe(n);return e[t?"validateSync":"validate"](r,{abortEarly:!1,context:i||r})}function Roe(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||Eke(r)?Roe(r):r!==""?r:void 0}):Eke(n[i])?e[i]=Roe(n[i]):e[i]=n[i]!==""?n[i]:void 0}return e}function e4t(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?Toe(Array.isArray(o)?[]:{},o,t):o}else t.isMergeableObject(o)?i[s]=Toe(n[s],o,t):n.indexOf(o)===-1&&i.push(o)}),i}function t4t(n){return Array.from(n).filter(function(e){return e.selected}).map(function(e){return e.value})}function n4t(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 i4t=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 i4t(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 r4t=w.forwardRef(function(n,e){var t=n.action,i=tVe(n,["action"]),r=t??"#",o=YMt(),s=o.handleReset,a=o.handleSubmit;return w.createElement("form",Ou({onSubmit:a,ref:e,onReset:s,action:r},i))});r4t.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 NF(){const n=zi();return(e,t)=>{n(Ak({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 o4t(){const n=zi();return e=>{$e("PUT",Ae("/api/v1/company_users/:id",{id:e.id}),e).then(t=>{An.set({...e},"company_user",t.data.data),In(["company_users"]),n(qy(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 ap=Ro(0);function Tg(n){const[e]=ve(),t=ki(),i=ml(),r=Ti(),o=Va(),s=w.useRef(null),[a,l]=w.useState(n.show??!1),[c,u]=w.useState(""),[d,h]=us(ap),g=Un().unix()-d>r.default_password_timeout/1e3&&r.default_password_timeout>0;w.useEffect(()=>{l(n.show)},[n.show]);const m=(v,_)=>{v==null||v.preventDefault(),n.onSave(c,!0),_&&h(Un().unix()),u(""),n.onClose(!1)};return w.useEffect(()=>{a&&(!g||!(r!=null&&r.oauth_password_required)&&(o!=null&&o.oauth_provider_id)&&o.oauth_provider_id.length>1)&&m()},[a]),O(Or,{onClose:()=>{i.pathname.startsWith("/settings/users")&&!n.tableActions?t("/settings/users"):n.onClose(!1),u("")},visible:a&&g,title:e("confirmation"),text:e("please_enter_your_password"),initialFocusRef:s,children:[p("form",{onSubmit:v=>m(v,!0),children:p(Ze,{innerRef:s,id:"current_password",type:"password",label:e("current_password"),required:!0,changeOverride:!0,value:c,onChange:v=>u(v.target.value)})}),p(un,{disabled:c.length===0,onClick:v=>m(v,!0),disableWithoutIcon:!0,children:e("continue")})]})}const aJ=rl.div`
background-color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function s4t(n){const[e]=ve(),t=Va(),i=zi(),r=si(),{isAboutVisible:o,setIsAboutVisible:s}=n,a=Wi(ap),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,f]=w.useState(!1),[g,m]=w.useState(!1),[v,_]=w.useState(!1),[b,y]=w.useState(),{data:C}=Ii({queryKey:["/api/v1/self-update/check_version"],queryFn:()=>$e("POST",Ae("/api/v1/self-update/check_version")).then(D=>D.data),staleTime:1/0}),{data:E}=Ii({queryKey:["/api/v1/health_check"],queryFn:()=>$e("GET",Ae("/api/v1/health_check")).then(D=>D.data),staleTime:1/0,enabled:!"".includes("staging")}),x=D=>{(!l||D)&&(he.processing(),c(!0),$e("GET",Ae("/api/v1/health_check")).then(A=>{y(A.data),d(!0),he.dismiss()}).finally(()=>c(!1)))},k=()=>{l||(he.processing(),c(!0),$e("GET",Ae("/api/v1/ping?clear_cache=true")).then(()=>{$e("POST",Ae("/api/v1/refresh?current_company=true")).then(D=>{i(y0(D.data.data)),he.dismiss(),x(!0)}).finally(()=>c(!1))}).catch(()=>c(!1)))},L=D=>{l||(c(!0),_(!0),$e("POST",Ae("/api/v1/self-update"),{},{headers:{"X-Api-Password":D}}).then(()=>window.location.reload()).catch(A=>{var N;((N=A.response)==null?void 0:N.status)===412&&(he.error("password_error_incorrect"),a(0))}).finally(()=>{c(!1),_(!1)}))};return O(St,{children:[O(Or,{title:e("about"),visible:o,onClose:()=>!l&&s(!1),disableClosing:u||h||g||v,children:[O("div",{className:"flex flex-col text-center",children:[O("div",{className:"flex flex-col",children:[O("span",{className:"text-gray-800",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]}),p("span",{children:t==null?void 0:t.email})]}),O("span",{className:"mt-4",children:["v",E==null?void 0:E.api_version]})]}),O(un,{behavior:"button",className:"flex items-center",onClick:x,disableWithoutIcon:!0,disabled:l,children:[p(nt,{element:v1t,color:"white"}),p("span",{children:e("health_check")})]}),C&&(E==null?void 0:E.api_version)&&E.api_version!==C&&!(E!=null&&E.is_docker)&&O(un,{behavior:"button",className:"flex items-center",onClick:()=>f(!0),disableWithoutIcon:!0,disabled:l,children:[p(nt,{element:cCt,color:"white"}),p("span",{children:e("force_update")})]}),O("div",{className:"flex flex-wrap justify-center items-center space-x-4 pt-6",children:[p("a",{href:"https://twitter.com/invoiceninja",target:"_blank",rel:"noreferrer",children:p(hwt,{})}),p("a",{href:"https://www.facebook.com/invoiceninja",target:"_blank",rel:"noreferrer",children:p(pCt,{})}),p("a",{href:"https://github.com/invoiceninja",target:"_blank",rel:"noreferrer",children:p(CCt,{})}),p("a",{href:"https://www.youtube.com/channel/UCXAHcBvhW05PDtWYIq7WDFA/videos",target:"_blank",rel:"noreferrer",children:p(ywt,{})}),p("a",{href:"http://slack.invoiceninja.com/",target:"_blank",rel:"noreferrer",children:p(iwt,{})})]})]}),O(Or,{title:e("health_check"),visible:u,onClose:()=>d(!1),children:[O("div",{className:"flex flex-col space-y-3",children:[O("div",{className:"flex justify-between items-center py-1 px-3",children:[O("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("system")}),O("span",{children:[e("email"),": ",b==null?void 0:b.mail_mailer]}),O("span",{children:[e("queue"),": ",b==null?void 0:b.queue]}),O("span",{children:[e("pdf"),": ",b==null?void 0:b.pdf_engine]})]}),p("div",{children:p(nt,{element:b!=null&&b.system_health?IZ:Ly,color:b!=null&&b.system_health?"green":"red",size:25})})]}),O("div",{className:"flex justify-between items-center py-1 px-3",children:[O("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("database_connection")}),p("span",{children:b!=null&&b.simple_db_check?e("passed"):e("failed")})]}),p("div",{children:p(nt,{element:b!=null&&b.simple_db_check?IZ:Ly,color:b!=null&&b.simple_db_check?"green":"red",size:25})})]}),O("div",{className:"flex justify-between items-center py-1 px-3",children:[O("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:"PHP"}),O("span",{children:[e("web"),": ",b==null?void 0:b.php_version.current_php_version]}),O("span",{children:[e("cli"),": ",b==null?void 0:b.php_version.current_php_cli_version]}),O("span",{children:["Memory: ",b==null?void 0:b.php_version.memory_limit]}),O("span",{children:["API: ",b==null?void 0:b.api_version]})]}),p("div",{children:p(nt,{element:b!=null&&b.php_version.is_okay?IZ:Ly,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)&&O(aJ,{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:[O("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("permissions")}),p("span",{children:b!=null&&b.env_writable?b==null?void 0:b.file_permissions:e("env_not_writable")})]}),p("div",{children:p(nt,{element:Ly,color:"red",size:25})})]}),(b==null?void 0:b.pdf_engine)!=="SnapPDF PDF Generator"&&O(aJ,{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:[O("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("snappdf_not_enabled")}),p("span",{children:e("use_snappdf")})]}),p("div",{children:p(nt,{element:kTe,size:25})})]}),!!(b!=null&&b.exchange_rate_api_not_configured)&&O(aJ,{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:[O("div",{className:"flex flex-col",children:[p("span",{className:"font-medium text-base mb-1",children:e("exchange_rate_not_enabled")}),p("span",{children:e("add_open_exchange")})]}),p("div",{children:p(nt,{element:kTe,size:25})})]})]}),O("div",{className:"flex justify-between",children:[p(un,{behavior:"button",type:"secondary",onClick:k,disableWithoutIcon:!0,disabled:l,children:e("clear_cache")}),p(un,{behavior:"button",onClick:x,disableWithoutIcon:!0,disabled:l,children:e("refresh")})]})]}),p(Or,{title:e("update_available"),visible:h,onClose:()=>f(!1),disableClosing:l||g||v,children:O("div",{className:"flex flex-col space-y-5",children:[p("span",{className:"font-medium text-base",children:e("a_new_version_is_available")}),O("div",{className:"flex flex-col",children:[O("span",{children:["· ",e("installed_version"),":"," ",E==null?void 0:E.api_version]}),O("span",{children:["· ",e("latest_version"),": ",C]})]}),O("div",{className:"flex justify-between",children:[p(un,{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")}),p(un,{behavior:"button",onClick:()=>{s(!1),f(!1),m(!0)},disableWithoutIcon:!0,disabled:l,children:e("update_now")})]})]})}),p(Or,{title:e("self-update"),visible:v,onClose:()=>{},disableClosing:!0,children:p("span",{className:"text-center py-3 font-medium",children:e("in_progress")})}),p(Tg,{show:g,onClose:m,onSave:L})]})}function GTr(n){return Hn({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 a4t(n){return Hn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M94.12 315.1c0 25.9-21.16 47.06-47.06 47.06S0 341 0 315.1c0-25.9 21.16-47.06 47.06-47.06h47.06v47.06zm23.72 0c0-25.9 21.16-47.06 47.06-47.06s47.06 21.16 47.06 47.06v117.84c0 25.9-21.16 47.06-47.06 47.06s-47.06-21.16-47.06-47.06V315.1zm47.06-188.98c-25.9 0-47.06-21.16-47.06-47.06S139 32 164.9 32s47.06 21.16 47.06 47.06v47.06H164.9zm0 23.72c25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06H47.06C21.16 243.96 0 222.8 0 196.9s21.16-47.06 47.06-47.06H164.9zm188.98 47.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06h-47.06V196.9zm-23.72 0c0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06V79.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06V196.9zM283.1 385.88c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06v-47.06h47.06zm0-23.72c-25.9 0-47.06-21.16-47.06-47.06 0-25.9 21.16-47.06 47.06-47.06h117.84c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06H283.1z"}}]})(n)}function l4t(n){return Hn({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)}function iVe(n){var E,x;const[e]=ve(),t=si(),i=I1(),r=Mk(),o=Va(),{mobileNavbar:s}=n,a=zi(),l=o4t(),c=NF(),[u,d]=w.useState(!1),[h,f]=w.useState(!1),[g,m]=w.useState(!1),[v,_]=w.useState(!1),b=!!((E=i==null?void 0:i.company_user)!=null&&E.react_settings.show_mini_sidebar),y=Gm({initialValues:{message:"",platform:"R",send_logs:!1},onSubmit:k=>{he.processing(),$e("POST",Ae("/api/v1/support/messages/send"),k).then(()=>he.success("your_message_has_been_received")).finally(()=>{y.setSubmitting(!1),d(!1)})}}),C=()=>{_(!0),$e("POST",Ae("/api/v1/refresh")).then(k=>{a(y0(k.data.data)),_(!1),m(!1)})};return w.useEffect(()=>{var L,D,A,N;const k=(D=(L=i==null?void 0:i.company_user)==null?void 0:L.react_settings)==null?void 0:D.show_mini_sidebar;i&&typeof k<"u"&&((N=(A=o==null?void 0:o.company_user)==null?void 0:A.react_settings)==null?void 0:N.show_mini_sidebar)!==k&&l(i)},[(x=i==null?void 0:i.company_user)==null?void 0:x.react_settings.show_mini_sidebar]),O(St,{children:[O(Or,{title:e("contact_us"),visible:u,onClose:d,children:[p(Ze,{label:e("from"),id:"from",value:`${i==null?void 0:i.first_name} - ${i==null?void 0:i.email}`,disabled:!0}),p(Ze,{element:"textarea",label:e("message"),id:"message",onChange:y.handleChange}),p(kt,{id:"send_errors",label:e("include_recent_errors"),onChange:k=>y.setFieldValue("send_logs",k)}),p(un,{onClick:()=>y.submitForm(),disabled:y.isSubmitting,children:e("send")})]}),O(Or,{title:e("crons_not_enabled"),visible:g,onClose:m,children:[p(un,{onClick:()=>{window.open("https://invoiceninja.github.io/en/self-host-troubleshooting/#cron-not-running-queue-not-running","_blank")},children:e("learn_more")}),p(un,{disabled:v,onClick:C,children:e("refresh_data")}),p(un,{onClick:()=>{m(!1)},children:e("dismiss")})]}),p(s4t,{isAboutVisible:h,setIsAboutVisible:f}),O("nav",{style:{borderColor:t.$5},className:zt("flex p-2 text-white border-t",{"justify-end":s,"justify-around":!s}),children:[!b&&!s&&O(St,{children:[r&&!r.is_scheduler_running&&p("button",{className:"p-2 hover:bg-ninja-gray-darker rounded-full",onClick:()=>m(!0),children:p(BI,{duration:0,content:e("error"),className:"text-white rounded text-xs mb-2",children:p(C1t,{})})}),p("div",{className:"flex p-2",children:p(BI,{duration:0,content:e("contact_us"),className:"text-white rounded text-xs mb-2",children:p("div",{className:"cursor-pointer",onClick:()=>window.open("https://slack.invoiceninja.com","_blank"),children:p(nt,{element:a4t,color:"white",size:23})})})}),p("a",{href:"https://forum.invoiceninja.com",target:"_blank",className:"p-2 hover:bg-ninja-gray-darker rounded-full",rel:"noreferrer",children:p(BI,{duration:0,content:e("support_forum"),className:"text-white rounded text-xs mb-2",children:p(WCt,{})})}),p("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:p(BI,{duration:0,content:e("user_guide"),className:"text-white rounded text-xs mb-2",children:p(Tge,{})})}),p("button",{className:"p-2 hover:bg-ninja-gray-darker rounded-full overflow-visible",onClick:()=>f(!0),children:p(BI,{duration:0,content:e("about"),className:"text-white rounded text-xs mb-2",children:p(DCt,{})})})]}),p("button",{className:"p-2 rounded-full",onClick:()=>c("company_user.react_settings.show_mini_sidebar",!b),children:p(BI,{duration:0,content:p("span",{style:{fontSize:b?"0.6rem":"0.75rem"},children:e(b?"show_menu":"hide_menu")}),className:"text-white rounded mb-1.5",children:b?p(Xj,{}):p(Q8e,{})})})]})]})}function G(n){const e=si();return O("div",{className:zt(`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:[O("dt",{className:zt("text-sm flex flex-col",{"opacity-75":n.disabledLabels}),style:{color:e.$3,colorScheme:e.$0},children:[O("span",{className:zt("font-medium",{"whitespace-nowrap":n.withoutWrappingLeftSide}),style:{color:e.$3,colorScheme:e.$0},children:[n.leftSide,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),n.leftSideHelp&&(typeof n.leftSideHelp=="object"?n.leftSideHelp:p("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:n.leftSideHelp},style:{color:e.$3,colorScheme:e.$0,opacity:.8}}))]}),p("dd",{className:zt("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 c4t="tippy-content",u4t="tippy-backdrop",d4t="tippy-arrow",h4t="tippy-svg-arrow",XE={passive:!0,capture:!0},rVe=function(){return document.body};function lJ(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Xme(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function oVe(n,e){return typeof n=="function"?n.apply(void 0,e):n}function Xke(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function f4t(n){return n.split(/\s+/).filter(Boolean)}function b2(n){return[].concat(n)}function Zke(n,e){n.indexOf(e)===-1&&n.push(e)}function p4t(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function g4t(n){return n.split("-")[0]}function zH(n){return[].slice.call(n)}function Jke(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function m4t(){return document.createElement("div")}function sVe(n){return["Element","Fragment"].some(function(e){return Xme(n,e)})}function _4t(n){return Xme(n,"NodeList")}function v4t(n){return Xme(n,"MouseEvent")}function b4t(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function y4t(n){return sVe(n)?[n]:_4t(n)?zH(n):Array.isArray(n)?n:zH(document.querySelectorAll(n))}function cJ(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function eIe(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function C4t(n){var e,t=b2(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function w4t(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=g4t(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,f=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-i+d>l,v=i-o.bottom-h>l,_=o.left-t+f>l,b=t-o.right-g>l;return m||v||_||b})}function uJ(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function tIe(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 ob={isTouch:!1},nIe=0;function S4t(){ob.isTouch||(ob.isTouch=!0,window.performance&&document.addEventListener("mousemove",aVe))}function aVe(){var n=performance.now();n-nIe<20&&(ob.isTouch=!1,document.removeEventListener("mousemove",aVe)),nIe=n}function E4t(){var n=document.activeElement;if(b4t(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function x4t(){document.addEventListener("touchstart",S4t,XE),window.addEventListener("blur",E4t)}var T4t=typeof window<"u"&&typeof document<"u",k4t=T4t?!!window.msCrypto:!1,I4t={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},L4t={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Z_=Object.assign({appendTo:rVe,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},I4t,L4t),D4t=Object.keys(Z_),A4t=function(e){var t=Object.keys(e);t.forEach(function(i){Z_[i]=e[i]})};function lVe(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=Z_[o])!=null?a:s}return i},{});return Object.assign({},n,t)}function R4t(n,e){var t=e?Object.keys(lVe(Object.assign({},Z_,{plugins:e}))):D4t,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 iIe(n,e){var t=Object.assign({},e,{content:oVe(e.content,[n])},e.ignoreAttributes?{}:R4t(n,e.plugins));return t.aria=Object.assign({},Z_.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 rIe(n){var e=n.firstElementChild,t=zH(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(c4t)}),arrow:t.find(function(i){return i.classList.contains(d4t)||i.classList.contains(h4t)}),backdrop:t.find(function(i){return i.classList.contains(u4t)})}}var N4t=1,A8=[],dJ=[];function O4t(n,e){var t=iIe(n,Object.assign({},Z_,lVe(Jke(e)))),i,r,o,s=!1,a=!1,l=!1,c=!1,u,d,h,f=[],g=Xke(Ft,t.interactiveDebounce),m,v=N4t++,_=null,b=p4t(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:v,reference:n,popper:m4t(),popperInstance:_,props:t,state:y,plugins:b,clearDelayTimeouts:te,setProps:me,setContent:Me,show:rt,hide:It,hideWithInteractivity:Qt,enable:X,disable:le,unmount:pe,destroy:We};if(!t.render)return C;var E=t.render(C),x=E.popper,k=E.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+C.id,C.popper=x,n._tippy=C,x._tippy=C;var L=b.map(function(ne){return ne.fn(C)}),D=n.hasAttribute("aria-expanded");return Fe(),V(),H(),W("onCreate",[C]),t.showOnCreate&&se(),x.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&B().addEventListener("mousemove",g)}),C;function A(){var ne=C.props.touch;return Array.isArray(ne)?ne:[ne,0]}function N(){return A()[0]==="hold"}function P(){var ne;return!!((ne=C.props.render)!=null&&ne.$$tippy)}function M(){return m||n}function B(){var ne=M().parentNode;return ne?C4t(ne):document}function F(){return rIe(x)}function U(ne){return C.state.isMounted&&!C.state.isVisible||ob.isTouch||u&&u.type==="focus"?0:lJ(C.props.delay,ne?0:1,Z_.delay)}function H(ne){ne===void 0&&(ne=!1),x.style.pointerEvents=C.props.interactive&&!ne?"":"none",x.style.zIndex=""+C.props.zIndex}function W(ne,Se,Ie){if(Ie===void 0&&(Ie=!0),L.forEach(function(Je){Je[ne]&&Je[ne].apply(Je,Se)}),Ie){var Ke;(Ke=C.props)[ne].apply(Ke,Se)}}function q(){var ne=C.props.aria;if(ne.content){var Se="aria-"+ne.content,Ie=x.id,Ke=b2(C.props.triggerTarget||n);Ke.forEach(function(Je){var ot=Je.getAttribute(Se);if(C.state.isVisible)Je.setAttribute(Se,ot?ot+" "+Ie:Ie);else{var wt=ot&&ot.replace(Ie,"").trim();wt?Je.setAttribute(Se,wt):Je.removeAttribute(Se)}})}}function V(){if(!(D||!C.props.aria.expanded)){var ne=b2(C.props.triggerTarget||n);ne.forEach(function(Se){C.props.interactive?Se.setAttribute("aria-expanded",C.state.isVisible&&Se===M()?"true":"false"):Se.removeAttribute("aria-expanded")})}}function re(){B().removeEventListener("mousemove",g),A8=A8.filter(function(ne){return ne!==g})}function oe(ne){if(!(ob.isTouch&&(l||ne.type==="mousedown"))){var Se=ne.composedPath&&ne.composedPath()[0]||ne.target;if(!(C.props.interactive&&tIe(x,Se))){if(b2(C.props.triggerTarget||n).some(function(Ie){return tIe(Ie,Se)})){if(ob.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else W("onClickOutside",[C,ne]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ye())}}}function Q(){l=!0}function Ne(){l=!1}function Ve(){var ne=B();ne.addEventListener("mousedown",oe,!0),ne.addEventListener("touchend",oe,XE),ne.addEventListener("touchstart",Ne,XE),ne.addEventListener("touchmove",Q,XE)}function Ye(){var ne=B();ne.removeEventListener("mousedown",oe,!0),ne.removeEventListener("touchend",oe,XE),ne.removeEventListener("touchstart",Ne,XE),ne.removeEventListener("touchmove",Q,XE)}function ye(ne,Se){Pe(ne,function(){!C.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&Se()})}function He(ne,Se){Pe(ne,Se)}function Pe(ne,Se){var Ie=F().box;function Ke(Je){Je.target===Ie&&(uJ(Ie,"remove",Ke),Se())}if(ne===0)return Se();uJ(Ie,"remove",d),uJ(Ie,"add",Ke),d=Ke}function Ge(ne,Se,Ie){Ie===void 0&&(Ie=!1);var Ke=b2(C.props.triggerTarget||n);Ke.forEach(function(Je){Je.addEventListener(ne,Se,Ie),f.push({node:Je,eventType:ne,handler:Se,options:Ie})})}function Fe(){N()&&(Ge("touchstart",Mt,{passive:!0}),Ge("touchend",Yt,{passive:!0})),f4t(C.props.trigger).forEach(function(ne){if(ne!=="manual")switch(Ge(ne,Mt),ne){case"mouseenter":Ge("mouseleave",Yt);break;case"focus":Ge(k4t?"focusout":"blur",ln);break;case"focusin":Ge("focusout",ln);break}})}function bt(){f.forEach(function(ne){var Se=ne.node,Ie=ne.eventType,Ke=ne.handler,Je=ne.options;Se.removeEventListener(Ie,Ke,Je)}),f=[]}function Mt(ne){var Se,Ie=!1;if(!(!C.state.isEnabled||Et(ne)||a)){var Ke=((Se=u)==null?void 0:Se.type)==="focus";u=ne,m=ne.currentTarget,V(),!C.state.isVisible&&v4t(ne)&&A8.forEach(function(Je){return Je(ne)}),ne.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||s)&&C.props.hideOnClick!==!1&&C.state.isVisible?Ie=!0:se(ne),ne.type==="click"&&(s=!Ie),Ie&&!Ke&&Y(ne)}}function Ft(ne){var Se=ne.target,Ie=M().contains(Se)||x.contains(Se);if(!(ne.type==="mousemove"&&Ie)){var Ke=Te().concat(x).map(function(Je){var ot,wt=Je._tippy,pn=(ot=wt.popperInstance)==null?void 0:ot.state;return pn?{popperRect:Je.getBoundingClientRect(),popperState:pn,props:t}:null}).filter(Boolean);w4t(Ke,ne)&&(re(),Y(ne))}}function Yt(ne){var Se=Et(ne)||C.props.trigger.indexOf("click")>=0&&s;if(!Se){if(C.props.interactive){C.hideWithInteractivity(ne);return}Y(ne)}}function ln(ne){C.props.trigger.indexOf("focusin")<0&&ne.target!==M()||C.props.interactive&&ne.relatedTarget&&x.contains(ne.relatedTarget)||Y(ne)}function Et(ne){return ob.isTouch?N()!==ne.type.indexOf("touch")>=0:!1}function mt(){Lt();var ne=C.props,Se=ne.popperOptions,Ie=ne.placement,Ke=ne.offset,Je=ne.getReferenceClientRect,ot=ne.moveTransition,wt=P()?rIe(x).arrow:null,pn=Je?{getBoundingClientRect:Je,contextElement:Je.contextElement||M()}:n,Kn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(bn){var Wn=bn.state;if(P()){var Ei=F(),er=Ei.box;["placement","reference-hidden","escaped"].forEach(function(ur){ur==="placement"?er.setAttribute("data-placement",Wn.placement):Wn.attributes.popper["data-popper-"+ur]?er.setAttribute("data-"+ur,""):er.removeAttribute("data-"+ur)}),Wn.attributes.popper={}}}},Cn=[{name:"offset",options:{offset:Ke}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},Kn];P()&&wt&&Cn.push({name:"arrow",options:{element:wt,padding:3}}),Cn.push.apply(Cn,(Se==null?void 0:Se.modifiers)||[]),C.popperInstance=R9e(pn,x,Object.assign({},Se,{placement:Ie,onFirstUpdate:h,modifiers:Cn}))}function Lt(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function be(){var ne=C.props.appendTo,Se,Ie=M();C.props.interactive&&ne===rVe||ne==="parent"?Se=Ie.parentNode:Se=oVe(ne,[Ie]),Se.contains(x)||Se.appendChild(x),C.state.isMounted=!0,mt()}function Te(){return zH(x.querySelectorAll("[data-tippy-root]"))}function se(ne){C.clearDelayTimeouts(),ne&&W("onTrigger",[C,ne]),Ve();var Se=U(!0),Ie=A(),Ke=Ie[0],Je=Ie[1];ob.isTouch&&Ke==="hold"&&Je&&(Se=Je),Se?i=setTimeout(function(){C.show()},Se):C.show()}function Y(ne){if(C.clearDelayTimeouts(),W("onUntrigger",[C,ne]),!C.state.isVisible){Ye();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ne.type)>=0&&s)){var Se=U(!1);Se?r=setTimeout(function(){C.state.isVisible&&C.hide()},Se):o=requestAnimationFrame(function(){C.hide()})}}function X(){C.state.isEnabled=!0}function le(){C.hide(),C.state.isEnabled=!1}function te(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function me(ne){if(!C.state.isDestroyed){W("onBeforeUpdate",[C,ne]),bt();var Se=C.props,Ie=iIe(n,Object.assign({},Se,Jke(ne),{ignoreAttributes:!0}));C.props=Ie,Fe(),Se.interactiveDebounce!==Ie.interactiveDebounce&&(re(),g=Xke(Ft,Ie.interactiveDebounce)),Se.triggerTarget&&!Ie.triggerTarget?b2(Se.triggerTarget).forEach(function(Ke){Ke.removeAttribute("aria-expanded")}):Ie.triggerTarget&&n.removeAttribute("aria-expanded"),V(),H(),k&&k(Se,Ie),C.popperInstance&&(mt(),Te().forEach(function(Ke){requestAnimationFrame(Ke._tippy.popperInstance.forceUpdate)})),W("onAfterUpdate",[C,ne])}}function Me(ne){C.setProps({content:ne})}function rt(){var ne=C.state.isVisible,Se=C.state.isDestroyed,Ie=!C.state.isEnabled,Ke=ob.isTouch&&!C.props.touch,Je=lJ(C.props.duration,0,Z_.duration);if(!(ne||Se||Ie||Ke)&&!M().hasAttribute("disabled")&&(W("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,P()&&(x.style.visibility="visible"),H(),Ve(),C.state.isMounted||(x.style.transition="none"),P()){var ot=F(),wt=ot.box,pn=ot.content;cJ([wt,pn],0)}h=function(){var Cn;if(!(!C.state.isVisible||c)){if(c=!0,x.offsetHeight,x.style.transition=C.props.moveTransition,P()&&C.props.animation){var hn=F(),bn=hn.box,Wn=hn.content;cJ([bn,Wn],Je),eIe([bn,Wn],"visible")}q(),V(),Zke(dJ,C),(Cn=C.popperInstance)==null||Cn.forceUpdate(),W("onMount",[C]),C.props.animation&&P()&&He(Je,function(){C.state.isShown=!0,W("onShown",[C])})}},be()}}function It(){var ne=!C.state.isVisible,Se=C.state.isDestroyed,Ie=!C.state.isEnabled,Ke=lJ(C.props.duration,1,Z_.duration);if(!(ne||Se||Ie)&&(W("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,s=!1,P()&&(x.style.visibility="hidden"),re(),Ye(),H(!0),P()){var Je=F(),ot=Je.box,wt=Je.content;C.props.animation&&(cJ([ot,wt],Ke),eIe([ot,wt],"hidden"))}q(),V(),C.props.animation?P()&&ye(Ke,C.unmount):C.unmount()}}function Qt(ne){B().addEventListener("mousemove",g),Zke(A8,g),g(ne)}function pe(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Lt(),Te().forEach(function(ne){ne._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),dJ=dJ.filter(function(ne){return ne!==C}),C.state.isMounted=!1,W("onHidden",[C]))}function We(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),bt(),delete n._tippy,C.state.isDestroyed=!0,W("onDestroy",[C]))}}function OF(n,e){e===void 0&&(e={});var t=Z_.plugins.concat(e.plugins||[]);x4t();var i=Object.assign({},e,{plugins:t}),r=y4t(n),o=r.reduce(function(s,a){var l=a&&O4t(a,i);return l&&s.push(l),s},[]);return sVe(n)?o[0]:o}OF.defaultProps=Z_;OF.setDefaultProps=A4t;OF.currentInput=ob;Object.assign({},eme,{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)}});OF.setDefaultProps({animation:!1});function cVe(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 uVe=typeof window<"u"&&typeof document<"u";function Noe(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function oIe(){return uVe&&document.createElement("div")}function P4t(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function dVe(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(!dVe(n[t],e[t]))return!1}else return!1;return!0}else return!1}function M4t(n){var e=[];return n.forEach(function(t){e.find(function(i){return dVe(t,i)})||e.push(t)}),e}function F4t(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:M4t([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var hJ=uVe?w.useLayoutEffect:w.useEffect;function B4t(n){var e=w.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function sIe(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var $4t={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()||sIe(t,"add",e.props.className)}function o(){i()&&sIe(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:o,onAfterUpdate:r}}};function V4t(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 f=cVe(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=s!==void 0,v=w.useState(!1),_=v[0],b=v[1],y=w.useState({}),C=y[0],E=y[1],x=w.useState(),k=x[0],L=x[1],D=B4t(function(){return{container:oIe(),renders:1}}),A=Object.assign({ignoreAttributes:h},f,{content:D.container});g&&(A.trigger="manual",A.hideOnClick=!1),m&&(u=!0);var N=A,P=A.plugins||[];a&&(N=Object.assign({},A,{plugins:m&&s.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(U,H){var W=s.data.children.find(function(q){var V=q.instance;return V.reference===H.currentTarget});U.state.$$activeSingletonInstance=W.instance,L(W.content)}}}}]):P,render:function(){return{popper:D.container}}}));var M=[l].concat(i?[i.type]:[]);return hJ(function(){var B=l;l&&l.hasOwnProperty("current")&&(B=l.current);var F=n(B||D.ref||oIe(),Object.assign({},N,{plugins:[$4t].concat(A.plugins||[])}));return D.instance=F,u&&F.disable(),o&&F.show(),m&&s.hook({instance:F,content:r,props:N,setSingletonContent:L}),b(!0),function(){F.destroy(),s==null||s.cleanup(F)}},M),hJ(function(){var B;if(D.renders===1){D.renders++;return}var F=D.instance;F.setProps(F4t(F.props,N)),(B=F.popperInstance)==null||B.forceUpdate(),u?F.disable():F.enable(),g&&(o?F.show():F.hide()),m&&s.hook({instance:F,content:r,props:N,setSingletonContent:L})}),hJ(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(U){var H=U.name;return H!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(H){var W,q=H.state,V=(W=q.modifiersData)==null?void 0:W.hide;(C.placement!==q.placement||C.referenceHidden!==(V==null?void 0:V.isReferenceHidden)||C.escaped!==(V==null?void 0:V.hasPopperEscaped))&&E({placement:q.placement,referenceHidden:V==null?void 0:V.isReferenceHidden,escaped:V==null?void 0:V.hasPopperEscaped}),q.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(M)),ce.createElement(ce.Fragment,null,i?w.cloneElement(i,{ref:function(F){D.ref=F,Noe(i.ref,F)}}):null,_&&op.createPortal(a?a(P4t(C),k,D.instance):r,D.container))}return e}var H4t=function(n,e){return w.forwardRef(function(i,r){var o=i.children,s=cVe(i,["children"]);return ce.createElement(n,Object.assign({},e,s),o?w.cloneElement(o,{ref:function(l){Noe(r,l),Noe(o.ref,l)}}):null)})},W4t=H4t(V4t(OF),{render:function(){return""}});const PF=W4t;function z4t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.addEventListener&&n.addEventListener.apply(n,e)}function U4t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.removeEventListener&&n.removeEventListener.apply(n,e)}var j4t=["mousedown","touchstart"],q4t=function(n,e,t){t===void 0&&(t=j4t);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];z4t(document,a,r)}return function(){for(var l=0,c=t;l<c.length;l++){var u=c[l];U4t(document,u,r)}}},[t,n])};const m1=q4t;function G4t(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 YD(n,e,t){e===void 0&&(e=0),t===void 0&&(t=[]);var i=G4t(n,e),r=i[0],o=i[1],s=i[2];return w.useEffect(s,t),[r,o]}const K4t=rl.button`
color: ${n=>n.theme.color} !important;
background-color: ${n=>n.theme.backgroundColor} !important;
border-color: ${n=>n.theme.borderColor} !important;
`,Y4t=rl.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function Fm(n){const e=w.useRef(null),[t,i]=w.useState(!1),r=Ss(),[o,s]=w.useState(),a=(c,u)=>c==="div"?{onClick:()=>i(!1),key:u}:{setVisible:i,key:u};m1(e,()=>{t&&i(!1)}),w.useEffect(()=>{s(w.Children.toArray(n.children))},[n.children]);const l=si();return p("div",{ref:e,children:p(PF,{disabled:n.disabled,placement:"bottom",interactive:!0,render:()=>p(Y4t,{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==gt||c.type=="div")?w.cloneElement(c,a(c.type,u)):c)}),visible:t,children:O(K4t,{theme:{backgroundColor:r,color:l.$9,borderColor:l.$5},type:"button",disabled:n.disabled,onClick:()=>i(!t),className:zt(`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&&p("span",{children:n.label}),p(bR,{size:n.cardActions?18:14})]})})})}function tn(n){const[e]=ve(),{padding:t="regular",height:i}=n,[r,o]=w.useState(n.collapsed),s=si();return p("div",{className:zt(`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:O("form",{onSubmit:n.onFormSubmit,className:zt({"h-full":i==="full"}),children:[n.title&&p("div",{className:zt({"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:O("div",{className:zt("flex items-center justify-between",{"cursor-pointer select-none":typeof n.collapsed<"u"}),children:[O("div",{children:[p("h3",{className:zt("leading-6 font-medium",{"text-lg":t=="regular","text-md":t=="small"}),children:n.title}),n.description&&p("p",{className:"mt-1 max-w-2xl text-sm",children:n.description})]}),n.topRight,typeof n.collapsed<"u"&&r&&p(bR,{}),typeof n.collapsed<"u"&&!r&&p(X8e,{})]})}),O("div",{className:zt(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&&p(G,{leftSide:p(ds,{})}),n.withContainer?p(S0,{children:n.children}):n.children]}),(n.withSaveButton||n.additionalAction)&&p("div",{className:"border-t px-4 py-5 sm:p-0",style:{borderColor:s.$4},children:p("dl",{className:"sm:divide-y sm:divide-gray-200",children:O("div",{className:"sm:py-5 sm:px-6 flex justify-end space-x-4",children:[n.additionalAction,n.withSaveButton&&!n.additionalSaveOptions&&p(un,{onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),n.withSaveButton&&n.additionalSaveOptions&&O("div",{className:"flex",children:[p(un,{className:"rounded-br-none rounded-tr-none px-3",onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),p(Fm,{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)=>p(gt,{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 S0(n){return p("div",{className:"px-6 py-4 space-y-6",children:n.children})}const Q4t=rl.button`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`,X4t=rl.a`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`,Z4t=rl(k1)`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`;function Nl(n){const e=si(),t=`block w-full text-left px-4 sm:px-6 block py-4 space-x-3 text-sm ${n.className}`;return n.to?p(Z4t,{theme:{hoverColor:e.$4,color:e.$3},to:n.to,style:{pointerEvents:n.disableNavigation?"none":"all"},className:t,children:n.children}):n.href?p(X4t,{theme:{hoverColor:e.$4,color:e.$3},target:"_blank",href:n.href,className:t,rel:"noreferrer",children:n.children}):p(Q4t,{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 J4t=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 e3t=nl(J4t),t3t=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2f7dc3","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b","#616161","#000000","#57a6e4","#324da1","#4c9a1c","#cd8900","#b93700"],E$=["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"],Ooe={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 n3t(){return(n,e)=>n&&e3t().test(n)?n:e}function kg(){var t,i,r;const n=_l(),e={$1:"",$2:"",$3:"",$4:"",$5:""};return(r=(i=Ooe[(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 Zme(){const n=_l(),e={$1:"",$2:"",$3:"",$4:"",$5:"",$6:"",$7:""};return E$.forEach((t,i)=>{var r;e[`$${i+1}`]=((r=n==null?void 0:n.color_theme)==null?void 0:r[t])||""}),e}function i3t(){var s;const[n]=ve(),e=_l(),t=zi(),i=NF(),r=()=>{let a="";E$.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(()=>he.success("copied_to_clipboard",{value:""}))},o=()=>{const a=An.cloneDeep(e==null?void 0:e.color_theme);a&&(E$.forEach(l=>{a[l]=""}),t(Ak({property:"company_user.react_settings.color_theme",value:a})))};return O(St,{children:[p(G,{leftSide:n("status_color_theme"),children:p(En,{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(Ooe).map((a,l)=>{var c,u;return p("option",{value:a,children:O("div",{className:"flex w-full space-x-2",children:[p("span",{className:"flex w-1/4 capitalize truncate",children:n(a)}),p("div",{className:"flex",children:(u=(c=Ooe[a])==null?void 0:c.palette)==null?void 0:u.map(d=>p("div",{style:{backgroundColor:d,width:50,height:20}},d))})]})},l)})})}),E$.map(a=>p(G,{leftSide:n(a),children:p(r3t,{fieldKey:a})},a)),O("div",{className:"flex justify-end px-6 mt-10 space-x-4",children:[p(un,{behavior:"button",type:"secondary",onClick:o,children:n("clear_all")}),p(un,{behavior:"button",onClick:r,children:n("export_colors")})]})]})}function r3t(n){var r;const{fieldKey:e}=n,t=_l(),i=NF();return O("div",{className:"flex space-x-20",children:[p(Ze,{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)}),p(o3t,{fieldKey:e})]})}function o3t(n){var u;const[e]=ve(),{fieldKey:t}=n,i=_l(),r=n3t(),o=NF(),[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]),O(St,{children:[O("div",{className:"flex items-center space-x-2",children:[p("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")}}),p(nt,{className:"cursor-pointer",element:p1,size:26,onClick:()=>o(`company_user.react_settings.color_theme.${t}`,"")})]}),p(Or,{title:e(t),visible:s,size:"small",onClose:()=>a(!1),children:O("div",{className:"flex flex-col space-y-6",children:[p("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:t3t.map(d=>p("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>c(d),style:{height:32,backgroundColor:d},children:l===d&&p(nt,{className:"absolute",element:sme,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},d))}),p(un,{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 DR=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}`}},MF=(n,e,t)=>n+e+t>384;function FF(){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 s3t=rl.div`
background-color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,aIe=rl(qi)`
&:hover {
background-color: ${n=>{if(n.theme.hoverColor){const e=DR(n.theme.hoverColor);return`rgba(${e.red}, ${e.green}, ${e.blue}, 0.1)`}return n.theme.hoverColor}};
}
`;function Poe(n){var s;const{item:e}=n,t=si(),i=I1(),r=Zme(),o=!!((s=i==null?void 0:i.company_user)!=null&&s.react_settings.show_mini_sidebar);return e.visible?O(s3t,{theme:{color:e.current?r.$1||t.$8:r.$3||"transparent",hoverColor:r.$1||t.$8},className:zt("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:[p(aIe,{to:e.href,className:"w-full",withoutDefaultStyling:!0,children:O("div",{className:"flex justify-start items-center my-2",style:{color:e.current?r.$2:r.$4},children:[p(e.icon,{className:zt("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&&p(aIe,{theme:{hoverColor:t.$13},to:e.rightButton.to,className:"rounded-full p-1.5",withoutDefaultStyling:!0,children:p(e.rightButton.icon,{className:"h-5 w-5",style:{color:e.current?r.$2:r.$4}})})]},e.name):p(St,{})}function Yu(n){const e=si(),{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,f]=w.useState(!1);return w.useEffect(()=>{var v,_;const g=(v=c==null?void 0:c.current)==null?void 0:v.offsetWidth,m=(_=c==null?void 0:c.current)==null?void 0:_.children[0];m&&g&&(m.offsetWidth>g?(d(g+10),f(!0)):d(m.offsetWidth+10))},[c,n.message]),p("div",{className:zt(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:p(PF,{placement:i||"top-start",interactive:!0,render:()=>O("div",{className:"flex flex-col items-center",onClick:g=>g.stopPropagation(),children:[O("div",{className:zt("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&&p(nt,{className:"rotate-90 -mt-2.5",element:HEt,size:24,style:{color:e.$5}})]}),disabled:a,children:p("div",{ref:c,className:zt("cursor-pointer",{"truncate w-full":n.truncate,"flex items-center":n.centerVertically}),children:n.children})})})}function a3t(n){var o;const e=I1(),t=!!((o=e==null?void 0:e.company_user)!=null&&o.react_settings.show_mini_sidebar),i=Sq(),r=si();return p("div",{className:zt("hidden md:flex z-10 md:flex-col md:fixed md:inset-y-0",{"md:w-16":t,"md:w-64":!t}),children:O("div",{style:{backgroundColor:r.$6,borderColor:r.$4},className:"flex flex-col flex-grow overflow-y-auto border-r",children:[p("div",{style:{borderColor:r.$5,backgroundColor:r.$1,color:r.$3},className:zt("flex items-center flex-shrink-0 h-16 border-b",{"pl-3 pr-6":!t,"justify-center":t}),children:t?p("img",{className:"w-8",src:i,alt:"Company logo"}):p(m$e,{})}),O("div",{className:"flex-grow flex flex-col mt-4",children:[p("nav",{className:"flex-1 pb-4 space-y-1","data-cy":"navigationBar",children:n.navigation.map((s,a)=>t?p(Yu,{message:s.name,width:"auto",placement:"right",withoutArrow:!0,withoutWrapping:!0,children:p(Poe,{item:s},a)},a):p(Poe,{item:s},a))}),p(iVe,{docsLink:n.docsLink})]})]})})}function l3t(n){var o;const e=Sq(),t=si(),i=I1(),r=!!((o=i==null?void 0:i.company_user)!=null&&o.react_settings.show_mini_sidebar);return p(Dy.Root,{show:n.sidebarOpen,as:w.Fragment,children:O(eM,{as:"div",className:"fixed inset-0 flex z-40 md:hidden",onClose:n.setSidebarOpen,style:{width:r?"4rem":"19.4rem"},children:[p(Dy.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:p(eM.Overlay,{className:"fixed inset-0 bg-gray-600 bg-opacity-75"})}),p(Dy.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:O("div",{className:"relative flex-1 flex flex-col max-w-xs w-full bg-ninja-gray dark:bg-gray-900",children:[p(Dy.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:p("div",{className:"absolute top-0 right-0 -mr-12 pt-2",children:O("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:[p("span",{className:"sr-only",children:"Close sidebar"}),p(qm,{className:"text-white"})]})})}),p("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?p("img",{className:"w-8",src:e,alt:"Company logo"}):p(m$e,{})}),O("div",{className:"flex flex-col flex-1 h-0 overflow-y-auto mt-4",children:[p("nav",{className:"flex-1 space-y-1",children:n.navigation.map((s,a)=>p(Poe,{item:s},a))}),p(iVe,{mobileNavbar:!0})]})]})}),p("div",{className:"flex-shrink-0 w-14","aria-hidden":"true"})]})})}var wi=(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))(wi||{});const c3t=[{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 u3t(){const[n]=ve(),e=Zi(),t=zi(),i=(r,o)=>t(go({object:"company",property:"enabled_modules",value:(e==null?void 0:e.enabled_modules)^o}));return p(tn,{title:n("enabled_modules"),children:c3t.map((r,o)=>p(G,{leftSide:n(r.label),children:p(kt,{checked:!!((e==null?void 0:e.enabled_modules)&r.bitmask),onChange:s=>i(s,r.bitmask)},r.label)},o))})}function vi(n){const e=si();return p("div",{style:{borderColor:n.borderColor||e.$4},className:zt("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 Bm(){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 xc(){return!0}function d3t(){const[n]=ve(),{isAdmin:e}=Fo();return O(tn,{title:n("integrations"),children:[((Bm()||xc())&&qo()||fR())&&e&&p(Nl,{to:"/settings/integrations/api_tokens",children:n("api_tokens")}),p(Nl,{to:"/settings/integrations/api_webhooks",children:n("api_webhooks")}),p(Nl,{href:"https://invoiceninja.github.io",children:n("api_docs")}),p(vi,{}),p(Nl,{className:"mt-4",href:"https://zapier.com/apps/invoice-ninja/integrations",children:"Zapier"}),p(Nl,{to:"/settings/integrations/analytics",children:n("analytics")})]})}function h3t(){const[n]=ve(),e="https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",[t,i]=w.useState(!1),r=Gm({initialValues:{license:""},onSubmit:o=>{he.processing(),$e("POST",Ae("/api/v1/claim_license?license_key=:key",{key:o.license})).then(()=>{he.success("bought_white_label"),i(!1)}).finally(()=>r.setSubmitting(!1))}});return O(St,{children:[p(Or,{title:n("apply_license"),visible:t,onClose:i,children:O("form",{onSubmit:r.handleSubmit,className:"space-y-4",children:[p(Ze,{onChange:r.handleChange,label:n("license"),id:"license",required:!0}),p(un,{disabled:r.isSubmitting,variant:"block",children:n("submit")})]})}),p(vi,{withoutPadding:!0}),p(Nl,{href:e,children:n("purchase_license")}),p(Nl,{onClick:()=>i(!0),children:n("apply_license")})]})}var hVe={exports:{}},fa={};/**
* @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 Jme=Symbol.for("react.element"),e_e=Symbol.for("react.portal"),Aq=Symbol.for("react.fragment"),Rq=Symbol.for("react.strict_mode"),Nq=Symbol.for("react.profiler"),Oq=Symbol.for("react.provider"),Pq=Symbol.for("react.context"),f3t=Symbol.for("react.server_context"),Mq=Symbol.for("react.forward_ref"),Fq=Symbol.for("react.suspense"),Bq=Symbol.for("react.suspense_list"),$q=Symbol.for("react.memo"),Vq=Symbol.for("react.lazy"),p3t=Symbol.for("react.offscreen"),fVe;fVe=Symbol.for("react.module.reference");function Km(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case Jme:switch(n=n.type,n){case Aq:case Nq:case Rq:case Fq:case Bq:return n;default:switch(n=n&&n.$$typeof,n){case f3t:case Pq:case Mq:case Vq:case $q:case Oq:return n;default:return e}}case e_e:return e}}}fa.ContextConsumer=Pq;fa.ContextProvider=Oq;fa.Element=Jme;fa.ForwardRef=Mq;fa.Fragment=Aq;fa.Lazy=Vq;fa.Memo=$q;fa.Portal=e_e;fa.Profiler=Nq;fa.StrictMode=Rq;fa.Suspense=Fq;fa.SuspenseList=Bq;fa.isAsyncMode=function(){return!1};fa.isConcurrentMode=function(){return!1};fa.isContextConsumer=function(n){return Km(n)===Pq};fa.isContextProvider=function(n){return Km(n)===Oq};fa.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===Jme};fa.isForwardRef=function(n){return Km(n)===Mq};fa.isFragment=function(n){return Km(n)===Aq};fa.isLazy=function(n){return Km(n)===Vq};fa.isMemo=function(n){return Km(n)===$q};fa.isPortal=function(n){return Km(n)===e_e};fa.isProfiler=function(n){return Km(n)===Nq};fa.isStrictMode=function(n){return Km(n)===Rq};fa.isSuspense=function(n){return Km(n)===Fq};fa.isSuspenseList=function(n){return Km(n)===Bq};fa.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===Aq||n===Nq||n===Rq||n===Fq||n===Bq||n===p3t||typeof n=="object"&&n!==null&&(n.$$typeof===Vq||n.$$typeof===$q||n.$$typeof===Oq||n.$$typeof===Pq||n.$$typeof===Mq||n.$$typeof===fVe||n.getModuleId!==void 0)};fa.typeOf=Km;hVe.exports=fa;var pVe=hVe.exports;function UH(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return ce.Children.forEach(n,function(i){i==null&&!e.keepEmpty||(Array.isArray(i)?t=t.concat(UH(i)):pVe.isFragment(i)&&i.props?t=t.concat(UH(i.props.children,e)):t.push(i))}),t}var Moe={},g3t=function(e){};function m3t(n,e){}function _3t(n,e){}function v3t(){Moe={}}function gVe(n,e,t){!e&&!Moe[t]&&(n(!1,t),Moe[t]=!0)}function Dd(n,e){gVe(m3t,n,e)}function mVe(n,e){gVe(_3t,n,e)}Dd.preMessage=g3t;Dd.resetWarned=v3t;Dd.noteOnce=mVe;function jH(n){return n instanceof HTMLElement||n instanceof SVGElement}function x$(n){return jH(n)?n:n instanceof ce.Component?uj.findDOMNode(n):null}function BF(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 t_e(n,e){typeof n=="function"?n(e):Zr(n)==="object"&&n&&"current"in n&&(n.current=e)}function Hq(){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){t_e(o,r)})}}function n_e(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return BF(function(){return Hq.apply(void 0,e)},e,function(i,r){return i.length!==r.length||i.every(function(o,s){return o!==r[s]})})}function $F(n){var e,t,i=pVe.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 Foe=w.createContext(null);function b3t(n){var e=n.children,t=n.onBatchResize,i=w.useRef(0),r=w.useRef([]),o=w.useContext(Foe),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(Foe.Provider,{value:s},e)}var _Ve=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}()}(),Boe=typeof window<"u"&&typeof document<"u"&&window.document===document,qH=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")()}(),y3t=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(qH):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),C3t=2;function w3t(n,e){var t=!1,i=!1,r=0;function o(){t&&(t=!1,n()),i&&a()}function s(){y3t(o)}function a(){var l=Date.now();if(t){if(l-r<C3t)return;i=!0}else t=!0,i=!1,setTimeout(s,e);r=l}return a}var S3t=20,E3t=["top","right","bottom","left","width","height","size","weight"],x3t=typeof MutationObserver<"u",T3t=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=w3t(this.refresh.bind(this),S3t)}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(){!Boe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),x3t?(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(){!Boe||!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=E3t.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}(),vVe=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},QD=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||qH},bVe=Wq(0,0,0,0);function GH(n){return parseFloat(n)||0}function lIe(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+GH(o)},0)}function k3t(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]=GH(s)}return t}function I3t(n){var e=n.getBBox();return Wq(0,0,e.width,e.height)}function L3t(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return bVe;var i=QD(n).getComputedStyle(n),r=k3t(i),o=r.left+r.right,s=r.top+r.bottom,a=GH(i.width),l=GH(i.height);if(i.boxSizing==="border-box"&&(Math.round(a+o)!==e&&(a-=lIe(i,"left","right")+o),Math.round(l+s)!==t&&(l-=lIe(i,"top","bottom")+s)),!A3t(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 Wq(r.left,r.top,a,l)}var D3t=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof QD(n).SVGGraphicsElement}:function(n){return n instanceof QD(n).SVGElement&&typeof n.getBBox=="function"}}();function A3t(n){return n===QD(n).document.documentElement}function R3t(n){return Boe?D3t(n)?I3t(n):L3t(n):bVe}function N3t(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 vVe(s,{x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:r+t,left:e}),s}function Wq(n,e,t,i){return{x:n,y:e,width:t,height:i}}var O3t=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Wq(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=R3t(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}(),P3t=function(){function n(e,t){var i=N3t(t);vVe(this,{target:e,contentRect:i})}return n}(),M3t=function(){function n(e,t,i){if(this.activeObservations_=[],this.observations_=new _Ve,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 QD(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new O3t(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 QD(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 P3t(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}(),yVe=typeof WeakMap<"u"?new WeakMap:new _Ve,CVe=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=T3t.getInstance(),i=new M3t(e,t,this);yVe.set(this,i)}return n}();["observe","unobserve","disconnect"].forEach(function(n){CVe.prototype[n]=function(){var e;return(e=yVe.get(this))[n].apply(e,arguments)}});var F3t=function(){return typeof qH.ResizeObserver<"u"?qH.ResizeObserver:CVe}(),QC=new Map;function B3t(n){n.forEach(function(e){var t,i=e.target;(t=QC.get(i))===null||t===void 0||t.forEach(function(r){return r(i)})})}var wVe=new F3t(B3t);function $3t(n,e){QC.has(n)||(QC.set(n,new Set),wVe.observe(n)),QC.get(n).add(e)}function V3t(n,e){QC.has(n)&&(QC.get(n).delete(e),QC.get(n).size||(wVe.unobserve(n),QC.delete(n)))}var H3t=function(n){Tv(t,n);var e=Rk(t);function t(){return El(this,t),e.apply(this,arguments)}return xl(t,[{key:"render",value:function(){return this.props.children}}]),t}(w.Component);function W3t(n,e){var t=n.children,i=n.disabled,r=w.useRef(null),o=w.useRef(null),s=w.useContext(Foe),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)&&$F(l),d=u?l.ref:null,h=n_e(d,r),f=function(){var _;return x$(r.current)||(r.current&&Zr(r.current)==="object"?x$((_=r.current)===null||_===void 0?void 0:_.nativeElement):null)||x$(o.current)};w.useImperativeHandle(e,function(){return f()});var g=w.useRef(n);g.current=n;var m=w.useCallback(function(v){var _=g.current,b=_.onResize,y=_.data,C=v.getBoundingClientRect(),E=C.width,x=C.height,k=v.offsetWidth,L=v.offsetHeight,D=Math.floor(E),A=Math.floor(x);if(c.current.width!==D||c.current.height!==A||c.current.offsetWidth!==k||c.current.offsetHeight!==L){var N={width:D,height:A,offsetWidth:k,offsetHeight:L};c.current=N;var P=k===Math.round(E)?E:k,M=L===Math.round(x)?x:L,B=pt(pt({},N),{},{offsetWidth:P,offsetHeight:M});s==null||s(B,v,y),b&&Promise.resolve().then(function(){b(B,v)})}},[]);return w.useEffect(function(){var v=f();return v&&!i&&$3t(v,m),function(){return V3t(v,m)}},[r.current,i]),w.createElement(H3t,{ref:o},u?w.cloneElement(l,{ref:h}):l)}var z3t=w.forwardRef(W3t),U3t="rc-observer-key";function j3t(n,e){var t=n.children,i=typeof t=="function"?[t]:UH(t);return i.map(function(r,o){var s=(r==null?void 0:r.key)||"".concat(U3t,"-").concat(o);return w.createElement(z3t,Tt({},n,{key:s,ref:o===0?e:void 0}),r)})}var i_e=w.forwardRef(j3t);i_e.Collection=b3t;function q3t(n,e){var t=pt({},n);return Array.isArray(e)&&e.forEach(function(i){delete t[i]}),t}var SVe=function(e){return+setTimeout(e,16)},EVe=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(SVe=function(e){return window.requestAnimationFrame(e)},EVe=function(e){return window.cancelAnimationFrame(e)});var cIe=0,r_e=new Map;function xVe(n){r_e.delete(n)}var Yf=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;cIe+=1;var i=cIe;function r(o){if(o===0)xVe(i),e();else{var s=SVe(function(){r(o-1)});r_e.set(i,s)}}return r(t),i};Yf.cancel=function(n){var e=r_e.get(n);return xVe(e),EVe(e)};function o_e(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 KH(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(Dd(!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&&Zr(o)==="object"&&Zr(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 uIe="%",G3t=function(){function n(e){El(this,n),it(this,"instanceId",void 0),it(this,"cache",new Map),this.instanceId=e}return xl(n,[{key:"get",value:function(t){return this.cache.get(t.join(uIe))||null}},{key:"update",value:function(t,i){var r=t.join(uIe),o=this.cache.get(r),s=i(o);s===null?this.cache.delete(r):this.cache.set(r,s)}}]),n}(),$oe="data-token-hash",sT="data-css-hash",j2="__cssinjs_instance__";function K3t(){var n=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var e=document.body.querySelectorAll("style[".concat(sT,"]"))||[],t=document.head.firstChild;Array.from(e).forEach(function(r){r[j2]=r[j2]||n,r[j2]===n&&document.head.insertBefore(r,t)});var i={};Array.from(document.querySelectorAll("style[".concat(sT,"]"))).forEach(function(r){var o=r.getAttribute(sT);if(i[o]){if(r[j2]===n){var s;(s=r.parentNode)===null||s===void 0||s.removeChild(r)}}else i[o]=!0})}return new G3t(n)}var s_e=w.createContext({hashPriority:"low",cache:K3t(),defaultCache:!0});function Qf(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Y3t(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 dIe="data-rc-order",hIe="data-rc-priority",Q3t="rc-util-key",Voe=new Map;function TVe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=n.mark;return e?e.startsWith("data-")?e:"data-".concat(e):Q3t}function zq(n){if(n.attachTo)return n.attachTo;var e=document.querySelector("head");return e||document.body}function X3t(n){return n==="queue"?"prependQueue":n?"prepend":"append"}function kVe(n){return Array.from((Voe.get(n)||n).children).filter(function(e){return e.tagName==="STYLE"})}function IVe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Qf())return null;var t=e.csp,i=e.prepend,r=e.priority,o=r===void 0?0:r,s=X3t(i),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(dIe,s),a&&o&&l.setAttribute(hIe,"".concat(o)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=n;var c=zq(e),u=c.firstChild;if(i){if(a){var d=kVe(c).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(dIe)))return!1;var f=Number(h.getAttribute(hIe)||0);return o>=f});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function LVe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=zq(e);return kVe(t).find(function(i){return i.getAttribute(TVe(e))===n})}function YH(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=LVe(n,e);if(t){var i=zq(e);i.removeChild(t)}}function Z3t(n,e){var t=Voe.get(n);if(!t||!Y3t(document,t)){var i=IVe("",e),r=i.parentNode;Voe.set(n,r),n.removeChild(i)}}function XD(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=zq(t);Z3t(i,t);var r=LVe(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=IVe(n,t);return l.setAttribute(TVe(t),e),l}function J3t(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 a_e=function(){function n(){El(this,n),it(this,"cache",void 0),it(this,"keys",void 0),it(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return xl(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=cn(c,2),h=d[1];return r.internalGet(u)[1]<h?[u,r.internalGet(u)[1]]:c},[this.keys[0],this.cacheCallTimes]),s=cn(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!J3t(i,t)}),this.deleteByPath(this.cache,t)}}]),n}();it(a_e,"MAX_CACHE_SIZE",20);it(a_e,"MAX_CACHE_OFFSET",5);var fIe=0,DVe=function(){function n(e){El(this,n),it(this,"derivatives",void 0),it(this,"id",void 0),this.derivatives=Array.isArray(e)?e:[e],this.id=fIe,e.length===0&&(e.length>0,void 0),fIe+=1}return xl(n,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(i,r){return r(t,i)},void 0)}}]),n}(),fJ=new a_e;function Hoe(n){var e=Array.isArray(n)?n:[n];return fJ.has(e)||fJ.set(e,new DVe(e)),fJ.get(e)}var e5t=new WeakMap,pJ={};function t5t(n,e){for(var t=e5t,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(pJ)||t.set(pJ,n()),t.get(pJ)}var pIe=new WeakMap;function QH(n){var e=pIe.get(n)||"";return e||(Object.keys(n).forEach(function(t){var i=n[t];e+=t,i instanceof DVe?e+=i.id:i&&Zr(i)==="object"?e+=QH(i):e+=i}),pIe.set(n,e)),e}function n5t(n,e){return o_e("".concat(e,"_").concat(QH(n)))}var iM="random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,""),AVe="_bAmBoO_";function i5t(n,e,t){if(Qf()){var i,r;XD(n,iM);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(AVe);return(r=o.parentNode)===null||r===void 0||r.removeChild(o),YH(iM),s}return!1}var gJ=void 0;function r5t(){return gJ===void 0&&(gJ=i5t("@layer ".concat(iM," { .").concat(iM,' { content: "').concat(AVe,'"!important; } }'),function(n){n.className=iM})),gJ}var gIe=Qf()?w.useLayoutEffect:w.useEffect,ih=function(e,t){var i=w.useRef(!0);gIe(function(){return e(i.current)},t),gIe(function(){return i.current=!1,function(){i.current=!0}},[])},mIe=function(e,t){ih(function(i){if(!i)return e()},t)},o5t=pt({},Lm),_Ie=o5t.useInsertionEffect,s5t=function(e,t,i){w.useMemo(e,i),ih(function(){return t(!0)},i)},a5t=_Ie?function(n,e,t){return _Ie(function(){return n(),e()},t)}:s5t,l5t=pt({},Lm),c5t=l5t.useInsertionEffect,u5t=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},d5t=function(){return function(e){e()}},h5t=typeof c5t<"u"?u5t:d5t;function RVe(n,e,t,i,r){var o=w.useContext(s_e),s=o.cache,a=[n].concat(no(e)),l=a.join("_"),c=h5t([l]),u=function(g){s.update(a,function(m){var v=m||[],_=cn(v,2),b=_[0],y=b===void 0?0:b,C=_[1],E=C,x=E||t(),k=[y,x];return g?g(k):k})};w.useMemo(function(){u()},[l]);var d=s.get(a),h=d[1];return a5t(function(){r==null||r(h)},function(f){return u(function(g){var m=cn(g,2),v=m[0],_=m[1];return f&&v===0&&(r==null||r(h)),[v+1,_]}),function(){s.update(a,function(g){var m=g||[],v=cn(m,2),_=v[0],b=_===void 0?0:_,y=v[1],C=b-1;return C===0?(c(function(){return i==null?void 0:i(y,!1)}),null):[b-1,y]})}},[l]),h}var f5t={},p5t="css",hx=new Map;function g5t(n){hx.set(n,(hx.get(n)||0)+1)}function m5t(n,e){if(typeof document<"u"){var t=document.querySelectorAll("style[".concat($oe,'="').concat(n,'"]'));t.forEach(function(i){if(i[j2]===e){var r;(r=i.parentNode)===null||r===void 0||r.removeChild(i)}})}}var _5t=0;function v5t(n,e){hx.set(n,(hx.get(n)||0)-1);var t=Array.from(hx.keys()),i=t.filter(function(r){var o=hx.get(r)||0;return o<=0});t.length-i.length>_5t&&i.forEach(function(r){m5t(r,e),hx.delete(r)})}var b5t=function(e,t,i,r){var o=i.getDerivativeToken(e),s=pt(pt({},o),t);return r&&(s=r(s)),s};function y5t(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=w.useContext(s_e),r=i.cache.instanceId,o=t.salt,s=o===void 0?"":o,a=t.override,l=a===void 0?f5t:a,c=t.formatToken,u=t.getComputedToken,d=t5t(function(){return Object.assign.apply(Object,[{}].concat(no(e)))},e),h=QH(d),f=QH(l),g=RVe("token",[s,n.id,h,f],function(){var m=u?u(d,l,n):b5t(d,l,n,c),v=n5t(m,s);m._tokenKey=v,g5t(v);var _="".concat(p5t,"-").concat(o_e(v));return m._hashId=_,[m,_]},function(m){v5t(m[0]._tokenKey,r)});return g}var C5t={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},vIe="data-ant-cssinjs-cache-path",NVe="_FILE_STYLE__",aT,OVe=!0;function w5t(){if(!aT&&(aT={},Qf())){var n=document.createElement("div");n.className=vIe,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=cn(o,2),a=s[0],l=s[1];aT[a]=l});var t=document.querySelector("style[".concat(vIe,"]"));if(t){var i;OVe=!1,(i=t.parentNode)===null||i===void 0||i.removeChild(t)}document.body.removeChild(n)}}function S5t(n){return w5t(),!!aT[n]}function E5t(n){var e=aT[n],t=null;if(e&&Qf())if(OVe)t=NVe;else{var i=document.querySelector("style[".concat(sT,'="').concat(aT[n],'"]'));i?t=i.innerHTML:delete aT[n]}return[t,e]}var bIe=Qf(),x5t="_skip_check_",PVe="_multi_value_";function yIe(n){var e=rT(G9e(n),K9e);return e.replace(/\{%%%\:[^;];}/g,";")}function T5t(n){return Zr(n)==="object"&&n&&(x5t in n||PVe in n)}function k5t(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(no(l.slice(1))).join(" ")});return o.join(",")}var I5t=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="",f={};function g(y){var C=y.getName(a);if(!f[C]){var E=n(y.style,t,{root:!1,parentSelectors:s}),x=cn(E,1),k=x[0];f[C]="@keyframes ".concat(y.getName(a)).concat(k)}}function m(y){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(E){Array.isArray(E)?m(E,C):E&&C.push(E)}),C}var v=m(Array.isArray(e)?e:[e]);if(v.forEach(function(y){var C=typeof y=="string"&&!r?{}:y;if(typeof C=="string")h+="".concat(C,`
`);else if(C._keyframe)g(C);else{var E=d.reduce(function(x,k){var L;return(k==null||(L=k.visit)===null||L===void 0?void 0:L.call(k,x))||x},C);Object.keys(E).forEach(function(x){var k=E[x];if(Zr(k)==="object"&&k&&(x!=="animationName"||!k._keyframe)&&!T5t(k)){var L=!1,D=x.trim(),A=!1;(r||o)&&a?D.startsWith("@")?L=!0:D=k5t(x,a,c):r&&!a&&(D==="&"||D==="")&&(D="",A=!0);var N=n(k,t,{root:A,injectHash:L,parentSelectors:[].concat(no(s),[D])}),P=cn(N,2),M=P[0],B=P[1];f=pt(pt({},f),B),h+="".concat(D).concat(M)}else{let H=function(W,q){var V=W.replace(/[A-Z]/g,function(oe){return"-".concat(oe.toLowerCase())}),re=q;!C5t[W]&&typeof re=="number"&&re!==0&&(re="".concat(re,"px")),W==="animationName"&&q!==null&&q!==void 0&&q._keyframe&&(g(q),re=q.getName(a)),h+="".concat(V,":").concat(re,";")};var F,U=(F=k==null?void 0:k.value)!==null&&F!==void 0?F:k;Zr(k)==="object"&&k!==null&&k!==void 0&&k[PVe]&&Array.isArray(U)?U.forEach(function(W){H(x,W)}):H(x,U)}})}}),!r)h="{".concat(h,"}");else if(l&&r5t()){var _=l.split(","),b=_[_.length-1].trim();h="@layer ".concat(b," {").concat(h,"}"),_.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function L5t(n,e){return o_e("".concat(n.join("%")).concat(e))}function D5t(){return null}function Woe(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(s_e),d=u.autoClear;u.mock;var h=u.defaultCache,f=u.hashPriority,g=u.container,m=u.ssrInline,v=u.transformers,_=u.linters,b=u.cache,y=t._tokenKey,C=[y].concat(no(i)),E=bIe,x=RVe("style",C,function(){var N=C.join("|");if(S5t(N)){var P=E5t(N),M=cn(P,2),B=M[0],F=M[1];if(B)return[B,y,F,{},a,c]}var U=e(),H=I5t(U,{hashId:r,hashPriority:f,layer:o,path:i.join("-"),transformers:v,linters:_}),W=cn(H,2),q=W[0],V=W[1],re=yIe(q),oe=L5t(C,re);return[re,y,oe,V,a,c]},function(N,P){var M=cn(N,3),B=M[2];(P||d)&&bIe&&YH(B,{mark:sT})},function(N){var P=cn(N,4),M=P[0];P[1];var B=P[2],F=P[3];if(E&&M!==NVe){var U={mark:sT,prepend:"queue",attachTo:g,priority:c},H=typeof s=="function"?s():s;H&&(U.csp={nonce:H});var W=XD(M,B,U);W[j2]=b.instanceId,W.setAttribute($oe,y),Object.keys(F).forEach(function(q){XD(yIe(F[q]),"_effect-".concat(q),U)})}}),k=cn(x,3),L=k[0],D=k[1],A=k[2];return function(N){var P;if(!m||E||!h)P=w.createElement(D5t,null);else{var M;P=w.createElement("style",Tt({},(M={},it(M,$oe,D),it(M,sT,A),M),{dangerouslySetInnerHTML:{__html:L}}))}return w.createElement(w.Fragment,null,P,N)}}var gh=function(){function n(e,t){El(this,n),it(this,"name",void 0),it(this,"style",void 0),it(this,"_keyframe",!0),this.name=e,this.style=t}return xl(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 $I(n){return n.notSplit=!0,n}$I(["borderTop","borderBottom"]),$I(["borderTop"]),$I(["borderBottom"]),$I(["borderLeft","borderRight"]),$I(["borderLeft"]),$I(["borderRight"]);var A5t=w.createContext({});const l_e=A5t;function J_(n,e){for(var t=n,i=0;i<e.length;i+=1){if(t==null)return;t=t[e[i]]}return t}function MVe(n,e,t,i){if(!e.length)return t;var r=J6e(e),o=r[0],s=r.slice(1),a;return!n&&typeof o=="number"?a=[]:Array.isArray(n)?a=no(n):a=pt({},n),i&&t===void 0&&s.length===1?delete a[o][s[0]]:a[o]=MVe(a[o],s,t,i),a}function L_(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&i&&t===void 0&&!J_(n,e.slice(0,-1))?n:MVe(n,e,t,i)}function R5t(n){return Zr(n)==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype}function CIe(n){return Array.isArray(n)?[]:{}}var N5t=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function q2(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=CIe(e[0]);return e.forEach(function(r){function o(s,a){var l=new Set(a),c=J_(r,s),u=Array.isArray(c);if(u||R5t(c)){if(!l.has(c)){l.add(c);var d=J_(i,s);u?i=L_(i,s,[]):(!d||Zr(d)!=="object")&&(i=L_(i,s,CIe(c))),N5t(c).forEach(function(h){o([].concat(no(s),[h]),l)})}}else i=L_(i,s,c)}o([])}),i}const O5t=w.createContext({}),P5t=w.createContext(void 0),M5t={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 F5t={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 B5t={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},FVe=B5t,$5t={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"]},F5t),timePickerLocale:Object.assign({},FVe)},XH=$5t,wp="${label} is not a valid ${type}",V5t={locale:"en",Pagination:M5t,DatePicker:XH,TimePicker:FVe,Calendar:XH,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:wp,method:wp,array:wp,object:wp,number:wp,date:wp,boolean:wp,integer:wp,float:wp,regexp:wp,email:wp,url:wp,hex:wp},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"}},ZD=V5t;Object.assign({},ZD.Modal);let T$=[];const wIe=()=>T$.reduce((n,e)=>Object.assign(Object.assign({},n),e),ZD.Modal);function H5t(n){if(n){const e=Object.assign({},n);return T$.push(e),wIe(),()=>{T$=T$.filter(t=>t!==e),wIe()}}Object.assign({},ZD.Modal)}const W5t=w.createContext(void 0),c_e=W5t,z5t=(n,e)=>{const t=w.useContext(c_e),i=w.useMemo(()=>{var o;const s=e||ZD[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?ZD.locale:o},[t]);return[i,r]},BVe=z5t,U5t="internalMark",j5t=n=>{const{locale:e={},children:t,_ANT_MARK__:i}=n;w.useEffect(()=>H5t(e&&e.Modal),[e]);const r=w.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return w.createElement(c_e.Provider,{value:r},t)},q5t=j5t;function Ad(n,e){G5t(n)&&(n="100%");var t=K5t(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 R8(n){return Math.min(1,Math.max(0,n))}function G5t(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function K5t(n){return typeof n=="string"&&n.indexOf("%")!==-1}function $Ve(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function N8(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Mx(n){return n.length===1?"0"+n:String(n)}function Y5t(n,e,t){return{r:Ad(n,255)*255,g:Ad(e,255)*255,b:Ad(t,255)*255}}function SIe(n,e,t){n=Ad(n,255),e=Ad(e,255),t=Ad(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 mJ(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 Q5t(n,e,t){var i,r,o;if(n=Ad(n,360),e=Ad(e,100),t=Ad(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=mJ(a,s,n+1/3),r=mJ(a,s,n),o=mJ(a,s,n-1/3)}return{r:i*255,g:r*255,b:o*255}}function zoe(n,e,t){n=Ad(n,255),e=Ad(e,255),t=Ad(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 X5t(n,e,t){n=Ad(n,360)*6,e=Ad(e,100),t=Ad(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 Uoe(n,e,t,i){var r=[Mx(Math.round(n).toString(16)),Mx(Math.round(e).toString(16)),Mx(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 Z5t(n,e,t,i,r){var o=[Mx(Math.round(n).toString(16)),Mx(Math.round(e).toString(16)),Mx(Math.round(t).toString(16)),Mx(J5t(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 J5t(n){return Math.round(parseFloat(n)*255).toString(16)}function EIe(n){return kp(n)/255}function kp(n){return parseInt(n,16)}function eFt(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var joe={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 y2(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=iFt(n)),typeof n=="object"&&(U0(n.r)&&U0(n.g)&&U0(n.b)?(e=Y5t(n.r,n.g,n.b),s=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):U0(n.h)&&U0(n.s)&&U0(n.v)?(i=N8(n.s),r=N8(n.v),e=X5t(n.h,i,r),s=!0,a="hsv"):U0(n.h)&&U0(n.s)&&U0(n.l)&&(i=N8(n.s),o=N8(n.l),e=Q5t(n.h,i,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=$Ve(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 tFt="[-\\+]?\\d+%?",nFt="[-\\+]?\\d*\\.\\d+%?",XC="(?:".concat(nFt,")|(?:").concat(tFt,")"),_J="[\\s|\\(]+(".concat(XC,")[,|\\s]+(").concat(XC,")[,|\\s]+(").concat(XC,")\\s*\\)?"),vJ="[\\s|\\(]+(".concat(XC,")[,|\\s]+(").concat(XC,")[,|\\s]+(").concat(XC,")[,|\\s]+(").concat(XC,")\\s*\\)?"),__={CSS_UNIT:new RegExp(XC),rgb:new RegExp("rgb"+_J),rgba:new RegExp("rgba"+vJ),hsl:new RegExp("hsl"+_J),hsla:new RegExp("hsla"+vJ),hsv:new RegExp("hsv"+_J),hsva:new RegExp("hsva"+vJ),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 iFt(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(joe[n])n=joe[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=__.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=__.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=__.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=__.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=__.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=__.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=__.hex8.exec(n),t?{r:kp(t[1]),g:kp(t[2]),b:kp(t[3]),a:EIe(t[4]),format:e?"name":"hex8"}:(t=__.hex6.exec(n),t?{r:kp(t[1]),g:kp(t[2]),b:kp(t[3]),format:e?"name":"hex"}:(t=__.hex4.exec(n),t?{r:kp(t[1]+t[1]),g:kp(t[2]+t[2]),b:kp(t[3]+t[3]),a:EIe(t[4]+t[4]),format:e?"name":"hex8"}:(t=__.hex3.exec(n),t?{r:kp(t[1]+t[1]),g:kp(t[2]+t[2]),b:kp(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function U0(n){return!!__.CSS_UNIT.exec(String(n))}var Cd=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=eFt(e)),this.originalInput=e;var r=y2(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=$Ve(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=zoe(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=zoe(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=SIe(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=SIe(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),Uoe(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),Z5t(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(Ad(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(Ad(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="#"+Uoe(this.r,this.g,this.b,!1),t=0,i=Object.entries(joe);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=R8(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=R8(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=R8(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=R8(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}(),O8=2,xIe=.16,rFt=.05,oFt=.05,sFt=.15,VVe=5,HVe=4,aFt=[{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 TIe(n){var e=n.r,t=n.g,i=n.b,r=zoe(e,t,i);return{h:r.h*360,s:r.s,v:r.v}}function P8(n){var e=n.r,t=n.g,i=n.b;return"#".concat(Uoe(e,t,i,!1))}function lFt(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 kIe(n,e,t){var i;return Math.round(n.h)>=60&&Math.round(n.h)<=240?i=t?Math.round(n.h)-O8*e:Math.round(n.h)+O8*e:i=t?Math.round(n.h)+O8*e:Math.round(n.h)-O8*e,i<0?i+=360:i>=360&&(i-=360),i}function IIe(n,e,t){if(n.h===0&&n.s===0)return n.s;var i;return t?i=n.s-xIe*e:e===HVe?i=n.s+xIe:i=n.s+rFt*e,i>1&&(i=1),t&&e===VVe&&i>.1&&(i=.1),i<.06&&(i=.06),Number(i.toFixed(2))}function LIe(n,e,t){var i;return t?i=n.v+oFt*e:i=n.v-sFt*e,i>1&&(i=1),Number(i.toFixed(2))}function PT(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],i=y2(n),r=VVe;r>0;r-=1){var o=TIe(i),s=P8(y2({h:kIe(o,r,!0),s:IIe(o,r,!0),v:LIe(o,r,!0)}));t.push(s)}t.push(P8(i));for(var a=1;a<=HVe;a+=1){var l=TIe(i),c=P8(y2({h:kIe(l,a),s:IIe(l,a),v:LIe(l,a)}));t.push(c)}return e.theme==="dark"?aFt.map(function(u){var d=u.index,h=u.opacity,f=P8(lFt(y2(e.backgroundColor||"#141414"),y2(t[d]),h*100));return f}):t}var bJ={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"},k$={},yJ={};Object.keys(bJ).forEach(function(n){k$[n]=PT(bJ[n]),k$[n].primary=k$[n][5],yJ[n]=PT(bJ[n],{theme:"dark",backgroundColor:"#141414"}),yJ[n].primary=yJ[n][5]});var cFt=k$.blue;const uFt=n=>{const{controlHeight:e}=n;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}},dFt=uFt;function hFt(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 WVe={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"},fFt=Object.assign(Object.assign({},WVe),{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}),j4=fFt;function pFt(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),f=t(o),g=t(s),m=t(a),v=i(c,u),_=n.colorLink||n.colorInfo,b=t(_);return Object.assign(Object.assign({},v),{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:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[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 Cd("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const gFt=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}},mFt=gFt;function _Ft(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},mFt(i))}const j0=(n,e)=>new Cd(n).setAlpha(e).toRgbString(),sO=(n,e)=>new Cd(n).darken(e).toHexString(),vFt=n=>{const e=PT(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]}},bFt=(n,e)=>{const t=n||"#fff",i=e||"#000";return{colorBgBase:t,colorTextBase:i,colorText:j0(i,.88),colorTextSecondary:j0(i,.65),colorTextTertiary:j0(i,.45),colorTextQuaternary:j0(i,.25),colorFill:j0(i,.15),colorFillSecondary:j0(i,.06),colorFillTertiary:j0(i,.04),colorFillQuaternary:j0(i,.02),colorBgLayout:sO(t,4),colorBgContainer:sO(t,0),colorBgElevated:sO(t,0),colorBgSpotlight:j0(i,.85),colorBgBlur:"transparent",colorBorder:sO(t,15),colorBorderSecondary:sO(t,6)}};function yFt(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 CFt=n=>{const e=yFt(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]}},wFt=CFt;function SFt(n){const e=Object.keys(WVe).map(t=>{const i=PT(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),pFt(n,{generateColorPalettes:vFt,generateNeutralColorPalettes:bFt})),wFt(n.fontSize)),hFt(n)),dFt(n)),_Ft(n))}const zVe=Hoe(SFt),UVe={token:j4,override:{override:j4},hashed:!0},jVe=ce.createContext(UVe),qVe="anticon",EFt=(n,e)=>e||(n?`ant-${n}`:"ant"),Ym=w.createContext({getPrefixCls:EFt,iconPrefixCls:qVe}),xFt=`-ant-${Date.now()}-${Math.random()}`;function TFt(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 Cd(s),c=PT(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 Cd(e.primaryColor),a=PT(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 Cd(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 kFt(n,e){const t=TFt(n,e);Qf()&&XD(t,`${xFt}-dynamic-theme`)}const qoe=w.createContext(!1),IFt=n=>{let{children:e,disabled:t}=n;const i=w.useContext(qoe);return w.createElement(qoe.Provider,{value:t??i},e)},Uq=qoe,Goe=w.createContext(void 0),LFt=n=>{let{children:e,size:t}=n;const i=w.useContext(Goe);return w.createElement(Goe.Provider,{value:t||i},e)},jq=Goe;function DFt(){const n=w.useContext(Uq),e=w.useContext(jq);return{componentDisabled:n,componentSize:e}}const AFt="5.10.3";function CJ(n){return n>=0&&n<=255}function M8(n,e){const{r:t,g:i,b:r,a:o}=new Cd(n).toRgb();if(o<1)return n;const{r:s,g:a,b:l}=new Cd(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(CJ(u)&&CJ(d)&&CJ(h))return new Cd({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new Cd({r:t,g:i,b:r,a:1}).toRgbString()}var RFt=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 GVe(n){const{override:e}=n,t=RFt(n,["override"]),i=Object.assign({},e);Object.keys(j4).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:M8(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:M8(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:M8(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:M8(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 Cd("rgba(0, 0, 0, 0.16)").toRgbString()},
0 3px 6px 0 ${new Cd("rgba(0, 0, 0, 0.12)").toRgbString()},
0 5px 12px 4px ${new Cd("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 DIe=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 KVe=(n,e,t)=>{const i=t.getDerivativeToken(n),{override:r}=e,o=DIe(e,["override"]);let s=Object.assign(Object.assign({},i),{override:r});return s=GVe(s),o&&Object.entries(o).forEach(a=>{let[l,c]=a;const{theme:u}=c,d=DIe(c,["theme"]);let h=d;u&&(h=KVe(Object.assign(Object.assign({},s),d),{override:d},u)),s[l]=h}),s};function VF(){const{token:n,hashed:e,theme:t,override:i}=ce.useContext(jVe),r=`${AFt}-${e||""}`,o=t||zVe,[s,a]=y5t(o,[j4,n],{salt:r,override:i,getComputedToken:KVe,formatToken:GVe});return[o,s,e?a:""]}function B_(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 VL(n){var e=w.useRef(!1),t=w.useState(n),i=cn(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 wJ(n){return n!==void 0}function wm(n,e){var t=e||{},i=t.defaultValue,r=t.value,o=t.onChange,s=t.postState,a=VL(function(){return wJ(r)?r:wJ(i)?typeof i=="function"?i():i:typeof n=="function"?n():n}),l=cn(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,h=s?s(d):d,f=B_(o),g=VL([d]),m=cn(g,2),v=m[0],_=m[1];mIe(function(){var y=v[0];c!==y&&f(c,y)},[v]),mIe(function(){wJ(r)||u(r)},[r]);var b=B_(function(y,C){u(y,C),_([d],C)});return[h,b]}const NFt=(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,f=d,g=2*o-l,m=c,v=2*o-s,_=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} ${f} L ${g} ${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"}}},OFt={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},q4=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}},PFt=()=>({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"}}),MFt=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),FFt=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"}}}),BFt=(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"}}}}},$Ft=n=>({outline:`${n.lineWidthFocus}px solid ${n.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),VFt=n=>({"&:focus-visible":Object.assign({},$Ft(n))}),YVe=typeof CSSINJS_STATISTIC<"u";let Koe=!0;function Gh(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];if(!YVe)return Object.assign.apply(Object,[{}].concat(e));Koe=!1;const i={};return e.forEach(r=>{Object.keys(r).forEach(s=>{Object.defineProperty(i,s,{configurable:!0,enumerable:!0,get:()=>r[s]})})}),Koe=!0,i}const AIe={};function HFt(){}function WFt(n){let e,t=n,i=HFt;return YVe&&(e=new Set,t=new Proxy(n,{get(r,o){return Koe&&e.add(o),r[o]}}),i=(r,o)=>{var s;AIe[r]={global:Array.from(e),component:Object.assign(Object.assign({},(s=AIe[r])===null||s===void 0?void 0:s.component),o)}}),{token:t,keys:e,flush:i}}const zFt=(n,e)=>{const[t,i]=VF();return Woe({theme:t,token:i,hashId:"",path:["ant-design-icons",n],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${n}`]:Object.assign(Object.assign({},PFt()),{[`.${n} .${n}-icon`]:{display:"block"}})}])},QVe=zFt;function AR(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]=VF(),{getPrefixCls:d,iconPrefixCls:h,csp:f}=w.useContext(Ym),g=d(),m={theme:l,token:c,hashId:u,nonce:()=>f==null?void 0:f.nonce,clientOnly:i.clientOnly,order:i.order||-999};return Woe(Object.assign(Object.assign({},m),{clientOnly:!1,path:["Shared",g]}),()=>[{"&":FFt(c)}]),QVe(h,f),[Woe(Object.assign(Object.assign({},m),{path:[s,a,h]}),()=>{const{token:v,flush:_}=WFt(c),b=Object.assign({},c[o]);if(i.deprecatedTokens){const{deprecatedTokens:L}=i;L.forEach(D=>{let[A,N]=D;var P;(b!=null&&b[A]||b!=null&&b[N])&&((P=b[N])!==null&&P!==void 0||(b[N]=b==null?void 0:b[A]))})}const y=typeof t=="function"?t(Gh(v,b??{})):t,C=Object.assign(Object.assign({},y),b),E=`.${a}`,x=Gh(v,{componentCls:E,prefixCls:a,iconCls:`.${h}`,antCls:`.${g}`},C),k=e(x,{hashId:u,prefixCls:a,rootPrefixCls:g,iconPrefixCls:h,overrideComponentToken:b});return _(o,C),[i.resetStyle===!1?null:BFt(c,a),k]}),u]}}const UFt=(n,e,t,i)=>{const r=AR(n,e,t,Object.assign({resetStyle:!1,order:-998},i));return s=>{let{prefixCls:a}=s;return r(a),null}};function jFt(n,e){const t=n||{},i=t.inherit===!1||!e?UVe:e;return BF(()=>{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!KH(s,l,!0)}))}var qFt=["children"],XVe=w.createContext({});function GFt(n){var e=n.children,t=Ku(n,qFt);return w.createElement(XVe.Provider,{value:t},e)}var KFt=function(n){Tv(t,n);var e=Rk(t);function t(){return El(this,t),e.apply(this,arguments)}return xl(t,[{key:"render",value:function(){return this.props.children}}]),t}(w.Component),ZE="none",F8="appear",B8="enter",$8="leave",RIe="none",D_="prepare",G2="start",K2="active",u_e="end",ZVe="prepared";function NIe(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 YFt(n,e){var t={animationend:NIe("Animation","AnimationEnd"),transitionend:NIe("Transition","TransitionEnd")};return n&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var QFt=YFt(Qf(),typeof window<"u"?window:{}),JVe={};if(Qf()){var XFt=document.createElement("div");JVe=XFt.style}var V8={};function eHe(n){if(V8[n])return V8[n];var e=QFt[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 JVe)return V8[n]=e[o],V8[n]}return""}var tHe=eHe("animationend"),nHe=eHe("transitionend"),iHe=!!(tHe&&nHe),OIe=tHe||"animationend",PIe=nHe||"transitionend";function MIe(n,e){if(!n)return null;if(Zr(n)==="object"){var t=e.replace(/-\w/g,function(i){return i[1].toUpperCase()});return n[t]}return"".concat(n,"-").concat(e)}const ZFt=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(PIe,i),s.removeEventListener(OIe,i))}function o(s){e.current&&e.current!==s&&r(e.current),s&&s!==e.current&&(s.addEventListener(PIe,i),s.addEventListener(OIe,i),e.current=s)}return w.useEffect(function(){return function(){r(e.current)}},[]),[o,r]};var rHe=Qf()?w.useLayoutEffect:w.useEffect;const JFt=function(){var n=w.useRef(null);function e(){Yf.cancel(n.current)}function t(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var o=Yf(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 e6t=[D_,G2,K2,u_e],t6t=[D_,ZVe],oHe=!1,n6t=!0;function sHe(n){return n===K2||n===u_e}const i6t=function(n,e,t){var i=VL(RIe),r=cn(i,2),o=r[0],s=r[1],a=JFt(),l=cn(a,2),c=l[0],u=l[1];function d(){s(D_,!0)}var h=e?t6t:e6t;return rHe(function(){if(o!==RIe&&o!==u_e){var f=h.indexOf(o),g=h[f+1],m=t(o);m===oHe?s(g,!0):g&&c(function(v){function _(){v.isCanceled()||s(g,!0)}m===!0?_():Promise.resolve(m).then(_)})}},[n,o]),w.useEffect(function(){return function(){u()}},[]),[d,o]};function r6t(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,f=i.onEnterPrepare,g=i.onLeavePrepare,m=i.onAppearStart,v=i.onEnterStart,_=i.onLeaveStart,b=i.onAppearActive,y=i.onEnterActive,C=i.onLeaveActive,E=i.onAppearEnd,x=i.onEnterEnd,k=i.onLeaveEnd,L=i.onVisibleChanged,D=VL(),A=cn(D,2),N=A[0],P=A[1],M=VL(ZE),B=cn(M,2),F=B[0],U=B[1],H=VL(null),W=cn(H,2),q=W[0],V=W[1],re=w.useRef(!1),oe=w.useRef(null);function Q(){return t()}var Ne=w.useRef(!1);function Ve(){U(ZE,!0),V(null,!0)}function Ye(Lt){var be=Q();if(!(Lt&&!Lt.deadline&&Lt.target!==be)){var Te=Ne.current,se;F===F8&&Te?se=E==null?void 0:E(be,Lt):F===B8&&Te?se=x==null?void 0:x(be,Lt):F===$8&&Te&&(se=k==null?void 0:k(be,Lt)),F!==ZE&&Te&&se!==!1&&Ve()}}var ye=ZFt(Ye),He=cn(ye,1),Pe=He[0],Ge=function(be){var Te,se,Y;switch(be){case F8:return Te={},it(Te,D_,h),it(Te,G2,m),it(Te,K2,b),Te;case B8:return se={},it(se,D_,f),it(se,G2,v),it(se,K2,y),se;case $8:return Y={},it(Y,D_,g),it(Y,G2,_),it(Y,K2,C),Y;default:return{}}},Fe=w.useMemo(function(){return Ge(F)},[F]),bt=i6t(F,!n,function(Lt){if(Lt===D_){var be=Fe[D_];return be?be(Q()):oHe}if(Yt in Fe){var Te;V(((Te=Fe[Yt])===null||Te===void 0?void 0:Te.call(Fe,Q(),null))||null)}return Yt===K2&&(Pe(Q()),u>0&&(clearTimeout(oe.current),oe.current=setTimeout(function(){Ye({deadline:!0})},u))),Yt===ZVe&&Ve(),n6t}),Mt=cn(bt,2),Ft=Mt[0],Yt=Mt[1],ln=sHe(Yt);Ne.current=ln,rHe(function(){P(e);var Lt=re.current;re.current=!0;var be;!Lt&&e&&a&&(be=F8),Lt&&e&&o&&(be=B8),(Lt&&!e&&c||!Lt&&d&&!e&&c)&&(be=$8);var Te=Ge(be);be&&(n||Te[D_])?(U(be),Ft()):U(ZE)},[e]),w.useEffect(function(){(F===F8&&!a||F===B8&&!o||F===$8&&!c)&&U(ZE)},[a,o,c]),w.useEffect(function(){return function(){re.current=!1,clearTimeout(oe.current)}},[]);var Et=w.useRef(!1);w.useEffect(function(){N&&(Et.current=!0),N!==void 0&&F===ZE&&((Et.current||N)&&(L==null||L(N)),Et.current=!0)},[N,F]);var mt=q;return Fe[D_]&&Yt===G2&&(mt=pt({transition:"none"},mt)),[F,Yt,mt,N??e]}function o6t(n){var e=n;Zr(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,f=r.leavedClassName,g=r.eventProps,m=w.useContext(XVe),v=m.motion,_=t(r,v),b=w.useRef(),y=w.useRef();function C(){try{return b.current instanceof HTMLElement?b.current:x$(y.current)}catch{return null}}var E=r6t(_,a,C,r),x=cn(E,4),k=x[0],L=x[1],D=x[2],A=x[3],N=w.useRef(A);A&&(N.current=!0);var P=w.useCallback(function(V){b.current=V,t_e(o,V)},[o]),M,B=pt(pt({},g),{},{visible:a});if(!d)M=null;else if(k===ZE)A?M=d(pt({},B),P):!c&&N.current&&f?M=d(pt(pt({},B),{},{className:f}),P):u||!c&&!f?M=d(pt(pt({},B),{},{style:{display:"none"}}),P):M=null;else{var F,U;L===D_?U="prepare":sHe(L)?U="active":L===G2&&(U="start");var H=MIe(h,"".concat(k,"-").concat(U));M=d(pt(pt({},B),{},{className:zt(MIe(h,k),(F={},it(F,H,H&&U),it(F,h,typeof h=="string"),F)),style:D}),P)}if(w.isValidElement(M)&&$F(M)){var W=M,q=W.ref;q||(M=w.cloneElement(M,{ref:P}))}return w.createElement(KFt,{ref:y},M)});return i.displayName="CSSMotion",i}const HF=o6t(iHe);var Yoe="add",Qoe="keep",Xoe="remove",SJ="removed";function s6t(n){var e;return n&&Zr(n)==="object"&&"key"in n?e=n:e={key:n},pt(pt({},e),{},{key:String(e.key)})}function Zoe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return n.map(s6t)}function a6t(){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=Zoe(n),s=Zoe(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(f){return pt(pt({},f),{},{status:Yoe})})),i=d),t.push(pt(pt({},h),{},{status:Qoe})),i+=1,u=!0;break}}u||t.push(pt(pt({},c),{},{status:Xoe}))}),i<r&&(t=t.concat(s.slice(i).map(function(c){return pt(pt({},c),{},{status:Yoe})})));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!==Xoe}),t.forEach(function(u){u.key===c&&(u.status=Qoe)})}),t}var l6t=["component","children","onVisibleChanged","onAllRemoved"],c6t=["status"],u6t=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function d6t(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:HF,t=function(i){Tv(o,i);var r=Rk(o);function o(){var s;El(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)),it(Xr(s),"state",{keyEntities:[]}),it(Xr(s),"removeKey",function(u){var d=s.state.keyEntities,h=d.map(function(f){return f.key!==u?f:pt(pt({},f),{},{status:SJ})});return s.setState({keyEntities:h}),h.filter(function(f){var g=f.status;return g!==SJ}).length}),s}return xl(o,[{key:"render",value:function(){var a=this,l=this.state.keyEntities,c=this.props,u=c.component,d=c.children,h=c.onVisibleChanged,f=c.onAllRemoved,g=Ku(c,l6t),m=u||w.Fragment,v={};return u6t.forEach(function(_){v[_]=g[_],delete g[_]}),delete g.keys,w.createElement(m,g,l.map(function(_,b){var y=_.status,C=Ku(_,c6t),E=y===Yoe||y===Qoe;return w.createElement(e,Tt({},v,{key:C.key,visible:E,eventProps:C,onVisibleChanged:function(k){if(h==null||h(k,{key:C.key}),!k){var L=a.removeKey(C.key);L===0&&f&&f()}}}),function(x,k){return d(pt(pt({},x),{},{index:b}),k)})}))}}],[{key:"getDerivedStateFromProps",value:function(a,l){var c=a.keys,u=l.keyEntities,d=Zoe(c),h=a6t(u,d);return{keyEntities:h.filter(function(f){var g=u.find(function(m){var v=m.key;return f.key===v});return!(g&&g.status===SJ&&f.status===Xoe)})}}}]),o}(w.Component);return it(t,"defaultProps",{component:"div"}),t}d6t(iHe);function h6t(n){const{children:e}=n,[,t]=VF(),{motion:i}=t,r=w.useRef(!1);return r.current=r.current||i===!1,r.current?w.createElement(GFt,{motion:i},e):e}const f6t=()=>null;var p6t=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 g6t=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form","select","button"],m6t="ant";let aHe;function _6t(){return aHe||m6t}function v6t(n){return Object.keys(n).some(e=>e.endsWith("Color"))}const b6t=n=>{let{prefixCls:e,iconPrefixCls:t,theme:i}=n;e!==void 0&&(aHe=e),i&&v6t(i)&&kFt(_6t(),i)},y6t=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:f,popupOverflow:g,legacyLocale:m,parentContext:v,iconPrefixCls:_,theme:b,componentDisabled:y,segmented:C,statistic:E,spin:x,calendar:k,carousel:L,cascader:D,collapse:A,typography:N,checkbox:P,descriptions:M,divider:B,drawer:F,skeleton:U,steps:H,image:W,layout:q,list:V,mentions:re,modal:oe,progress:Q,result:Ne,slider:Ve,breadcrumb:Ye,menu:ye,pagination:He,input:Pe,empty:Ge,badge:Fe,radio:bt,rate:Mt,switch:Ft,transfer:Yt,avatar:ln,message:Et,tag:mt,table:Lt,card:be,tabs:Te,timeline:se,timePicker:Y,upload:X,notification:le,tree:te,colorPicker:me,datePicker:Me,flex:rt,wave:It,warning:Qt}=n,pe=w.useCallback((Cn,hn)=>{const{prefixCls:bn}=n;if(hn)return hn;const Wn=bn||v.getPrefixCls("");return Cn?`${Wn}-${Cn}`:Wn},[v.getPrefixCls,n.prefixCls]),We=_||v.iconPrefixCls||qVe,ne=t||v.csp;QVe(We,ne);const Se=jFt(b,v.theme),Ie={csp:ne,autoInsertSpaceInButton:i,alert:r,anchor:o,locale:a||m,direction:c,space:u,virtual:d,popupMatchSelectWidth:f??h,popupOverflow:g,getPrefixCls:pe,iconPrefixCls:We,theme:Se,segmented:C,statistic:E,spin:x,calendar:k,carousel:L,cascader:D,collapse:A,typography:N,checkbox:P,descriptions:M,divider:B,drawer:F,skeleton:U,steps:H,image:W,input:Pe,layout:q,list:V,mentions:re,modal:oe,progress:Q,result:Ne,slider:Ve,breadcrumb:Ye,menu:ye,pagination:He,empty:Ge,badge:Fe,radio:bt,rate:Mt,switch:Ft,transfer:Yt,avatar:ln,message:Et,tag:mt,table:Lt,card:be,tabs:Te,timeline:se,timePicker:Y,upload:X,notification:le,tree:te,colorPicker:me,datePicker:Me,flex:rt,wave:It,warning:Qt},Ke=Object.assign({},v);Object.keys(Ie).forEach(Cn=>{Ie[Cn]!==void 0&&(Ke[Cn]=Ie[Cn])}),g6t.forEach(Cn=>{const hn=n[Cn];hn&&(Ke[Cn]=hn)});const Je=BF(()=>Ke,Ke,(Cn,hn)=>{const bn=Object.keys(Cn),Wn=Object.keys(hn);return bn.length!==Wn.length||bn.some(Ei=>Cn[Ei]!==hn[Ei])}),ot=w.useMemo(()=>({prefixCls:We,csp:ne}),[We,ne]);let wt=w.createElement(w.Fragment,null,w.createElement(f6t,{dropdownMatchSelectWidth:h}),e);const pn=w.useMemo(()=>{var Cn,hn,bn,Wn;return q2(((Cn=ZD.Form)===null||Cn===void 0?void 0:Cn.defaultValidateMessages)||{},((bn=(hn=Je.locale)===null||hn===void 0?void 0:hn.Form)===null||bn===void 0?void 0:bn.defaultValidateMessages)||{},((Wn=Je.form)===null||Wn===void 0?void 0:Wn.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[Je,s==null?void 0:s.validateMessages]);Object.keys(pn).length>0&&(wt=w.createElement(P5t.Provider,{value:pn},wt)),a&&(wt=w.createElement(q5t,{locale:a,_ANT_MARK__:U5t},wt)),(We||ne)&&(wt=w.createElement(l_e.Provider,{value:ot},wt)),l&&(wt=w.createElement(LFt,{size:l},wt)),wt=w.createElement(h6t,null,wt);const Kn=w.useMemo(()=>{const Cn=Se||{},{algorithm:hn,token:bn,components:Wn}=Cn,Ei=p6t(Cn,["algorithm","token","components"]),er=hn&&(!Array.isArray(hn)||hn.length>0)?Hoe(hn):zVe,ur={};Object.entries(Wn||{}).forEach($i=>{let[xs,wr]=$i;const Ji=Object.assign({},wr);"algorithm"in Ji&&(Ji.algorithm===!0?Ji.theme=er:(Array.isArray(Ji.algorithm)||typeof Ji.algorithm=="function")&&(Ji.theme=Hoe(Ji.algorithm)),delete Ji.algorithm),ur[xs]=Ji});const Jr=Object.assign(Object.assign({},j4),bn);return Object.assign(Object.assign({},Ei),{theme:er,token:Jr,components:ur,override:Object.assign({override:Jr},ur)})},[Se]);return b&&(wt=w.createElement(jVe.Provider,{value:Kn},wt)),Je.warning&&(wt=w.createElement(O5t.Provider,{value:Je.warning},wt)),y!==void 0&&(wt=w.createElement(IFt,{disabled:y},wt)),w.createElement(Ym.Provider,{value:Je},wt)},RR=n=>{const e=w.useContext(Ym),t=w.useContext(c_e);return w.createElement(y6t,Object.assign({parentContext:e,legacyLocale:t},n))};RR.ConfigContext=Ym;RR.SizeContext=jq;RR.config=b6t;RR.useConfig=DFt;Object.defineProperty(RR,"SizeContext",{get:()=>jq});const d_e=RR;function lHe(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}function C6t(n){return lHe(n)instanceof ShadowRoot}function ZH(n){return C6t(n)?lHe(n):null}function w6t(n){return n.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function S6t(n,e){Dd(n,"[@ant-design/icons] ".concat(e))}function FIe(n){return Zr(n)==="object"&&typeof n.name=="string"&&typeof n.theme=="string"&&(Zr(n.icon)==="object"||typeof n.icon=="function")}function BIe(){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[w6t(t)]=i}return e},{})}function Joe(n,e,t){return t?ce.createElement(n.tag,pt(pt({key:e},BIe(n.attrs)),t),(n.children||[]).map(function(i,r){return Joe(i,"".concat(e,"-").concat(n.tag,"-").concat(r))})):ce.createElement(n.tag,pt({key:e},BIe(n.attrs)),(n.children||[]).map(function(i,r){return Joe(i,"".concat(e,"-").concat(n.tag,"-").concat(r))}))}function cHe(n){return PT(n)[0]}function uHe(n){return n?Array.isArray(n)?n:[n]:[]}var E6t=`
.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);
}
}
`,x6t=function(e){var t=w.useContext(l_e),i=t.csp,r=t.prefixCls,o=E6t;r&&(o=o.replace(/anticon/g,r)),w.useEffect(function(){var s=e.current,a=ZH(s);XD(o,"@ant-design-icons",{prepend:!0,csp:i,attachTo:a})},[])},T6t=["icon","className","onClick","style","primaryColor","secondaryColor"],rM={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function k6t(n){var e=n.primaryColor,t=n.secondaryColor;rM.primaryColor=e,rM.secondaryColor=t||cHe(e),rM.calculated=!!t}function I6t(){return pt({},rM)}var qq=function(e){var t=e.icon,i=e.className,r=e.onClick,o=e.style,s=e.primaryColor,a=e.secondaryColor,l=Ku(e,T6t),c=w.useRef(),u=rM;if(s&&(u={primaryColor:s,secondaryColor:a||cHe(s)}),x6t(c),S6t(FIe(t),"icon should be icon definiton, but got ".concat(t)),!FIe(t))return null;var d=t;return d&&typeof d.icon=="function"&&(d=pt(pt({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),Joe(d.icon,"svg-".concat(d.name),pt(pt({className:i,onClick:r,style:o,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};qq.displayName="IconReact";qq.getTwoToneColors=I6t;qq.setTwoToneColors=k6t;const h_e=qq;function dHe(n){var e=uHe(n),t=cn(e,2),i=t[0],r=t[1];return h_e.setTwoToneColors({primaryColor:i,secondaryColor:r})}function L6t(){var n=h_e.getTwoToneColors();return n.calculated?[n.primaryColor,n.secondaryColor]:n.primaryColor}var D6t=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];dHe(cFt.primary);var Gq=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=Ku(n,D6t),d=w.useContext(l_e),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,m=zt(g,f,(t={},it(t,"".concat(f,"-").concat(r.name),!!r.name),it(t,"".concat(f,"-spin"),!!o||r.name==="loading"),t),i),v=a;v===void 0&&l&&(v=-1);var _=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,b=uHe(c),y=cn(b,2),C=y[0],E=y[1];return w.createElement("span",Tt({role:"img","aria-label":r.name},u,{ref:e,tabIndex:v,onClick:l,className:m}),w.createElement(h_e,{icon:r,primaryColor:C,secondaryColor:E,style:_}))});Gq.displayName="AntdIcon";Gq.getTwoToneColor=L6t;Gq.setTwoToneColor=dHe;const WF=Gq;var A6t={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 R6t=A6t;var N6t=function(e,t){return w.createElement(WF,Tt({},e,{ref:t,icon:R6t}))};const hHe=w.forwardRef(N6t);var O6t=`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`,P6t=`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`,M6t="".concat(O6t," ").concat(P6t).split(/[\s\n]+/),F6t="aria-",B6t="data-";function $Ie(n,e){return n.indexOf(e)===0}function fHe(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=pt({},e);var i={};return Object.keys(n).forEach(function(r){(t.aria&&(r==="role"||$Ie(r,F6t))||t.data&&$Ie(r,B6t)||t.attr&&M6t.includes(r))&&(i[r]=n[r])}),i}const{isValidElement:pHe}=Lm;function $6t(n){return n&&pHe(n)&&n.type===w.Fragment}function V6t(n,e,t){return pHe(n)?w.cloneElement(n,typeof t=="function"?t(n.props||{}):t):e}function gHe(n,e){return V6t(n,n,e)}var ii={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>=ii.F1&&t<=ii.F12)return!1;switch(t){case ii.ALT:case ii.CAPS_LOCK:case ii.CONTEXT_MENU:case ii.CTRL:case ii.DOWN:case ii.END:case ii.ESC:case ii.HOME:case ii.INSERT:case ii.LEFT:case ii.MAC_FF_META:case ii.META:case ii.NUMLOCK:case ii.NUM_CENTER:case ii.PAGE_DOWN:case ii.PAGE_UP:case ii.PAUSE:case ii.PRINT_SCREEN:case ii.RIGHT:case ii.SHIFT:case ii.UP:case ii.WIN_KEY:case ii.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=ii.ZERO&&e<=ii.NINE||e>=ii.NUM_ZERO&&e<=ii.NUM_MULTIPLY||e>=ii.A&&e<=ii.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case ii.SPACE:case ii.QUESTION_MARK:case ii.NUM_PLUS:case ii.NUM_MINUS:case ii.NUM_PERIOD:case ii.NUM_DIVISION:case ii.SEMICOLON:case ii.DASH:case ii.EQUALS:case ii.COMMA:case ii.PERIOD:case ii.SLASH:case ii.APOSTROPHE:case ii.SINGLE_QUOTE:case ii.OPEN_SQUARE_BRACKET:case ii.BACKSLASH:case ii.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},H6t={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 W6t=H6t;var z6t=function(e,t){return w.createElement(WF,Tt({},e,{ref:t,icon:W6t}))};const U6t=w.forwardRef(z6t);function Kh(){Kh=function(){return e};var n,e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(U,H,W){U[H]=W.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(U,H,W){return Object.defineProperty(U,H,{value:W,enumerable:!0,configurable:!0,writable:!0}),U[H]}try{c({},"")}catch{c=function(W,q,V){return W[q]=V}}function u(U,H,W,q){var V=H&&H.prototype instanceof _?H:_,re=Object.create(V.prototype),oe=new B(q||[]);return r(re,"_invoke",{value:A(U,W,oe)}),re}function d(U,H,W){try{return{type:"normal",arg:U.call(H,W)}}catch(q){return{type:"throw",arg:q}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function _(){}function b(){}function y(){}var C={};c(C,s,function(){return this});var E=Object.getPrototypeOf,x=E&&E(E(F([])));x&&x!==t&&i.call(x,s)&&(C=x);var k=y.prototype=_.prototype=Object.create(C);function L(U){["next","throw","return"].forEach(function(H){c(U,H,function(W){return this._invoke(H,W)})})}function D(U,H){function W(V,re,oe,Q){var Ne=d(U[V],U,re);if(Ne.type!=="throw"){var Ve=Ne.arg,Ye=Ve.value;return Ye&&Zr(Ye)=="object"&&i.call(Ye,"__await")?H.resolve(Ye.__await).then(function(ye){W("next",ye,oe,Q)},function(ye){W("throw",ye,oe,Q)}):H.resolve(Ye).then(function(ye){Ve.value=ye,oe(Ve)},function(ye){return W("throw",ye,oe,Q)})}Q(Ne.arg)}var q;r(this,"_invoke",{value:function(re,oe){function Q(){return new H(function(Ne,Ve){W(re,oe,Ne,Ve)})}return q=q?q.then(Q,Q):Q()}})}function A(U,H,W){var q=h;return function(V,re){if(q===g)throw new Error("Generator is already running");if(q===m){if(V==="throw")throw re;return{value:n,done:!0}}for(W.method=V,W.arg=re;;){var oe=W.delegate;if(oe){var Q=N(oe,W);if(Q){if(Q===v)continue;return Q}}if(W.method==="next")W.sent=W._sent=W.arg;else if(W.method==="throw"){if(q===h)throw q=m,W.arg;W.dispatchException(W.arg)}else W.method==="return"&&W.abrupt("return",W.arg);q=g;var Ne=d(U,H,W);if(Ne.type==="normal"){if(q=W.done?m:f,Ne.arg===v)continue;return{value:Ne.arg,done:W.done}}Ne.type==="throw"&&(q=m,W.method="throw",W.arg=Ne.arg)}}}function N(U,H){var W=H.method,q=U.iterator[W];if(q===n)return H.delegate=null,W==="throw"&&U.iterator.return&&(H.method="return",H.arg=n,N(U,H),H.method==="throw")||W!=="return"&&(H.method="throw",H.arg=new TypeError("The iterator does not provide a '"+W+"' method")),v;var V=d(q,U.iterator,H.arg);if(V.type==="throw")return H.method="throw",H.arg=V.arg,H.delegate=null,v;var re=V.arg;return re?re.done?(H[U.resultName]=re.value,H.next=U.nextLoc,H.method!=="return"&&(H.method="next",H.arg=n),H.delegate=null,v):re:(H.method="throw",H.arg=new TypeError("iterator result is not an object"),H.delegate=null,v)}function P(U){var H={tryLoc:U[0]};1 in U&&(H.catchLoc=U[1]),2 in U&&(H.finallyLoc=U[2],H.afterLoc=U[3]),this.tryEntries.push(H)}function M(U){var H=U.completion||{};H.type="normal",delete H.arg,U.completion=H}function B(U){this.tryEntries=[{tryLoc:"root"}],U.forEach(P,this),this.reset(!0)}function F(U){if(U||U===""){var H=U[s];if(H)return H.call(U);if(typeof U.next=="function")return U;if(!isNaN(U.length)){var W=-1,q=function V(){for(;++W<U.length;)if(i.call(U,W))return V.value=U[W],V.done=!1,V;return V.value=n,V.done=!0,V};return q.next=q}}throw new TypeError(Zr(U)+" is not iterable")}return b.prototype=y,r(k,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:b,configurable:!0}),b.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(U){var H=typeof U=="function"&&U.constructor;return!!H&&(H===b||(H.displayName||H.name)==="GeneratorFunction")},e.mark=function(U){return Object.setPrototypeOf?Object.setPrototypeOf(U,y):(U.__proto__=y,c(U,l,"GeneratorFunction")),U.prototype=Object.create(k),U},e.awrap=function(U){return{__await:U}},L(D.prototype),c(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(U,H,W,q,V){V===void 0&&(V=Promise);var re=new D(u(U,H,W,q),V);return e.isGeneratorFunction(H)?re:re.next().then(function(oe){return oe.done?oe.value:re.next()})},L(k),c(k,l,"Generator"),c(k,s,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(U){var H=Object(U),W=[];for(var q in H)W.push(q);return W.reverse(),function V(){for(;W.length;){var re=W.pop();if(re in H)return V.value=re,V.done=!1,V}return V.done=!0,V}},e.values=F,B.prototype={constructor:B,reset:function(H){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(M),!H)for(var W in this)W.charAt(0)==="t"&&i.call(this,W)&&!isNaN(+W.slice(1))&&(this[W]=n)},stop:function(){this.done=!0;var H=this.tryEntries[0].completion;if(H.type==="throw")throw H.arg;return this.rval},dispatchException:function(H){if(this.done)throw H;var W=this;function q(Ve,Ye){return oe.type="throw",oe.arg=H,W.next=Ve,Ye&&(W.method="next",W.arg=n),!!Ye}for(var V=this.tryEntries.length-1;V>=0;--V){var re=this.tryEntries[V],oe=re.completion;if(re.tryLoc==="root")return q("end");if(re.tryLoc<=this.prev){var Q=i.call(re,"catchLoc"),Ne=i.call(re,"finallyLoc");if(Q&&Ne){if(this.prev<re.catchLoc)return q(re.catchLoc,!0);if(this.prev<re.finallyLoc)return q(re.finallyLoc)}else if(Q){if(this.prev<re.catchLoc)return q(re.catchLoc,!0)}else{if(!Ne)throw new Error("try statement without catch or finally");if(this.prev<re.finallyLoc)return q(re.finallyLoc)}}}},abrupt:function(H,W){for(var q=this.tryEntries.length-1;q>=0;--q){var V=this.tryEntries[q];if(V.tryLoc<=this.prev&&i.call(V,"finallyLoc")&&this.prev<V.finallyLoc){var re=V;break}}re&&(H==="break"||H==="continue")&&re.tryLoc<=W&&W<=re.finallyLoc&&(re=null);var oe=re?re.completion:{};return oe.type=H,oe.arg=W,re?(this.method="next",this.next=re.finallyLoc,v):this.complete(oe)},complete:function(H,W){if(H.type==="throw")throw H.arg;return H.type==="break"||H.type==="continue"?this.next=H.arg:H.type==="return"?(this.rval=this.arg=H.arg,this.method="return",this.next="end"):H.type==="normal"&&W&&(this.next=W),v},finish:function(H){for(var W=this.tryEntries.length-1;W>=0;--W){var q=this.tryEntries[W];if(q.finallyLoc===H)return this.complete(q.completion,q.afterLoc),M(q),v}},catch:function(H){for(var W=this.tryEntries.length-1;W>=0;--W){var q=this.tryEntries[W];if(q.tryLoc===H){var V=q.completion;if(V.type==="throw"){var re=V.arg;M(q)}return re}}throw new Error("illegal catch attempt")},delegateYield:function(H,W,q){return this.delegate={iterator:F(H),resultName:W,nextLoc:q},this.method==="next"&&(this.arg=n),v}},e}function VIe(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 Hk(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){VIe(o,i,r,s,a,"next",l)}function a(l){VIe(o,i,r,s,a,"throw",l)}s(void 0)})}}var zF=pt({},hgt),j6t=zF.version,q6t=zF.render,G6t=zF.unmountComponentAtNode,Kq;try{var K6t=Number((j6t||"").split(".")[0]);K6t>=18&&(Kq=zF.createRoot)}catch{}function HIe(n){var e=zF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Zr(e)==="object"&&(e.usingClientEntryPoint=n)}var JH="__rc_react_root__";function Y6t(n,e){HIe(!0);var t=e[JH]||Kq(e);HIe(!1),t.render(n),e[JH]=t}function Q6t(n,e){q6t(n,e)}function X6t(n,e){if(Kq){Y6t(n,e);return}Q6t(n,e)}function Z6t(n){return ese.apply(this,arguments)}function ese(){return ese=Hk(Kh().mark(function n(e){return Kh().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.resolve().then(function(){var r;(r=e[JH])===null||r===void 0||r.unmount(),delete e[JH]}));case 1:case"end":return i.stop()}},n)})),ese.apply(this,arguments)}function J6t(n){G6t(n)}function eBt(n){return tse.apply(this,arguments)}function tse(){return tse=Hk(Kh().mark(function n(e){return Kh().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(Kq===void 0){i.next=2;break}return i.abrupt("return",Z6t(e));case 2:J6t(e);case 3:case"end":return i.stop()}},n)})),tse.apply(this,arguments)}const f_e=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},tBt=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(",")}}}}},nBt=AR("Wave",n=>[tBt(n)]);function iBt(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 EJ(n){return n&&n!=="#fff"&&n!=="#ffffff"&&n!=="rgb(255, 255, 255)"&&n!=="rgba(255, 255, 255, 1)"&&iBt(n)&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&n!=="transparent"}function rBt(n){const{borderTopColor:e,borderColor:t,backgroundColor:i}=getComputedStyle(n);return EJ(e)?e:EJ(t)?t:EJ(i)?i:null}const mHe="ant-wave-target";function xJ(n){return Number.isNaN(n)?0:n}const oBt=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),[f,g]=w.useState(0),[m,v]=w.useState(0),[_,b]=w.useState(!1),y={left:c,top:d,width:f,height:m,borderRadius:a.map(x=>`${x}px`).join(" ")};o&&(y["--wave-color"]=o);function C(){const x=getComputedStyle(t);s(rBt(t));const k=x.position==="static",{borderLeftWidth:L,borderTopWidth:D}=x;u(k?t.offsetLeft:xJ(-parseFloat(L))),h(k?t.offsetTop:xJ(-parseFloat(D))),g(t.offsetWidth),v(t.offsetHeight);const{borderTopLeftRadius:A,borderTopRightRadius:N,borderBottomLeftRadius:P,borderBottomRightRadius:M}=x;l([A,N,M,P].map(B=>xJ(parseFloat(B))))}if(w.useEffect(()=>{if(t){const x=Yf(()=>{C(),b(!0)});let k;return typeof ResizeObserver<"u"&&(k=new ResizeObserver(C),k.observe(t)),()=>{Yf.cancel(x),k==null||k.disconnect()}}},[]),!_)return null;const E=(i==="Checkbox"||i==="Radio")&&(t==null?void 0:t.classList.contains(mHe));return w.createElement(HF,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(x,k)=>{var L;if(k.deadline||k.propertyName==="opacity"){const D=(L=r.current)===null||L===void 0?void 0:L.parentElement;eBt(D).then(()=>{D==null||D.remove()})}return!1}},x=>{let{className:k}=x;return w.createElement("div",{ref:r,className:zt(e,{"wave-quick":E},k),style:y})})},sBt=(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),X6t(w.createElement(oBt,Object.assign({},e,{target:n})),r)},aBt=sBt;function lBt(n,e,t){const{wave:i}=w.useContext(Ym),[,r,o]=VF(),s=B_(c=>{const u=n.current;if(i!=null&&i.disabled||!u)return;const d=u.querySelector(`.${mHe}`)||u,{showEffect:h}=i||{};(h||aBt)(d,{className:e,token:r,component:t,event:c,hashId:o})}),a=w.useRef();return c=>{Yf.cancel(a.current),a.current=Yf(()=>{s(c)})}}const cBt=n=>{const{children:e,disabled:t,component:i}=n,{getPrefixCls:r}=w.useContext(Ym),o=w.useRef(null),s=r("wave"),[,a]=nBt(s),l=lBt(o,zt(s,a),i);if(ce.useEffect(()=>{const u=o.current;if(!u||u.nodeType!==1||t)return;const d=h=>{!f_e(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]),!ce.isValidElement(e))return e??null;const c=$F(e)?Hq(e.ref,o):o;return gHe(e,{ref:c})},uBt=cBt,dBt=n=>{const e=ce.useContext(jq);return ce.useMemo(()=>n?typeof n=="string"?n??e:n instanceof Function?n(e):e:e,[n,e])},p_e=dBt;globalThis&&globalThis.__rest;const hBt=w.createContext(null),g_e=(n,e)=>{const t=w.useContext(hBt),i=w.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:o,isLastItem:s}=t,a=r==="vertical"?"-vertical-":"-";return zt(`${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 fBt=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 _He=w.createContext(void 0),pBt=n=>{const{getPrefixCls:e,direction:t}=w.useContext(Ym),{prefixCls:i,size:r,className:o}=n,s=fBt(n,["prefixCls","size","className"]),a=e("btn-group",i),[,,l]=VF();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=zt(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},o,l);return w.createElement(_He.Provider,{value:r},w.createElement("div",Object.assign({},s,{className:u})))},gBt=pBt,WIe=/^[\u4e00-\u9fa5]{2}$/,nse=WIe.test.bind(WIe);function zIe(n){return typeof n=="string"}function TJ(n){return n==="text"||n==="link"}function mBt(n,e){if(n==null)return;const t=e?" ":"";return typeof n!="string"&&typeof n!="number"&&zIe(n.type)&&nse(n.props.children)?gHe(n,{children:n.props.children.split("").join(t)}):zIe(n)?nse(n)?ce.createElement("span",null,n.split("").join(t)):ce.createElement("span",null,n):$6t(n)?ce.createElement("span",null,n):n}function _Bt(n,e){let t=!1;const i=[];return ce.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}),ce.Children.map(i,r=>mBt(r,e))}const vBt=w.forwardRef((n,e)=>{const{className:t,style:i,children:r,prefixCls:o}=n,s=zt(`${o}-icon`,t);return ce.createElement("span",{ref:e,className:s,style:i},r)}),vHe=vBt,UIe=w.forwardRef((n,e)=>{let{prefixCls:t,className:i,style:r,iconClassName:o}=n;const s=zt(`${t}-loading-icon`,i);return ce.createElement(vHe,{prefixCls:t,className:s,style:r,ref:e},ce.createElement(U6t,{className:o}))}),kJ=()=>({width:0,opacity:0,transform:"scale(0)"}),IJ=n=>({width:n.scrollWidth,opacity:1,transform:"scale(1)"}),bBt=n=>{const{prefixCls:e,loading:t,existIcon:i,className:r,style:o}=n,s=!!t;return i?ce.createElement(UIe,{prefixCls:e,className:r,style:o}):ce.createElement(HF,{visible:s,motionName:`${e}-loading-icon-motion`,motionLeave:s,removeOnLeave:!0,onAppearStart:kJ,onAppearActive:IJ,onEnterStart:kJ,onEnterActive:IJ,onLeaveStart:IJ,onLeaveActive:kJ},(a,l)=>{let{className:c,style:u}=a;return ce.createElement(UIe,{prefixCls:e,className:r,style:Object.assign(Object.assign({},o),u),ref:l,iconClassName:c})})},yBt=bBt,jIe=(n,e)=>({[`> span, > ${n}`]:{"&:not(:last-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),CBt=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}},jIe(`${e}-primary`,r),jIe(`${e}-danger`,o)]}},wBt=CBt,SBt=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({},VFt(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:'""'}}}}}}},_1=(n,e,t)=>({[`&:not(:disabled):not(${n}-disabled)`]:{"&:hover":e,"&:active":t}}),EBt=n=>({minWidth:n.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),xBt=n=>({borderRadius:n.controlHeight,paddingInlineStart:n.controlHeight/2,paddingInlineEnd:n.controlHeight/2}),TBt=n=>({cursor:"not-allowed",borderColor:n.borderColorDisabled,color:n.colorTextDisabled,backgroundColor:n.colorBgContainerDisabled,boxShadow:"none"}),G4=(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"},_1(n,Object.assign({backgroundColor:e},s),Object.assign({backgroundColor:e},a))),{"&:disabled":{cursor:"not-allowed",color:r||void 0,borderColor:o||void 0}})}),m_e=n=>({[`&:disabled, &${n.componentCls}-disabled`]:Object.assign({},TBt(n))}),bHe=n=>Object.assign({},m_e(n)),eW=n=>({[`&:disabled, &${n.componentCls}-disabled`]:{cursor:"not-allowed",color:n.colorTextDisabled}}),yHe=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},bHe(n)),{backgroundColor:n.defaultBg,borderColor:n.defaultBorderColor,color:n.defaultColor,boxShadow:n.defaultShadow}),_1(n.componentCls,{color:n.colorPrimaryHover,borderColor:n.colorPrimaryHover},{color:n.colorPrimaryActive,borderColor:n.colorPrimaryActive})),G4(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},_1(n.componentCls,{color:n.colorErrorHover,borderColor:n.colorErrorBorderHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),G4(n.componentCls,n.ghostBg,n.colorError,n.colorError,n.colorTextDisabled,n.colorBorder)),m_e(n))}),kBt=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},bHe(n)),{color:n.primaryColor,backgroundColor:n.colorPrimary,boxShadow:n.primaryShadow}),_1(n.componentCls,{color:n.colorTextLightSolid,backgroundColor:n.colorPrimaryHover},{color:n.colorTextLightSolid,backgroundColor:n.colorPrimaryActive})),G4(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},_1(n.componentCls,{backgroundColor:n.colorErrorHover},{backgroundColor:n.colorErrorActive})),G4(n.componentCls,n.ghostBg,n.colorError,n.colorError,n.colorTextDisabled,n.colorBorder,{color:n.colorErrorHover,borderColor:n.colorErrorHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),m_e(n))}),IBt=n=>Object.assign(Object.assign({},yHe(n)),{borderStyle:"dashed"}),LBt=n=>Object.assign(Object.assign(Object.assign({color:n.colorLink},_1(n.componentCls,{color:n.colorLinkHover,backgroundColor:n.linkHoverBg},{color:n.colorLinkActive})),eW(n)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign({color:n.colorError},_1(n.componentCls,{color:n.colorErrorHover},{color:n.colorErrorActive})),eW(n))}),DBt=n=>Object.assign(Object.assign(Object.assign({},_1(n.componentCls,{color:n.colorText,backgroundColor:n.textHoverBg},{color:n.colorText,backgroundColor:n.colorBgTextActive})),eW(n)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign({color:n.colorError},eW(n)),_1(n.componentCls,{color:n.colorErrorHover,backgroundColor:n.colorErrorBg},{color:n.colorErrorHover,backgroundColor:n.colorErrorBg}))}),ABt=n=>{const{componentCls:e}=n;return{[`${e}-default`]:yHe(n),[`${e}-primary`]:kBt(n),[`${e}-dashed`]:IBt(n),[`${e}-link`]:LBt(n),[`${e}-text`]:DBt(n),[`${e}-ghost`]:G4(n.componentCls,n.ghostBg,n.colorBgContainer,n.colorBgContainer,n.colorTextDisabled,n.colorBorder)}},__e=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}`]:EBt(n)},{[`${t}${t}-round${e}`]:xBt(n)}]},RBt=n=>__e(Gh(n,{fontSize:n.contentFontSize})),NBt=n=>{const e=Gh(n,{controlHeight:n.controlHeightSM,fontSize:n.contentFontSizeSM,padding:n.paddingXS,buttonPaddingHorizontal:n.paddingInlineSM,borderRadius:n.borderRadiusSM,buttonIconOnlyFontSize:n.onlyIconSizeSM});return __e(e,`${n.componentCls}-sm`)},OBt=n=>{const e=Gh(n,{controlHeight:n.controlHeightLG,fontSize:n.contentFontSizeLG,buttonPaddingHorizontal:n.paddingInlineLG,borderRadius:n.borderRadiusLG,buttonIconOnlyFontSize:n.onlyIconSizeLG});return __e(e,`${n.componentCls}-lg`)},PBt=n=>{const{componentCls:e}=n;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},CHe=n=>{const{paddingInline:e,onlyIconSize:t}=n;return Gh(n,{buttonPaddingHorizontal:e,buttonIconOnlyFontSize:t})},wHe=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}),MBt=AR("Button",n=>{const e=CHe(n);return[SBt(e),NBt(e),RBt(e),OBt(e),PBt(e),ABt(e),wBt(e)]},wHe);function FBt(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 BBt(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 v_e(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({},FBt(n,i,e)),BBt(t,i,e))}}function $Bt(n,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:-n.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function VBt(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 HBt(n){const e=`${n.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},$Bt(n,e)),VBt(n.componentCls,e))}}const WBt=UFt(["Button","compact"],n=>{const e=CHe(n);return[v_e(e),HBt(e)]},wHe);var 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 UBt(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 jBt=(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:f,children:g,icon:m,ghost:v=!1,block:_=!1,htmlType:b="button",classNames:y,style:C={}}=n,E=zBt(n,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:x,autoInsertSpaceInButton:k,direction:L,button:D}=w.useContext(Ym),A=x("btn",o),[N,P]=MBt(A),M=w.useContext(Uq),B=d??M,F=w.useContext(_He),U=w.useMemo(()=>UBt(r),[r]),[H,W]=w.useState(U.loading),[q,V]=w.useState(!1),oe=Hq(e,w.createRef()),Q=w.Children.count(g)===1&&!m&&!TJ(s);w.useEffect(()=>{let be=null;U.delay>0?be=setTimeout(()=>{be=null,W(!0)},U.delay):W(U.loading);function Te(){be&&(clearTimeout(be),be=null)}return Te},[U]),w.useEffect(()=>{if(!oe||!oe.current||k===!1)return;const be=oe.current.textContent;Q&&nse(be)?q||V(!0):q&&V(!1)},[oe]);const Ne=be=>{const{onClick:Te}=n;if(H||B){be.preventDefault();return}Te==null||Te(be)},Ve=k!==!1,{compactSize:Ye,compactItemClassnames:ye}=g_e(A,L),He={large:"lg",small:"sm",middle:void 0},Pe=p_e(be=>{var Te,se;return(se=(Te=c??Ye)!==null&&Te!==void 0?Te:F)!==null&&se!==void 0?se:be}),Ge=Pe&&He[Pe]||"",Fe=H?"loading":m,bt=q3t(E,["navigate"]),Mt=zt(A,P,{[`${A}-${l}`]:l!=="default"&&l,[`${A}-${s}`]:s,[`${A}-${Ge}`]:Ge,[`${A}-icon-only`]:!g&&g!==0&&!!Fe,[`${A}-background-ghost`]:v&&!TJ(s),[`${A}-loading`]:H,[`${A}-two-chinese-chars`]:q&&Ve&&!H,[`${A}-block`]:_,[`${A}-dangerous`]:!!a,[`${A}-rtl`]:L==="rtl"},ye,h,f,D==null?void 0:D.className),Ft=Object.assign(Object.assign({},D==null?void 0:D.style),C),Yt=zt(y==null?void 0:y.icon,(t=D==null?void 0:D.classNames)===null||t===void 0?void 0:t.icon),ln=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)||{}),Et=m&&!H?ce.createElement(vHe,{prefixCls:A,className:Yt,style:ln},m):ce.createElement(yBt,{existIcon:!!m,prefixCls:A,loading:!!H}),mt=g||g===0?_Bt(g,Q&&Ve):null;if(bt.href!==void 0)return N(ce.createElement("a",Object.assign({},bt,{className:zt(Mt,{[`${A}-disabled`]:B}),style:Ft,onClick:Ne,ref:oe}),Et,mt));let Lt=ce.createElement("button",Object.assign({},E,{type:b,className:Mt,style:Ft,onClick:Ne,disabled:B,ref:oe}),Et,mt,ye&&ce.createElement(WBt,{key:"compact",prefixCls:A}));return TJ(s)||(Lt=ce.createElement(uBt,{component:"Button",disabled:!!H},Lt)),N(Lt)},b_e=w.forwardRef(jBt);b_e.Group=gBt;b_e.__ANT_BUTTON=!0;const qBt=b_e;var SHe=w.createContext(null),qIe=[];function GBt(n,e){var t=w.useState(function(){if(!Qf())return null;var g=document.createElement("div");return g}),i=cn(t,1),r=i[0],o=w.useRef(!1),s=w.useContext(SHe),a=w.useState(qIe),l=cn(a,2),c=l[0],u=l[1],d=s||(o.current?void 0:function(g){u(function(m){var v=[g].concat(no(m));return v})});function h(){r.parentElement||document.body.appendChild(r),o.current=!0}function f(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),o.current=!1}return ih(function(){return n?s?s(h):h():f(),f},[n]),ih(function(){c.length&&(c.forEach(function(g){return g()}),u(qIe))},[c]),[r,d]}var LJ;function KBt(n){if(typeof document>"u")return 0;if(n||LJ===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),LJ=r-o}return LJ}function GIe(n){var e=n.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?KBt():t}function YBt(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:GIe(t),height:GIe(i)}}function QBt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var XBt="rc-util-locker-".concat(Date.now()),KIe=0;function ZBt(n){var e=!!n,t=w.useState(function(){return KIe+=1,"".concat(XBt,"_").concat(KIe)}),i=cn(t,1),r=i[0];ih(function(){if(e){var o=YBt(document.body).width,s=QBt();XD(`
html body {
overflow-y: hidden;
`.concat(s?"width: calc(100% - ".concat(o,"px);"):"",`
}`),r)}else YH(r);return function(){YH(r)}},[e,r])}var YIe=!1;function JBt(n){return typeof n=="boolean"&&(YIe=n),YIe}var QIe=function(e){return e===!1?!1:!Qf()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},EHe=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=cn(l,2),u=c[0],d=c[1],h=u||t;w.useEffect(function(){(s||t)&&d(t)},[t,s]);var f=w.useState(function(){return QIe(r)}),g=cn(f,2),m=g[0],v=g[1];w.useEffect(function(){var N=QIe(r);v(N??null)});var _=GBt(h&&!m),b=cn(_,2),y=b[0],C=b[1],E=m??y;ZBt(i&&t&&Qf()&&(E===y||E===document.body));var x=null;if(a&&$F(a)&&e){var k=a;x=k.ref}var L=n_e(x,e);if(!h||!Qf()||m===void 0)return null;var D=E===!1||JBt(),A=a;return e&&(A=w.cloneElement(a,{ref:L})),w.createElement(SHe.Provider,{value:C},D?A:op.createPortal(A,E))});function e8t(){var n=pt({},Lm);return n.useId}var XIe=0,ZIe=e8t();const t8t=ZIe?function(e){var t=ZIe();return e||t}:function(e){var t=w.useState("ssr-id"),i=cn(t,2),r=i[0],o=i[1];return w.useEffect(function(){var s=XIe;XIe+=1,o("rc_unique_".concat(s))},[]),e||r};var Fx="RC_FORM_INTERNAL_HOOKS",va=function(){Dd(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},JD=w.createContext({getFieldValue:va,getFieldsValue:va,getFieldError:va,getFieldWarning:va,getFieldsError:va,isFieldsTouched:va,isFieldTouched:va,isFieldValidating:va,isFieldsValidating:va,resetFields:va,setFields:va,setFieldValue:va,setFieldsValue:va,validateFields:va,submit:va,getInternalHooks:function(){return va(),{dispatch:va,initEntityValue:va,registerField:va,useSubscribe:va,setInitialValues:va,destroyForm:va,setCallbacks:va,registerWatch:va,getFields:va,setValidateMessages:va,setPreserve:va,getInitialValue:va}}}),tW=w.createContext(null);function ise(n){return n==null?[]:Array.isArray(n)?n:[n]}function n8t(n){return n&&!!n._init}function Bx(){return Bx=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},Bx.apply(this,arguments)}function i8t(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,K4(n,e)}function rse(n){return rse=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rse(n)}function K4(n,e){return K4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},K4(n,e)}function r8t(){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 I$(n,e,t){return r8t()?I$=Reflect.construct.bind():I$=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),c=new l;return s&&K4(c,s.prototype),c},I$.apply(null,arguments)}function o8t(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function ose(n){var e=typeof Map=="function"?new Map:void 0;return ose=function(i){if(i===null||!o8t(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 I$(i,arguments,rse(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),K4(r,i)},ose(n)}var s8t=/%[sdj%]/g,a8t=function(){};typeof process<"u"&&process.env;function sse(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 Gp(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(s8t,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 l8t(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function Cu(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||l8t(e)&&typeof n=="string"&&!n)}function c8t(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 JIe(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 u8t(n){var e=[];return Object.keys(n).forEach(function(t){e.push.apply(e,n[t]||[])}),e}var e2e=function(n){i8t(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}(ose(Error));function d8t(n,e,t,i,r){if(e.first){var o=new Promise(function(h,f){var g=function(_){return i(_),_.length?f(new e2e(_,sse(_))):h(r)},m=u8t(n);JIe(m,t,g)});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,f){var g=function(v){if(u.push.apply(u,v),c++,c===l)return i(u),u.length?f(new e2e(u,sse(u))):h(r)};a.length||(i(u),h(r)),a.forEach(function(m){var v=n[m];s.indexOf(m)!==-1?JIe(v,t,g):c8t(v,t,g)})});return d.catch(function(h){return h}),d}function h8t(n){return!!(n&&n.message!==void 0)}function f8t(n,e){for(var t=n,i=0;i<e.length;i++){if(t==null)return t;t=t[e[i]]}return t}function t2e(n,e){return function(t){var i;return n.fullFields?i=f8t(e,n.fullFields):i=e[t.field||n.fullField],h8t(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 n2e(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]=Bx({},n[t],i):n[t]=i}}return n}var xHe=function(e,t,i,r,o,s){e.required&&(!i.hasOwnProperty(e.field)||Cu(t,s||e.type))&&r.push(Gp(o.messages.required,e.fullField))},p8t=function(e,t,i,r,o){(/^\s+$/.test(t)||t==="")&&r.push(Gp(o.messages.whitespace,e.fullField))},H8,g8t=function(){if(H8)return H8;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,f="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",g="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",v="(?::\\d{2,5})?",_='(?:[/?#][^\\s"]*)?',b="(?:"+c+"|www\\.)"+u+"(?:localhost|"+d+"|"+h+"|"+f+g+m+")"+v+_;return H8=new RegExp("(?:^"+b+"$)","i"),H8},i2e={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},aP={integer:function(e){return aP.number(e)&&parseInt(e,10)===e},float:function(e){return aP.number(e)&&!aP.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"&&!aP.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(i2e.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(g8t())},hex:function(e){return typeof e=="string"&&!!e.match(i2e.hex)}},m8t=function(e,t,i,r,o){if(e.required&&t===void 0){xHe(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?aP[a](t)||r.push(Gp(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(Gp(o.messages.types[a],e.fullField,e.type))},_8t=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",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&r.push(Gp(o.messages[d].len,e.fullField,e.len)):a&&!l&&u<e.min?r.push(Gp(o.messages[d].min,e.fullField,e.min)):l&&!a&&u>e.max?r.push(Gp(o.messages[d].max,e.fullField,e.max)):a&&l&&(u<e.min||u>e.max)&&r.push(Gp(o.messages[d].range,e.fullField,e.min,e.max))},VI="enum",v8t=function(e,t,i,r,o){e[VI]=Array.isArray(e[VI])?e[VI]:[],e[VI].indexOf(t)===-1&&r.push(Gp(o.messages[VI],e.fullField,e[VI].join(", ")))},b8t=function(e,t,i,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Gp(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(Gp(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},Xo={required:xHe,whitespace:p8t,type:m8t,range:_8t,enum:v8t,pattern:b8t},y8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t,"string")&&!e.required)return i();Xo.required(e,t,r,s,o,"string"),Cu(t,"string")||(Xo.type(e,t,r,s,o),Xo.range(e,t,r,s,o),Xo.pattern(e,t,r,s,o),e.whitespace===!0&&Xo.whitespace(e,t,r,s,o))}i(s)},C8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),t!==void 0&&Xo.type(e,t,r,s,o)}i(s)},w8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),t!==void 0&&(Xo.type(e,t,r,s,o),Xo.range(e,t,r,s,o))}i(s)},S8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),t!==void 0&&Xo.type(e,t,r,s,o)}i(s)},E8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),Cu(t)||Xo.type(e,t,r,s,o)}i(s)},x8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),t!==void 0&&(Xo.type(e,t,r,s,o),Xo.range(e,t,r,s,o))}i(s)},T8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),t!==void 0&&(Xo.type(e,t,r,s,o),Xo.range(e,t,r,s,o))}i(s)},k8t=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();Xo.required(e,t,r,s,o,"array"),t!=null&&(Xo.type(e,t,r,s,o),Xo.range(e,t,r,s,o))}i(s)},I8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),t!==void 0&&Xo.type(e,t,r,s,o)}i(s)},L8t="enum",D8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o),t!==void 0&&Xo[L8t](e,t,r,s,o)}i(s)},A8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t,"string")&&!e.required)return i();Xo.required(e,t,r,s,o),Cu(t,"string")||Xo.pattern(e,t,r,s,o)}i(s)},R8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t,"date")&&!e.required)return i();if(Xo.required(e,t,r,s,o),!Cu(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),Xo.type(e,l,r,s,o),l&&Xo.range(e,l.getTime(),r,s,o)}}i(s)},N8t=function(e,t,i,r,o){var s=[],a=Array.isArray(t)?"array":typeof t;Xo.required(e,t,r,s,o,a),i(s)},DJ=function(e,t,i,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(Cu(t,s)&&!e.required)return i();Xo.required(e,t,r,a,o,s),Cu(t,s)||Xo.type(e,t,r,a,o)}i(a)},O8t=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Cu(t)&&!e.required)return i();Xo.required(e,t,r,s,o)}i(s)},oM={string:y8t,method:C8t,number:w8t,boolean:S8t,regexp:E8t,integer:x8t,float:T8t,array:k8t,object:I8t,enum:D8t,pattern:A8t,date:R8t,url:DJ,hex:DJ,email:DJ,required:N8t,any:O8t};function ase(){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 lse=ase(),UF=function(){function n(t){this.rules=null,this._messages=lse,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=n2e(ase(),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 E;v=(E=v).concat.apply(E,C)}else v.push(C)}for(var y=0;y<m.length;y++)b(m[y]);v.length?(_=sse(v),c(v,_)):c(null,a)}if(l.messages){var d=this.messages();d===lse&&(d=ase()),n2e(d,l.messages),l.messages=d}else l.messages=this.messages();var h={},f=l.keys||Object.keys(this.rules);f.forEach(function(m){var v=s.rules[m],_=a[m];v.forEach(function(b){var y=b;typeof y.transform=="function"&&(a===i&&(a=Bx({},a)),_=a[m]=y.transform(_)),typeof y=="function"?y={validator:y}:y=Bx({},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:_,source:a,field:m}))})});var g={};return d8t(h,l,function(m,v){var _=m.rule,b=(_.type==="object"||_.type==="array")&&(typeof _.fields=="object"||typeof _.defaultField=="object");b=b&&(_.required||!_.required&&m.value),_.field=m.field;function y(x,k){return Bx({},k,{fullField:_.fullField+"."+x,fullFields:_.fullFields?[].concat(_.fullFields,[x]):[x]})}function C(x){x===void 0&&(x=[]);var k=Array.isArray(x)?x:[x];!l.suppressWarning&&k.length&&n.warning("async-validator:",k),k.length&&_.message!==void 0&&(k=[].concat(_.message));var L=k.map(t2e(_,a));if(l.first&&L.length)return g[_.field]=1,v(L);if(!b)v(L);else{if(_.required&&!m.value)return _.message!==void 0?L=[].concat(_.message).map(t2e(_,a)):l.error&&(L=[l.error(_,Gp(l.messages.required,_.field))]),v(L);var D={};_.defaultField&&Object.keys(m.value).map(function(P){D[P]=_.defaultField}),D=Bx({},D,m.rule.fields);var A={};Object.keys(D).forEach(function(P){var M=D[P],B=Array.isArray(M)?M:[M];A[P]=B.map(y.bind(null,P))});var N=new n(A);N.messages(l.messages),m.rule.options&&(m.rule.options.messages=l.messages,m.rule.options.error=l.error),N.validate(m.value,m.rule.options||l,function(P){var M=[];L&&L.length&&M.push.apply(M,L),P&&P.length&&M.push.apply(M,P),v(M.length?M:null)})}}var E;if(_.asyncValidator)E=_.asyncValidator(_,m.value,C,m.source,l);else if(_.validator){try{E=_.validator(_,m.value,C,m.source,l)}catch(x){console.error==null||console.error(x),l.suppressValidatorError||setTimeout(function(){throw x},0),C(x.message)}E===!0?C():E===!1?C(typeof _.message=="function"?_.message(_.fullField||_.field):_.message||(_.fullField||_.field)+" fails"):E instanceof Array?C(E):E instanceof Error&&C(E.message)}E&&E.then&&E.then(function(){return C()},function(x){return C(x)})},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&&!oM.hasOwnProperty(i.type))throw new Error(Gp("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"?oM.required:oM[this.getType(i)]||void 0},n}();UF.register=function(e,t){if(typeof t!="function")throw new Error("Cannot register a validator by type, validator is not a function");oM[e]=t};UF.warning=a8t;UF.messages=lse;UF.validators=oM;var Sp="'${name}' is not a valid ${type}",THe={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:Sp,method:Sp,array:Sp,object:Sp,number:Sp,date:Sp,boolean:Sp,integer:Sp,float:Sp,regexp:Sp,email:Sp,url:Sp,hex:Sp},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}"}},r2e=UF;function P8t(n,e){return n.replace(/\$\{\w+\}/g,function(t){var i=t.slice(2,-1);return e[i]})}var o2e="CODE_LOGIC_ERROR";function cse(n,e,t,i,r){return use.apply(this,arguments)}function use(){return use=Hk(Kh().mark(function n(e,t,i,r,o){var s,a,l,c,u,d,h,f,g;return Kh().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s=pt({},i),delete s.ruleIndex,r2e.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(_){return console.error(_),Promise.reject(o2e)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new r2e(it({},e,[s])),u=q2(THe,r.validateMessages),c.messages(u),d=[],v.prev=10,v.next=13,Promise.resolve(c.validate(it({},e,t),pt({},r)));case 13:v.next=18;break;case 15:v.prev=15,v.t0=v.catch(10),v.t0.errors&&(d=v.t0.errors.map(function(_,b){var y=_.message,C=y===o2e?u.default:y;return w.isValidElement(C)?w.cloneElement(C,{key:"error_".concat(b)}):C}));case 18:if(!(!d.length&&l)){v.next=23;break}return v.next=21,Promise.all(t.map(function(_,b){return cse("".concat(e,".").concat(b),_,l,r,o)}));case 21:return h=v.sent,v.abrupt("return",h.reduce(function(_,b){return[].concat(no(_),no(b))},[]));case 23:return f=pt(pt({},i),{},{name:e,enum:(i.enum||[]).join(", ")},o),g=d.map(function(_){return typeof _=="string"?P8t(_,f):_}),v.abrupt("return",g);case 26:case"end":return v.stop()}},n,null,[[10,15]])})),use.apply(this,arguments)}function M8t(n,e,t,i,r,o){var s=n.join("."),a=t.map(function(u,d){var h=u.validator,f=pt(pt({},u),{},{ruleIndex:d});return h&&(f.validator=function(g,m,v){var _=!1,b=function(){for(var E=arguments.length,x=new Array(E),k=0;k<E;k++)x[k]=arguments[k];Promise.resolve().then(function(){Dd(!_,"Your validator function has already return a promise. `callback` will be ignored."),_||v.apply(void 0,x)})},y=h(g,m,b);_=y&&typeof y.then=="function"&&typeof y.catch=="function",Dd(_,"`callback` is deprecated. Please return a promise instead."),_&&y.then(function(){v()}).catch(function(C){v(C||" ")})}),f}).sort(function(u,d){var h=u.warningOnly,f=u.ruleIndex,g=d.warningOnly,m=d.ruleIndex;return!!h==!!g?f-m:h?1:-1}),l;if(r===!0)l=new Promise(function(){var u=Hk(Kh().mark(function d(h,f){var g,m,v;return Kh().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:g=0;case 1:if(!(g<a.length)){b.next=12;break}return m=a[g],b.next=5,cse(s,e,m,i,o);case 5:if(v=b.sent,!v.length){b.next=9;break}return f([{errors:v,rule:m}]),b.abrupt("return");case 9:g+=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 cse(s,e,u,i,o).then(function(d){return{errors:d,rule:u}})});l=(r?B8t(c):F8t(c)).then(function(u){return Promise.reject(u)})}return l.catch(function(u){return u}),l}function F8t(n){return dse.apply(this,arguments)}function dse(){return dse=Hk(Kh().mark(function n(e){return Kh().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,no(r));return s}));case 1:case"end":return i.stop()}},n)})),dse.apply(this,arguments)}function B8t(n){return hse.apply(this,arguments)}function hse(){return hse=Hk(Kh().mark(function n(e){var t;return Kh().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)})),hse.apply(this,arguments)}function hc(n){return ise(n)}function s2e(n,e){var t={};return e.forEach(function(i){var r=J_(n,i);t=L_(t,i,r)}),t}function HL(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return n&&n.some(function(i){return kHe(e,i,t)})}function kHe(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 $8t(n,e){if(n===e)return!0;if(!n&&e||n&&!e||!n||!e||Zr(n)!=="object"||Zr(e)!=="object")return!1;var t=Object.keys(n),i=Object.keys(e),r=new Set([].concat(t,i));return no(r).every(function(o){var s=n[o],a=e[o];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function V8t(n){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&Zr(e.target)==="object"&&n in e.target?e.target[n]:e}function a2e(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(no(n.slice(0,t)),[r],no(n.slice(t,e)),no(n.slice(e+1,i))):o<0?[].concat(no(n.slice(0,e)),no(n.slice(e+1,t+1)),[r],no(n.slice(t+1,i))):n}var H8t=["name"],Gg=[];function l2e(n,e,t,i,r,o){return typeof n=="function"?n(e,t,"source"in o?{source:o.source}:{}):i!==r}var y_e=function(n){Tv(t,n);var e=Rk(t);function t(i){var r;if(El(this,t),r=e.call(this,i),it(Xr(r),"state",{resetCount:0}),it(Xr(r),"cancelRegisterFunc",null),it(Xr(r),"mounted",!1),it(Xr(r),"touched",!1),it(Xr(r),"dirty",!1),it(Xr(r),"validatePromise",void 0),it(Xr(r),"prevValidating",void 0),it(Xr(r),"errors",Gg),it(Xr(r),"warnings",Gg),it(Xr(r),"cancelRegister",function(){var l=r.props,c=l.preserve,u=l.isListField,d=l.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(u,c,hc(d)),r.cancelRegisterFunc=null}),it(Xr(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(no(h),no(c)):[]}),it(Xr(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})}),it(Xr(r),"refresh",function(){r.mounted&&r.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),it(Xr(r),"metaCache",null),it(Xr(r),"triggerMetaEvent",function(l){var c=r.props.onMetaChange;if(c){var u=pt(pt({},r.getMeta()),{},{destroy:l});KH(r.metaCache,u)||c(u),r.metaCache=u}else r.metaCache=null}),it(Xr(r),"onStoreChange",function(l,c,u){var d=r.props,h=d.shouldUpdate,f=d.dependencies,g=f===void 0?[]:f,m=d.onReset,v=u.store,_=r.getNamePath(),b=r.getValue(l),y=r.getValue(v),C=c&&HL(c,_);switch(u.type==="valueUpdate"&&u.source==="external"&&b!==y&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=Gg,r.warnings=Gg,r.triggerMetaEvent()),u.type){case"reset":if(!c||C){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=Gg,r.warnings=Gg,r.triggerMetaEvent(),m==null||m(),r.refresh();return}break;case"remove":{if(h){r.reRender();return}break}case"setField":{var E=u.data;if(C){"touched"in E&&(r.touched=E.touched),"validating"in E&&!("originRCField"in E)&&(r.validatePromise=E.validating?Promise.resolve([]):null),"errors"in E&&(r.errors=E.errors||Gg),"warnings"in E&&(r.warnings=E.warnings||Gg),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}else if("value"in E&&HL(c,_,!0)){r.reRender();return}if(h&&!_.length&&l2e(h,l,v,b,y,u)){r.reRender();return}break}case"dependenciesUpdate":{var x=g.map(hc);if(x.some(function(k){return HL(u.relatedFields,k)})){r.reRender();return}break}default:if(C||(!g.length||_.length||h)&&l2e(h,l,v,b,y,u)){r.reRender();return}break}h===!0&&r.reRender()}),it(Xr(r),"validateRules",function(l){var c=r.getNamePath(),u=r.getValue(),d=l||{},h=d.triggerName,f=d.validateOnly,g=f===void 0?!1:f,m=Promise.resolve().then(Hk(Kh().mark(function v(){var _,b,y,C,E,x,k;return Kh().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(_=r.props,b=_.validateFirst,y=b===void 0?!1:b,C=_.messageVariables,E=_.validateDebounce,x=r.getRules(),h&&(x=x.filter(function(A){return A}).filter(function(A){var N=A.validateTrigger;if(!N)return!0;var P=ise(N);return P.includes(h)})),!(E&&h)){D.next=10;break}return D.next=8,new Promise(function(A){setTimeout(A,E)});case 8:if(r.validatePromise===m){D.next=10;break}return D.abrupt("return",[]);case 10:return k=M8t(c,u,x,l,y,C),k.catch(function(A){return A}).then(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gg;if(r.validatePromise===m){var N;r.validatePromise=null;var P=[],M=[];(N=A.forEach)===null||N===void 0||N.call(A,function(B){var F=B.rule.warningOnly,U=B.errors,H=U===void 0?Gg:U;F?M.push.apply(M,no(H)):P.push.apply(P,no(H))}),r.errors=P,r.warnings=M,r.triggerMetaEvent(),r.reRender()}}),D.abrupt("return",k);case 13:case"end":return D.stop()}},v)})));return g||(r.validatePromise=m,r.dirty=!0,r.errors=Gg,r.warnings=Gg,r.triggerMetaEvent(),r.reRender()),m}),it(Xr(r),"isFieldValidating",function(){return!!r.validatePromise}),it(Xr(r),"isFieldTouched",function(){return r.touched}),it(Xr(r),"isFieldDirty",function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks(Fx),u=c.getInitialValue;return u(r.getNamePath())!==void 0}),it(Xr(r),"getErrors",function(){return r.errors}),it(Xr(r),"getWarnings",function(){return r.warnings}),it(Xr(r),"isListField",function(){return r.props.isListField}),it(Xr(r),"isList",function(){return r.props.isList}),it(Xr(r),"isPreserve",function(){return r.props.preserve}),it(Xr(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}),it(Xr(r),"getOnlyChild",function(l){if(typeof l=="function"){var c=r.getMeta();return pt(pt({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=UH(l);return u.length!==1||!w.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),it(Xr(r),"getValue",function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return J_(l||c(!0),u)}),it(Xr(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,f=c.normalize,g=c.valuePropName,m=c.getValueProps,v=c.fieldContext,_=d!==void 0?d:v.validateTrigger,b=r.getNamePath(),y=v.getInternalHooks,C=v.getFieldsValue,E=y(Fx),x=E.dispatch,k=r.getValue(),L=m||function(P){return it({},g,P)},D=l[u],A=pt(pt({},l),L(k));A[u]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var P,M=arguments.length,B=new Array(M),F=0;F<M;F++)B[F]=arguments[F];h?P=h.apply(void 0,B):P=V8t.apply(void 0,[g].concat(B)),f&&(P=f(P,k,C(!0))),x({type:"updateValue",namePath:b,value:P}),D&&D.apply(void 0,B)};var N=ise(_||[]);return N.forEach(function(P){var M=A[P];A[P]=function(){M&&M.apply(void 0,arguments);var B=r.props.rules;B&&B.length&&x({type:"validateField",namePath:b,triggerName:P})}}),A}),i.fieldContext){var o=i.fieldContext.getInternalHooks,s=o(Fx),a=s.initEntityValue;a(Xr(r))}return r}return xl(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(Fx),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)):(Dd(!a,"`children` of Field is not validate ReactElement."),c=a),w.createElement(w.Fragment,{key:r},c)}}]),t}(w.Component);it(y_e,"contextType",JD);it(y_e,"defaultProps",{trigger:"onChange",valuePropName:"value"});function IHe(n){var e=n.name,t=Ku(n,H8t),i=w.useContext(JD),r=w.useContext(tW),o=e!==void 0?hc(e):void 0,s="keep";return t.isListField||(s="_".concat((o||[]).join("_"))),w.createElement(y_e,Tt({key:s,name:o,isListField:!!r},t,{fieldContext:i}))}function W8t(n){var e=n.name,t=n.initialValue,i=n.children,r=n.rules,o=n.validateTrigger,s=n.isListField,a=w.useContext(JD),l=w.useContext(tW),c=w.useRef({keys:[],id:0}),u=c.current,d=w.useMemo(function(){var m=hc(a.prefixName)||[];return[].concat(no(m),no(hc(e)))},[a.prefixName,e]),h=w.useMemo(function(){return pt(pt({},a),{},{prefixName:d})},[a,d]),f=w.useMemo(function(){return{getKey:function(v){var _=d.length,b=v[_];return[u.keys[b],v.slice(_+1)]}}},[d]);if(typeof i!="function")return Dd(!1,"Form.List only accepts function as children."),null;var g=function(v,_,b){var y=b.source;return y==="internal"?!1:v!==_};return w.createElement(tW.Provider,{value:f},w.createElement(JD.Provider,{value:h},w.createElement(IHe,{name:[],shouldUpdate:g,rules:r,validateTrigger:o,initialValue:t,isList:!0,isListField:s??!!l},function(m,v){var _=m.value,b=_===void 0?[]:_,y=m.onChange,C=a.getFieldValue,E=function(){var D=C(d||[]);return D||[]},x={add:function(D,A){var N=E();A>=0&&A<=N.length?(u.keys=[].concat(no(u.keys.slice(0,A)),[u.id],no(u.keys.slice(A))),y([].concat(no(N.slice(0,A)),[D],no(N.slice(A))))):(u.keys=[].concat(no(u.keys),[u.id]),y([].concat(no(N),[D]))),u.id+=1},remove:function(D){var A=E(),N=new Set(Array.isArray(D)?D:[D]);N.size<=0||(u.keys=u.keys.filter(function(P,M){return!N.has(M)}),y(A.filter(function(P,M){return!N.has(M)})))},move:function(D,A){if(D!==A){var N=E();D<0||D>=N.length||A<0||A>=N.length||(u.keys=a2e(u.keys,D,A),y(a2e(N,D,A)))}}},k=b||[];return Array.isArray(k)||(k=[]),i(k.map(function(L,D){var A=u.keys[D];return A===void 0&&(u.keys[D]=u.id,A=u.keys[D],u.id+=1),{name:D,key:A,isListField:!0}}),x,v)})))}function z8t(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 LHe="__@field_split__";function AJ(n){return n.map(function(e){return"".concat(Zr(e),":").concat(e)}).join(LHe)}var HI=function(){function n(){El(this,n),it(this,"kvs",new Map)}return xl(n,[{key:"set",value:function(t,i){this.kvs.set(AJ(t),i)}},{key:"get",value:function(t){return this.kvs.get(AJ(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(AJ(t))}},{key:"map",value:function(t){return no(this.kvs.entries()).map(function(i){var r=cn(i,2),o=r[0],s=r[1],a=o.split(LHe);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=cn(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}(),U8t=["name"],j8t=xl(function n(e){var t=this;El(this,n),it(this,"formHooked",!1),it(this,"forceRootUpdate",void 0),it(this,"subscribable",!0),it(this,"store",{}),it(this,"fieldEntities",[]),it(this,"initialValues",{}),it(this,"callbacks",{}),it(this,"validateMessages",null),it(this,"preserve",null),it(this,"lastValidatePromise",null),it(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}}),it(this,"getInternalHooks",function(i){return i===Fx?(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}):(Dd(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),it(this,"useSubscribe",function(i){t.subscribable=i}),it(this,"prevWithoutPreserves",null),it(this,"setInitialValues",function(i,r){if(t.initialValues=i||{},r){var o,s=q2(i,t.store);(o=t.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=L_(s,l,J_(i,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}}),it(this,"destroyForm",function(){var i=new HI;t.getFieldEntities(!0).forEach(function(r){t.isMergedPreserve(r.isPreserve())||i.set(r.getNamePath(),!0)}),t.prevWithoutPreserves=i}),it(this,"getInitialValue",function(i){var r=J_(t.initialValues,i);return i.length?q2(r):r}),it(this,"setCallbacks",function(i){t.callbacks=i}),it(this,"setValidateMessages",function(i){t.validateMessages=i}),it(this,"setPreserve",function(i){t.preserve=i}),it(this,"watchList",[]),it(this,"registerWatch",function(i){return t.watchList.push(i),function(){t.watchList=t.watchList.filter(function(r){return r!==i})}}),it(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)})}}),it(this,"timeoutId",null),it(this,"warningUnhooked",function(){}),it(this,"updateStore",function(i){t.store=i}),it(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}),it(this,"getFieldsMap",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new HI;return t.getFieldEntities(i).forEach(function(o){var s=o.getNamePath();r.set(s,o)}),r}),it(this,"getFieldEntitiesForNamePathList",function(i){if(!i)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return i.map(function(o){var s=hc(o);return r.get(s)||{INVALIDATE_NAME_PATH:hc(o)}})}),it(this,"getFieldsValue",function(i,r){t.warningUnhooked();var o,s,a;if(i===!0||Array.isArray(i)?(o=i,s=r):i&&Zr(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,f="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(a){var g,m;if((g=(m=u).isList)!==null&&g!==void 0&&g.call(m))return}else if(!o&&(d=(h=u).isListField)!==null&&d!==void 0&&d.call(h))return;if(!s)c.push(f);else{var v="getMeta"in u?u.getMeta():null;s(v)&&c.push(f)}}),s2e(t.store,c.map(hc))}),it(this,"getFieldValue",function(i){t.warningUnhooked();var r=hc(i);return J_(t.store,r)}),it(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:hc(i[s]),errors:[],warnings:[]}})}),it(this,"getFieldError",function(i){t.warningUnhooked();var r=hc(i),o=t.getFieldsError([r])[0];return o.errors}),it(this,"getFieldWarning",function(i){t.warningUnhooked();var r=hc(i),o=t.getFieldsError([r])[0];return o.warnings}),it(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(hc),c=!1):(l=null,c=s):(l=s.map(hc),c=a);var u=t.getFieldEntities(!0),d=function(v){return v.isFieldTouched()};if(!l)return c?u.every(d):u.some(d);var h=new HI;l.forEach(function(m){h.set(m,[])}),u.forEach(function(m){var v=m.getNamePath();l.forEach(function(_){_.every(function(b,y){return v[y]===b})&&h.update(_,function(b){return[].concat(no(b),[m])})})});var f=function(v){return v.some(d)},g=h.map(function(m){var v=m.value;return v});return c?g.every(f):g.some(f)}),it(this,"isFieldTouched",function(i){return t.warningUnhooked(),t.isFieldsTouched([i])}),it(this,"isFieldsValidating",function(i){t.warningUnhooked();var r=t.getFieldEntities();if(!i)return r.some(function(s){return s.isFieldValidating()});var o=i.map(hc);return r.some(function(s){var a=s.getNamePath();return HL(o,a)&&s.isFieldValidating()})}),it(this,"isFieldValidating",function(i){return t.warningUnhooked(),t.isFieldsValidating([i])}),it(this,"resetWithFieldInitialValue",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new HI,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(),f=t.getInitialValue(h);if(f!==void 0)Dd(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=r.get(h);if(g&&g.size>1)Dd(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var m=t.getFieldValue(h),v=u.isListField();!v&&(!i.skipExist||m===void 0)&&t.updateStore(L_(t.store,h,no(g)[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,no(no(c).map(function(d){return d.entity})))}})):a=o,s(a)}),it(this,"resetFields",function(i){t.warningUnhooked();var r=t.store;if(!i){t.updateStore(q2(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var o=i.map(hc);o.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(L_(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:o}),t.notifyObservers(r,o,{type:"reset"}),t.notifyWatch(o)}),it(this,"setFields",function(i){t.warningUnhooked();var r=t.store,o=[];i.forEach(function(s){var a=s.name,l=Ku(s,U8t),c=hc(a);o.push(c),"value"in l&&t.updateStore(L_(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:s})}),t.notifyWatch(o)}),it(this,"getFields",function(){var i=t.getFieldEntities(!0),r=i.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=pt(pt({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r}),it(this,"initEntityValue",function(i){var r=i.props.initialValue;if(r!==void 0){var o=i.getNamePath(),s=J_(t.store,o);s===void 0&&t.updateStore(L_(t.store,o,r))}}),it(this,"isMergedPreserve",function(i){var r=i!==void 0?i:t.preserve;return r??!0}),it(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!kHe(d.getNamePath(),r)})){var u=t.store;t.updateStore(L_(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}}),it(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}}}),it(this,"notifyObservers",function(i,r,o){if(t.subscribable){var s=pt(pt({},o),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(i,r,s)})}else t.forceRootUpdate()}),it(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(no(o))}),o}),it(this,"updateValue",function(i,r){var o=hc(i),s=t.store;t.updateStore(L_(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=s2e(t.store,[o]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([o].concat(no(a)))}),it(this,"setFieldsValue",function(i){t.warningUnhooked();var r=t.store;if(i){var o=q2(t.store,i);t.updateStore(o)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),it(this,"setFieldValue",function(i,r){t.setFields([{name:i,value:r}])}),it(this,"getDependencyChildrenFields",function(i){var r=new Set,o=[],s=new HI;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=hc(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}),it(this,"triggerOnFieldsChange",function(i,r){var o=t.callbacks.onFieldsChange;if(o){var s=t.getFields();if(r){var a=new HI;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 HL(i,u)});l.length&&o(l,s)}}),it(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(hc):[],u=[],d=String(Date.now()),h=new Set,f=(o=a)===null||o===void 0?void 0:o.recursive;t.getFieldEntities(!0).forEach(function(_){if(l||c.push(_.getNamePath()),!(!_.props.rules||!_.props.rules.length)){var b=_.getNamePath();if(h.add(b.join(d)),!l||HL(c,b,f)){var y=_.validateRules(pt({validateMessages:pt(pt({},THe),t.validateMessages)},a));u.push(y.then(function(){return{name:b,errors:[],warnings:[]}}).catch(function(C){var E,x=[],k=[];return(E=C.forEach)===null||E===void 0||E.call(C,function(L){var D=L.rule.warningOnly,A=L.errors;D?k.push.apply(k,no(A)):x.push.apply(x,no(A))}),x.length?Promise.reject({name:b,errors:x,warnings:k}):{name:b,errors:x,warnings:k}}))}}});var g=z8t(u);t.lastValidatePromise=g,g.catch(function(_){return _}).then(function(_){var b=_.map(function(y){var C=y.name;return C});t.notifyObservers(t.store,b,{type:"validateFinish"}),t.triggerOnFieldsChange(b,_)});var m=g.then(function(){return t.lastValidatePromise===g?Promise.resolve(t.getFieldsValue(c)):Promise.reject([])}).catch(function(_){var b=_.filter(function(y){return y&&y.errors.length});return Promise.reject({values:t.getFieldsValue(c),errorFields:b,outOfDate:t.lastValidatePromise!==g})});m.catch(function(_){return _});var v=c.filter(function(_){return h.has(_.join(d))});return t.triggerOnFieldsChange(v),m}),it(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 DHe(n){var e=w.useRef(),t=w.useState({}),i=cn(t,2),r=i[1];if(!e.current)if(n)e.current=n;else{var o=function(){r({})},s=new j8t(o);e.current=s.getForm()}return[e.current]}var fse=w.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),q8t=function(e){var t=e.validateMessages,i=e.onFormChange,r=e.onFormFinish,o=e.children,s=w.useContext(fse),a=w.useRef({});return w.createElement(fse.Provider,{value:pt(pt({},s),{},{validateMessages:pt(pt({},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=pt(pt({},a.current),{},it({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=pt({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},G8t=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],K8t=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,f=h===void 0?"onChange":h,g=e.onValuesChange,m=e.onFieldsChange,v=e.onFinish,_=e.onFinishFailed,b=Ku(e,G8t),y=w.useContext(fse),C=DHe(s),E=cn(C,1),x=E[0],k=x.getInternalHooks(Fx),L=k.useSubscribe,D=k.setInitialValues,A=k.setCallbacks,N=k.setValidateMessages,P=k.setPreserve,M=k.destroyForm;w.useImperativeHandle(t,function(){return x}),w.useEffect(function(){return y.registerForm(i,x),function(){y.unregisterForm(i)}},[y,x,i]),N(pt(pt({},y.validateMessages),d)),A({onValuesChange:g,onFieldsChange:function(oe){if(y.triggerFormChange(i,oe),m){for(var Q=arguments.length,Ne=new Array(Q>1?Q-1:0),Ve=1;Ve<Q;Ve++)Ne[Ve-1]=arguments[Ve];m.apply(void 0,[oe].concat(Ne))}},onFinish:function(oe){y.triggerFormFinish(i,oe),v&&v(oe)},onFinishFailed:_}),P(a);var B=w.useRef(null);D(r,!B.current),B.current||(B.current=!0),w.useEffect(function(){return M},[]);var F,U=typeof l=="function";if(U){var H=x.getFieldsValue(!0);F=l(H,x)}else F=l;L(!U);var W=w.useRef();w.useEffect(function(){$8t(W.current||[],o||[])||x.setFields(o||[]),W.current=o},[o,x]);var q=w.useMemo(function(){return pt(pt({},x),{},{validateTrigger:f})},[x,f]),V=w.createElement(tW.Provider,{value:null},w.createElement(JD.Provider,{value:q},F));return u===!1?V:w.createElement(u,Tt({},b,{onSubmit:function(oe){oe.preventDefault(),oe.stopPropagation(),x.submit()},onReset:function(oe){var Q;oe.preventDefault(),x.resetFields(),(Q=b.onReset)===null||Q===void 0||Q.call(b,oe)}}),V)};function c2e(n){try{return JSON.stringify(n)}catch{return Math.random()}}function Y8t(){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=n8t(s)?{form:s}:s,l=a.form,c=w.useState(),u=cn(c,2),d=u[0],h=u[1],f=w.useMemo(function(){return c2e(d)},[d]),g=w.useRef(f);g.current=f;var m=w.useContext(JD),v=l||m,_=v&&v._init,b=hc(r),y=w.useRef(b);return y.current=b,w.useEffect(function(){if(_){var C=v.getFieldsValue,E=v.getInternalHooks,x=E(Fx),k=x.registerWatch,L=k(function(A,N){var P=J_(a.preserve?N:A,y.current),M=c2e(P);g.current!==M&&(g.current=M,h(P))}),D=J_(a.preserve?C(!0):C(),y.current);return d!==D&&h(D),L}},[_]),d}var Q8t=w.forwardRef(K8t),jF=Q8t;jF.FormProvider=q8t;jF.Field=IHe;jF.List=W8t;jF.useForm=DHe;jF.useWatch=Y8t;const AHe=w.createContext({}),X8t=n=>({animationDuration:n,animationFillMode:"both"}),Z8t=n=>({animationDuration:n,animationFillMode:"both"}),RHe=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({},X8t(i)),{animationPlayState:"paused"}),[`${o}${n}-leave`]:Object.assign(Object.assign({},Z8t(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"}}},J8t=new gh("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),e9t=new gh("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),t9t=new gh("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),n9t=new gh("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),i9t=new gh("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),r9t=new gh("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),o9t=new gh("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),s9t=new gh("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),a9t={"move-up":{inKeyframes:o9t,outKeyframes:s9t},"move-down":{inKeyframes:J8t,outKeyframes:e9t},"move-left":{inKeyframes:t9t,outKeyframes:n9t},"move-right":{inKeyframes:i9t,outKeyframes:r9t}},u2e=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:o}=a9t[e];return[RHe(i,r,o,n.motionDurationMid),{[`
${i}-enter,
${i}-appear
`]:{opacity:0,animationTimingFunction:n.motionEaseOutCirc},[`${i}-leave`]:{animationTimingFunction:n.motionEaseInOutCirc}}]},NHe=new gh("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),OHe=new gh("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),PHe=new gh("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),MHe=new gh("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),l9t=new gh("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),c9t=new gh("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),u9t=new gh("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),d9t=new gh("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),h9t={"slide-up":{inKeyframes:NHe,outKeyframes:OHe},"slide-down":{inKeyframes:PHe,outKeyframes:MHe},"slide-left":{inKeyframes:l9t,outKeyframes:c9t},"slide-right":{inKeyframes:u9t,outKeyframes:d9t}},d2e=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:o}=h9t[e];return[RHe(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 f9t(n){return function(t){return w.createElement(d_e,{theme:{token:{motion:!1,zIndexPopupBase:0}}},w.createElement(n,Object.assign({},t)))}}function FHe(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),[f,g]=wm(!1,{value:o.open}),{getPrefixCls:m}=w.useContext(Ym),v=m(e||"select",s);w.useEffect(()=>{if(g(!0),typeof ResizeObserver<"u"){const b=new ResizeObserver(C=>{const E=C[0].target;u(E.offsetHeight+8),h(E.offsetWidth)}),y=setInterval(()=>{var C;const E=t?`.${t(v)}`:`.${v}-dropdown`,x=(C=l.current)===null||C===void 0?void 0:C.querySelector(E);x&&(clearInterval(y),b.observe(x))},10);return()=>{clearInterval(y),b.disconnect()}}},[]);let _=Object.assign(Object.assign({},o),{style:Object.assign(Object.assign({},a),{margin:0}),open:f,visible:f,getPopupContainer:()=>l.current});return i&&(_=i(_)),w.createElement("div",{ref:l,style:{paddingBottom:c,position:"relative",minWidth:d}},w.createElement(n,Object.assign({},_)))}return f9t(r)}const p9t=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 g9t(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 f={position:"absolute"};if(t.autoArrow!==!1){var g=t.points[0],m=t.points[1],v=g[0],_=g[1],b=m[0],y=m[1];v===b||!["t","b"].includes(v)?f.top=d:v==="t"?f.top=0:f.bottom=0,_===y||!["l","r"].includes(_)?f.left=c:_==="l"?f.left=0:f.right=0}return w.createElement("div",{ref:h,className:zt("".concat(e,"-arrow"),s),style:f},a)}function m9t(n){var e=n.prefixCls,t=n.open,i=n.zIndex,r=n.mask,o=n.motion;return r?w.createElement(HF,Tt({},o,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return w.createElement("div",{style:{zIndex:i},className:zt("".concat(e,"-mask"),a)})}):null}var _9t=w.memo(function(n){var e=n.children;return e},function(n,e){return e.cache}),v9t=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,f=n.arrow,g=n.arrowPos,m=n.align,v=n.motion,_=n.maskMotion,b=n.forceRender,y=n.getPopupContainer,C=n.autoDestroy,E=n.portal,x=n.zIndex,k=n.onMouseEnter,L=n.onMouseLeave,D=n.onPointerEnter,A=n.ready,N=n.offsetX,P=n.offsetY,M=n.offsetR,B=n.offsetB,F=n.onAlign,U=n.onPrepare,H=n.stretch,W=n.targetWidth,q=n.targetHeight,V=typeof t=="function"?t():t,re=l||c,oe=(y==null?void 0:y.length)>0,Q=w.useState(!y||!oe),Ne=cn(Q,2),Ve=Ne[0],Ye=Ne[1];if(ih(function(){!Ve&&oe&&s&&Ye(!0)},[Ve,oe,s]),!Ve)return null;var ye="auto",He={left:"-1000vw",top:"-1000vh",right:ye,bottom:ye};if(A||!l){var Pe,Ge=m.points,Fe=m.dynamicInset||((Pe=m._experimental)===null||Pe===void 0?void 0:Pe.dynamicInset),bt=Fe&&Ge[0][1]==="r",Mt=Fe&&Ge[0][0]==="b";bt?(He.right=M,He.left=ye):(He.left=N,He.right=ye),Mt?(He.bottom=B,He.top=ye):(He.top=P,He.bottom=ye)}var Ft={};return H&&(H.includes("height")&&q?Ft.height=q:H.includes("minHeight")&&q&&(Ft.minHeight=q),H.includes("width")&&W?Ft.width=W:H.includes("minWidth")&&W&&(Ft.minWidth=W)),l||(Ft.pointerEvents="none"),w.createElement(E,{open:b||re,getContainer:y&&function(){return y(s)},autoDestroy:C},w.createElement(m9t,{prefixCls:r,open:l,zIndex:x,mask:h,motion:_}),w.createElement(i_e,{onResize:F,disabled:!l},function(Yt){return w.createElement(HF,Tt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(r,"-hidden")},v,{onAppearPrepare:U,onEnterPrepare:U,visible:l,onVisibleChanged:function(Et){var mt;v==null||(mt=v.onVisibleChanged)===null||mt===void 0||mt.call(v,Et),a(Et)}}),function(ln,Et){var mt=ln.className,Lt=ln.style,be=zt(r,mt,i);return w.createElement("div",{ref:Hq(Yt,e,Et),className:be,style:pt(pt(pt(pt({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},He),Ft),Lt),{},{boxSizing:"border-box",zIndex:x},o),onMouseEnter:k,onMouseLeave:L,onPointerEnter:D,onClick:d},f&&w.createElement(g9t,{prefixCls:r,arrow:f,arrowPos:g,align:m}),w.createElement(_9t,{cache:!l&&!u},V))})}))}),b9t=w.forwardRef(function(n,e){var t=n.children,i=n.getTriggerDOMNode,r=$F(t),o=w.useCallback(function(a){t_e(e,i?i(a):a)},[i]),s=n_e(o,t.ref);return r?w.cloneElement(t,{ref:s}):t}),h2e=w.createContext(null);function f2e(n){return n?Array.isArray(n)?n:[n]:[]}function y9t(n,e,t,i){return w.useMemo(function(){var r=f2e(t??e),o=f2e(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 C9t(){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 w9t(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(C9t((a=n[l])===null||a===void 0?void 0:a.points,r,i))return"".concat(e,"-placement-").concat(l)}return""}function p2e(n,e,t,i){return e||(t?{motionName:"".concat(n,"-").concat(t)}:i?{motionName:i}:null)}function qF(n){return n.ownerDocument.defaultView}function pse(n){for(var e=[],t=n==null?void 0:n.parentElement,i=["hidden","scroll","clip","auto"];t;){var r=qF(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 Y4(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(n)?e:n}function aO(n){return Y4(parseFloat(n),0)}function g2e(n,e){var t=pt({},n);return(e||[]).forEach(function(i){if(!(i instanceof HTMLBodyElement||i instanceof HTMLHtmlElement)){var r=qF(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,f=i.clientHeight,g=i.offsetWidth,m=i.clientWidth,v=aO(a),_=aO(l),b=aO(c),y=aO(u),C=Y4(Math.round(d.width/g*1e3)/1e3),E=Y4(Math.round(d.height/h*1e3)/1e3),x=(g-m-b-y)*C,k=(h-f-v-_)*E,L=v*E,D=_*E,A=b*C,N=y*C,P=0,M=0;if(o==="clip"){var B=aO(s);P=B*C,M=B*E}var F=d.x+A-P,U=d.y+L-M,H=F+d.width+2*P-A-N-x,W=U+d.height+2*M-L-D-k;t.left=Math.max(t.left,F),t.top=Math.max(t.top,U),t.right=Math.min(t.right,H),t.bottom=Math.min(t.bottom,W)}}),t}function m2e(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 _2e(n,e){var t=e||[],i=cn(t,2),r=i[0],o=i[1];return[m2e(n.width,r),m2e(n.height,o)]}function v2e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[n[0],n[1]]}function WI(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 tC(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 S9t(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=cn(a,2),c=l[0],u=l[1],d=w.useRef(0),h=w.useMemo(function(){return e?pse(e):[]},[e]),f=w.useRef({}),g=function(){f.current={}};n||g();var m=B_(function(){if(e&&t&&n){let Lr=function(so,Ki){var ti=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lt,yi=q.x+so,Qn=q.y+Ki,li=yi+He,Si=Qn+ye,Yi=Math.max(yi,ti.left),Tn=Math.max(Qn,ti.top),xn=Math.min(li,ti.right),Xn=Math.min(Si,ti.bottom);return Math.max(0,(xn-Yi)*(Xn-Tn))},Br=function(){Wr=q.y+hn,Qe=Wr+ye,Ct=q.x+Cn,Gt=Ct+He};var b,y,C=e,E=C.ownerDocument,x=qF(C),k=x.getComputedStyle(C),L=k.width,D=k.height,A=k.position,N=C.style.left,P=C.style.top,M=C.style.right,B=C.style.bottom,F=pt(pt({},r[i]),o),U=E.createElement("div");(b=C.parentElement)===null||b===void 0||b.appendChild(U),U.style.left="".concat(C.offsetLeft,"px"),U.style.top="".concat(C.offsetTop,"px"),U.style.position=A,U.style.height="".concat(C.offsetHeight,"px"),U.style.width="".concat(C.offsetWidth,"px"),C.style.left="0",C.style.top="0",C.style.right="auto",C.style.bottom="auto";var H;if(Array.isArray(t))H={x:t[0],y:t[1],width:0,height:0};else{var W=t.getBoundingClientRect();H={x:W.x,y:W.y,width:W.width,height:W.height}}var q=C.getBoundingClientRect(),V=E.documentElement,re=V.clientWidth,oe=V.clientHeight,Q=V.scrollWidth,Ne=V.scrollHeight,Ve=V.scrollTop,Ye=V.scrollLeft,ye=q.height,He=q.width,Pe=H.height,Ge=H.width,Fe={left:0,top:0,right:re,bottom:oe},bt={left:-Ye,top:-Ve,right:Q-Ye,bottom:Ne-Ve},Mt=F.htmlRegion,Ft="visible",Yt="visibleFirst";Mt!=="scroll"&&Mt!==Yt&&(Mt=Ft);var ln=Mt===Yt,Et=g2e(bt,h),mt=g2e(Fe,h),Lt=Mt===Ft?mt:Et,be=ln?mt:Lt;C.style.left="auto",C.style.top="auto",C.style.right="0",C.style.bottom="0";var Te=C.getBoundingClientRect();C.style.left=N,C.style.top=P,C.style.right=M,C.style.bottom=B,(y=C.parentElement)===null||y===void 0||y.removeChild(U);var se=Y4(Math.round(He/parseFloat(L)*1e3)/1e3),Y=Y4(Math.round(ye/parseFloat(D)*1e3)/1e3);if(se===0||Y===0||jH(t)&&!f_e(t))return;var X=F.offset,le=F.targetOffset,te=_2e(q,X),me=cn(te,2),Me=me[0],rt=me[1],It=_2e(H,le),Qt=cn(It,2),pe=Qt[0],We=Qt[1];H.x-=pe,H.y-=We;var ne=F.points||[],Se=cn(ne,2),Ie=Se[0],Ke=Se[1],Je=v2e(Ke),ot=v2e(Ie),wt=WI(H,Je),pn=WI(q,ot),Kn=pt({},F),Cn=wt.x-pn.x+Me,hn=wt.y-pn.y+rt,bn=Lr(Cn,hn),Wn=Lr(Cn,hn,mt),Ei=WI(H,["t","l"]),er=WI(q,["t","l"]),ur=WI(H,["b","r"]),Jr=WI(q,["b","r"]),$i=F.overflow||{},xs=$i.adjustX,wr=$i.adjustY,Ji=$i.shiftX,rn=$i.shiftY,di=function(Ki){return typeof Ki=="boolean"?Ki:Ki>=0},Wr,Qe,Ct,Gt;Br();var Jt=di(wr),ut=ot[0]===Je[0];if(Jt&&ot[0]==="t"&&(Qe>be.bottom||f.current.bt)){var Le=hn;ut?Le-=ye-Pe:Le=Ei.y-Jr.y-rt;var st=Lr(Cn,Le),ze=Lr(Cn,Le,mt);st>bn||st===bn&&(!ln||ze>=Wn)?(f.current.bt=!0,hn=Le,rt=-rt,Kn.points=[tC(ot,0),tC(Je,0)]):f.current.bt=!1}if(Jt&&ot[0]==="b"&&(Wr<be.top||f.current.tb)){var Ee=hn;ut?Ee+=ye-Pe:Ee=ur.y-er.y-rt;var tt=Lr(Cn,Ee),xt=Lr(Cn,Ee,mt);tt>bn||tt===bn&&(!ln||xt>=Wn)?(f.current.tb=!0,hn=Ee,rt=-rt,Kn.points=[tC(ot,0),tC(Je,0)]):f.current.tb=!1}var lt=di(xs),gn=ot[1]===Je[1];if(lt&&ot[1]==="l"&&(Gt>be.right||f.current.rl)){var Ln=Cn;gn?Ln-=He-Ge:Ln=Ei.x-Jr.x-Me;var ri=Lr(Ln,hn),mi=Lr(Ln,hn,mt);ri>bn||ri===bn&&(!ln||mi>=Wn)?(f.current.rl=!0,Cn=Ln,Me=-Me,Kn.points=[tC(ot,1),tC(Je,1)]):f.current.rl=!1}if(lt&&ot[1]==="r"&&(Ct<be.left||f.current.lr)){var Vi=Cn;gn?Vi+=He-Ge:Vi=ur.x-er.x-Me;var qn=Lr(Vi,hn),mn=Lr(Vi,hn,mt);qn>bn||qn===bn&&(!ln||mn>=Wn)?(f.current.lr=!0,Cn=Vi,Me=-Me,Kn.points=[tC(ot,1),tC(Je,1)]):f.current.lr=!1}Br();var oi=Ji===!0?0:Ji;typeof oi=="number"&&(Ct<mt.left&&(Cn-=Ct-mt.left-Me,H.x+Ge<mt.left+oi&&(Cn+=H.x-mt.left+Ge-oi)),Gt>mt.right&&(Cn-=Gt-mt.right-Me,H.x>mt.right-oi&&(Cn+=H.x-mt.right+oi)));var dr=rn===!0?0:rn;typeof dr=="number"&&(Wr<mt.top&&(hn-=Wr-mt.top-rt,H.y+Pe<mt.top+dr&&(hn+=H.y-mt.top+Pe-dr)),Qe>mt.bottom&&(hn-=Qe-mt.bottom-rt,H.y>mt.bottom-dr&&(hn+=H.y-mt.bottom+dr)));var gr=q.x+Cn,ta=gr+He,ma=q.y+hn,za=ma+ye,ts=H.x,fs=ts+Ge,$o=H.y,Tl=$o+Pe,ac=Math.max(gr,ts),xi=Math.min(ta,fs),co=(ac+xi)/2,vo=co-gr,Ws=Math.max(ma,$o),Vo=Math.min(za,Tl),zs=(Ws+Vo)/2,No=zs-ma;s==null||s(e,Kn);var Yr=Te.right-q.x-(Cn+q.width),uo=Te.bottom-q.y-(hn+q.height);u({ready:!0,offsetX:Cn/se,offsetY:hn/Y,offsetR:Yr/se,offsetB:uo/Y,arrowX:vo/se,arrowY:No/Y,scaleX:se,scaleY:Y,align:Kn})}}),v=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&m()})},_=function(){u(function(y){return pt(pt({},y),{},{ready:!1})})};return ih(_,[i]),ih(function(){n||_()},[n]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function E9t(n,e,t,i,r){ih(function(){if(n&&e&&t){let d=function(){i(),r()};var o=e,s=t,a=pse(o),l=pse(s),c=qF(s),u=new Set([c].concat(no(a),no(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 x9t(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=Yf(function(){c.current=!1});return function(){Yf.cancel(u)}},[n]),w.useEffect(function(){if(e&&i&&(!r||o)){var u=function(){var x=!1,k=function(A){var N=A.target;x=s(N)},L=function(A){var N=A.target;!c.current&&l.current&&!x&&!s(N)&&a(!1)};return[k,L]},d=u(),h=cn(d,2),f=h[0],g=h[1],m=u(),v=cn(m,2),_=v[0],b=v[1],y=qF(i);y.addEventListener("mousedown",f,!0),y.addEventListener("click",g,!0),y.addEventListener("contextmenu",g,!0);var C=ZH(t);return C&&(C.addEventListener("mousedown",_,!0),C.addEventListener("click",b,!0),C.addEventListener("contextmenu",b,!0)),function(){y.removeEventListener("mousedown",f,!0),y.removeEventListener("click",g,!0),y.removeEventListener("contextmenu",g,!0),C&&(C.removeEventListener("mousedown",_,!0),C.removeEventListener("click",b,!0),C.removeEventListener("contextmenu",b,!0))}}},[e,t,i,r,o])}var T9t=["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 k9t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:EHe,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,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,m=t.mouseEnterDelay,v=t.mouseLeaveDelay,_=v===void 0?.1:v,b=t.focusDelay,y=t.blurDelay,C=t.mask,E=t.maskClosable,x=E===void 0?!0:E,k=t.getPopupContainer,L=t.forceRender,D=t.autoDestroy,A=t.destroyPopupOnHide,N=t.popup,P=t.popupClassName,M=t.popupStyle,B=t.popupPlacement,F=t.builtinPlacements,U=F===void 0?{}:F,H=t.popupAlign,W=t.zIndex,q=t.stretch,V=t.getPopupClassNameFromAlign,re=t.fresh,oe=t.alignPoint,Q=t.onPopupClick,Ne=t.onPopupAlign,Ve=t.arrow,Ye=t.popupMotion,ye=t.maskMotion,He=t.popupTransitionName,Pe=t.popupAnimation,Ge=t.maskTransitionName,Fe=t.maskAnimation,bt=t.className,Mt=t.getTriggerDOMNode,Ft=Ku(t,T9t),Yt=D||A||!1,ln=w.useState(!1),Et=cn(ln,2),mt=Et[0],Lt=Et[1];ih(function(){Lt(p9t())},[]);var be=w.useRef({}),Te=w.useContext(h2e),se=w.useMemo(function(){return{registerSubPopup:function($t,yn){be.current[$t]=yn,Te==null||Te.registerSubPopup($t,yn)}}},[Te]),Y=t8t(),X=w.useState(null),le=cn(X,2),te=le[0],me=le[1],Me=B_(function(vt){jH(vt)&&te!==vt&&me(vt),Te==null||Te.registerSubPopup(Y,vt)}),rt=w.useState(null),It=cn(rt,2),Qt=It[0],pe=It[1],We=w.useRef(null),ne=B_(function(vt){jH(vt)&&Qt!==vt&&(pe(vt),We.current=vt)}),Se=w.Children.only(s),Ie=(Se==null?void 0:Se.props)||{},Ke={},Je=B_(function(vt){var $t,yn,ni=Qt;return(ni==null?void 0:ni.contains(vt))||(($t=ZH(ni))===null||$t===void 0?void 0:$t.host)===vt||vt===ni||(te==null?void 0:te.contains(vt))||((yn=ZH(te))===null||yn===void 0?void 0:yn.host)===vt||vt===te||Object.values(be.current).some(function(Gn){return(Gn==null?void 0:Gn.contains(vt))||vt===Gn})}),ot=p2e(o,Ye,Pe,He),wt=p2e(o,ye,Fe,Ge),pn=w.useState(h||!1),Kn=cn(pn,2),Cn=Kn[0],hn=Kn[1],bn=d??Cn,Wn=B_(function(vt){d===void 0&&hn(vt)});ih(function(){hn(d||!1)},[d]);var Ei=w.useRef(bn);Ei.current=bn;var er=B_(function(vt){op.flushSync(function(){bn!==vt&&(Wn(vt),f==null||f(vt))})}),ur=w.useRef(),Jr=function(){clearTimeout(ur.current)},$i=function($t){var yn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Jr(),yn===0?er($t):ur.current=setTimeout(function(){er($t)},yn*1e3)};w.useEffect(function(){return Jr},[]);var xs=w.useState(!1),wr=cn(xs,2),Ji=wr[0],rn=wr[1];ih(function(vt){(!vt||bn)&&rn(!0)},[bn]);var di=w.useState(null),Wr=cn(di,2),Qe=Wr[0],Ct=Wr[1],Gt=w.useState([0,0]),Jt=cn(Gt,2),ut=Jt[0],Le=Jt[1],st=function($t){Le([$t.clientX,$t.clientY])},ze=S9t(bn,te,oe?ut:Qt,B,U,H,Ne),Ee=cn(ze,11),tt=Ee[0],xt=Ee[1],lt=Ee[2],gn=Ee[3],Ln=Ee[4],ri=Ee[5],mi=Ee[6],Vi=Ee[7],qn=Ee[8],mn=Ee[9],oi=Ee[10],dr=y9t(mt,l,c,u),gr=cn(dr,2),ta=gr[0],ma=gr[1],za=ta.has("click"),ts=ma.has("click")||ma.has("contextMenu"),fs=B_(function(){Ji||oi()}),$o=function(){Ei.current&&oe&&ts&&$i(!1)};E9t(bn,Qt,te,fs,$o),ih(function(){fs()},[ut,B]),ih(function(){bn&&!(U!=null&&U[B])&&fs()},[JSON.stringify(H)]);var Tl=w.useMemo(function(){var vt=w9t(U,o,mn,oe);return zt(vt,V==null?void 0:V(mn))},[mn,V,U,o,oe]);w.useImperativeHandle(i,function(){return{nativeElement:We.current,forceAlign:fs}});var ac=w.useState(0),xi=cn(ac,2),co=xi[0],vo=xi[1],Ws=w.useState(0),Vo=cn(Ws,2),zs=Vo[0],No=Vo[1],Yr=function(){if(q&&Qt){var $t=Qt.getBoundingClientRect();vo($t.width),No($t.height)}},uo=function(){Yr(),fs()},Lr=function($t){rn(!1),oi(),g==null||g($t)},Br=function(){return new Promise(function($t){Yr(),Ct(function(){return $t})})};ih(function(){Qe&&(oi(),Qe(),Ct(null))},[Qe]);function so(vt,$t,yn,ni){Ke[vt]=function(Gn){var fi;ni==null||ni(Gn),$i($t,yn);for(var $r=arguments.length,ho=new Array($r>1?$r-1:0),eo=1;eo<$r;eo++)ho[eo-1]=arguments[eo];(fi=Ie[vt])===null||fi===void 0||fi.call.apply(fi,[Ie,Gn].concat(ho))}}(za||ts)&&(Ke.onClick=function(vt){var $t;Ei.current&&ts?$i(!1):!Ei.current&&za&&(st(vt),$i(!0));for(var yn=arguments.length,ni=new Array(yn>1?yn-1:0),Gn=1;Gn<yn;Gn++)ni[Gn-1]=arguments[Gn];($t=Ie.onClick)===null||$t===void 0||$t.call.apply($t,[Ie,vt].concat(ni))}),x9t(bn,ts,Qt,te,C,x,Je,$i);var Ki=ta.has("hover"),ti=ma.has("hover"),yi,Qn;Ki&&(so("onMouseEnter",!0,m,function(vt){st(vt)}),so("onPointerEnter",!0,m,function(vt){st(vt)}),yi=function(){(bn||Ji)&&$i(!0,m)},oe&&(Ke.onMouseMove=function(vt){var $t;($t=Ie.onMouseMove)===null||$t===void 0||$t.call(Ie,vt)})),ti&&(so("onMouseLeave",!1,_),so("onPointerLeave",!1,_),Qn=function(){$i(!1,_)}),ta.has("focus")&&so("onFocus",!0,b),ma.has("focus")&&so("onBlur",!1,y),ta.has("contextMenu")&&(Ke.onContextMenu=function(vt){var $t;Ei.current&&ma.has("contextMenu")?$i(!1):(st(vt),$i(!0)),vt.preventDefault();for(var yn=arguments.length,ni=new Array(yn>1?yn-1:0),Gn=1;Gn<yn;Gn++)ni[Gn-1]=arguments[Gn];($t=Ie.onContextMenu)===null||$t===void 0||$t.call.apply($t,[Ie,vt].concat(ni))}),bt&&(Ke.className=zt(Ie.className,bt));var li=pt(pt({},Ie),Ke),Si={},Yi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Yi.forEach(function(vt){Ft[vt]&&(Si[vt]=function(){for(var $t,yn=arguments.length,ni=new Array(yn),Gn=0;Gn<yn;Gn++)ni[Gn]=arguments[Gn];($t=li[vt])===null||$t===void 0||$t.call.apply($t,[li].concat(ni)),Ft[vt].apply(Ft,ni)})});var Tn=w.cloneElement(Se,pt(pt({},li),Si)),xn={x:ri,y:mi},Xn=Ve?pt({},Ve!==!0?Ve:{}):null;return w.createElement(w.Fragment,null,w.createElement(i_e,{disabled:!bn,ref:ne,onResize:uo},w.createElement(b9t,{getTriggerDOMNode:Mt},Tn)),w.createElement(h2e.Provider,{value:se},w.createElement(v9t,{portal:n,ref:Me,prefixCls:o,popup:N,className:zt(P,Tl),style:M,target:Qt,onMouseEnter:yi,onMouseLeave:Qn,onPointerEnter:yi,zIndex:W,open:bn,keepDom:Ji,fresh:re,onClick:Q,mask:C,motion:ot,maskMotion:wt,onVisibleChanged:Lr,onPrepare:Br,forceRender:L,autoDestroy:Yt,getPopupContainer:k,align:mn,arrow:Xn,arrowPos:xn,ready:tt,offsetX:xt,offsetY:lt,offsetR:gn,offsetB:Ln,onAlign:fs,stretch:q,targetWidth:co/Vi,targetHeight:zs/qn})))});return e}const I9t=k9t(EHe);function BHe(n,e,t){return zt({[`${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 $He=(n,e)=>e||n;var VHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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")}}})})(VHe);var L9t=VHe.exports;const D9t=nl(L9t);var HHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,function(){return function(t,i,r){var o=i.prototype,s=function(d){return d&&(d.indexOf?d:d.s)},a=function(d,h,f,g,m){var v=d.name?d:d.$locale(),_=s(v[h]),b=s(v[f]),y=_||b.map(function(E){return E.slice(0,g)});if(!m)return y;var C=v.weekStart;return y.map(function(E,x){return y[(x+(C||0))%7]})},l=function(){return r.Ls[r.locale()]},c=function(d,h){return d.formats[h]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,m,v){return m||v.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)}}})})(HHe);var A9t=HHe.exports;const R9t=nl(A9t);var WHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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"),f=this.diff(h,t,!0);return f<0?s(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(WHe);var N9t=WHe.exports;const O9t=nl(N9t);var zHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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}}})})(zHe);var P9t=zHe.exports;const M9t=nl(P9t);var UHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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)}}})})(UHe);var F9t=UHe.exports;const B9t=nl(F9t);var jHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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(v){this[m]=+v}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(v){if(!v||v==="Z")return 0;var _=v.match(/([+-]|\d\d)/g),b=60*_[1]+(+_[2]||0);return b===0?0:_[0]==="+"?-b:b}(m)}],d=function(m){var v=a[m];return v&&(v.indexOf?v:v.s.concat(v.f))},h=function(m,v){var _,b=a.meridiem;if(b){for(var y=1;y<=24;y+=1)if(m.indexOf(b(y,0,v))>-1){_=y>12;break}}else _=m===(v?"pm":"PM");return _},f={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 v=a.ordinal,_=m.match(/\d+/);if(this.day=_[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===m&&(this.day=b)}],M:[o,c("month")],MM:[r,c("month")],MMM:[s,function(m){var v=d("months"),_=(d("monthsShort")||v.map(function(b){return b.slice(0,3)})).indexOf(m)+1;if(_<1)throw new Error;this.month=_%12||_}],MMMM:[s,function(m){var v=d("months").indexOf(m)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(m){this.year=l(m)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(m){var v,_;v=m,_=a&&a.formats;for(var b=(m=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,A,N){var P=N&&N.toUpperCase();return A||_[N]||t[N]||_[P].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,B,F){return B||F.slice(1)})})).match(i),y=b.length,C=0;C<y;C+=1){var E=b[C],x=f[E],k=x&&x[0],L=x&&x[1];b[C]=L?{regex:k,parser:L}:E.replace(/^\[|\]$/g,"")}return function(D){for(var A={},N=0,P=0;N<y;N+=1){var M=b[N];if(typeof M=="string")P+=M.length;else{var B=M.regex,F=M.parser,U=D.slice(P),H=B.exec(U)[0];F.call(A,H),D=D.replace(H,"")}}return function(W){var q=W.afternoon;if(q!==void 0){var V=W.hours;q?V<12&&(W.hours+=12):V===12&&(W.hours=0),delete W.afternoon}}(A),A}}return function(m,v,_){_.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(l=m.parseTwoDigitYear);var b=v.prototype,y=b.parse;b.parse=function(C){var E=C.date,x=C.utc,k=C.args;this.$u=x;var L=k[1];if(typeof L=="string"){var D=k[2]===!0,A=k[3]===!0,N=D||A,P=k[2];A&&(P=k[2]),a=this.$locale(),!D&&P&&(a=_.Ls[P]),this.$d=function(U,H,W){try{if(["x","X"].indexOf(H)>-1)return new Date((H==="X"?1e3:1)*U);var q=g(H)(U),V=q.year,re=q.month,oe=q.day,Q=q.hours,Ne=q.minutes,Ve=q.seconds,Ye=q.milliseconds,ye=q.zone,He=new Date,Pe=oe||(V||re?1:He.getDate()),Ge=V||He.getFullYear(),Fe=0;V&&!re||(Fe=re>0?re-1:He.getMonth());var bt=Q||0,Mt=Ne||0,Ft=Ve||0,Yt=Ye||0;return ye?new Date(Date.UTC(Ge,Fe,Pe,bt,Mt,Ft,Yt+60*ye.offset*1e3)):W?new Date(Date.UTC(Ge,Fe,Pe,bt,Mt,Ft,Yt)):new Date(Ge,Fe,Pe,bt,Mt,Ft,Yt)}catch{return new Date("")}}(E,L,x),this.init(),P&&P!==!0&&(this.$L=this.locale(P).$L),N&&E!=this.format(L)&&(this.$d=new Date("")),a={}}else if(L instanceof Array)for(var M=L.length,B=1;B<=M;B+=1){k[1]=L[B-1];var F=_.apply(this,k);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}B===M&&(this.$d=new Date(""))}else y.call(this,C)}}})})(jHe);var $9t=jHe.exports;const C_e=nl($9t);Un.extend(C_e);Un.extend(B9t);Un.extend(D9t);Un.extend(R9t);Un.extend(O9t);Un.extend(M9t);Un.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 V9t={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"},AE=function(e){var t=V9t[e];return t||e.split("_")[0]},b2e=function(){mVe(!1,"Not match any format. Please help to fire a issue about this.")},H9t={getNow:function(){return Un()},getFixedDate:function(e){return Un(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 Un().locale(AE(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(AE(e)).weekday(0)},getWeek:function(e,t){return t.locale(AE(e)).week()},getShortWeekDays:function(e){return Un().locale(AE(e)).localeData().weekdaysMin()},getShortMonths:function(e){return Un().locale(AE(e)).localeData().monthsShort()},format:function(e,t,i){return t.locale(AE(e)).format(i)},parse:function(e,t,i){for(var r=AE(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=Un(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 b2e(),null}var f=Un(a,s,!0).locale(r);if(f.isValid())return f}return t&&b2e(),null}}},q_=10,Ay=q_*10,sM=7;function Wk(n,e){if(!n&&!e)return!0;if(!n||!e)return!1}function W9t(n,e,t){var i=Wk(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 GF(n,e,t){var i=Wk(e,t);return typeof i=="boolean"?i:n.getYear(e)===n.getYear(t)}function gse(n,e){var t=Math.floor(n.getMonth(e)/3);return t+1}function qHe(n,e,t){var i=Wk(e,t);return typeof i=="boolean"?i:GF(n,e,t)&&gse(n,e)===gse(n,t)}function w_e(n,e,t){var i=Wk(e,t);return typeof i=="boolean"?i:GF(n,e,t)&&n.getMonth(e)===n.getMonth(t)}function Ry(n,e,t){var i=Wk(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 z9t(n,e,t){var i=Wk(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 L$(n,e,t,i){var r=Wk(t,i);return typeof r=="boolean"?r:GF(n,t,i)&&n.locale.getWeek(e,t)===n.locale.getWeek(e,i)}function eA(n,e,t){return Ry(n,e,t)&&z9t(n,e,t)}function lP(n,e,t,i){return!e||!t||!i?!1:!Ry(n,e,i)&&!Ry(n,t,i)&&n.isAfter(i,e)&&n.isAfter(t,i)}function U9t(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 aM(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 ah(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 GHe(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 nW(n){var e=n.cellDate,t=n.mode,i=n.disabledDate,r=n.generateConfig;if(!i)return!1;var o=function(g,m,v){for(var _=m;_<=v;){var b=void 0;switch(g){case"date":{if(b=r.setDate(e,_),!i(b))return!1;break}case"month":{if(b=r.setMonth(e,_),!nW({cellDate:b,mode:"month",generateConfig:r,disabledDate:i}))return!1;break}case"year":{if(b=r.setYear(e,_),!nW({cellDate:b,mode:"year",generateConfig:r,disabledDate:i}))return!1;break}}_+=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/q_)*q_,h=d+q_-1;return o("year",d,h)}}}function iW(n,e){var t=e.formatList,i=e.generateConfig,r=e.locale,o=BF(function(){if(!n)return[[""],""];for(var c="",u=[],d=0;d<t.length;d+=1){var h=t[d],f=ah(n,{generateConfig:i,locale:r,format:h});u.push(f),d===0&&(c=f)}return[u,c]},[n,t,r],function(c,u){return!eA(i,c[0],u[0])||!KH(c[1],u[1],!0)||!KH(c[2],u[2],!0)}),s=cn(o,2),a=s[0],l=s[1];return w.useMemo(function(){return[a,l]},[a.join(""),l])}function mse(n,e){var t=e.formatList,i=e.generateConfig,r=e.locale,o=w.useState(null),s=cn(o,2),a=s[0],l=s[1],c=w.useRef(null);function u(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(c.current),_){l(v);return}c.current=requestAnimationFrame(function(){l(v)})}var d=iW(a,{formatList:t,generateConfig:i,locale:r}),h=cn(d,2),f=h[1];function g(v){u(v)}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u(null,v)}return w.useEffect(function(){m(!0)},[n]),w.useEffect(function(){return function(){return cancelAnimationFrame(c.current)}},[]),[f,g,m]}var W8=new Map;function j9t(n,e){var t;function i(){f_e(n)?e():t=Yf(function(){i()})}return i(),function(){Yf.cancel(t)}}function _se(n,e,t){if(W8.get(n)&&cancelAnimationFrame(W8.get(n)),t<=0){W8.set(n,requestAnimationFrame(function(){n.scrollTop=e}));return}var i=e-n.scrollTop,r=i/t*10;W8.set(n,requestAnimationFrame(function(){n.scrollTop+=r,n.scrollTop!==e&&_se(n,e,t-10)}))}function NR(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 ii.LEFT:if(l||c){if(i)return i(-1),!0}else if(t)return t(-1),!0;break;case ii.RIGHT:if(l||c){if(i)return i(1),!0}else if(t)return t(1),!0;break;case ii.UP:if(r)return r(-1),!0;break;case ii.DOWN:if(r)return r(1),!0;break;case ii.PAGE_UP:if(o)return o(-1),!0;break;case ii.PAGE_DOWN:if(o)return o(1),!0;break;case ii.ENTER:if(s)return s(),!0;break}return!1}function KHe(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 YHe(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 lO=null,z8=new Set;function q9t(n){return!lO&&typeof window<"u"&&window.addEventListener&&(lO=function(t){no(z8).forEach(function(i){i(t)})},window.addEventListener("mousedown",lO)),z8.add(n),function(){z8.delete(n),z8.size===0&&(window.removeEventListener("mousedown",lO),lO=null)}}function G9t(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 K9t=function(e){return e==="month"||e==="date"?"year":e},Y9t=function(e){return e==="date"?"month":e},Q9t=function(e){return e==="month"||e==="date"?"quarter":e},X9t=function(e){return e==="date"?"week":e},Z9t={year:K9t,month:Y9t,quarter:Q9t,week:X9t,time:null,date:null};function QHe(n,e){return n.some(function(t){return t&&t.contains(e)})}function vse(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,f=w.useState(!1),g=cn(f,2),m=g[0],v=g[1],_=w.useState(!1),b=cn(_,2),y=b[0],C=b[1],E=w.useRef(!1),x=w.useRef(!1),k=w.useRef(!1),L={onMouseDown:function(){v(!0),r(!0)},onKeyDown:function(A){var N=function(){k.current=!0};if(s(A,N),!k.current){switch(A.which){case ii.ENTER:{e?c()!==!1&&v(!0):r(!0),A.preventDefault();return}case ii.TAB:{m&&e&&!A.shiftKey?(v(!1),A.preventDefault()):!m&&e&&!o(A)&&A.shiftKey&&(v(!0),A.preventDefault());return}case ii.ESC:{v(!0),u();return}}!e&&![ii.SHIFT].includes(A.which)?r(!0):m||o(A)}},onFocus:function(A){v(!0),C(!0),d&&d(A)},onBlur:function(A){if(E.current||!i(document.activeElement)){E.current=!1;return}a?setTimeout(function(){for(var N=document,P=N.activeElement;P&&P.shadowRoot;)P=P.shadowRoot.activeElement;i(P)&&u()},0):e&&(r(!1),x.current&&c()),C(!1),h==null||h(A)}};return w.useEffect(function(){x.current=!1},[e]),w.useEffect(function(){x.current=!0},[t]),w.useEffect(function(){return q9t(function(D){var A=G9t(D),N=i(A);e&&(N?!l&&!a&&(!y||N)&&r(!1):(E.current=!0,Yf(function(){E.current=!1})))})}),[L,{focused:y,typing:m}]}function XHe(n,e){return w.useMemo(function(){return n||(e?(Dd(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(e).map(function(t){var i=cn(t,2),r=i[0],o=i[1];return{label:r,value:o}})):[])},[n,e])}function bse(n){var e=n.valueTexts,t=n.onTextChange,i=w.useState(""),r=cn(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 ih(function(){e.every(function(u){return u!==o})&&c()},[e.join("||")]),[o,l,c]}var Xf=w.createContext({});function ZHe(n){var e=n.cellRender,t=n.monthCellRender,i=n.dateRender,r=ce.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 JHe(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 J9t=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t};function eWe(n){return n==null?[]:Array.isArray(n)?n:[n]}function Lo(n,e){return n?n[e]:null}function om(n,e,t){var i=[Lo(n,0),Lo(n,1)];return i[t]=typeof e=="function"?e(i[t]):e,!i[0]&&!i[1]?null:i}function y2e(n){return typeof n=="function"?n():n}function Yq(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,f=a(d,-1),g=a(d,1),m=Lo(i,0),v=Lo(i,1),_=Lo(r,0),b=Lo(r,1),y=lP(t,_,b,d);function C(A){return s(m,A)}function E(A){return s(v,A)}var x=s(_,d),k=s(b,d),L=(y||k)&&(!o(f)||E(f)),D=(y||x)&&(!o(g)||C(g));return h={},it(h,"".concat(e,"-in-view"),o(d)),it(h,"".concat(e,"-in-range"),lP(t,m,v,d)),it(h,"".concat(e,"-range-start"),C(d)),it(h,"".concat(e,"-range-end"),E(d)),it(h,"".concat(e,"-range-start-single"),C(d)&&!v),it(h,"".concat(e,"-range-end-single"),E(d)&&!m),it(h,"".concat(e,"-range-start-near-hover"),C(d)&&(s(f,_)||lP(t,_,b,f))),it(h,"".concat(e,"-range-end-near-hover"),E(d)&&(s(g,b)||lP(t,_,b,g))),it(h,"".concat(e,"-range-hover"),y),it(h,"".concat(e,"-range-hover-start"),x),it(h,"".concat(e,"-range-hover-end"),k),it(h,"".concat(e,"-range-hover-edge-start"),L),it(h,"".concat(e,"-range-hover-edge-end"),D),it(h,"".concat(e,"-range-hover-edge-start-near-range"),L&&s(f,v)),it(h,"".concat(e,"-range-hover-edge-end-near-range"),D&&s(g,m)),it(h,"".concat(e,"-today"),s(l,d)),it(h,"".concat(e,"-selected"),s(c,d)),h}return u}var zk=w.createContext({});function tWe(n,e,t,i,r){var o=n.setHour(e,t);return o=n.setMinute(o,i),o=n.setSecond(o,r),o}function nWe(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 e7t(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 t7t(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 KF(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,f=n.getCellDate,g=n.generateConfig,m=n.titleCell,v=n.headerCells,_=w.useContext(Xf),b=_.onDateMouseEnter,y=_.onDateMouseLeave,C=_.mode,E="".concat(e,"-cell"),x=[],k=0;k<o;k+=1){for(var L=[],D=void 0,A=function(){var M,B=k*s+N,F=f(c,B),U=nW({cellDate:F,mode:C,disabledDate:t,generateConfig:g});N===0&&(D=F,a&&L.push(a(D)));var H=m&&m(F),W=w.createElement("div",{className:"".concat(E,"-inner")},d(F));L.push(w.createElement("td",{key:N,title:H,className:zt(E,pt((M={},it(M,"".concat(E,"-disabled"),U),it(M,"".concat(E,"-start"),d(F)===1||r==="year"&&Number(H)%10===0),it(M,"".concat(E,"-end"),H===t7t(g,F)||r==="year"&&Number(H)%10===9),M),u(F))),onClick:function(){U||i(F)},onMouseEnter:function(){!U&&b&&b(F)},onMouseLeave:function(){!U&&y&&y(F)}},h?h(F,W):W))},N=0;N<s;N+=1)A();x.push(w.createElement("tr",{key:k,className:l&&l(D)},L))}return w.createElement("div",{className:"".concat(e,"-body")},w.createElement("table",{className:"".concat(e,"-content")},v&&w.createElement("thead",null,w.createElement("tr",null,v)),w.createElement("tbody",null,x)))}function n7t(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(zk),d=u.rangedValue,h=u.hoverRangedValue,f=U9t(r.locale,t,s),g="".concat(e,"-cell"),m=t.locale.getWeekFirstDay(r.locale),v=t.getNow(),_=[],b=r.shortWeekDays||(t.locale.getShortWeekDays?t.locale.getShortWeekDays(r.locale):[]);i&&_.push(w.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var y=0;y<sM;y+=1)_.push(w.createElement("th",{key:y},b[(y+m)%sM]));var C=Yq({cellPrefixCls:g,today:v,value:a,generateConfig:t,rangedValue:i?null:d,hoverRangedValue:i?null:h,isSameCell:c||function(x,k){return Ry(t,x,k)},isInView:function(k){return w_e(t,k,s)},offsetCell:function(k,L){return t.addDate(k,L)}}),E=l?function(x,k){return l(x,{originNode:k,today:v,type:"date",locale:r})}:void 0;return w.createElement(KF,Tt({},n,{rowNum:o,colNum:sM,baseDate:f,getCellNode:E,getCellText:t.getDate,getCellClassName:C,getCellDate:t.addDate,titleCell:function(k){return ah(k,{locale:r,format:"YYYY-MM-DD",generateConfig:t})},headerCells:_}))}var U8={visibility:"hidden"};function OR(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,f=n.onNext,g=n.children,m=w.useContext(Xf),v=m.hideNextBtn,_=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:_?U8:{}},a),h&&w.createElement("button",{type:"button",onClick:h,tabIndex:-1,className:"".concat(e,"-prev-btn"),style:_?U8:{}},i),w.createElement("div",{className:"".concat(e,"-view")},g),f&&w.createElement("button",{type:"button",onClick:f,tabIndex:-1,className:"".concat(e,"-next-btn"),style:v?U8:{}},o),d&&w.createElement("button",{type:"button",onClick:d,tabIndex:-1,className:"".concat(e,"-super-next-btn"),style:v?U8:{}},c))}function i7t(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(Xf),h=d.hideHeader;if(h)return null;var f="".concat(e,"-header"),g=i.shortMonths||(t.locale.getShortMonths?t.locale.getShortMonths(i.locale):[]),m=t.getMonth(r),v=w.createElement("button",{type:"button",key:"year",onClick:c,tabIndex:-1,className:"".concat(e,"-year-btn")},ah(r,{locale:i,format:i.yearFormat,generateConfig:t})),_=w.createElement("button",{type:"button",key:"month",onClick:u,tabIndex:-1,className:"".concat(e,"-month-btn")},i.monthFormat?ah(r,{locale:i,format:i.monthFormat,generateConfig:t}):g[m]),b=i.monthBeforeYear?[_,v]:[v,_];return w.createElement(OR,Tt({},n,{prefixCls:f,onSuperPrev:l,onPrev:s,onNext:o,onSuperNext:a}),b)}var r7t=6;function S_e(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,f="".concat(e,"-").concat(i,"-panel");s.current={onKeyDown:function(_){return NR(_,pt({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*sM),"key")},onPageUpDown:function(y){h(a.addMonth(l||c,y),"key")}},r))}};var g=function(_){var b=a.addYear(c,_);u(b),d(null,b)},m=function(_){var b=a.addMonth(c,_);u(b),d(null,b)};return w.createElement("div",{className:zt(f,it({},"".concat(f,"-active"),o))},w.createElement(i7t,Tt({},n,{prefixCls:e,value:l,viewDate:c,onPrevYear:function(){g(-1)},onNextYear:function(){g(1)},onPrevMonth:function(){m(-1)},onNextMonth:function(){m(1)},onMonthClick:function(){d("month",c)},onYearClick:function(){d("year",c)}})),w.createElement(n7t,Tt({},n,{onSelect:function(_){return h(_,"mouse")},prefixCls:e,value:l,viewDate:c,rowCount:r7t})))}function o7t(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,f){var g=t.getNow(),m=e||g,v=!a||!u?d:d+12,_=d<0?t.getHour(g):v,b=h<0?t.getMinute(g):h,y=f<0?t.getSecond(g):f,C=i&&i(_);if(C!=null&&C.includes(b)){var E=o.find(function(L){return!C.includes(L.value)});if(E)b=E.value;else return null}var x=r&&r(_,b);if(x!=null&&x.includes(y)){var k=s.find(function(L){return!x.includes(L.value)});if(k)y=k.value;else return null}return m=tWe(t,m,_,b,y),m};return l}function j8(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(Xf),d=u.open,h=w.useRef(null),f=w.useRef(new Map),g=w.useRef();return w.useLayoutEffect(function(){var m=f.current.get(r);m&&d!==!1&&_se(h.current,m.offsetTop,120)},[r]),w.useLayoutEffect(function(){if(d){var m=f.current.get(r);m&&(g.current=j9t(m,function(){_se(h.current,m.offsetTop,0)}))}return function(){var v;(v=g.current)===null||v===void 0||v.call(g)}},[d]),w.createElement("ul",{className:zt("".concat(e,"-column"),it({},"".concat(e,"-column-active"),o)),ref:h,style:{position:"relative"}},t.map(function(m){var v;return s&&m.disabled?null:w.createElement("li",{key:m.value,ref:function(b){f.current.set(m.value,b)},className:zt(c,(v={},it(v,"".concat(c,"-disabled"),m.disabled),it(v,"".concat(c,"-selected"),r===m.value),v)),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 s7t(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 RJ(n,e,t,i){for(var r=[],o=t>=1?t|0:1,s=n;s<=e;s+=o)r.push({label:JHe(s,2),value:s,disabled:(i||[]).includes(s)});return r}function a7t(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,f=h===void 0?1:h,g=n.secondStep,m=g===void 0?1:g,v=n.disabledHours,_=n.disabledMinutes,b=n.disabledSeconds,y=n.disabledTime,C=n.hideDisabledOptions,E=n.onSelect,x=n.cellRender,k=n.locale,L=[],D="".concat(t,"-content"),A="".concat(t,"-time-panel"),N,P=o?e.getHour(o):-1,M=P,B=o?e.getMinute(o):-1,F=o?e.getSecond(o):-1,U=e.getNow(),H=w.useMemo(function(){if(y){var Ft=y(U);return[Ft.disabledHours,Ft.disabledMinutes,Ft.disabledSeconds]}return[v,_,b]},[v,_,b,y,U]),W=cn(H,3),q=W[0],V=W[1],re=W[2],oe=RJ(0,23,d,q&&q()),Q=BF(function(){return oe},oe,s7t);c&&(N=M>=12,M%=12);var Ne=w.useMemo(function(){if(!c)return[!1,!1];var Ft=[!0,!0];return Q.forEach(function(Yt){var ln=Yt.disabled,Et=Yt.value;ln||(Et>=12?Ft[1]=!1:Ft[0]=!1)}),Ft},[c,Q]),Ve=cn(Ne,2),Ye=Ve[0],ye=Ve[1],He=w.useMemo(function(){return c?Q.filter(N?function(Ft){return Ft.value>=12}:function(Ft){return Ft.value<12}).map(function(Ft){var Yt=Ft.value%12,ln=Yt===0?"12":JHe(Yt,2);return pt(pt({},Ft),{},{label:ln,value:Yt})}):Q},[c,N,Q]),Pe=RJ(0,59,f,V&&V(P)),Ge=RJ(0,59,m,re&&re(P,B)),Fe=o7t({value:o,generateConfig:e,disabledMinutes:V,disabledSeconds:re,minutes:Pe,seconds:Ge,use12Hours:c});i.current={onUpDown:function(Yt){var ln=L[r];if(ln)for(var Et=ln.units.findIndex(function(Te){return Te.value===ln.value}),mt=ln.units.length,Lt=1;Lt<mt;Lt+=1){var be=ln.units[(Et+Yt*Lt+mt)%mt];if(be.disabled!==!0){ln.onSelect(be.value);break}}}};function bt(Ft,Yt,ln,Et,mt){Ft!==!1&&L.push({node:w.cloneElement(Yt,{prefixCls:A,value:ln,active:r===L.length,onSelect:mt,units:Et,hideDisabledOptions:C}),onSelect:mt,value:ln,units:Et})}bt(s,w.createElement(j8,{key:"hour",type:"hour",info:{today:U,locale:k,cellRender:x}}),M,He,function(Ft){E(Fe(N,Ft,B,F),"mouse")}),bt(a,w.createElement(j8,{key:"minute",type:"minute",info:{today:U,locale:k,cellRender:x}}),B,Pe,function(Ft){E(Fe(N,M,Ft,F),"mouse")}),bt(l,w.createElement(j8,{key:"second",type:"second",info:{today:U,locale:k,cellRender:x}}),F,Ge,function(Ft){E(Fe(N,M,B,Ft),"mouse")});var Mt=-1;return typeof N=="boolean"&&(Mt=N?1:0),bt(c===!0,w.createElement(j8,{key:"meridiem",type:"meridiem",info:{today:U,locale:k,cellRender:x}}),Mt,[{label:"AM",value:0,disabled:Ye},{label:"PM",value:1,disabled:ye}],function(Ft){E(Fe(!!Ft,M,B,F),"mouse")}),w.createElement("div",{className:D},L.map(function(Ft){var Yt=Ft.node;return Yt}))}function l7t(n){var e=w.useContext(Xf),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(OR,{prefixCls:l},s?ah(s,{locale:o,format:a,generateConfig:r}):" ")}var c7t=function(e){return e.filter(function(t){return t!==!1}).length};function iWe(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,f=n.value,g="".concat(r,"-time-panel"),m=w.useRef(),v=w.useState(-1),_=cn(v,2),b=_[0],y=_[1],C=c7t([a,l,c,d]);return s.current={onKeyDown:function(x){return NR(x,{onLeftRight:function(L){y((b+L+C)%C)},onUpDown:function(L){b===-1?y(0):m.current&&m.current.onUpDown(L)},onEnter:function(){h(f||e.getNow(),"key"),y(-1)}})},onBlur:function(){y(-1)}},w.createElement("div",{className:zt(g,it({},"".concat(g,"-active"),o))},w.createElement(l7t,Tt({},n,{format:i,prefixCls:r})),w.createElement(a7t,Tt({},n,{prefixCls:r,activeColumnIndex:b,operationRef:m})))}var C2e=J9t("date","time"),NJ=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 u7t(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=cn(d,2),f=h[0],g=h[1],m=w.useRef({}),v=w.useRef({}),_=Zr(a)==="object"?pt({},a):{};function b(x){var k=C2e.indexOf(f)+x,L=C2e[k]||null;return L}var y=function(k){v.current.onBlur&&v.current.onBlur(k),g(null)};t.current={onKeyDown:function(k){if(k.which===ii.TAB){var L=b(k.shiftKey?-1:1);return g(L),L&&k.preventDefault(),!0}if(f){var D=f==="date"?m:v;return D.current&&D.current.onKeyDown&&D.current.onKeyDown(k),!0}return[ii.LEFT,ii.RIGHT,ii.UP,ii.DOWN].includes(k.which)?(g("date"),!0):!1},onBlur:y,onClose:y};var C=function(k,L){var D=k;if(L==="date"){var A,N,P,M=(s==null?void 0:s(r||_.defaultValue))||{},B=NJ(i.getHour(D),((A=M.disabledHours)===null||A===void 0?void 0:A.call(M))||[-1],23),F=NJ(i.getMinute(D),((N=M.disabledMinutes)===null||N===void 0?void 0:N.call(M,B))||[-1],59),U=NJ(i.getSecond(D),((P=M.disabledSeconds)===null||P===void 0?void 0:P.call(M,B,F))||[-1],59);D=i.setHour(D,B),D=i.setMinute(D,F),D=i.setSecond(D,U)}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")},E=s?s(r||null):{};return w.createElement("div",{className:zt(u,it({},"".concat(u,"-active"),f))},w.createElement(S_e,Tt({},n,{cellRender:c,operationRef:m,active:f==="date",onSelect:function(k){C(nWe(i,k,!r&&Zr(a)==="object"?a.defaultValue:null),"date")}})),w.createElement(iWe,Tt({},n,{cellRender:c?function(x,k){return c(x,pt(pt({},k),{},{type:"time"}))}:void 0,format:void 0},_,E,{disabledTime:null,defaultValue:void 0,operationRef:v,active:f==="time",onSelect:function(k){C(k,"time")}})))}function d7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.viewDate,r=n.onPrevDecades,o=n.onNextDecades,s=w.useContext(Xf),a=s.hideHeader;if(a)return null;var l="".concat(e,"-header"),c=t.getYear(i),u=Math.floor(c/Ay)*Ay,d=u+Ay-1;return w.createElement(OR,Tt({},n,{prefixCls:l,onSuperPrev:r,onSuperNext:o}),u,"-",d)}var yse=3,w2e=4;function h7t(n){var e=q_-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/q_)*q_,u=Math.floor(l/Ay)*Ay,d=u+Ay-1,h=r.setYear(i,u-Math.ceil((yse*w2e*q_-Ay)/2)),f=function(v){var _,b=r.getYear(v),y=b+e;return _={},it(_,"".concat(a,"-in-view"),u<=b&&y<=d),it(_,"".concat(a,"-selected"),b===c),_},g=o?function(m,v){return o(m,{originNode:v,today:r.getNow(),type:"decade",locale:s})}:void 0;return w.createElement(KF,Tt({},n,{rowNum:w2e,colNum:yse,baseDate:h,getCellNode:g,getCellText:function(v){var _=r.getYear(v);return"".concat(_,"-").concat(_+e)},getCellClassName:f,getCellDate:function(v,_){return r.addYear(v,_*q_)}}))}function f7t(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 NR(h,{onLeftRight:function(g){s(i.addYear(r,g*q_),"key")},onCtrlLeftRight:function(g){s(i.addYear(r,g*Ay),"key")},onUpDown:function(g){s(i.addYear(r,g*q_*yse),"key")},onEnter:function(){a("year",r)}})}};var c=function(h){var f=i.addYear(r,h*Ay);t(f),a(null,f)},u=function(h){s(h,"mouse"),a("year",h)};return w.createElement("div",{className:l},w.createElement(d7t,Tt({},n,{prefixCls:e,onPrevDecades:function(){c(-1)},onNextDecades:function(){c(1)}})),w.createElement(h7t,Tt({},n,{prefixCls:e,onSelect:u})))}function p7t(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(Xf),c=l.hideHeader;if(c)return null;var u="".concat(e,"-header");return w.createElement(OR,Tt({},n,{prefixCls:u,onSuperPrev:s,onSuperNext:o}),w.createElement("button",{type:"button",onClick:a,className:"".concat(e,"-year-btn")},ah(r,{locale:i,format:i.yearFormat,generateConfig:t})))}var E_e=3,g7t=4;function m7t(n){var e=n.prefixCls,t=n.locale,i=n.value,r=n.viewDate,o=n.generateConfig,s=n.cellRender,a=w.useContext(zk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=Yq({cellPrefixCls:u,value:i,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(v,_){return w_e(o,v,_)},isInView:function(){return!0},offsetCell:function(v,_){return o.addMonth(v,_)}}),h=t.shortMonths||(o.locale.getShortMonths?o.locale.getShortMonths(t.locale):[]),f=o.setMonth(r,0),g=s?function(m,v){return s(m,{originNode:v,locale:t,today:o.getNow(),type:"month"})}:void 0;return w.createElement(KF,Tt({},n,{rowNum:g7t,colNum:E_e,baseDate:f,getCellNode:g,getCellText:function(v){return t.monthFormat?ah(v,{locale:t,format:t.monthFormat,generateConfig:o}):h[o.getMonth(v)]},getCellClassName:d,getCellDate:o.addMonth,titleCell:function(v){return ah(v,{locale:t,format:"YYYY-MM",generateConfig:o})}}))}function _7t(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 NR(h,{onLeftRight:function(g){l(r.addMonth(o||s,g),"key")},onCtrlLeftRight:function(g){l(r.addYear(o||s,g),"key")},onUpDown:function(g){l(r.addMonth(o||s,g*E_e),"key")},onEnter:function(){a("date",o||s)}})}};var u=function(h){var f=r.addYear(s,h);i(f),a(null,f)};return w.createElement("div",{className:c},w.createElement(p7t,Tt({},n,{prefixCls:e,onPrevYear:function(){u(-1)},onNextYear:function(){u(1)},onYearClick:function(){a("year",s)}})),w.createElement(m7t,Tt({},n,{prefixCls:e,onSelect:function(h){l(h,"mouse"),a("date",h)}})))}function v7t(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(Xf),c=l.hideHeader;if(c)return null;var u="".concat(e,"-header");return w.createElement(OR,Tt({},n,{prefixCls:u,onSuperPrev:s,onSuperNext:o}),w.createElement("button",{type:"button",onClick:a,className:"".concat(e,"-year-btn")},ah(r,{locale:i,format:i.yearFormat,generateConfig:t})))}var b7t=4,y7t=1;function C7t(n){var e=n.prefixCls,t=n.locale,i=n.value,r=n.viewDate,o=n.generateConfig,s=n.cellRender,a=w.useContext(zk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=Yq({cellPrefixCls:u,value:i,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(m,v){return qHe(o,m,v)},isInView:function(){return!0},offsetCell:function(m,v){return o.addMonth(m,v*3)}}),h=o.setDate(o.setMonth(r,0),1),f=s?function(g,m){return s(g,{originNode:m,locale:t,today:o.getNow(),type:"quarter"})}:void 0;return w.createElement(KF,Tt({},n,{rowNum:y7t,colNum:b7t,baseDate:h,getCellNode:f,getCellText:function(m){return ah(m,{locale:t,format:t.quarterFormat||"[Q]Q",generateConfig:o})},getCellClassName:d,getCellDate:function(m,v){return o.addMonth(m,v*3)},titleCell:function(m){return ah(m,{locale:t,format:"YYYY-[Q]Q",generateConfig:o})}}))}function w7t(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 NR(h,{onLeftRight:function(g){l(r.addMonth(o||s,g*3),"key")},onCtrlLeftRight:function(g){l(r.addYear(o||s,g),"key")},onUpDown:function(g){l(r.addYear(o||s,g),"key")}})}};var u=function(h){var f=r.addYear(s,h);i(f),a(null,f)};return w.createElement("div",{className:c},w.createElement(v7t,Tt({},n,{prefixCls:e,onPrevYear:function(){u(-1)},onNextYear:function(){u(1)},onYearClick:function(){a("year",s)}})),w.createElement(C7t,Tt({},n,{prefixCls:e,onSelect:function(h){l(h,"mouse")}})))}function S7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.value,o=n.disabledDate,s=n.onSelect,a=w.useContext(zk),l=a.rangedValue,c=a.hoverRangedValue,u=w.useContext(Xf),d=u.onDateMouseEnter,h=u.onDateMouseLeave,f=(c==null?void 0:c[0])||(l==null?void 0:l[0]),g=(c==null?void 0:c[1])||(l==null?void 0:l[1]),m="".concat(e,"-cell"),v=function(C){var E=nW({cellDate:C,mode:"week",disabledDate:o,generateConfig:t});return w.createElement("td",{key:"week",className:zt(m,"".concat(m,"-week")),onClick:function(){E||s(C,"mouse")},onMouseEnter:function(){!E&&d&&d(C)},onMouseLeave:function(){!E&&h&&h(C)}},w.createElement("div",{className:"".concat(m,"-inner")},t.locale.getWeek(i.locale,C)))},_="".concat(e,"-week-panel-row"),b=function(C){var E,x=L$(t,i.locale,f,C),k=L$(t,i.locale,g,C);return zt(_,(E={},it(E,"".concat(_,"-selected"),!l&&L$(t,i.locale,r,C)),it(E,"".concat(_,"-range-start"),x),it(E,"".concat(_,"-range-end"),k),it(E,"".concat(_,"-range-hover"),!x&&!k&&lP(t,f,g,C)),E))};return w.createElement(S_e,Tt({},n,{panelName:"week",prefixColumn:v,rowClassName:b,keyboardConfig:{onLeftRight:null},isSameCell:function(){return!1}}))}var ZC=10;function E7t(n){var e=n.prefixCls,t=n.generateConfig,i=n.viewDate,r=n.onPrevDecade,o=n.onNextDecade,s=n.onDecadeClick,a=w.useContext(Xf),l=a.hideHeader;if(l)return null;var c="".concat(e,"-header"),u=t.getYear(i),d=Math.floor(u/ZC)*ZC,h=d+ZC-1;return w.createElement(OR,Tt({},n,{prefixCls:c,onSuperPrev:r,onSuperNext:o}),w.createElement("button",{type:"button",onClick:s,className:"".concat(e,"-decade-btn")},d,"-",h))}var Cse=3,S2e=4;function x7t(n){var e=n.prefixCls,t=n.value,i=n.viewDate,r=n.locale,o=n.generateConfig,s=n.cellRender,a=w.useContext(zk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=o.getYear(i),h=Math.floor(d/ZC)*ZC,f=h+ZC-1,g=o.setYear(i,h-Math.ceil((Cse*S2e-ZC)/2)),m=o.getNow(),v=function(C){var E=o.getYear(C);return h<=E&&E<=f},_=Yq({cellPrefixCls:u,value:t,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(C,E){return GF(o,C,E)},isInView:v,offsetCell:function(C,E){return o.addYear(C,E)}}),b=s?function(y,C){return s(y,{originNode:C,today:m,type:"year",locale:r})}:void 0;return w.createElement(KF,Tt({},n,{rowNum:S2e,colNum:Cse,baseDate:g,getCellNode:b,getCellText:o.getYear,getCellClassName:_,getCellDate:o.addYear,titleCell:function(C){return ah(C,{locale:r,format:"YYYY",generateConfig:o})}}))}function T7t(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(f){return NR(f,{onLeftRight:function(m){l(r.addYear(o||s,m),"key")},onCtrlLeftRight:function(m){l(r.addYear(o||s,m*ZC),"key")},onUpDown:function(m){l(r.addYear(o||s,m*Cse),"key")},onEnter:function(){c(a==="date"?"date":"month",o||s)}})}};var d=function(f){var g=r.addYear(s,f*10);i(g),c(null,g)};return w.createElement("div",{className:u},w.createElement(E7t,Tt({},n,{prefixCls:e,onPrevDecade:function(){d(-1)},onNextDecade:function(){d(1)},onDecadeClick:function(){c("decade",s)}})),w.createElement(x7t,Tt({},n,{prefixCls:e,onSelect:function(f){c(a==="date"?"date":"month",f),l(f,"mouse")}})))}function rWe(n,e,t){return t?w.createElement("div",{className:"".concat(n,"-footer-extra")},t(e)):null}function oWe(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 k7t=["date","month"];function sWe(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,f=t.disabledDate,g=t.mode,m=t.picker,v=m===void 0?"date":m,_=t.tabIndex,b=_===void 0?0:_,y=t.showNow,C=t.showTime,E=t.showToday,x=t.renderExtraFooter,k=t.hideHeader,L=t.onSelect,D=t.onChange,A=t.onPanelChange,N=t.onMouseDown,P=t.onPickerValueChange,M=t.onOk,B=t.components,F=t.direction,U=t.hourStep,H=U===void 0?1:U,W=t.minuteStep,q=W===void 0?1:W,V=t.secondStep,re=V===void 0?1:V,oe=t.dateRender,Q=t.monthCellRender,Ne=t.cellRender,Ve=v==="date"&&!!C||v==="time",Ye=24%H===0,ye=60%q===0,He=60%re===0,Pe=w.useContext(Xf),Ge=Pe.operationRef,Fe=Pe.onSelect,bt=Pe.hideRanges,Mt=Pe.defaultOpenValue,Ft=w.useContext(zk),Yt=Ft.inRange,ln=Ft.panelPosition,Et=Ft.rangedValue,mt=Ft.hoverRangedValue,Lt=w.useRef({}),be=w.useRef(!0),Te=wm(null,{value:c,defaultValue:u,postState:function(rn){return!rn&&Mt&&v==="time"?Mt:rn}}),se=cn(Te,2),Y=se[0],X=se[1],le=wm(null,{value:d,defaultValue:h||Y,postState:function(rn){var di=l.getNow();if(!rn)return di;if(!Y&&C){var Wr=Zr(C)==="object"?C.defaultValue:u;return nWe(l,Array.isArray(rn)?rn[0]:rn,Wr||di)}return Array.isArray(rn)?rn[0]:rn}}),te=cn(le,2),me=te[0],Me=te[1],rt=function(rn){Me(rn),P&&P(rn)},It=function(rn){var di=Z9t[v];return di?di(rn):rn},Qt=wm(function(){return v==="time"?"time":It("date")},{value:g}),pe=cn(Qt,2),We=pe[0],ne=pe[1];w.useEffect(function(){ne(v)},[v]);var Se=w.useState(function(){return We}),Ie=cn(Se,2),Ke=Ie[0],Je=Ie[1],ot=function(rn,di){var Wr=It(rn||We);Je(We),ne(Wr),A&&(We!==Wr||eA(l,me,me))&&A(di,Wr)},wt=function(rn,di){var Wr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(We===v||Wr)&&(X(rn),L&&L(rn),Fe&&Fe(rn,di),D&&!eA(l,rn,Y)&&!(f!=null&&f(rn))&&D(rn))},pn=function(rn){if(k7t.includes(We)){var di,Wr,Qe=We==="date";switch(rn===ii.PAGE_UP||rn===ii.PAGE_DOWN?Wr=Qe?l.addMonth:l.addYear:Wr=Qe?l.addDate:l.addMonth,rn){case ii.LEFT:case ii.PAGE_UP:di=Wr(me,-1);break;case ii.RIGHT:case ii.PAGE_DOWN:di=Wr(me,1);break;case ii.UP:case ii.DOWN:di=Wr(me,Number("".concat(rn===ii.UP?"-":"").concat(Qe?sM:E_e)));break}if(di)return!(f!=null&&f(di))}return!0},Kn=function(rn){if(Lt.current&&Lt.current.onKeyDown){var di=!0,Wr=rn.which;if([ii.LEFT,ii.RIGHT,ii.UP,ii.DOWN,ii.PAGE_UP,ii.PAGE_DOWN,ii.ENTER].includes(Wr)&&(rn.preventDefault(),Wr!==ii.ENTER&&b===0&&(di=pn(Wr))),di)return Lt.current.onKeyDown(rn)}return Dd(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1},Cn=function(rn){Lt.current&&Lt.current.onBlur&&Lt.current.onBlur(rn)};Ge&&ln!=="right"&&(Ge.current={onKeyDown:Kn,onClose:function(){Lt.current&&Lt.current.onClose&&Lt.current.onClose()}}),w.useEffect(function(){c&&!be.current&&Me(c)},[c]),w.useEffect(function(){be.current=!1},[]);var hn,bn=ZHe({cellRender:Ne,monthCellRender:Q,dateRender:oe}),Wn=pt(pt({},n),{},{cellRender:bn,operationRef:Lt,prefixCls:r,viewDate:me,value:Y,onViewDateChange:rt,sourceMode:Ke,onPanelChange:ot,disabledDate:f});switch(delete Wn.onChange,delete Wn.onSelect,We){case"decade":hn=w.createElement(f7t,Tt({},Wn,{onSelect:function(rn,di){rt(rn),wt(rn,di)}}));break;case"year":hn=w.createElement(T7t,Tt({},Wn,{onSelect:function(rn,di){rt(rn),wt(rn,di)}}));break;case"month":hn=w.createElement(_7t,Tt({},Wn,{onSelect:function(rn,di){rt(rn),wt(rn,di)}}));break;case"quarter":hn=w.createElement(w7t,Tt({},Wn,{onSelect:function(rn,di){rt(rn),wt(rn,di)}}));break;case"week":hn=w.createElement(S7t,Tt({},Wn,{onSelect:function(rn,di){rt(rn),wt(rn,di)}}));break;case"time":delete Wn.showTime,hn=w.createElement(iWe,Tt({},Wn,Zr(C)==="object"?C:null,{onSelect:function(rn,di){rt(rn),wt(rn,di)}}));break;default:C?hn=w.createElement(u7t,Tt({},Wn,{onSelect:function(rn,di){rt(rn),wt(rn,di)}})):hn=w.createElement(S_e,Tt({},Wn,{onSelect:function(rn,di){rt(rn),wt(rn,di)}}))}var Ei,er,ur=function(){var rn=l.getNow(),di=e7t(l.getHour(rn),l.getMinute(rn),l.getSecond(rn),Ye?H:1,ye?q:1,He?re:1),Wr=tWe(l,rn,di[0],di[1],di[2]);wt(Wr,"submit")};bt||(Ei=rWe(r,We,x),C&&We!=="date"?er=null:er=oWe({prefixCls:r,components:B,needConfirmButton:Ve,okDisabled:!Y||f&&f(Y),locale:a,showNow:y,onNow:Ve&&ur,onOk:function(){Y&&(wt(Y,"submit",!0),M&&M(Y))}}));var Jr;if(E&&We==="date"&&v==="date"&&!C){var $i=l.getNow(),xs="".concat(r,"-today-btn"),wr=f&&f($i);Jr=w.createElement("a",{className:zt(xs,wr&&"".concat(xs,"-disabled")),"aria-disabled":wr,onClick:function(){wr||wt($i,"mouse",!0)}},a.today)}return w.createElement(Xf.Provider,{value:pt(pt({},Pe),{},{mode:We,hideHeader:"hideHeader"in n?k:Pe.hideHeader,hidePrevBtn:Yt&&ln==="right",hideNextBtn:Yt&&ln==="left"})},w.createElement("div",{tabIndex:b,className:zt("".concat(r,"-panel"),o,(e={},it(e,"".concat(r,"-panel-has-range"),Et&&Et[0]&&Et[1]),it(e,"".concat(r,"-panel-has-range-hover"),mt&&mt[0]&&mt[1]),it(e,"".concat(r,"-panel-rtl"),F==="rtl"),e)),style:s,onKeyDown:Kn,onBlur:Cn,onMouseDown:N},hn,Ei||er||Jr?w.createElement("div",{className:"".concat(r,"-footer")},Ei,er,Jr):null))}var I7t={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 aWe(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,f=n.direction,g="".concat(t,"-dropdown"),m=function(){return h!==void 0?h:f==="rtl"?"bottomRight":"bottomLeft"};return w.createElement(I9t,{showAction:[],hideAction:[],popupPlacement:m(),builtinPlacements:I7t,prefixCls:g,popupTransitionName:l,popup:i,popupAlign:a,popupVisible:o,popupClassName:zt(s,(e={},it(e,"".concat(g,"-range"),d),it(e,"".concat(g,"-rtl"),f==="rtl"),e)),popupStyle:r,getPopupContainer:c},u)}function lWe(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(y2e(l))},onMouseEnter:function(){return r==null?void 0:r(y2e(l))},onMouseLeave:function(){return r==null?void 0:r(null)}},a)}))):null}function cWe(n,e,t){var i=Zr(e)==="object"?e.clearIcon:t;return i||ce.createElement("span",{className:"".concat(n,"-clear-btn")})}function L7t(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,f=t.transitionName,g=t.generateConfig,m=t.locale,v=t.inputReadOnly,_=t.allowClear,b=t.autoFocus,y=t.showTime,C=t.picker,E=C===void 0?"date":C,x=t.format,k=t.use12Hours,L=t.value,D=t.defaultValue,A=t.presets,N=t.open,P=t.defaultOpen,M=t.defaultOpenValue,B=t.suffixIcon,F=t.clearIcon,U=t.disabled,H=t.disabledDate,W=t.placeholder,q=t.getPopupContainer,V=t.pickerRef,re=t.panelRender,oe=t.onChange,Q=t.onOpenChange,Ne=t.onFocus,Ve=t.onBlur,Ye=t.onMouseDown,ye=t.onMouseUp,He=t.onMouseEnter,Pe=t.onMouseLeave,Ge=t.onContextMenu,Fe=t.onClick,bt=t.onKeyDown,Mt=t.onSelect,Ft=t.direction,Yt=t.autoComplete,ln=Yt===void 0?"off":Yt,Et=t.inputRender,mt=t.changeOnBlur,Lt=w.useRef(null),be=E==="date"&&!!y||E==="time",Te=XHe(A),se=eWe(KHe(x,E,y,k)),Y=w.useRef(null),X=w.useRef(null),le=w.useRef(null),te=wm(null,{value:L,defaultValue:D}),me=cn(te,2),Me=me[0],rt=me[1],It=w.useState(Me),Qt=cn(It,2),pe=Qt[0],We=Qt[1],ne=w.useRef(null),Se=wm(!1,{value:N,defaultValue:P,postState:function(mn){return U?!1:mn},onChange:function(mn){Q&&Q(mn),!mn&&ne.current&&ne.current.onClose&&ne.current.onClose()}}),Ie=cn(Se,2),Ke=Ie[0],Je=Ie[1],ot=iW(pe,{formatList:se,generateConfig:g,locale:m}),wt=cn(ot,2),pn=wt[0],Kn=wt[1],Cn=bse({valueTexts:pn,onTextChange:function(mn){var oi=GHe(mn,{locale:m,formatList:se,generateConfig:g});oi&&(!H||!H(oi))&&We(oi)}}),hn=cn(Cn,3),bn=hn[0],Wn=hn[1],Ei=hn[2],er=function(mn){We(mn),rt(mn),oe&&!eA(g,Me,mn)&&oe(mn,mn?ah(mn,{generateConfig:g,locale:m,format:se[0]}):"")},ur=function(mn){U&&mn||Je(mn)},Jr=function(mn){return Ke&&ne.current&&ne.current.onKeyDown?ne.current.onKeyDown(mn):(Dd(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},$i=function(){for(var mn=arguments.length,oi=new Array(mn),dr=0;dr<mn;dr++)oi[dr]=arguments[dr];Fe==null||Fe.apply(void 0,oi),Lt.current&&(Lt.current.focus(),ur(!0))},xs=function(mn){mt&&er(pe),Ve==null||Ve(mn)},wr=vse({blurToCancel:be,changeOnBlur:mt,open:Ke,value:bn,triggerOpen:ur,forwardKeyDown:Jr,isClickOutside:function(mn){return!QHe([Y.current,X.current,le.current],mn)},onSubmit:function(){return!pe||H&&H(pe)?!1:(er(pe),ur(!1),Ei(),!0)},onCancel:function(){ur(!1),We(Me),Ei()},onKeyDown:function(mn,oi){bt==null||bt(mn,oi)},onFocus:Ne,onBlur:xs}),Ji=cn(wr,2),rn=Ji[0],di=Ji[1],Wr=di.focused,Qe=di.typing;w.useEffect(function(){Ke||(We(Me),!pn.length||pn[0]===""?Wn(""):Kn!==bn&&Ei())},[Ke,pn]),w.useEffect(function(){Ke||Ei()},[E]),w.useEffect(function(){We(Me)},[Me]),V&&(V.current={focus:function(){var mn;(mn=Lt.current)===null||mn===void 0||mn.focus()},blur:function(){var mn;(mn=Lt.current)===null||mn===void 0||mn.blur()}});var Ct=mse(bn,{formatList:se,generateConfig:g,locale:m}),Gt=cn(Ct,3),Jt=Gt[0],ut=Gt[1],Le=Gt[2],st=pt(pt({},n),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0,onChange:null}),ze=w.createElement("div",{className:"".concat(r,"-panel-layout")},w.createElement(lWe,{prefixCls:r,presets:Te,onClick:function(mn){er(mn),ur(!1)}}),w.createElement(sWe,Tt({},st,{generateConfig:g,className:zt(it({},"".concat(r,"-panel-focused"),!Qe)),value:pe,locale:m,tabIndex:-1,onSelect:function(mn){Mt==null||Mt(mn),We(mn)},direction:Ft,onPanelChange:function(mn,oi){var dr=n.onPanelChange;Le(!0),dr==null||dr(mn,oi)}})));re&&(ze=re(ze));var Ee=w.createElement("div",{className:"".concat(r,"-panel-container"),ref:Y,onMouseDown:function(mn){mn.preventDefault()}},ze),tt;B&&(tt=w.createElement("span",{className:"".concat(r,"-suffix"),onMouseDown:function(mn){mn.preventDefault()}},B));var xt=cWe(r,_,F),lt=w.createElement("span",{onMouseDown:function(mn){mn.preventDefault(),mn.stopPropagation()},onMouseUp:function(mn){mn.preventDefault(),mn.stopPropagation(),er(null),ur(!1)},className:"".concat(r,"-clear"),role:"button"},xt),gn=!!_&&Me&&!U,Ln=pt(pt(pt({id:o,tabIndex:a,disabled:U,readOnly:v||typeof se[0]=="function"||!Qe,value:Jt||bn,onChange:function(mn){Wn(mn.target.value)},autoFocus:b,placeholder:W,ref:Lt,title:bn},rn),{},{size:YHe(E,se[0],g),name:s},fHe(n,{aria:!0,data:!0})),{},{autoComplete:ln}),ri=Et?Et(Ln):w.createElement("input",Ln),mi=function(mn,oi){(oi==="submit"||oi!=="key"&&!be)&&(er(mn),ur(!1))},Vi=Ft==="rtl"?"bottomRight":"bottomLeft";return w.createElement(Xf.Provider,{value:{operationRef:ne,hideHeader:E==="time",onSelect:mi,open:Ke,defaultOpenValue:M,onDateMouseEnter:ut,onDateMouseLeave:Le}},w.createElement(aWe,{visible:Ke,popupElement:Ee,popupStyle:h,prefixCls:r,dropdownClassName:u,dropdownAlign:d,getPopupContainer:q,transitionName:f,popupPlacement:Vi,direction:Ft},w.createElement("div",{ref:le,className:zt(r,c,(e={},it(e,"".concat(r,"-disabled"),U),it(e,"".concat(r,"-focused"),Wr),it(e,"".concat(r,"-rtl"),Ft==="rtl"),e)),style:l,onMouseDown:Ye,onMouseUp:ye,onMouseEnter:He,onMouseLeave:Pe,onContextMenu:Ge,onClick:$i},w.createElement("div",{className:zt("".concat(r,"-input"),it({},"".concat(r,"-input-placeholder"),!!Jt)),ref:X},ri,tt,gn&&lt))))}var D7t=function(n){Tv(t,n);var e=Rk(t);function t(){var i;El(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)),it(Xr(i),"pickerRef",w.createRef()),it(Xr(i),"focus",function(){i.pickerRef.current&&i.pickerRef.current.focus()}),it(Xr(i),"blur",function(){i.pickerRef.current&&i.pickerRef.current.blur()}),i}return xl(t,[{key:"render",value:function(){return w.createElement(L7t,Tt({},this.props,{pickerRef:this.pickerRef}))}}]),t}(w.Component);function A7t(n,e){var t=n.picker,i=n.locale,r=n.selectedValue,o=n.disabledDate,s=n.disabled,a=n.generateConfig,l=Lo(r,0),c=Lo(r,1);function u(m){return a.locale.getWeekFirstDate(i.locale,m)}function d(m){var v=a.getYear(m),_=a.getMonth(m);return v*100+_}function h(m){var v=a.getYear(m),_=gse(a,m);return v*10+_}var f=w.useCallback(function(m){if(s[0]||o&&o(m))return!0;if(s[1]&&c)return!Ry(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!Ry(a,m,c)&&a.isAfter(m,c)}return!1},[o,s[1],c,e]),g=w.useCallback(function(m){if(s[1]||o&&o(m))return!0;if(s[0]&&l)return!Ry(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!Ry(a,m,l)&&a.isAfter(l,m)}return!1},[o,s[0],l,e]);return[f,g]}function R7t(n,e,t,i,r,o,s,a,l,c,u){var d=w.useState(!1),h=cn(d,2),f=h[0],g=h[1],m=wm(n||!1,{value:e}),v=cn(m,2),_=v[0],b=v[1],y=wm(n||!1,{value:e,onChange:function(W){u==null||u(W)}}),C=cn(y,2),E=C[0],x=C[1],k=wm(0,{value:t}),L=cn(k,2),D=L[0],A=L[1],N=w.useState(null),P=cn(N,2),M=P[0],B=P[1];w.useEffect(function(){E&&g(!0)},[E]);var F=function(W){return W===0?1:0},U=B_(function(H,W,q){if(W===!1)x(H);else if(H){A(W),x(H);var V=F(W);!E||![a,l][V]?B(V):(g(!1),M!==null&&B(null))}else if(q==="confirm"||q==="blur"&&i){var re=_&&!r?F(W):M;re!==null&&(g(!1),A(re)),B(null),re!==null&&!c[re]?Yf(function(){var oe,Q=[o,s][re];(oe=Q.current)===null||oe===void 0||oe.focus()}):x(!1)}else x(!1),b(!1)});return[E,D,f,U]}function N7t(n,e,t,i){var r=aM(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 W9t(i,s,a)});case"quarter":case"month":return o(function(s,a){return GF(i,s,a)});default:return o(function(s,a){return w_e(i,s,a)})}}function O7t(n,e,t,i){var r=Lo(n,0),o=Lo(n,1);if(e===0)return r;if(r&&o){var s=N7t(r,o,t,i);switch(s){case"same":return r;case"closing":return r;default:return aM(o,t,i,-1)}}return r}function P7t(n){var e=n.values,t=n.picker,i=n.defaultDates,r=n.generateConfig,o=w.useState(function(){return[Lo(i,0),Lo(i,1)]}),s=cn(o,2),a=s[0],l=s[1],c=w.useState(null),u=cn(c,2),d=u[0],h=u[1],f=Lo(e,0),g=Lo(e,1);function m(_){return a[_]?a[_]:Lo(d,_)||O7t(e,_,t,r)||f||g||r.getNow()}function v(_,b){if(_){var y=om(d,_,b);l(om(a,null,b)||[null,null]);var C=(b+1)%2;Lo(e,C)||(y=om(y,_,C)),h(y)}else(f||g)&&h(null)}return[m,v]}function E2e(n,e){return n&&n[0]&&n[1]&&e.isAfter(n[0],n[1])?[n[1],n[0]]:n}function x2e(n,e,t,i){return!!(n||i&&i[e]||t[(e+1)%2])}function M7t(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,f=r.dropdownAlign,g=r.getPopupContainer,m=r.generateConfig,v=r.locale,_=r.placeholder,b=r.autoFocus,y=r.disabled,C=r.format,E=r.picker,x=E===void 0?"date":E,k=r.showTime,L=r.use12Hours,D=r.separator,A=D===void 0?"~":D,N=r.value,P=r.defaultValue,M=r.defaultPickerValue,B=r.open,F=r.defaultOpen,U=r.disabledDate,H=r.disabledTime,W=r.dateRender,q=r.monthCellRender,V=r.cellRender,re=r.panelRender,oe=r.presets,Q=r.ranges,Ne=r.allowEmpty,Ve=r.allowClear,Ye=r.suffixIcon,ye=r.clearIcon,He=r.pickerRef,Pe=r.inputReadOnly,Ge=r.mode,Fe=r.renderExtraFooter,bt=r.onChange,Mt=r.onOpenChange,Ft=r.onPanelChange,Yt=r.onCalendarChange,ln=r.onFocus,Et=r.onBlur,mt=r.onMouseDown,Lt=r.onMouseUp,be=r.onMouseEnter,Te=r.onMouseLeave,se=r.onClick,Y=r.onOk,X=r.onKeyDown,le=r.components,te=r.order,me=r.direction,Me=r.activePickerIndex,rt=r.autoComplete,It=rt===void 0?"off":rt,Qt=r.changeOnBlur,pe=x==="date"&&!!k||x==="time",We=w.useRef(null),ne=w.useRef(null),Se=w.useRef(null),Ie=w.useRef(null),Ke=w.useRef(null),Je=w.useRef(null),ot=w.useRef(null),wt=w.useRef(null),pn=eWe(KHe(C,x,k,L)),Kn=function(Nn,Mr){return Nn&&Nn[Mr]?ah(Nn[Mr],{generateConfig:m,locale:v,format:pn[0]}):""},Cn=w.useRef(null),hn=w.useMemo(function(){return Array.isArray(y)?y:[y||!1,y||!1]},[y]),bn=wm(null,{value:N,defaultValue:P,postState:function(Nn){return x==="time"&&!te?Nn:E2e(Nn,m)}}),Wn=cn(bn,2),Ei=Wn[0],er=Wn[1],ur=P7t({values:Ei,picker:x,defaultDates:M,generateConfig:m}),Jr=cn(ur,2),$i=Jr[0],xs=Jr[1],wr=wm(Ei,{postState:function(Nn){var Mr=Nn;if(hn[0]&&hn[1])return Mr;for(var zr=0;zr<2;zr+=1)hn[zr]&&!Mr&&!Lo(Mr,zr)&&!Lo(Ne,zr)&&(Mr=om(Mr,m.getNow(),zr));return Mr}}),Ji=cn(wr,2),rn=Ji[0],di=Ji[1],Wr=wm([x,x],{value:Ge}),Qe=cn(Wr,2),Ct=Qe[0],Gt=Qe[1];w.useEffect(function(){Gt([x,x])},[x]);var Jt=function(Nn,Mr){Gt(Nn),Ft&&Ft(Mr,Nn)},ut=R7t(F,B,Me,Qt,pe,Je,ot,Lo(rn,0),Lo(rn,1),hn,Mt),Le=cn(ut,4),st=Le[0],ze=Le[1],Ee=Le[2],tt=Le[3],xt=st&&ze===0,lt=st&&ze===1,gn=A7t({picker:x,selectedValue:rn,locale:v,disabled:hn,disabledDate:U,generateConfig:m},!st||Ee),Ln=cn(gn,2),ri=Ln[0],mi=Ln[1],Vi=w.useState(0),qn=cn(Vi,2),mn=qn[0],oi=qn[1];w.useEffect(function(){!st&&We.current&&oi(We.current.offsetWidth)},[st]);function dr(Ci){tt(!0,Ci,"open"),Yf(function(){var Nn,Mr=[Je,ot][Ci];(Nn=Mr.current)===null||Nn===void 0||Nn.focus()},0)}function gr(Ci,Nn,Mr){var zr=Ci,gs=Lo(zr,0),Mc=Lo(zr,1);gs&&Mc&&m.isAfter(gs,Mc)&&(x==="week"&&!L$(m,v.locale,gs,Mc)||x==="quarter"&&!qHe(m,gs,Mc)||x!=="week"&&x!=="quarter"&&x!=="time"&&!Ry(m,gs,Mc)?Nn===0?(zr=[gs,null],Mc=null):(gs=null,zr=[null,Mc]):(x!=="time"||te!==!1)&&(zr=E2e(zr,m))),di(zr);var td=Kn(zr,0),ol=Kn(zr,1);if(Yt){var Ch={range:Nn===0?"start":"end"};Yt(zr,[td,ol],Ch)}if(!Mr){var gp=x2e(gs,0,hn,Ne),Bg=x2e(Mc,1,hn,Ne),ru=zr===null||gp&&Bg;ru&&(er(zr),bt&&(!eA(m,Lo(Ei,0),gs)||!eA(m,Lo(Ei,1),Mc))&&bt(zr,[td,ol]))}}var ta=function(Nn){return st&&Cn.current&&Cn.current.onKeyDown?Cn.current.onKeyDown(Nn):(Dd(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},ma={formatList:pn,generateConfig:m,locale:v},za=iW(Lo(rn,0),ma),ts=cn(za,2),fs=ts[0],$o=ts[1],Tl=iW(Lo(rn,1),ma),ac=cn(Tl,2),xi=ac[0],co=ac[1],vo=function(Nn,Mr){var zr=GHe(Nn,{locale:v,formatList:pn,generateConfig:m}),gs=Mr===0?ri:mi;zr&&!gs(zr)&&(di(om(rn,zr,Mr)),xs(zr,Mr))},Ws=bse({valueTexts:fs,onTextChange:function(Nn){return vo(Nn,0)}}),Vo=cn(Ws,3),zs=Vo[0],No=Vo[1],Yr=Vo[2],uo=bse({valueTexts:xi,onTextChange:function(Nn){return vo(Nn,1)}}),Lr=cn(uo,3),Br=Lr[0],so=Lr[1],Ki=Lr[2],ti=w.useState(null),yi=cn(ti,2),Qn=yi[0],li=yi[1],Si=w.useState(null),Yi=cn(Si,2),Tn=Yi[0],xn=Yi[1],Xn=mse(zs,{formatList:pn,generateConfig:m,locale:v}),vt=cn(Xn,3),$t=vt[0],yn=vt[1],ni=vt[2],Gn=mse(Br,{formatList:pn,generateConfig:m,locale:v}),fi=cn(Gn,3),$r=fi[0],ho=fi[1],eo=fi[2],Ua=function(Nn){xn(om(rn,Nn,ze)),ze===0?yn(Nn):ho(Nn)},Dr=function(){xn(om(rn,null,ze)),ze===0?ni():eo()},Rn=w.useState(st),Ts=cn(Rn,2),kl=Ts[0],tu=Ts[1];w.useEffect(function(){tu(st)},[st]);var ps=function(Nn){if(kl){if(pe){var Mr=ze?0:1,zr=Lo(rn,Mr);zr&&gr(rn,Mr,!0)}else if(Qt){var gs=Lo(rn,ze);gs&&gr(rn,ze)}}return Et==null?void 0:Et(Nn)},Hl=function(Nn,Mr){return{blurToCancel:!Qt&&pe,changeOnBlur:Qt,forwardKeyDown:ta,onBlur:ps,isClickOutside:function(gs){var Mc=[Se.current,Ie.current,We.current];return!QHe([].concat(no(pe?[Mc[ze]]:Mc),[ne.current]),gs)},onFocus:function(gs){ln&&ln(gs)},triggerOpen:function(gs){gs?tt(gs,Nn,"open"):tt(gs,Lo(rn,Nn)?Nn:!1,"blur")},onSubmit:function(){if(!rn||U&&U(rn[Nn]))return!1;gr(rn,Nn),Mr(),tt(!1,ze,"confirm")},onCancel:function(){tt(!1,Nn,"cancel"),di(Ei),Mr()}}},Wl={onKeyDown:function(Nn,Mr){X==null||X(Nn,Mr)}},Og=vse(pt(pt({},Hl(0,Yr)),{},{open:xt,value:zs},Wl)),A0=cn(Og,2),vl=A0[0],s_=A0[1],bh=s_.focused,Pg=s_.typing,ku=vse(pt(pt({},Hl(1,Ki)),{},{open:lt,value:Br},Wl)),nu=cn(ku,2),R0=nu[0],Mg=nu[1],Fg=Mg.focused,rf=Mg.typing,gI=function(Nn){se&&se(Nn),!st&&!Je.current.contains(Nn.target)&&!ot.current.contains(Nn.target)&&(hn[0]?hn[1]||dr(1):dr(0))},mI=function(Nn){mt&&mt(Nn),st&&(bh||Fg)&&!Je.current.contains(Nn.target)&&!ot.current.contains(Nn.target)&&Nn.preventDefault()},ed=Ei&&Ei[0]?ah(Ei[0],{locale:v,format:"YYYYMMDDHHmmss",generateConfig:m}):"",SN=Ei&&Ei[1]?ah(Ei[1],{locale:v,format:"YYYYMMDDHHmmss",generateConfig:m}):"";w.useEffect(function(){st||(di(Ei),!fs.length||fs[0]===""?No(""):$o!==zs&&Yr(),!xi.length||xi[0]===""?so(""):co!==Br&&Ki())},[st,fs,xi]),w.useEffect(function(){di(Ei)},[ed,SN]);var iu=ZHe({cellRender:V,monthCellRender:q,dateRender:W}),EN=w.useMemo(function(){if(iu)return function(Ci,Nn){return iu(Ci,pt(pt({},Nn),{},{range:ze?"end":"start"}))}},[ze,iu]);He&&(He.current={focus:function(){Je.current&&Je.current.focus()},blur:function(){Je.current&&Je.current.blur(),ot.current&&ot.current.blur()}});var _I=XHe(oe,Q);function of(){var Ci=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Nn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Mr=null;st&&Tn&&Tn[0]&&Tn[1]&&m.isAfter(Tn[1],Tn[0])&&(Mr=Tn);var zr=k;if(k&&Zr(k)==="object"&&k.defaultValue){var gs=k.defaultValue;zr=pt(pt({},k),{},{defaultValue:Lo(gs,ze)||void 0})}return w.createElement(zk.Provider,{value:{inRange:!0,panelPosition:Ci,rangedValue:Qn||rn,hoverRangedValue:Mr}},w.createElement(sWe,Tt({},n,Nn,{cellRender:EN,showTime:zr,mode:Ct[ze],generateConfig:m,style:void 0,direction:me,disabledDate:ze===0?ri:mi,disabledTime:function(td){return H?H(td,ze===0?"start":"end"):!1},className:zt(it({},"".concat(s,"-panel-focused"),ze===0?!Pg:!rf)),value:Lo(rn,ze),locale:v,tabIndex:-1,onPanelChange:function(td,ol){ze===0&&ni(!0),ze===1&&eo(!0),Jt(om(Ct,ol,ze),om(rn,td,ze));var Ch=td;Ci==="right"&&Ct[ze]===ol&&(Ch=aM(Ch,ol,m,-1)),xs(Ch,ze)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:ze===0?Lo(rn,1):Lo(rn,0)})))}var yh=0,z1=0;if(ze&&Se.current&&Ke.current&&ne.current&&wt.current){yh=Se.current.offsetWidth+Ke.current.offsetWidth;var _a=wt.current.offsetLeft>yh?wt.current.offsetLeft-yh:wt.current.offsetLeft,pp=ne.current.offsetWidth,bl=wt.current.offsetWidth;pp&&bl&&yh>pp-bl-(me==="rtl"?0:_a)&&(z1=yh)}var yE=me==="rtl"?{right:yh}:{left:yh};function CE(){var Ci,Nn=rWe(s,Ct[ze],Fe),Mr=oWe({prefixCls:s,components:le,needConfirmButton:pe,okDisabled:!Lo(rn,ze)||U&&U(rn[ze]),locale:v,onOk:function(){var ru=Lo(rn,ze);ru&&(gr(rn,ze),Y==null||Y(rn),tt(!1,ze,"confirm"))}});if(x!=="time"&&!k){var zr=$i(ze),gs=aM(zr,x,m),Mc=Ct[ze],td=Mc===x,ol=of(td?"left":!1,{pickerValue:zr,onPickerValueChange:function(ru){xs(ru,ze)}}),Ch=of("right",{pickerValue:gs,onPickerValueChange:function(ru){xs(aM(ru,x,m,-1),ze)}});me==="rtl"?Ci=w.createElement(w.Fragment,null,Ch,td&&ol):Ci=w.createElement(w.Fragment,null,ol,td&&Ch)}else Ci=of();var gp=w.createElement("div",{className:"".concat(s,"-panel-layout")},w.createElement(lWe,{prefixCls:s,presets:_I,onClick:function(ru){gr(ru,null),tt(!1,ze,"preset")},onHover:function(ru){li(ru)}}),w.createElement("div",null,w.createElement("div",{className:"".concat(s,"-panels")},Ci),(Nn||Mr)&&w.createElement("div",{className:"".concat(s,"-footer")},Nn,Mr)));return re&&(gp=re(gp)),w.createElement("div",{className:"".concat(s,"-panel-container"),style:{marginLeft:z1},ref:ne,onMouseDown:function(ru){ru.preventDefault()}},gp)}var ee=w.createElement("div",{className:zt("".concat(s,"-range-wrapper"),"".concat(s,"-").concat(x,"-range-wrapper")),style:{minWidth:mn}},w.createElement("div",{ref:wt,className:"".concat(s,"-range-arrow"),style:yE}),CE()),z;Ye&&(z=w.createElement("span",{className:"".concat(s,"-suffix"),onMouseDown:function(Nn){Nn.preventDefault()}},Ye));var Z=cWe(s,Ve,ye),xe=w.createElement("span",{onMouseDown:function(Nn){Nn.preventDefault(),Nn.stopPropagation()},onMouseUp:function(Nn){Nn.preventDefault(),Nn.stopPropagation();var Mr=Ei;hn[0]||(Mr=om(Mr,null,0)),hn[1]||(Mr=om(Mr,null,1)),gr(Mr,null),tt(!1,ze,"clear")},className:"".concat(s,"-clear"),role:"button"},Z),Oe=Ve&&(Lo(Ei,0)&&!hn[0]||Lo(Ei,1)&&!hn[1]),Kt={size:YHe(x,pn[0],m)},$n=0,Li=0;Se.current&&Ie.current&&Ke.current&&(ze===0?Li=Se.current.offsetWidth:($n=yh,Li=Ie.current.offsetWidth));var Vr=me==="rtl"?{right:$n}:{left:$n},Oo=function(Nn,Mr){var zr=om(rn,Nn,ze);if(Mr==="submit"||Mr!=="key"&&!pe){gr(zr,ze),ze===0?ni():eo();var gs=ze===0?1:0;hn[gs]?tt(!1,!1,"confirm"):tt(!1,ze,"confirm")}else di(zr)};return w.createElement(Xf.Provider,{value:{operationRef:Cn,hideHeader:x==="time",onDateMouseEnter:Ua,onDateMouseLeave:Dr,hideRanges:!0,onSelect:Oo,open:st}},w.createElement(aWe,{visible:st,popupElement:ee,popupStyle:u,prefixCls:s,dropdownClassName:d,dropdownAlign:f,getPopupContainer:g,transitionName:h,range:!0,direction:me},w.createElement("div",Tt({ref:We,className:zt(s,"".concat(s,"-range"),c,(e={},it(e,"".concat(s,"-disabled"),hn[0]&&hn[1]),it(e,"".concat(s,"-focused"),ze===0?bh:Fg),it(e,"".concat(s,"-rtl"),me==="rtl"),e)),style:l,onClick:gI,onMouseEnter:be,onMouseLeave:Te,onMouseDown:mI,onMouseUp:Lt},fHe(n,{aria:!0,data:!0})),w.createElement("div",{className:zt("".concat(s,"-input"),(t={},it(t,"".concat(s,"-input-active"),ze===0),it(t,"".concat(s,"-input-placeholder"),!!$t),t)),ref:Se},w.createElement("input",Tt({id:a,disabled:hn[0],readOnly:Pe||typeof pn[0]=="function"||!Pg,value:$t||zs,onChange:function(Nn){No(Nn.target.value)},autoFocus:b,placeholder:Lo(_,0)||"",ref:Je},vl,Kt,{autoComplete:It}))),w.createElement("div",{className:"".concat(s,"-range-separator"),ref:Ke},A),w.createElement("div",{className:zt("".concat(s,"-input"),(i={},it(i,"".concat(s,"-input-active"),ze===1),it(i,"".concat(s,"-input-placeholder"),!!$r),i)),ref:Ie},w.createElement("input",Tt({disabled:hn[1],readOnly:Pe||typeof pn[0]=="function"||!rf,value:$r||Br,onChange:function(Nn){so(Nn.target.value)},placeholder:Lo(_,1)||"",ref:ot},R0,Kt,{autoComplete:It}))),w.createElement("div",{className:"".concat(s,"-active-bar"),style:pt(pt({},Vr),{},{width:Li,position:"absolute"})}),z,Oe&&xe)))}var F7t=function(n){Tv(t,n);var e=Rk(t);function t(){var i;El(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)),it(Xr(i),"pickerRef",w.createRef()),it(Xr(i),"focus",function(){i.pickerRef.current&&i.pickerRef.current.focus()}),it(Xr(i),"blur",function(){i.pickerRef.current&&i.pickerRef.current.blur()}),i}return xl(t,[{key:"render",value:function(){return w.createElement(M7t,Tt({},this.props,{pickerRef:this.pickerRef}))}}]),t}(w.Component);const B7t=n=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:n,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),x_e=n=>({borderColor:n.hoverBorderColor,backgroundColor:n.hoverBg}),tA=n=>({borderColor:n.activeBorderColor,boxShadow:n.activeShadow,outline:0,backgroundColor:n.activeBg}),uWe=n=>({color:n.colorTextDisabled,backgroundColor:n.colorBgContainerDisabled,borderColor:n.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},x_e(Gh(n,{hoverBorderColor:n.colorBorder,hoverBg:n.colorBgContainerDisabled})))}),dWe=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}},hWe=n=>({padding:`${n.paddingBlockSM}px ${n.paddingInlineSM}px`,borderRadius:n.borderRadiusSM}),fWe=(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({},tA(Gh(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({},tA(Gh(n,{activeBorderColor:r,activeShadow:s}))),[`${t}-prefix, ${t}-suffix`]:{color:r}}}},T_e=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}`},B7t(n.colorTextPlaceholder)),{"&:hover":Object.assign({},x_e(n)),"&:focus, &:focus-within":Object.assign({},tA(n)),"&-disabled, &[disabled]":Object.assign({},uWe(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({},dWe(n)),"&-sm":Object.assign({},hWe(n)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),$7t=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({},dWe(n)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},hWe(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"},MFt()),{[`${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}}}})}},V7t=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({},q4(n)),T_e(n)),fWe(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"}})}},H7t=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`}}}},W7t=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({},T_e(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}}}),H7t(n)),{[`${a}${e}-password-icon`]:{color:o,cursor:"pointer",transition:`all ${r}`,"&:hover":{color:s}}}),fWe(n,`${e}-affix-wrapper`))}},z7t=n=>{const{componentCls:e,colorError:t,colorWarning:i,borderRadiusLG:r,borderRadiusSM:o}=n;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},q4(n)),$7t(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({},uWe(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}}}})}},U7t=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}}}}},j7t=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 pWe(n){return Gh(n,{inputAffixPadding:n.paddingXXS})}const gWe=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:f,colorPrimary:g,controlOutlineWidth:m,controlOutline:v,colorErrorOutline:_,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:g,hoverBorderColor:f,activeShadow:`0 0 0 ${m}px ${v}`,errorActiveShadow:`0 0 0 ${m}px ${_}`,warningActiveShadow:`0 0 0 ${m}px ${b}`,hoverBg:"",activeBg:""}};AR("Input",n=>{const e=Gh(n,pWe(n));return[V7t(e),j7t(e),W7t(e),z7t(e),U7t(e),v_e(e)]},gWe);const OJ=(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`}},q7t=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:f,controlHeightSM:g,cellRangeBorderColor:m,pickerCellBorderGap:v,cellHoverWithRangeBg:_,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:f,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:g,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:v},[`&-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:_},[`&-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}}},G7t=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:f,colorPrimary:g,colorTextHeading:m,colorSplit:v,pickerControlIconBorderWidth:_,colorIcon:b,textHeight:y,motionDurationMid:C,colorIconHover:E,fontWeightStrong:x,cellHeight:k,pickerCellPaddingVertical:L,colorTextDisabled:D,colorText:A,fontSize:N,cellHoverWithRangeBg:P,motionDurationSlow:M,withoutTimeCellHeight:B,pickerQuarterPanelContentHeight:F,colorLink:U,colorLinkActive:H,colorLinkHover:W,cellRangeBorderColor:q,borderRadiusSM:V,colorTextLightSolid:re,cellHoverBg:oe,timeColumnHeight:Q,timeColumnWidth:Ne,timeCellHeight:Ve,controlItemBgActive:Ye,marginXXS:ye,pickerDatePanelPaddingHorizontal:He}=n,Pe=s*7+He*2,Ge=(Pe-l*2)/3-r-a,Fe=(Pe-l*2)/4-r;return{[e]:{"&-panel":{display:"inline-flex",flexDirection:"column",textAlign:"center",background:u,border:`${d}px ${h} ${v}`,borderRadius:f,outline:"none","&-focused":{borderColor:g},"&-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:Pe},"&-header":{display:"flex",padding:`0 ${l}px`,color:m,borderBottom:`${d}px ${h} ${v}`,"> *":{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:N,"&:hover":{color:E}},"&-view":{flex:"auto",fontWeight:x,lineHeight:`${y}px`,button:{color:"inherit",fontWeight:"inherit",verticalAlign:"top","&:not(:first-child)":{marginInlineStart:l},"&:hover":{color:g}}}},"&-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:_,borderBlockEndWidth:0,borderInlineStartWidth:_,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:_,borderBlockEndWidth:0,borderInlineStartWidth:_,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:k,fontWeight:"normal"},th:{height:k+L*2,color:A,verticalAlign:"middle"}},"&-cell":Object.assign({padding:`${L}px 0`,color:D,cursor:"pointer","&-in-view":{color:A}},q7t(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:P,transition:`all ${M}`,content:'""'}},[`&-date-panel
${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start
${i}::after`]:{insetInlineEnd:-(s-k)/2,insetInlineStart:0},[`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${i}::after`]:{insetInlineEnd:0,insetInlineStart:-(s-k)/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:Fe,borderInlineStart:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineEnd:Fe,borderInlineEnd:`${d}px dashed ${q}`}},[`${e}-cell-range-hover-end::after`]:{insetInlineEnd:Fe,borderInlineEnd:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineStart:Fe,borderInlineStart:`${d}px dashed ${q}`}}},[`&-panel ${e}-footer`]:{borderTop:`${d}px ${h} ${v}`},"&-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} ${v}`}}},"&-now":{textAlign:"start"},"&-today-btn":{color:U,"&:hover":{color:W},"&:active":{color:H},[`&${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:V,borderEndStartRadius:V,borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-panel-rtl &`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:V,borderEndEndRadius:V}},[`${e}-cell-range-hover-end::after`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:V,borderEndEndRadius:V,[`${e}-panel-rtl &`]:{borderStartStartRadius:V,borderEndStartRadius:V,borderStartEndRadius:0,borderEndEndRadius:0}}},"&-year-panel,\n &-month-panel":{[`${e}-cell-range-hover-start::after`]:{insetInlineStart:Ge,borderInlineStart:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineEnd:Ge,borderInlineEnd:`${d}px dashed ${q}`}},[`${e}-cell-range-hover-end::after`]:{insetInlineEnd:Ge,borderInlineEnd:`${d}px dashed ${q}`,[`${e}-panel-rtl &`]:{insetInlineStart:Ge,borderInlineStart:`${d}px dashed ${q}`}}},"&-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:V,borderEndStartRadius:V},"&:last-child:before":{borderStartEndRadius:V,borderEndEndRadius:V}},"&:hover td":{"&:before":{background:oe}},"&-range-start td,\n &-range-end td,\n &-selected td":{[`&${t}`]:{"&:before":{background:g},[`&${e}-cell-week`]:{color:new Cd(re).setAlpha(.5).toHexString()},[i]:{color:re}}},"&-range-hover td:before":{background:Ye}}},"&-date-panel":{[`${e}-body`]:{padding:`${l}px ${He}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} ${v}`},[`${e}-date-panel,
${e}-time-panel`]:{transition:`opacity ${M}`},"&-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:Q},"&-column":{flex:"1 0 auto",width:Ne,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:Q-Ve,content:'""'},"&:not(:first-child)":{borderInlineStart:`${d}px ${h} ${v}`},"&-active":{background:new Cd(Ye).setAlpha(.2).toHexString()},"&:hover":{overflowY:"auto"},"> li":{margin:0,padding:0,[`&${e}-time-panel-cell`]:{marginInline:ye,[`${e}-time-panel-cell-inner`]:{display:"block",width:Ne-2*ye,height:Ve,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:(Ne-Ve)/2,color:A,lineHeight:`${Ve}px`,borderRadius:V,cursor:"pointer",transition:`background ${C}`,"&:hover":{background:oe}},"&-selected":{[`${e}-time-panel-cell-inner`]:{background:Ye}},"&-disabled":{[`${e}-time-panel-cell-inner`]:{color:D,background:"transparent",cursor:"not-allowed"}}}}}},[`&-datetime-panel ${e}-time-panel-column:after`]:{height:Q-Ve+c*2}}}},K7t=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({},tA(Gh(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({},tA(Gh(n,{activeBorderColor:o,activeShadow:s}))),[`${e}-active-bar`]:{background:o}}}}},Y7t=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:f,colorTextPlaceholder:g,controlHeightLG:m,fontSizeLG:v,controlHeightSM:_,paddingInlineSM:b,paddingXS:y,marginXS:C,colorTextDescription:E,lineWidthBold:x,lineHeight:k,colorPrimary:L,motionDurationSlow:D,zIndexPopup:A,paddingXXS:N,paddingSM:P,textHeight:M,cellActiveWithRangeBg:B,colorPrimaryBorder:F,sizePopupArrow:U,borderRadiusXS:H,borderRadiusOuter:W,colorBgElevated:q,borderRadiusLG:V,boxShadowSecondary:re,borderRadiusSM:oe,colorSplit:Q,cellHoverBg:Ne,presetsWidth:Ve,presetsMaxWidth:Ye,boxShadowPopoverArrow:ye,colorTextQuaternary:He}=n;return[{[e]:Object.assign(Object.assign(Object.assign({},q4(n)),OJ(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({},x_e(n)),[`&-focused${e}`]:Object.assign({},tA(n)),[`&${e}-disabled`]:{background:h,borderColor:c,cursor:"not-allowed",[`${e}-suffix`]:{color:He}},[`&${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({},T_e(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:g}}},"&-large":Object.assign(Object.assign({},OJ(n,m,v,o)),{[`${e}-input > input`]:{fontSize:v}}),"&-small":Object.assign({},OJ(n,_,r,b)),[`${e}-suffix`]:{display:"flex",flex:"none",alignSelf:"center",marginInlineStart:y/2,color:f,lineHeight:1,pointerEvents:"none","> *":{verticalAlign:"top","&:not(:last-child)":{marginInlineEnd:C}}},[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineEnd:0,color:f,lineHeight:1,background:s,transform:"translateY(-50%)",cursor:"pointer",opacity:0,transition:`opacity ${d}, color ${d}`,"> *":{verticalAlign:"top"},"&:hover":{color:E}},[`${e}-separator`]:{position:"relative",display:"inline-block",width:"1em",height:v,color:f,fontSize:v,verticalAlign:"top",cursor:"default",[`${e}-focused &`]:{color:E},[`${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:x,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({},q4(n)),G7t(n)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:A,[`&${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:PHe},[`&${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:NHe},[`&${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:MHe},[`&${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:OHe},[`${e}-panel > ${e}-time-panel`]:{paddingTop:N},[`${e}-ranges`]:{marginBottom:0,padding:`${N}px ${P}px`,overflow:"hidden",lineHeight:`${M-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`},NFt(U,H,W,q,ye)),[`${e}-panel-container`]:{overflow:"hidden",verticalAlign:"top",background:q,borderRadius:V,boxShadow:re,transition:`margin ${D}`,[`${e}-panel-layout`]:{display:"flex",flexWrap:"nowrap",alignItems:"stretch"},[`${e}-presets`]:{display:"flex",flexDirection:"column",minWidth:Ve,maxWidth:Ye,ul:{height:0,flex:"auto",listStyle:"none",overflow:"auto",margin:0,padding:y,borderInlineEnd:`${a}px ${l} ${Q}`,li:Object.assign(Object.assign({},OFt),{borderRadius:oe,paddingInline:y,paddingBlock:(_-Math.round(r*k))/2,cursor:"pointer",transition:`all ${D}`,"+ li":{marginTop:C},"&:hover":{background:Ne}})}},[`${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:`${U*2/3}px 0`,"&-hidden":{display:"none"}},"&-rtl":{direction:"rtl",[`${e}-separator`]:{transform:"rotate(180deg)"},[`${e}-footer`]:{"&-extra":{direction:"rtl"}}}})},d2e(n,"slide-up"),d2e(n,"slide-down"),u2e(n,"move-up"),u2e(n,"move-down")]},Q7t=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}},X7t=n=>({cellHoverBg:n.controlItemBgHover,cellActiveWithRangeBg:n.controlItemBgActive,cellHoverWithRangeBg:new Cd(n.colorPrimary).lighten(35).toHexString(),cellRangeBorderColor:new Cd(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}),mWe=AR("DatePicker",n=>{const e=Gh(pWe(n),Q7t(n));return[Y7t(e),K7t(e),v_e(n,{focusElCls:`${n.componentCls}-focused`})]},n=>Object.assign(Object.assign(Object.assign({},gWe(n)),X7t(n)),{presetsWidth:120,presetsMaxWidth:200,zIndexPopup:n.zIndexPopupBase+50})),Z7t=n=>{const{componentCls:e,sizePaddingEdgeHorizontal:t,colorSplit:i,lineWidth:r,textPaddingInline:o,orientationMargin:s,verticalMarginInline:a}=n;return{[e]:Object.assign(Object.assign({},q4(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}}})}},J7t=AR("Divider",n=>{const e=Gh(n,{dividerHorizontalWithTextGutterMargin:n.margin,dividerHorizontalGutterMargin:n.marginLG,sizePaddingEdgeHorizontal:0});return[Z7t(e)]},n=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:n.marginXS}));var e$t=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 t$t=n=>{const{getPrefixCls:e,direction:t,divider:i}=w.useContext(Ym),{prefixCls:r,type:o="horizontal",orientation:s="center",orientationMargin:a,className:l,rootClassName:c,children:u,dashed:d,plain:h,style:f}=n,g=e$t(n,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),m=e("divider",r),[v,_]=J7t(m),b=s.length>0?`-${s}`:s,y=!!u,C=s==="left"&&a!=null,E=s==="right"&&a!=null,x=zt(m,i==null?void 0:i.className,_,`${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`]:E},l,c),k=w.useMemo(()=>typeof a=="number"?a:/^\d+$/.test(a)?Number(a):a,[a]),L=Object.assign(Object.assign({},C&&{marginLeft:k}),E&&{marginRight:k});return v(w.createElement("div",Object.assign({className:x,style:Object.assign(Object.assign({},i==null?void 0:i.style),f)},g,{role:"separator"}),u&&o!=="vertical"&&w.createElement("span",{className:`${m}-inner-text`,style:L},u)))},n$t=t$t;var i$t={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 r$t=i$t;var o$t=function(e,t){return w.createElement(WF,Tt({},e,{ref:t,icon:r$t}))};const _We=w.forwardRef(o$t);var s$t={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 a$t=s$t;var l$t=function(e,t){return w.createElement(WF,Tt({},e,{ref:t,icon:a$t}))};const vWe=w.forwardRef(l$t);var c$t={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 u$t=c$t;var d$t=function(e,t){return w.createElement(WF,Tt({},e,{ref:t,icon:u$t}))};const h$t=w.forwardRef(d$t);function f$t(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 p$t(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 k_e(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 g$t(n){return n?Array.isArray(n)?n:[n]:[]}function rW(n){const{format:e,picker:t,showHour:i,showMinute:r,showSecond:o,use12Hours:s}=n,a=g$t(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 bWe(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 m$t(n){return w.createElement(qBt,Object.assign({size:"small",type:"primary"},n))}const _$t={button:m$t},yWe=_$t;var v$t=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 b$t(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:f,status:g,clearIcon:m,allowClear:v,rootClassName:_}=t,b=v$t(t,["prefixCls","getPopupContainer","className","placement","size","disabled","bordered","placeholder","popupClassName","dropdownClassName","status","clearIcon","allowClear","rootClassName"]),y=w.useRef(null),{getPrefixCls:C,direction:E,getPopupContainer:x}=w.useContext(Ym),k=C("picker",r),{compactSize:L,compactItemClassnames:D}=g_e(k,E),{format:A,showTime:N,picker:P}=t,M=C(),[B,F]=mWe(k),U=Object.assign(Object.assign({},N?rW(Object.assign({format:A,picker:P},N)):{}),P==="time"?rW(Object.assign(Object.assign({format:A},t),{picker:P})):{}),H=p_e(ye=>{var He;return(He=l??L)!==null&&He!==void 0?He:ye}),W=w.useContext(Uq),q=c??W,V=w.useContext(AHe),{hasFeedback:re,status:oe,feedbackIcon:Q}=V,Ne=w.createElement(w.Fragment,null,P==="time"?w.createElement(vWe,null):w.createElement(_We,null),re&&Q);w.useImperativeHandle(i,()=>({focus:()=>{var ye;return(ye=y.current)===null||ye===void 0?void 0:ye.focus()},blur:()=>{var ye;return(ye=y.current)===null||ye===void 0?void 0:ye.blur()}}));const[Ve]=BVe("Calendar",XH),Ye=Object.assign(Object.assign({},Ve),t.locale);return B(w.createElement(F7t,Object.assign({separator:w.createElement("span",{"aria-label":"to",className:`${k}-separator`},w.createElement(h$t,null)),disabled:q,ref:y,dropdownAlign:k_e(E,a),placeholder:p$t(Ye,P,d),suffixIcon:Ne,prevIcon:w.createElement("span",{className:`${k}-prev-icon`}),nextIcon:w.createElement("span",{className:`${k}-next-icon`}),superPrevIcon:w.createElement("span",{className:`${k}-super-prev-icon`}),superNextIcon:w.createElement("span",{className:`${k}-super-next-icon`}),transitionName:`${M}-slide-up`},b,U,{className:zt({[`${k}-${H}`]:H,[`${k}-borderless`]:!u},BHe(k,$He(oe,g),re),F,D,s,_),locale:Ye.lang,prefixCls:k,getPopupContainer:o||x,generateConfig:n,components:yWe,direction:E,dropdownClassName:zt(F,h||f,_),allowClear:bWe(v,m,w.createElement(hHe,null))})))})}var y$t=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 C$t(n){function e(l,c){const u=c==="TimePicker"?"timePicker":"datePicker",d=w.forwardRef((h,f)=>{const{prefixCls:g,getPopupContainer:m,style:v,className:_,rootClassName:b,size:y,bordered:C=!0,placement:E,placeholder:x,popupClassName:k,dropdownClassName:L,disabled:D,status:A,clearIcon:N,allowClear:P}=h,M=y$t(h,["prefixCls","getPopupContainer","style","className","rootClassName","size","bordered","placement","placeholder","popupClassName","dropdownClassName","disabled","status","clearIcon","allowClear"]),{getPrefixCls:B,direction:F,getPopupContainer:U,[u]:H}=w.useContext(Ym),W=B("picker",g),{compactSize:q,compactItemClassnames:V}=g_e(W,F),re=w.useRef(null),{format:oe,showTime:Q}=h,[Ne,Ve]=mWe(W);w.useImperativeHandle(f,()=>({focus:()=>{var be;return(be=re.current)===null||be===void 0?void 0:be.focus()},blur:()=>{var be;return(be=re.current)===null||be===void 0?void 0:be.blur()}}));const Ye={showToday:!0};let ye={};l&&(ye.picker=l);const He=l||h.picker;ye=Object.assign(Object.assign(Object.assign({},ye),Q?rW(Object.assign({format:oe,picker:He},Q)):{}),He==="time"?rW(Object.assign(Object.assign({format:oe},h),{picker:He})):{});const Pe=B(),Ge=p_e(be=>{var Te;return(Te=y??q)!==null&&Te!==void 0?Te:be}),Fe=w.useContext(Uq),bt=D??Fe,Mt=w.useContext(AHe),{hasFeedback:Ft,status:Yt,feedbackIcon:ln}=Mt,Et=w.createElement(w.Fragment,null,He==="time"?w.createElement(vWe,null):w.createElement(_We,null),Ft&&ln),[mt]=BVe("DatePicker",XH),Lt=Object.assign(Object.assign({},mt),h.locale);return Ne(w.createElement(D7t,Object.assign({ref:re,placeholder:f$t(Lt,He,x),suffixIcon:Et,dropdownAlign:k_e(F,E),prevIcon:w.createElement("span",{className:`${W}-prev-icon`}),nextIcon:w.createElement("span",{className:`${W}-next-icon`}),superPrevIcon:w.createElement("span",{className:`${W}-super-prev-icon`}),superNextIcon:w.createElement("span",{className:`${W}-super-next-icon`}),transitionName:`${Pe}-slide-up`},Ye,M,ye,{locale:Lt.lang,className:zt({[`${W}-${Ge}`]:Ge,[`${W}-borderless`]:!C},BHe(W,$He(Yt,A),Ft),Ve,V,H==null?void 0:H.className,_,b),style:Object.assign(Object.assign({},H==null?void 0:H.style),v),prefixCls:W,getPopupContainer:m||U,generateConfig:n,components:yWe,direction:F,disabled:bt,dropdownClassName:zt(Ve,b,k||L),allowClear:bWe(P,N,w.createElement(hHe,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 CWe(n){const{DatePicker:e,WeekPicker:t,MonthPicker:i,YearPicker:r,TimePicker:o,QuarterPicker:s}=C$t(n),a=b$t(n),l=e;return l.WeekPicker=t,l.MonthPicker=i,l.YearPicker=r,l.RangePicker=a,l.TimePicker=o,l.QuarterPicker=s,l}const PR=CWe(H9t);function wWe(n){const e=k_e(n.direction,n.placement);return e.overflow.adjustY=!1,e.overflow.adjustX=!1,Object.assign(Object.assign({},n),{dropdownAlign:e})}const w$t=FHe(PR,"picker",null,wWe);PR._InternalPanelDoNotUseOrYouWillBeFired=w$t;const S$t=FHe(PR.RangePicker,"picker",null,wWe);PR._InternalRangePanelDoNotUseOrYouWillBeFired=S$t;PR.generatePicker=CWe;const SWe=PR;function E$t(){const[n]=ve(),e=zi(),t=Zi(),i=Mk(),[r,o]=w.useState(!0),s=(l,c)=>e(go({object:"company",property:l,value:c})),a=()=>{he.processing(),$e("POST",Ae(`/api/v1/companies/${t.id}/default`),{}).then(l=>{he.success(l.data.message),o(!1)})};return O(tn,{title:n("overview"),children:[p(G,{leftSide:n("activate_company"),leftSideHelp:n("activate_company_help"),children:p(kt,{checked:!(t!=null&&t.is_disabled),onChange:l=>s("is_disabled",!l)})}),p(G,{leftSide:n("enable_markdown"),leftSideHelp:n("enable_markdown_help"),children:p(kt,{checked:t==null?void 0:t.markdown_enabled,onChange:l=>s("markdown_enabled",l)})}),p(G,{leftSide:n("include_drafts"),leftSideHelp:n("include_drafts_help"),children:p(kt,{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&&O(St,{children:[p(n$t,{}),p(G,{leftSide:n("set_default_company"),children:p(un,{type:"minimal",behavior:"button",onClick:a,children:t==null?void 0:t.settings.name})})]})]})}function x$t(){const[n]=ve();Va();const e=Mk(),{dateFormat:t}=sc();return O(tn,{title:n("plan"),children:[p(G,{className:"mb-3",leftSide:n("plan"),children:p("span",{children:n((e==null?void 0:e.plan_expires)!==""&&!Un(e.plan_expires).isBefore(Un())?"licensed":"plan_free_self_hosted")})}),(e==null?void 0:e.plan_expires)!==""&&p(G,{leftSide:n("expires_on"),children:Un(e.plan_expires).year()>2e3?xo(e.plan_expires,t):n("forever_free")}),qo(),!d1()&&p(h3t,{})]})}/**
* 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 Bs=Ro(void 0);function T$t(){const[n]=ve(),e=Zi(),t=Gi(Bs),i=ki(),r=zi(),[o,s]=w.useState(!1),a=[{value:18e5,label:At(n("count_minutes"),{count:"30"})},{value:72e5,label:At(n("count_hours"),{count:"2"})},{value:288e5,label:At(n("count_hours"),{count:"8"})},{value:864e5,label:At(n("count_day"),{count:"1"})},{value:6048e5,label:At(n("count_days"),{count:"7"})},{value:2592e6,label:At(n("count_days"),{count:"30"})},{value:0,label:n("never")}],l=d=>r(go({object:"company",property:d.target.id,value:d.target.value})),c=(d,h)=>r(go({object:"company",property:d,value:h})),u=()=>{o||(s(!0),$e("POST",Ae("/api/v1/logout")).then(()=>{he.success("success"),i("/logout")}).finally(()=>s(!1)))};return O(tn,{title:n("security_settings"),children:[p(G,{leftSide:n("password_timeout"),children:p(En,{id:"default_password_timeout",value:e==null?void 0:e.default_password_timeout,onChange:l,errorMessage:t==null?void 0:t.errors.default_password_timeout,children:a.map(d=>p("option",{value:d.value,children:d.label},d.value))})}),p(G,{leftSide:n("web_session_timeout"),children:p(En,{id:"session_timeout",value:e==null?void 0:e.session_timeout,onChange:l,errorMessage:t==null?void 0:t.errors.session_timeout,children:a.map(d=>p("option",{value:d.value,children:d.label},d.value))})}),p(G,{leftSide:n("require_password_with_social_login"),children:p(kt,{checked:e==null?void 0:e.oauth_password_required,id:"oauth_password_required",onChange:d=>c("oauth_password_required",d)})}),p(G,{leftSide:n("end_all_sessions"),leftSideHelp:n("end_all_sessions_help"),children:p(un,{behavior:"button",type:"secondary",onClick:u,disabled:o,disableWithoutIcon:!0,children:n("logout")})})]})}function k$t(){const[n]=ve(),e=Ti(),t=Wi(ap),i=Nc(v=>v.companyUsers),[r,o]=w.useState(""),[s,a]=w.useState(""),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,f]=w.useState(""),g=()=>{he.processing(),$e("POST",Ae("/api/v1/companies/purge_save_settings/:id",{id:e.id}),{cancellation_message:s},{headers:{"X-Api-Password":r}}).then(()=>he.success("purge_successful")).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===412&&(he.error("password_error_incorrect"),t(0))}).finally(()=>c(!1))},m=()=>{he.processing(),$e("DELETE",Ae("/api/v1/companies/:id",{id:e.id}),{},{headers:{"X-Api-Password":r}}).then(()=>window.location.reload()).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===412&&(he.error("password_error_incorrect"),t(0))})};return O(St,{children:[O(Or,{title:n("purge_data"),text:n("purge_data_message"),visible:l,onClose:c,children:[p(Ze,{label:At(n("please_type_to_confirm"),{value:"purge"}),id:"purge_data",onChange:v=>f(v.target.value),required:!0}),p(Ze,{type:"password",label:n("password"),id:"password",onChange:v=>o(v.target.value),required:!0}),h==="purge"&&p(un,{onClick:g,children:n("continue")})]}),O(Or,{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:[p(Ze,{label:At(n("please_type_to_confirm"),{value:"delete"}),id:"cancel_account",onChange:v=>f(v.target.value),required:!0}),p(Ze,{type:"text",label:n("reason_for_canceling"),id:"feedback",onChange:v=>a(v.target.value)}),p(Ze,{type:"password",label:n("password"),id:"password",onChange:v=>o(v.target.value),required:!0}),h==="delete"&&p(un,{onClick:m,children:n("continue")})]}),O(tn,{title:n("danger_zone"),children:[p(Nl,{onClick:()=>c(!0),className:"text-red-500 hover:text-red-600",children:n("purge_data")}),p(Nl,{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 Oc(n){const e=n.text||"",t=i=>{i.stopPropagation(),navigator.clipboard.writeText(e),he.success("copied_to_clipboard",{value:""})};return O("div",{className:`inline-flex space-x-2 ${n.className}`,children:[p("span",{children:n.secure?n.text.split("").map(()=>"*"):e}),e.length>0&&navigator.clipboard&&window.isSecureContext&&p("button",{type:"button",onClick:t,children:p(V9e,{size:18})})]})}function I$t(){var t,i,r;const[n]=ve(),e=Va();return O(tn,{title:n("referral_program"),children:[p(G,{leftSide:n("referral_code"),children:p(Oc,{text:`https://app.invoicing.co/#/register?rc=${e==null?void 0:e.referral_code}`})}),p(G,{leftSide:n("free"),children:((t=e==null?void 0:e.referral_meta)==null?void 0:t.free)||0}),p(G,{leftSide:n("pro"),children:((i=e==null?void 0:e.referral_meta)==null?void 0:i.pro)||0}),p(G,{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 L$t(){return[{name:"income",icon:qEt,visible:!0},{name:"expense",icon:JEt,visible:!0},{name:"settings",icon:XEt,visible:qo()}]}/**
* 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 Eu=Ro(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 EWe(n){const{isAdmin:e}=Fo(),{status:t}=n||{};return Ii(["/api/v1/company_gateways",n],()=>$e("GET",Ae("/api/v1/company_gateways?sort=id|desc&status=:status",{status:t||"active"})),{staleTime:1/0,enabled:e})}function D$t(n){const{isAdmin:e}=Fo();return Ii(["/api/v1/company_gateways",n.id,n.queryParams],()=>$e("GET",Ae(`/api/v1/company_gateways/:id?${n.queryParams||""}`,{id:n.id})),{staleTime:1/0,enabled:(n.enabled??!0)&&e})}function A$t(){const{isAdmin:n}=Fo();return Ii(["/api/v1/company_gateways/create"],()=>$e("GET",Ae("/api/v1/company_gateways/create")),{staleTime:1/0,enabled:n})}function xWe(){const n=Co(),e=Gi(Eu);return async(t,i)=>(he.processing(),$e("POST",Ae("/api/v1/company_gateways/bulk"),{action:i,ids:t}).then(()=>{he.success(`${i}d_company_gateway`),In(["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 TWe(n){const{isAdmin:e,isOwner:t}=Fo();return Ii(["/api/v1/bank_integrations",n.id],()=>$e("GET",Ae("/api/v1/bank_integrations/:id",{id:n.id})).then(i=>i.data.data),{enabled:(n.enabled??!0)&&(e||t),staleTime:1/0})}function R$t(n){const{perPage:e}=n||{};return Ii(["/api/v1/bank_integrations"],()=>$e("GET",Ae("/api/v1/bank_integrations?per_page=:perPage&status=active",{perPage:e??20})).then(t=>t.data.data),{staleTime:1/0})}function kWe(){const{isAdmin:n,isOwner:e}=Fo();return Ii(["/api/v1/bank_integrations","create"],()=>$e("GET",Ae("/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 IWe(n){return Ii(["/api/v1/tax_rates",n],()=>$e("GET",Ae("/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 N$t(n){return Ii(["/api/v1/tax_rates",n.id],()=>$e("GET",Ae("/api/v1/tax_rates/:id",{id:n.id})),{staleTime:1/0})}function O$t(){const{isAdmin:n}=Fo();return Ii(["/api/v1/tax_rates","create"],()=>$e("GET",Ae("/api/v1/tax_rates/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function P$t(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/tax_rates/bulk"),{action:e,ids:[n]}).then(()=>{he.success(`${e}d_tax_rate`),In(["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 Ir(n){return()=>{var t,i,r;const e=!!(((r=(i=(t=VH.getState().companyUsers.api)==null?void 0:t[VH.getState().companyUsers.currentIndex])==null?void 0:i.company)==null?void 0:r.enabled_modules)&n);return new Promise(o=>o(e))}}function LWe(){const n=Ti();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 M$t(){const n=Ti(),e=hs(),t=LWe(),{isAdmin:i,isOwner:r}=Fo(),{data:o}=EWe(),{data:s}=R$t(),{data:a}=IWe({}),[l,c]=w.useState(),[u,d]=w.useState(),[h,f]=w.useState();return w.useEffect(()=>{o&&c(o.data.data),s&&d(s),a&&f(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(wi.Invoices)},{key:"recurring_invoice",url:"/recurring_invoices/create",section:"income",visible:e("create_recurring_invoice")&&t(wi.RecurringInvoices)},{key:"quote",url:"/quotes/create",section:"income",visible:e("create_quote")&&t(wi.Quotes)},{key:"credit",url:"/credits/create",section:"income",visible:e("create_credit")&&t(wi.Credits)},{key:"payment",url:"/payments/create",section:"income",visible:e("create_payment")},{key:"subscription",url:"/settings/subscription/create",section:"income",visible:(Bm()||xc())&&(i||r)},{key:"expense",url:"/expenses/create",section:"expense",visible:e("create_expense")&&t(wi.Expenses)},{key:"purchase_order",url:"/purchase_orders/create",section:"expense",visible:e("create_purchase_order")&&t(wi.PurchaseOrders)},{key:"vendor",url:"/vendors/create",section:"expense",visible:e("create_vendor")&&t(wi.Vendors)},{key:"transaction",url:"/transactions/create",section:"expense",visible:e("create_bank_transaction")&&t(wi.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:xc()&&!(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:(Bm()||xc())&&(i||r)}]}const F$t=rl.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function B$t(){var l;const[n]=ve(),e=TR(),t=si(),i=Ss(),r=M$t(),o=L$t(),s=I1(),a=!!((l=s==null?void 0:s.company_user)!=null&&l.react_settings.show_mini_sidebar);return p(YZ,{className:"relative mt-2",children:()=>O(St,{children:[O(YZ.Button,{"data-cy":"quickPopoverButton",style:{backgroundColor:t.$1,color:t.$3},className:zt("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:[p(dke,{className:"cursor-pointer text-xl"}),p(YEt,{className:"cursor-pointer text-xl"})]}),p(Dy,{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:p(YZ.Panel,{className:zt("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":qo(),"left-14 md:left-52 md:max-w-2xl lg:max-w-3xl":qo(),"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:p("div",{style:{borderColor:t.$4},className:"border overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",children:p("div",{style:{backgroundColor:t.$1},className:zt("relative grid gap-y-4 md:gap-y-0 px-2 py-4 grid-cols-2",{"md:grid-cols-3":qo()}),children:o.map(c=>c.visible&&O("div",{className:"flex flex-col items-start rounded-lg transition duration-150 ease-in-out",children:[O("div",{className:"flex items-center pl-3",children:[p(c.icon,{className:"text-base",color:i}),p("p",{style:{color:t.$3},className:"uppercase text-sm tracking-wide font-medium ml-1 md:ml-2",children:n(c.name)})]}),p("div",{className:"flex flex-col w-full mt-2 space-y-2",children:r.map(u=>u.section===c.name&&u.visible&&O(F$t,{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:[p(dke,{className:"text-base",style:{color:t.$3}}),p("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 $$t(){const n=Mk();return Fo(),new Date(n==null?void 0:n.plan_expires)<new Date,qo()}/**
* 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 V$t(){const n=Mk(),{isAdmin:e,isOwner:t}=Fo(),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 lM=(n=>(n.Company="company",n.Group="group",n.Client="client",n))(lM||{});/**
* 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 I_e(){const n=Nc(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 $s(){const n=I_e(),e=lM.Company===n.level,t=lM.Group===n.level,i=lM.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 H$t(){const[n]=ve(),e=ml(),{isCompanySettingsActive:t}=$s(),{isOwner:i,isAdmin:r}=Fo(),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("e_invoice"),href:"/settings/e_invoice",current:e.pathname.startsWith("/settings/e_invoice"),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 DWe=Ro(null);function KTr(n,e=[]){const[t,i]=us(DWe),{displayButton:r=!0}=n||{};return w.useEffect(()=>(n&&r&&i(n),n&&!r&&i(null),()=>{i(null)}),e),t}const W$t=Ro(null);function z$t(n,e=[]){const[t,i]=us(W$t);return w.useEffect(()=>(n&&i(n),()=>{i(null)}),e),t}function U$t({variant:n,children:e,className:t,id:i}){return p("div",{id:i,className:zt("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"},t),children:e})}const j$t="font-medium text-xs md:text-sm underline cursor-pointer";function q$t(){return ve(),Va(),null}function G$t(){const[n]=ve(),e=Ti(),t=Va();return!e||!(t!=null&&t.email_verified_at)||e&&!e.is_disabled?null:p(U$t,{variant:"orange",children:O("div",{className:"flex space-x-1",children:[O("span",{children:[n("company_disabled_warning"),"."]}),p(k1,{className:j$t,to:"/settings/account_management/overview",children:n("activate_company")})]})})}var AWe={};/*! 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=[],f=0;f<arguments.length;f++){var g=arguments[f];if(g){var m=typeof g;if(m==="string"||m==="number")h.push(g);else if(Array.isArray(g)){if(g.length){var v=d.apply(null,g);v&&h.push(v)}}else if(m==="object"){if(g.toString!==Object.prototype.toString&&!g.toString.toString().includes("[native code]")){h.push(g.toString());continue}for(var _ in g)u.call(g,_)&&g[_]&&h.push(_)}}}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:()=>g});var u=c(81),d=c.n(u),h=c(645),f=c.n(h)()(d());f.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 g=f},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,f,g){typeof u=="string"&&(u=[[null,u,void 0]]);var m={};if(h)for(var v=0;v<this.length;v++){var _=this[v][0];_!=null&&(m[_]=!0)}for(var b=0;b<u.length;b++){var y=[].concat(u[b]);h&&m[y[0]]||(g!==void 0&&(y[5]===void 0||(y[1]="@layer".concat(y[5].length>0?" ".concat(y[5]):""," {").concat(y[1],"}")),y[5]=g),d&&(y[2]&&(y[1]="@media ".concat(y[2]," {").concat(y[1],"}")),y[2]=d),f&&(y[4]?(y[1]="@supports (".concat(y[4],") {").concat(y[1],"}"),y[4]=f):y[4]="".concat(f)),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 f(v,_,b,y,C,E){if(E!==u){var x=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 x.name="Invariant Violation",x}}function g(){return f}f.isRequired=f;var m={array:f,bigint:f,bool:f,func:f,number:f,object:f,string:f,symbol:f,any:f,arrayOf:g,element:f,elementType:f,instanceOf:g,node:f,objectOf:g,oneOf:g,oneOfType:g,shape:g,exact:g,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),f=i(28);function g(D){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},g(D)}var m=["className","type"],v=["className"];function _(D,A,N){return(A=function(P){var M=function(B,F){if(g(B)!=="object"||B===null)return B;var U=B[Symbol.toPrimitive];if(U!==void 0){var H=U.call(B,"string");if(g(H)!=="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(B)}(P);return g(M)==="symbol"?M:String(M)}(A))in D?Object.defineProperty(D,A,{value:N,enumerable:!0,configurable:!0,writable:!0}):D[A]=N,D}function b(){return b=Object.assign?Object.assign.bind():function(D){for(var A=1;A<arguments.length;A++){var N=arguments[A];for(var P in N)Object.prototype.hasOwnProperty.call(N,P)&&(D[P]=N[P])}return D},b.apply(this,arguments)}function y(D,A){if(D==null)return{};var N,P,M=function(F,U){if(F==null)return{};var H,W,q={},V=Object.keys(F);for(W=0;W<V.length;W++)H=V[W],U.indexOf(H)>=0||(q[H]=F[H]);return q}(D,A);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(D);for(P=0;P<B.length;P++)N=B[P],A.indexOf(N)>=0||Object.prototype.propertyIsEnumerable.call(D,N)&&(M[N]=D[N])}return M}function C(D,A){return function(N){if(Array.isArray(N))return N}(D)||function(N,P){var M=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(M!=null){var B,F,U,H,W=[],q=!0,V=!1;try{if(U=(M=M.call(N)).next,P===0){if(Object(M)!==M)return;q=!1}else for(;!(q=(B=U.call(M)).done)&&(W.push(B.value),W.length!==P);q=!0);}catch(re){V=!0,F=re}finally{try{if(!q&&M.return!=null&&(H=M.return(),Object(H)!==H))return}finally{if(V)throw F}}return W}}(D,A)||E(D,A)||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 E(D,A){if(D){if(typeof D=="string")return x(D,A);var N=Object.prototype.toString.call(D).slice(8,-1);return N==="Object"&&D.constructor&&(N=D.constructor.name),N==="Map"||N==="Set"?Array.from(D):N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N)?x(D,A):void 0}}function x(D,A){(A==null||A>D.length)&&(A=D.length);for(var N=0,P=new Array(A);N<A;N++)P[N]=D[N];return P}var k=(0,a.forwardRef)(function(D,A){var N=D.value,P=D.length,M=D.validChars,B=D.placeholder,F=D.autoFocus,U=D.passwordMode,H=D.inputProps,W=D.containerProps,q=D.classNames,V=D.onChange,re=D.onFocus,oe=D.onBlur,Q=D.onComplete,Ne=C((0,a.useState)(""),2),Ve=Ne[0],Ye=Ne[1],ye=C((0,a.useState)(!1),2),He=ye[0],Pe=ye[1],Ge=(0,a.useRef)(null);(0,a.useEffect)(function(){F&&Ge.current.focus()},[F]);var Fe,bt=function(){Ge.current.focus()},Mt=function(){return N??Ve},Ft=H.className,Yt=H.type,ln=y(H,m),Et=W.className,mt=y(W,v);return l().createElement("div",{className:"vi__wrapper"},l().createElement("input",b({"aria-label":"verification input",spellCheck:!1,value:Mt(),onChange:function(Lt){var be=Lt.target.value.replace(/\s/g,"");RegExp("^[".concat(M,"]{0,").concat(P,"}$")).test(be)&&(V&&(V==null||V(be)),Ye(be),be.length===P&&(Q==null||Q(be)))},ref:function(Lt){Ge.current=Lt,typeof A=="function"?A(Lt):A&&(A.current=Lt)},className:u()("vi",Ft),onKeyDown:function(Lt){["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Lt.key)&&Lt.preventDefault()},onFocus:function(){Pe(!0),re==null||re()},onBlur:function(){Pe(!1),oe==null||oe()},onSelect:function(Lt){var be=Lt.target.value;Lt.target.setSelectionRange(be.length,be.length)},type:U?"password":Yt},ln)),l().createElement("div",b({"data-testid":"container",className:u()("vi__container",q.container,Et),onClick:function(){return Ge.current.focus()}},mt),(Fe=Array(P),function(Lt){if(Array.isArray(Lt))return x(Lt)}(Fe)||function(Lt){if(typeof Symbol<"u"&&Lt[Symbol.iterator]!=null||Lt["@@iterator"]!=null)return Array.from(Lt)}(Fe)||E(Fe)||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(Lt,be){var Te;return l().createElement("div",{className:u()("vi__character",q.character,(Te={"vi__character--selected":(Mt().length===be||Mt().length===be+1&&P===be+1)&&He},_(Te,q.characterSelected,(Mt().length===be||Mt().length===be+1&&P===be+1)&&He),_(Te,"vi__character--inactive",Mt().length<be),_(Te,q.characterInactive,Mt().length<be),Te)),onClick:bt,id:"field-".concat(be),"data-testid":"character-".concat(be),key:be},U&&Mt()[be]?"*":Mt()[be]||B)})),l().createElement("style",{dangerouslySetInnerHTML:{__html:f.Z}}))});k.displayName="VerificationInput",k.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},k.defaultProps={length:6,validChars:"A-Za-z0-9",placeholder:"·",autoFocus:!1,inputProps:{},containerProps:{},classNames:{}};const L=k})();var o=n;for(var s in r)o[s]=r[s];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()})(AWe);const RWe=nl(AWe);function K$t(){ve(),w.useState(!1),Va();const n=Mk();return Ti(),null}let q8;const Y$t=new Uint8Array(16);function Q$t(){if(!q8&&(q8=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!q8))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q8(Y$t)}const rd=[];for(let n=0;n<256;++n)rd.push((n+256).toString(16).slice(1));function X$t(n,e=0){return rd[n[e+0]]+rd[n[e+1]]+rd[n[e+2]]+rd[n[e+3]]+"-"+rd[n[e+4]]+rd[n[e+5]]+"-"+rd[n[e+6]]+rd[n[e+7]]+"-"+rd[n[e+8]]+rd[n[e+9]]+"-"+rd[n[e+10]]+rd[n[e+11]]+rd[n[e+12]]+rd[n[e+13]]+rd[n[e+14]]+rd[n[e+15]]}const Z$t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),T2e={randomUUID:Z$t};function Qq(n,e,t){if(T2e.randomUUID&&!e&&!n)return T2e.randomUUID();n=n||{};const i=n.random||(n.rng||Q$t)();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 X$t(i)}var NWe={exports:{}},J$t=function(){var e=this,t=-1;return{next:function(){return t+=1,{value:e.items[t],done:t>=e.items.length}}}},eVt=function(){return this.items};function wse(n){"@babel/helpers - typeof";return wse=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},wse(n)}var $l={isArray:function(e){return Array.isArray(e)},isObject:function(e){return wse(e)==="object"&&Array.isArray(e)===!1&&e!==null},isFunction:function(e){return typeof e=="function"}},tVt=$l,nVt=tVt.isFunction,OWe=function(e){return e===void 0?this.sum()/this.items.length:nVt(e)?new this.constructor(this.items).sum(e)/this.items.length:new this.constructor(this.items).pluck(e).sum()/this.items.length},iVt=OWe,rVt=iVt;function Sse(n){"@babel/helpers - typeof";return Sse=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},Sse(n)}var oVt=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(Sse(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 sVt(n){return uVt(n)||cVt(n)||lVt(n)||aVt()}function aVt(){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 lVt(n,e){if(n){if(typeof n=="string")return Ese(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 Ese(n,e)}}function cVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function uVt(n){if(Array.isArray(n))return Ese(n)}function Ese(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 dVt=function(){var e;return new this.constructor((e=[]).concat.apply(e,sVt(this.items)))};function hVt(n,e){return mVt(n)||gVt(n,e)||pVt(n,e)||fVt()}function fVt(){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 pVt(n,e){if(n){if(typeof n=="string")return k2e(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 k2e(n,e)}}function k2e(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 gVt(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 mVt(n){if(Array.isArray(n))return n}function oW(n){"@babel/helpers - typeof";return oW=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},oW(n)}var _Vt=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(oW(this.items)==="object"&&oW(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=hVt(o,1);r[this.items]=s[0]}else typeof this.items=="string"&&(r[this.items]=i);return new this.constructor(r)};function vVt(n){return wVt(n)||CVt(n)||yVt(n)||bVt()}function bVt(){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 yVt(n,e){if(n){if(typeof n=="string")return xse(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 xse(n,e)}}function CVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function wVt(n){if(Array.isArray(n))return xse(n)}function xse(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 PWe=function(e){var t;if(Array.isArray(e)){var i;t=[],(i=t).push.apply(i,vVt(e))}else t={},Object.keys(e).forEach(function(r){t[r]=e[r]});return t};function sW(n){"@babel/helpers - typeof";return sW=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},sW(n)}var SVt=PWe,EVt=function(e){var t=e;e instanceof this.constructor?t=e.all():sW(e)==="object"&&(t=[],Object.keys(e).forEach(function(r){t.push(e[r])}));var i=SVt(this.items);return t.forEach(function(r){sW(r)==="object"?Object.keys(r).forEach(function(o){return i.push(r[o])}):i.push(r)}),new this.constructor(i)};function I2e(n){return IVt(n)||kVt(n)||TVt(n)||xVt()}function xVt(){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 TVt(n,e){if(n){if(typeof n=="string")return Tse(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 Tse(n,e)}}function kVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function IVt(n){if(Array.isArray(n))return Tse(n)}function Tse(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 E0=function(e){var t=[];return Array.isArray(e)?t.push.apply(t,I2e(e)):e.constructor.name==="Collection"?t.push.apply(t,I2e(e.all())):Object.keys(e).forEach(function(i){return t.push(e[i])}),t};function LVt(n){return NVt(n)||RVt(n)||AVt(n)||DVt()}function DVt(){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 AVt(n,e){if(n){if(typeof n=="string")return kse(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 kse(n,e)}}function RVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function NVt(n){if(Array.isArray(n))return kse(n)}function kse(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 OVt=E0,PVt=$l,MVt=PVt.isFunction,MWe=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(MVt(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=OVt(this.items);return i.push.apply(i,LVt(Object.keys(this.items))),i.indexOf(e)!==-1},FVt=function(){return this.count()===1},BVt=function(){var e=0;return Array.isArray(this.items)&&(e=this.items.length),Math.max(Object.keys(this.items).length,e)},$Vt=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()})},VVt=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 f=o.slice();f.push(l[h]),u?d.push(f):d=d.concat(e(f,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)))},HVt=function(){this.dump(),typeof process<"u"&&process.exit(1)},WVt=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)},zVt=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)},UVt=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)},jVt=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)},qVt=function(e,t){return!this.contains(e,t)},GVt=function(){return console.log(this),this};function aW(n){"@babel/helpers - typeof";return aW=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},aW(n)}var KVt=function(){var e=this,t=[],i={},r=function(s){return Array.isArray(s)||aW(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}):aW(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)},YVt=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 QVt(n){return eHt(n)||JVt(n)||ZVt(n)||XVt()}function XVt(){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 ZVt(n,e){if(n){if(typeof n=="string")return Ise(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 Ise(n,e)}}function JVt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function eHt(n){if(Array.isArray(n))return Ise(n)}function Ise(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 tHt=function(e){return this.each(function(t,i){e.apply(void 0,QVt(t).concat([i]))}),this},nHt=E0,iHt=function(e){var t=nHt(this.items);return t.every(e)},Xq=function(e){return Array.isArray(e[0])?e[0]:e},rHt=Xq,oHt=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=rHt(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 Lse(n){"@babel/helpers - typeof";return Lse=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},Lse(n)}function FWe(n){if(Array.isArray(n)){if(n.length)return!1}else if(n!=null&&Lse(n)==="object"){if(Object.keys(n).length)return!1}else if(n)return!1;return!0}function sHt(n,e){var t={};return Object.keys(e).forEach(function(i){n?n(e[i],i)&&(t[i]=e[i]):FWe(e[i])||(t[i]=e[i])}),t}function aHt(n,e){if(n)return e.filter(n);for(var t=[],i=0;i<e.length;i+=1){var r=e[i];FWe(r)||t.push(r)}return t}var lHt=function(e){var t=e||!1,i=null;return Array.isArray(this.items)?i=aHt(t,this.items):i=sHt(t,this.items),new this.constructor(i)},cHt=$l,PJ=cHt.isFunction,uHt=function(e,t){if(PJ(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 PJ(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 PJ(t)?t():t},dHt=$l,hHt=dHt.isFunction,fHt=function(e,t,i){if(hHt(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()},pHt=function(e,t,i){return this.where(e,t,i).first()||null},gHt=function(e){return this.map(e).collapse()},BWe=$l,MJ=BWe.isArray,FJ=BWe.isObject,mHt=function(e){var t=e||1/0,i=!1,r=[],o=function(a){r=[],MJ(a)?a.forEach(function(l){MJ(l)?r=r.concat(l):FJ(l)?Object.keys(l).forEach(function(c){r=r.concat(l[c])}):r.push(l)}):Object.keys(a).forEach(function(l){MJ(a[l])?r=r.concat(a[l]):FJ(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 FJ(l)}),i=i.length===0,t-=1};for(o(this.items);!i&&t>0;)o(r);return new this.constructor(r)},_Ht=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)},vHt=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)},bHt=function(e){return Array.isArray(this.items)?this.items.splice(e,1):delete this.items[e],this},yHt=$l,CHt=yHt.isFunction,wHt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.items[e]!==void 0?this.items[e]:CHt(t)?t():t!==null?t:null},GS=function(e,t){try{return t.split(".").reduce(function(i,r){return i[r]},e)}catch{return e}},BJ=GS,SHt=$l,EHt=SHt.isFunction,xHt=function(e){var t=this,i={};return this.items.forEach(function(r,o){var s;EHt(e)?s=e(r,o):BJ(r,e)||BJ(r,e)===0?s=BJ(r,e):s="",i[s]===void 0&&(i[s]=new t.constructor([])),i[s].push(r)}),new this.constructor(i)},THt=Xq,kHt=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=THt(i);return o.filter(function(s){return Object.hasOwnProperty.call(e.items,s)}).length===o.length},IHt=function(e,t){return t===void 0?this.items.join(e):new this.constructor(this.items).pluck(e).all().join(t)},LHt=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)},DHt=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)},AHt=function(){return Array.isArray(this.items)?!this.items.length:!Object.keys(this.items).length},RHt=function(){return!this.isEmpty()},NHt=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},OHt=GS,PHt=$l,MHt=PHt.isFunction,FHt=function(e){var t={};return MHt(e)?this.items.forEach(function(i){t[e(i)]=i}):this.items.forEach(function(i){var r=OHt(i,e);t[r||""]=i}),new this.constructor(t)},BHt=function(){var e=Object.keys(this.items);return Array.isArray(this.items)&&(e=e.map(Number)),new this.constructor(e)},$Ht=$l,L2e=$Ht.isFunction,VHt=function(e,t){var i=this.items;if(L2e(e)&&(i=this.filter(e).all()),Array.isArray(i)&&!i.length||!Object.keys(i).length)return L2e(t)?t():t;if(Array.isArray(i))return i[i.length-1];var r=Object.keys(i);return i[r[r.length-1]]},HHt=function(e,t){this.constructor.prototype[e]=t},WHt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new this.constructor(e)},zHt=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 UHt(n){return KHt(n)||GHt(n)||qHt(n)||jHt()}function jHt(){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 qHt(n,e){if(n){if(typeof n=="string")return Dse(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 Dse(n,e)}}function GHt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function KHt(n){if(Array.isArray(n))return Dse(n)}function Dse(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 YHt=function(e){return this.map(function(t,i){return e.apply(void 0,UHt(t).concat([i]))})};function QHt(n,e){return eWt(n)||JHt(n,e)||ZHt(n,e)||XHt()}function XHt(){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 ZHt(n,e){if(n){if(typeof n=="string")return D2e(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 D2e(n,e)}}function D2e(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 JHt(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 eWt(n){if(Array.isArray(n))return n}var tWt=function(e){var t={};return this.items.forEach(function(i,r){var o=e(i,r),s=QHt(o,2),a=s[0],l=s[1];t[a]===void 0?t[a]=[l]:t[a].push(l)}),new this.constructor(t)},nWt=function(e){return this.map(function(t,i){return new e(t,i)})};function iWt(n,e){return aWt(n)||sWt(n,e)||oWt(n,e)||rWt()}function rWt(){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 oWt(n,e){if(n){if(typeof n=="string")return A2e(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 A2e(n,e)}}function A2e(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 sWt(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 aWt(n){if(Array.isArray(n))return n}var lWt=function(e){var t={};return this.items.forEach(function(i,r){var o=e(i,r),s=iWt(o,2),a=s[0],l=s[1];t[a]===void 0?t[a]=[l]:t[a].push(l)}),new this.constructor(t)};function R2e(n,e){return hWt(n)||dWt(n,e)||uWt(n,e)||cWt()}function cWt(){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 uWt(n,e){if(n){if(typeof n=="string")return N2e(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 N2e(n,e)}}function N2e(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 dWt(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 hWt(n){if(Array.isArray(n))return n}var fWt=function(e){var t=this,i={};return Array.isArray(this.items)?this.items.forEach(function(r,o){var s=e(r,o),a=R2e(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=R2e(o,2),a=s[0],l=s[1];i[a]=l}),new this.constructor(i)};function O2e(n){return _Wt(n)||mWt(n)||gWt(n)||pWt()}function pWt(){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 gWt(n,e){if(n){if(typeof n=="string")return Ase(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 Ase(n,e)}}function mWt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function _Wt(n){if(Array.isArray(n))return Ase(n)}function Ase(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 vWt=function(e){if(typeof e=="string"){var t=this.items.filter(function(i){return i[e]!==void 0});return Math.max.apply(Math,O2e(t.map(function(i){return i[e]})))}return Math.max.apply(Math,O2e(this.items))},bWt=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]},yWt=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 lW(n){"@babel/helpers - typeof";return lW=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},lW(n)}function P2e(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 M2e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?P2e(Object(t),!0).forEach(function(i){CWt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):P2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function CWt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var wWt=function(e){var t=function i(r,o){var s={},a=Object.keys(M2e(M2e({},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])&&lW(r[l])==="object"&&!Array.isArray(o[l])&&lW(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 F2e(n){return TWt(n)||xWt(n)||EWt(n)||SWt()}function SWt(){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 EWt(n,e){if(n){if(typeof n=="string")return Rse(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 Rse(n,e)}}function xWt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function TWt(n){if(Array.isArray(n))return Rse(n)}function Rse(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 kWt=function(e){if(e!==void 0){var t=this.items.filter(function(i){return i[e]!==void 0});return Math.min.apply(Math,F2e(t.map(function(i){return i[e]})))}return Math.min.apply(Math,F2e(this.items))},IWt=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},LWt=E0,DWt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=LWt(this.items),r=i.slice(t).filter(function(o,s){return s%e===0});return new this.constructor(r)},AWt=Xq,RWt=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=AWt(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)},NWt=PWe,OWt=function(e,t){var i=Math.abs(e),r=this.count();if(i<=r)return this;for(var o=i-r,s=NWt(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)},PWt=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)},MWt=function(e){return e(this)},$We=$l,FWt=$We.isArray,BWt=$We.isObject,G8=GS,$Wt=function(e){var t={};return e.forEach(function(i,r){function o(s,a){BWt(s)?Object.keys(s).forEach(function(l){o(s[l],"".concat(a,".").concat(l))}):FWt(s)&&s.forEach(function(l,c){o(l,"".concat(a,".").concat(c))}),t[a]=s}o(i,r)}),t},VWt=function(e,t){if(e.indexOf("*")!==-1){var i=$Wt(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 f=h.match(o);if(f){var g=f[0];g.split(".").length===s&&r.push(i[g])}})}var a=[],l=new RegExp("0.".concat(e),"g"),c="0.".concat(e).split(".").length;if(Object.keys(i).forEach(function(h){var f=h.match(l);if(f){var g=f[0];g.split(".").length===c&&a.push(i[g])}}),t!==void 0){var u={};return this.items.forEach(function(h,f){u[r[f]||""]=a}),new this.constructor(u)}return new this.constructor([a])}if(t!==void 0){var d={};return this.items.forEach(function(h){G8(h,e)!==void 0?d[h[t]||""]=G8(h,e):d[h[t]||""]=null}),new this.constructor(d)}return this.map(function(h){return G8(h,e)!==void 0?G8(h,e):null})},HWt=Xq,VWe=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];HWt(i).forEach(function(o){delete e[o]})},HWe=$l,WWt=HWe.isArray,zWt=HWe.isObject,B2e=VWe,UWt=function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(WWt(this.items))return t===1?this.items.pop():new this.constructor(this.items.splice(-t));if(zWt(this.items)){var i=Object.keys(this.items);if(t===1){var r=i[i.length-1],o=this.items[r];return B2e(this.items,r),o}var s=i.slice(-t),a=s.reduce(function(l,c){return l[c]=e.items[c],l},{});return B2e(this.items,s),new this.constructor(a)}return null},jWt=function(e,t){return t!==void 0?this.put(t,e):(this.items.unshift(e),this)},qWt=$l,GWt=qWt.isFunction,KWt=function(e,t){var i=this.items[e]||null;return!i&&t!==void 0&&(GWt(t)?i=t():i=t),delete this.items[e],i},YWt=function(){var e;return(e=this.items).push.apply(e,arguments),this},QWt=function(e,t){return this.items[e]=t,this},XWt=E0,ZWt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=XWt(this.items),i=new this.constructor(t).shuffle();return e!==parseInt(e,10)?i.first():i.take(e)},JWt=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},ezt=function(e){return new this.constructor(this.items).filter(function(t){return!e(t)})};function $2e(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 K8(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$2e(Object(t),!0).forEach(function(i){tzt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function tzt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var nzt=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=K8(K8({},this.items),e.all());return new this.constructor(i)}var r=K8(K8({},this.items),e);return new this.constructor(r)};function fx(n){"@babel/helpers - typeof";return fx=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},fx(n)}function V2e(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 zI(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?V2e(Object(t),!0).forEach(function(i){izt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):V2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function izt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var rzt=function(e){var t=function i(r,o){var s=zI({},r),a=Object.keys(zI(zI({},r),o));return a.forEach(function(l){!Array.isArray(o[l])&&fx(o[l])==="object"?s[l]=i(r[l],o[l]):r[l]===void 0&&o[l]!==void 0?fx(r[l])==="object"?s[l]=zI({},o[l]):s[l]=o[l]:r[l]!==void 0&&o[l]===void 0?fx(r[l])==="object"?s[l]=zI({},r[l]):s[l]=r[l]:r[l]!==void 0&&o[l]!==void 0&&(fx(o[l])==="object"?s[l]=zI({},o[l]):s[l]=o[l])}),s};return e?!Array.isArray(e)&&fx(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},ozt=function(){var e=[].concat(this.items).reverse();return new this.constructor(e)},L_e=$l,szt=L_e.isArray,azt=L_e.isObject,lzt=L_e.isFunction,czt=function(e,t){var i=this,r,o=function(a,l){return lzt(e)?e(i.items[l],l):t?i.items[l]===e:i.items[l]==e};return szt(this.items)?r=this.items.findIndex(o):azt(this.items)&&(r=Object.keys(this.items).find(function(s){return o(i.items[s],s)})),r===void 0||r<0?!1:r},WWe=$l,uzt=WWe.isArray,dzt=WWe.isObject,hzt=VWe,fzt=function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(uzt(this.items))return t===1?this.items.shift():new this.constructor(this.items.splice(0,t));if(dzt(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 hzt(this.items,s),new this.constructor(a)}return null},pzt=E0,gzt=function(){var e=pzt(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},mzt=$l,_zt=mzt.isObject,vzt=function(e){var t=this;return _zt(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))},D_e=$l,bzt=D_e.isArray,yzt=D_e.isObject,Czt=D_e.isFunction,wzt=function(e){var t=this,i=null,r,o=function(a){return a===e};return Czt(e)&&(o=e),bzt(this.items)&&(r=this.items.filter(function(s){return i!==!0&&(i=o(s)),i})),yzt(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)},A_e=$l,Szt=A_e.isArray,Ezt=A_e.isObject,xzt=A_e.isFunction,Tzt=function(e){var t=this,i=null,r,o=function(a){return a===e};return xzt(e)&&(o=e),Szt(this.items)&&(r=this.items.filter(function(s){return i!==!0&&(i=!o(s)),i})),Ezt(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)},kzt=function(e,t){var i=this.items.slice(e);return t!==void 0&&(i=i.slice(0,t)),new this.constructor(i)},Izt=$l,Lzt=Izt.isFunction,Dzt=function(e,t,i){var r;if(Lzt(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()},Azt=MWe,Rzt=Azt,Nzt=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)},Ozt=function(){return this.sort().reverse()},Pzt=GS,Mzt=$l,Fzt=Mzt.isFunction,Bzt=function(e){var t=[].concat(this.items),i=function(o){return Fzt(e)?e(o):Pzt(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)},$zt=function(e){return this.sortBy(e).reverse()},Vzt=function(){var e=this,t={};return Object.keys(this.items).sort().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)},Hzt=function(){var e=this,t={};return Object.keys(this.items).sort().reverse().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)},Wzt=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},zzt=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)},Uzt=E0,jzt=$l,qzt=jzt.isFunction,Gzt=function(e){var t=Uzt(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(qzt(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 Nse(n){"@babel/helpers - typeof";return Nse=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},Nse(n)}var Kzt=function(e){var t=this;if(!Array.isArray(this.items)&&Nse(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))},R_e=$l,Yzt=R_e.isArray,Qzt=R_e.isObject,Xzt=R_e.isFunction,Zzt=function(e){var t=this,i=null,r,o=function(a){return a===e};return Xzt(e)&&(o=e),Yzt(this.items)&&(r=this.items.filter(function(s){return i!==!1&&(i=!o(s)),i})),Qzt(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)},N_e=$l,Jzt=N_e.isArray,eUt=N_e.isObject,tUt=N_e.isFunction,nUt=function(e){var t=this,i=null,r,o=function(a){return a===e};return tUt(e)&&(o=e),Jzt(this.items)&&(r=this.items.filter(function(s){return i!==!1&&(i=o(s)),i})),eUt(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)},iUt=function(e){return e(this),this},rUt=function(e,t){for(var i=1;i<=e;i+=1)this.items.push(t(i));return this},oUt=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 Ose(n){"@babel/helpers - typeof";return Ose=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},Ose(n)}var sUt=function(){return Ose(this.items)==="object"&&!Array.isArray(this.items)?JSON.stringify(this.all()):JSON.stringify(this.toArray())},aUt=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 H2e(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 W2e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?H2e(Object(t),!0).forEach(function(i){lUt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):H2e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function lUt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var cUt=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=W2e(W2e({},t),r)}else t[i]=e.items[i]}),new this.constructor(t)},uUt=function(e,t,i){e?i(this):t(this)},z2e=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},U2e=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},dUt=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)},hUt=$l,fUt=hUt.isFunction,pUt=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;fUt(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)},gUt=function(e){return e instanceof this.constructor?e.all():e},mUt=E0,_Ut=function(){return new this.constructor(mUt(this.items))},vUt=function(e,t,i){return e?t(this,e):i?i(this,e):this},bUt=E0,Kg=GS,yUt=function(e,t,i){var r=t,o=i,s=bUt(this.items);if(t===void 0||t===!0)return new this.constructor(s.filter(function(l){return Kg(l,e)}));if(t===!1)return new this.constructor(s.filter(function(l){return!Kg(l,e)}));i===void 0&&(o=t,r="===");var a=s.filter(function(l){switch(r){case"==":return Kg(l,e)===Number(o)||Kg(l,e)===o.toString();default:case"===":return Kg(l,e)===o;case"!=":case"<>":return Kg(l,e)!==Number(o)&&Kg(l,e)!==o.toString();case"!==":return Kg(l,e)!==o;case"<":return Kg(l,e)<o;case"<=":return Kg(l,e)<=o;case">":return Kg(l,e)>o;case">=":return Kg(l,e)>=o}});return new this.constructor(a)},CUt=function(e,t){return this.where(e,">=",t[0]).where(e,"<=",t[t.length-1])},wUt=E0,SUt=GS,EUt=function(e,t){var i=wUt(t),r=this.items.filter(function(o){return i.indexOf(SUt(o,e))!==-1});return new this.constructor(r)},xUt=function(e){return this.filter(function(t){return t instanceof e})},j2e=GS,TUt=function(e,t){return this.filter(function(i){return j2e(i,e)<t[0]||j2e(i,e)>t[t.length-1]})},kUt=E0,IUt=GS,LUt=function(e,t){var i=kUt(t),r=this.items.filter(function(o){return i.indexOf(IUt(o,e))===-1});return new this.constructor(r)},DUt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"===",null)},AUt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"!==",null)};function Pse(n){"@babel/helpers - typeof";return Pse=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},Pse(n)}var RUt=function(e){return e instanceof this.constructor?e:Pse(e)==="object"?new this.constructor(e):new this.constructor([e])},NUt=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=J$t;typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=i),t.prototype.toJSON=function(){return this.items},t.prototype.all=eVt,t.prototype.average=OWe,t.prototype.avg=rVt,t.prototype.chunk=oVt,t.prototype.collapse=dVt,t.prototype.combine=_Vt,t.prototype.concat=EVt,t.prototype.contains=MWe,t.prototype.containsOneItem=FVt,t.prototype.count=BVt,t.prototype.countBy=$Vt,t.prototype.crossJoin=VVt,t.prototype.dd=HVt,t.prototype.diff=WVt,t.prototype.diffAssoc=zVt,t.prototype.diffKeys=UVt,t.prototype.diffUsing=jVt,t.prototype.doesntContain=qVt,t.prototype.dump=GVt,t.prototype.duplicates=KVt,t.prototype.each=YVt,t.prototype.eachSpread=tHt,t.prototype.every=iHt,t.prototype.except=oHt,t.prototype.filter=lHt,t.prototype.first=uHt,t.prototype.firstOrFail=fHt,t.prototype.firstWhere=pHt,t.prototype.flatMap=gHt,t.prototype.flatten=mHt,t.prototype.flip=_Ht,t.prototype.forPage=vHt,t.prototype.forget=bHt,t.prototype.get=wHt,t.prototype.groupBy=xHt,t.prototype.has=kHt,t.prototype.implode=IHt,t.prototype.intersect=LHt,t.prototype.intersectByKeys=DHt,t.prototype.isEmpty=AHt,t.prototype.isNotEmpty=RHt,t.prototype.join=NHt,t.prototype.keyBy=FHt,t.prototype.keys=BHt,t.prototype.last=VHt,t.prototype.macro=HHt,t.prototype.make=WHt,t.prototype.map=zHt,t.prototype.mapSpread=YHt,t.prototype.mapToDictionary=tWt,t.prototype.mapInto=nWt,t.prototype.mapToGroups=lWt,t.prototype.mapWithKeys=fWt,t.prototype.max=vWt,t.prototype.median=bWt,t.prototype.merge=yWt,t.prototype.mergeRecursive=wWt,t.prototype.min=kWt,t.prototype.mode=IWt,t.prototype.nth=DWt,t.prototype.only=RWt,t.prototype.pad=OWt,t.prototype.partition=PWt,t.prototype.pipe=MWt,t.prototype.pluck=VWt,t.prototype.pop=UWt,t.prototype.prepend=jWt,t.prototype.pull=KWt,t.prototype.push=YWt,t.prototype.put=QWt,t.prototype.random=ZWt,t.prototype.reduce=JWt,t.prototype.reject=ezt,t.prototype.replace=nzt,t.prototype.replaceRecursive=rzt,t.prototype.reverse=ozt,t.prototype.search=czt,t.prototype.shift=fzt,t.prototype.shuffle=gzt,t.prototype.skip=vzt,t.prototype.skipUntil=wzt,t.prototype.skipWhile=Tzt,t.prototype.slice=kzt,t.prototype.sole=Dzt,t.prototype.some=Rzt,t.prototype.sort=Nzt,t.prototype.sortDesc=Ozt,t.prototype.sortBy=Bzt,t.prototype.sortByDesc=$zt,t.prototype.sortKeys=Vzt,t.prototype.sortKeysDesc=Hzt,t.prototype.splice=Wzt,t.prototype.split=zzt,t.prototype.sum=Gzt,t.prototype.take=Kzt,t.prototype.takeUntil=Zzt,t.prototype.takeWhile=nUt,t.prototype.tap=iUt,t.prototype.times=rUt,t.prototype.toArray=oUt,t.prototype.toJson=sUt,t.prototype.transform=aUt,t.prototype.undot=cUt,t.prototype.unless=uUt,t.prototype.unlessEmpty=z2e,t.prototype.unlessNotEmpty=U2e,t.prototype.union=dUt,t.prototype.unique=pUt,t.prototype.unwrap=gUt,t.prototype.values=_Ut,t.prototype.when=vUt,t.prototype.whenEmpty=U2e,t.prototype.whenNotEmpty=z2e,t.prototype.where=yUt,t.prototype.whereBetween=CUt,t.prototype.whereIn=EUt,t.prototype.whereInstanceOf=xUt,t.prototype.whereNotBetween=TUt,t.prototype.whereNotIn=LUt,t.prototype.whereNull=DUt,t.prototype.whereNotNull=AUt,t.prototype.wrap=RUt,t.prototype.zip=NUt;var r=function(s){return new t(s)};n.exports=r,n.exports.collect=r,n.exports.default=r,n.exports.Collection=t})(NWe);var OUt=NWe.exports;const Ja=nl(OUt),q2e=rl(F_.Option)`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function PUt(){const[n]=ve(),[e,t]=w.useState(""),[i,r]=w.useState(!1),o=TR(),s=si(),a=w.useRef(null),l=w.useRef(null),{data:c,refetch:u}=Ii(["/api/v1/search"],()=>{const g=e.length===0?"/api/v1/search":`/api/v1/search?search=${e}`;return $e("POST",Ae(g)).then(m=>{const v=[];return Object.entries(m.data).forEach(([_,b])=>{b.forEach(y=>{v.push({id:Qq(),label:y.name,value:y.id,resource:y,searchable:`${n(_)}: ${y.name}`,eventType:"external"})})}),v})},{staleTime:1/0}),d=Ja(c).filter(g=>g.searchable.toLowerCase().includes(e.toLowerCase())||g.label.toLowerCase().includes(e.toLowerCase())||g.value.toString().toLowerCase().includes(e.toLowerCase())).take(100);w.useEffect(()=>{const g=m=>{var v;m.ctrlKey&&m.key==="k"&&(m.preventDefault(),(v=l.current)==null||v.focus())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]),w.useEffect(()=>{i===!1&&t("")},[i]),m1(a,()=>r(!1));const h=An.debounce(g=>t(g.target.value),500),f=d.count()===0?Ja(c):d;return w.useEffect(()=>{e&&d.count()===0&&u()},[e]),p(F_,{as:"div",onChange:g=>g.resource?o({url:g.resource.path}):null,className:"relative w-full max-w-[70%]",ref:a,children:O("div",{className:"relative mt-2",children:[p(F_.Input,{className:"border-transparent focus:border-transparent focus:ring-0 w-full",onChange:h,ref:l,onFocus:()=>r(!0),placeholder:`${n("search")}... (Ctrl K)`,style:{backgroundColor:s.$1,color:s.$3}}),O(F_.Options,{className:zt("absolute border rounded max-h-72 overflow-y-auto shadow-lg","min-w-full w-max",{hidden:!i}),style:{backgroundColor:s.$1,borderColor:s.$4,minWidth:"33vw",maxWidth:"max(100%, 33vw)"},static:!0,children:[f==null?void 0:f.map(g=>p(q2e,{value:g,theme:{color:s.$3,hoverColor:s.$2},className:"cursor-pointer rounded px-4 py-2 active:font-semibold",children:({active:m})=>{var v;return p("span",{className:zt("block truncate space-x-1",m&&"font-semibold"),children:O("div",{children:[p("p",{className:"text-xs font-semibold",children:(v=g.resource)==null?void 0:v.heading}),p("p",{children:g.label})]})})}},g.id)),f.count()===0&&p(q2e,{value:null,theme:{color:s.$3,hoverColor:s.$2},className:"cursor-not-allowed rounded px-4 py-2 active:font-semibold",disabled:!0,children:({active:g})=>p("span",{className:zt("block truncate space-x-1",g&&"font-semibold"),children:p("p",{className:"text-sm",children:n("no_match_found")})})})]})]})})}const MUt=w.memo(PUt);function Q4({children:n,className:e}){return p("div",{className:zt("inline-flex items-center space-x-2",e),children:n})}const FUt=rl.div`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function BUt(n){const{padding:e="regular",className:t,style:i}=n,r=si();return p(FUt,{style:{...i},theme:{hoverColor:r.$2,color:r.$3},className:zt(`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})}Yj("notifications",[]);function MR(n){var _;const[e]=ve(),t=ml(),i=hs(),r=si(),o=TR(),s=LWe(),a=I1(),l=Ti(),c=Eq(),u=!!((_=a==null?void 0:a.company_user)!=null&&_.react_settings.show_mini_sidebar),d=!d1()&&($$t()||V$t()),[h,f]=w.useState(!1),g=[{name:e("dashboard"),href:"/dashboard",icon:J8e,current:t.pathname.startsWith("/dashboard"),visible:i("view_dashboard")},{name:e("clients"),href:"/clients",icon:gwt,current:t.pathname.startsWith("/clients"),visible:i("view_client")||i("create_client")||i("edit_client"),rightButton:{icon:Gd,to:"/clients/create",label:e("new_client"),visible:i("create_client")}},{name:e("products"),href:"/products",icon:R1t,current:t.pathname.startsWith("/products"),visible:i("view_product")||i("create_product")||i("edit_product"),rightButton:{icon:Gd,to:"/products/create",label:e("new_product"),visible:i("create_product")}},{name:e("invoices"),href:"/invoices",icon:oS,current:t.pathname.startsWith("/invoices"),visible:s(wi.Invoices)&&(i("view_invoice")||i("create_invoice")||i("edit_invoice")),rightButton:{icon:Gd,to:"/invoices/create",label:e("new_invoice"),visible:i("create_invoice")}},{name:e("recurring_invoices"),href:"/recurring_invoices",icon:SH,current:t.pathname.startsWith("/recurring_invoices"),visible:s(wi.RecurringInvoices)&&(i("view_recurring_invoice")||i("create_recurring_invoice")||i("edit_recurring_invoice")),rightButton:{icon:Gd,to:"/recurring_invoices/create",label:e("new_recurring_invoice"),visible:i("create_recurring_invoice")}},{name:e("payments"),href:"/payments",icon:sCt,current:t.pathname.startsWith("/payments"),visible:i("view_payment")||i("create_payment")||i("edit_payment"),rightButton:{icon:Gd,to:"/payments/create",label:e("new_payment"),visible:i("create_payment")}},{name:e("quotes"),href:"/quotes",icon:Sge,current:t.pathname.startsWith("/quotes"),visible:s(wi.Quotes)&&(i("view_quote")||i("create_quote")||i("edit_quote")),rightButton:{icon:Gd,to:"/quotes/create",label:e("new_quote"),visible:i("create_quote")}},{name:e("credits"),href:"/credits",icon:oS,current:t.pathname.startsWith("/credits"),visible:s(wi.Credits)&&(i("view_credit")||i("create_credit")||i("edit_credit")),rightButton:{icon:Gd,to:"/credits/create",label:e("new_credit"),visible:i("create_credit")}},{name:e("projects"),href:"/projects",icon:P1t,current:t.pathname.startsWith("/projects"),visible:s(wi.Projects)&&(i("view_project")||i("create_project")||i("edit_project")),rightButton:{icon:Gd,to:"/projects/create",label:e("new_project"),visible:i("create_project")}},{name:e("tasks"),href:"/tasks",icon:iCt,current:t.pathname.startsWith("/tasks"),visible:s(wi.Tasks)&&(i("view_task")||i("edit_task")||i("create_task")),rightButton:{icon:Gd,to:"/tasks/create",label:e("new_task"),visible:i("create_task")}},{name:e("vendors"),href:"/vendors",icon:BAt,current:t.pathname.startsWith("/vendors"),visible:s(wi.Vendors)&&(i("view_vendor")||i("create_vendor")||i("edit_vendor")),rightButton:{icon:Gd,to:"/vendors/create",label:e("new_vendor"),visible:i("create_vendor")}},{name:e("purchase_orders"),href:"/purchase_orders",icon:$me,current:t.pathname.startsWith("/purchase_orders"),visible:s(wi.PurchaseOrders)&&(i("view_purchase_order")||i("create_purchase_order")||i("edit_purchase_order")),rightButton:{icon:Gd,to:"/purchase_orders/create",label:e("new_purchase_order"),visible:i("create_purchase_order")}},{name:e("expenses"),href:"/expenses",icon:WAt,current:t.pathname.startsWith("/expenses"),visible:s(wi.Expenses)&&(i("view_expense")||i("create_expense")||i("edit_expense")),rightButton:{icon:Gd,to:"/expenses/create",label:e("new_expense"),visible:i("create_expense")}},{name:e("recurring_expenses"),href:"/recurring_expenses",icon:SH,current:t.pathname.startsWith("/recurring_expenses"),visible:s(wi.RecurringExpenses)&&(i("view_recurring_expense")||i("create_recurring_expense")||i("edit_recurring_expense")),rightButton:{icon:Gd,to:"/recurring_expenses/create",label:e("new_recurring_expense"),visible:i("create_recurring_expense")}},{name:e("reports"),href:"/reports",icon:jCt,current:t.pathname.startsWith("/reports"),visible:i("view_reports")},{name:e("transactions"),href:"/transactions",icon:XIt,current:t.pathname.startsWith("/transactions"),visible:s(wi.Transactions)&&(i("view_bank_transaction")||i("create_bank_transaction")||i("edit_bank_transaction")),rightButton:{icon:Gd,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:$ge,current:t.pathname.startsWith("/settings"),visible:!!l}],m=Gi(DWe),v=z$t();return O("div",{children:[p(G$t,{}),p(q$t,{}),p(K$t,{}),p(l3t,{navigation:g,sidebarOpen:h,setSidebarOpen:f}),p(a3t,{navigation:g,docsLink:n.docsLink}),O("div",{className:`${u?"md:pl-16":"md:pl-64"} flex flex-col flex-1`,children:[O("div",{style:{backgroundColor:r.$1,borderColor:r.$4},className:"sticky top-0 z-10 flex-shrink-0 flex h-16 border-b shadow",children:[O("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:()=>f(!0),children:[p("span",{className:"sr-only",children:"Open sidebar"}),p($Ct,{className:"dark:text-gray-100"})]}),O("div",{className:"flex-1 px-4 xl:px-8 flex items-center","data-cy":"topNavbar",children:[O("div",{className:"flex flex-1 items-center space-x-4",children:[p("h2",{style:{color:r.$3},className:"text-sm md:text-lg whitespace-nowrap",children:n.title}),p(B$t,{}),p(MUt,{})]}),O("div",{className:"ml-4 flex items-center md:ml-6 space-x-2 lg:space-x-3",children:[null,d&&p("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:p("span",{children:e("white_label_button")})}),n.onCancelClick&&p(un,{onClick:n.onCancelClick,type:"secondary",children:e("cancel")}),(!!n.onSaveClick||m)&&O("div",{children:[!n.additionalSaveOptions&&p(un,{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&&O("div",{className:"flex",children:[p(un,{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")}),p(Fm,{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)=>p(gt,{icon:b.icon,disabled:n.disableSaveButton,onClick:b.onClick,children:b.label},y))})]})]}),(v||n.navigationTopRight)&&p("div",{className:"flex space-x-3 items-center",children:(v==null?void 0:v.element)||n.navigationTopRight})]})]})]}),n.aboveMainContainer,O("main",{className:"flex-1",children:[(n.breadcrumbs||n.topRight)&&n.breadcrumbs.length>0&&O("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:[p("div",{className:"",children:n.breadcrumbs&&p(Bme,{pages:n.breadcrumbs})}),n.topRight&&p("div",{children:n.topRight})]}),p("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 zWe({children:n,type:e="page"}){return p(w.Suspense,{fallback:e==="page"||e==="component"?p(MR,{breadcrumbs:[],children:p(ds,{})}):p(ds,{}),children:n})}function UWe(){const n=Jpe(),e=Nc(t=>t.user);return n?e.user.id?p(zWe,{children:p(sp,{})}):p(d1t,{}):p(DT,{to:"/login"})}function $Ut(){const[n]=ve(),[e,t]=w.useState(!0);return w.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),p(MR,{breadcrumbs:[],children:p("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?p(ds,{}):O(St,{children:[p(K8e,{size:128}),O("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})})}function VUt(){const[n]=ve(),[e,t]=w.useState(!0);return w.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),p("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?p(ds,{}):O(St,{children:[p(K8e,{size:128}),O("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})}function HUt(){const n=Eq(),e=Co(),t=il(),i=Va(),r=I_e();return{companyUser:n,queryClient:e,params:t,user:i,settingsLevel:r.level}}function zn({guards:n,component:e,type:t="page"}){const[i,r]=w.useState("loading"),{companyUser:o,queryClient:s,params:a,user:l,settingsLevel:c}=HUt();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"?p(MR,{breadcrumbs:[],children:p(ds,{})}):p(ds,{}):i==="unauthorized"?t==="page"?p($Ut,{}):t==="subPage"?p(VUt,{}):null:p(zWe,{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 en(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 Ai(...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 Ta(n,e="id"){return({params:t,user:i})=>{const r=t[e],o=At(n,{id:r});return $e("GET",Ae(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 WUt=w.lazy(()=>ie(()=>import("./bundle.b2dac992.js"),["bundle.b2dac992.js","bundle.72256692.js","bundle.756326ba.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.f60c32a7.js","bundle.6f604da1.js","bundle.5683592f.js","bundle.1914e891.js","bundle.461c2575.js","bundle.4c2c3539.js","bundle.598e34cb.js","bundle.9e0f9320.js","bundle.1672f6d5.js","bundle.ea1db7a3.js","bundle.51e1486d.js","bundle.78dd95c3.js","bundle.5513f517.js"])),zUt=w.lazy(()=>ie(()=>import("./bundle.27496548.js"),["bundle.27496548.js","bundle.72256692.js","bundle.756326ba.js","bundle.1ad8bb74.js","bundle.9879f37c.js"])),UUt=w.lazy(()=>ie(()=>import("./bundle.c069fac8.js"),[])),jUt=w.lazy(()=>ie(()=>import("./bundle.0f2523c0.js"),["bundle.0f2523c0.js","bundle.ca06b7b6.js","bundle.1ad8bb74.js","bundle.9879f37c.js"])),qUt=w.lazy(()=>ie(()=>import("./bundle.c167b27b.js"),["bundle.c167b27b.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.8da78272.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.2965f621.js","bundle.1ad8bb74.js","bundle.d1a4d606.js","bundle.756326ba.js"])),GUt=w.lazy(()=>ie(()=>import("./bundle.a395b839.js"),["bundle.a395b839.js","bundle.b6ced983.js"])),KUt=w.lazy(()=>ie(()=>import("./bundle.47ffcc3e.js"),["bundle.47ffcc3e.js","bundle.10fc7255.js","bundle.b6ced983.js"])),G2e=w.lazy(()=>ie(()=>import("./bundle.93e07bb7.js"),[])),K2e=w.lazy(()=>ie(()=>import("./bundle.ea7bfbb7.js"),["bundle.ea7bfbb7.js","bundle.23e92eea.js","bundle.1145e4b9.js","bundle.7934b7d8.js"])),YUt=w.lazy(()=>ie(()=>import("./bundle.86535ddb.js"),["bundle.86535ddb.js","bundle.9e0f9320.js","bundle.1672f6d5.js","bundle.72256692.js","bundle.756326ba.js","bundle.ea1db7a3.js","bundle.51e1486d.js","bundle.d1a4d606.js","bundle.78dd95c3.js"])),QUt=w.lazy(()=>ie(()=>import("./bundle.c229f85e.js"),[])),XUt=w.lazy(()=>ie(()=>import("./bundle.07ffa452.js"),["bundle.07ffa452.js","bundle.78dd95c3.js"])),ZUt=w.lazy(()=>ie(()=>import("./bundle.7bab7d9f.js"),["bundle.7bab7d9f.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.8da78272.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.2965f621.js","bundle.1ad8bb74.js"])),JUt=O(_e,{path:"/invoices",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.Invoices),Ai(en("view_invoice"),en("create_invoice"),en("edit_invoice"))],component:p(WUt,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ir(wi.Invoices),Ai(en("create_invoice"),en("edit_invoice"))],component:p(UUt,{})})}),O(_e,{path:"create",element:p(zn,{guards:[Ir(wi.Invoices),en("create_invoice")],component:p(jUt,{})}),children:[p(_e,{path:"",element:p(ZUt,{})}),p(_e,{path:"documents",element:p(G2e,{})}),p(_e,{path:"settings",element:p(K2e,{})})]}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.Invoices),Ai(en("view_invoice"),en("edit_invoice"),Ta("/api/v1/invoices/:id"))],component:p(zUt,{})}),children:[p(_e,{path:"edit",element:p(qUt,{})}),p(_e,{path:"documents",element:p(G2e,{})}),p(_e,{path:"settings",element:p(K2e,{})}),p(_e,{path:"activity",element:p(YUt,{})}),p(_e,{path:"history",element:p(QUt,{})}),p(_e,{path:"email_history",element:p(XUt,{})})]}),p(_e,{path:":id/pdf",element:p(zn,{guards:[Ir(wi.Invoices),Ai(en("edit_invoice"),Ta("/api/v1/invoices/:id"))],component:p(GUt,{})})}),p(_e,{path:":id/email",element:p(zn,{guards:[Ir(wi.Invoices),Ai(en("edit_invoice"),Ta("/api/v1/invoices/:id"))],component:p(KUt,{})})})]}),ejt=w.lazy(()=>ie(()=>import("./bundle.3122ea90.js"),["bundle.3122ea90.js","bundle.f60c32a7.js","bundle.6f604da1.js"])),tjt=w.lazy(()=>ie(()=>import("./bundle.5b66baa4.js"),[])),njt=w.lazy(()=>ie(()=>import("./bundle.64bd9728.js"),[])),ijt=w.lazy(()=>ie(()=>import("./bundle.07242ea7.js"),[])),rjt=w.lazy(()=>ie(()=>import("./bundle.62649be6.js"),["bundle.62649be6.js","bundle.ef23c84d.js","bundle.78dd95c3.js"])),ojt=w.lazy(()=>ie(()=>import("./bundle.2859ccad.js"),["bundle.2859ccad.js","bundle.c64d8b33.js","bundle.1914e891.js","bundle.598e34cb.js"])),sjt=w.lazy(()=>ie(()=>import("./bundle.6d4636a5.js"),["bundle.6d4636a5.js","bundle.b0d988bb.js","bundle.ea1db7a3.js","bundle.51e1486d.js","bundle.ff1a9b64.js","bundle.461c2575.js"])),ajt=w.lazy(()=>ie(()=>import("./bundle.57a5a382.js"),["bundle.57a5a382.js","bundle.05fb4c91.js","bundle.598e34cb.js"])),ljt=w.lazy(()=>ie(()=>import("./bundle.d2475c3a.js"),["bundle.d2475c3a.js","bundle.7f3d0f35.js","bundle.872bfadd.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.556851c1.js","bundle.1914e891.js","bundle.461c2575.js","bundle.4c2c3539.js"])),cjt=w.lazy(()=>ie(()=>import("./bundle.12c4554b.js"),["bundle.12c4554b.js","bundle.43b5d7b2.js","bundle.5b659923.js"])),ujt=w.lazy(()=>ie(()=>import("./bundle.f787e00b.js"),["bundle.f787e00b.js","bundle.bd4ee183.js"])),djt=w.lazy(()=>ie(()=>import("./bundle.41206de5.js"),[])),hjt=w.lazy(()=>ie(()=>import("./bundle.815a8d2a.js"),["bundle.815a8d2a.js","bundle.04fbea26.js"])),fjt=w.lazy(()=>ie(()=>import("./bundle.2984bfb7.js"),[])),pjt=w.lazy(()=>ie(()=>import("./bundle.21aa0ebb.js"),["bundle.21aa0ebb.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.72256692.js","bundle.5683592f.js","bundle.1914e891.js","bundle.461c2575.js","bundle.4c2c3539.js","bundle.598e34cb.js"])),gjt=w.lazy(()=>ie(()=>import("./bundle.bbf3e060.js"),[])),mjt=w.lazy(()=>ie(()=>import("./bundle.b76b6c08.js"),["bundle.b76b6c08.js","bundle.f60c32a7.js"])),_jt=O(_e,{path:"clients",children:[p(_e,{path:"",element:p(zn,{guards:[Ai(en("view_client"),en("create_client"),en("edit_client"))],component:p(ejt,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ai(en("create_client"),en("edit_client"))],component:p(tjt,{})})}),p(_e,{path:"create",element:p(zn,{guards:[en("create_client")],component:p(njt,{})})}),p(_e,{path:":id/edit",element:p(zn,{guards:[Ai(en("edit_client"),Ta("/api/v1/clients/:id"))],component:p(ijt,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ai(en("view_client"),en("edit_client"),Ta("/api/v1/clients/:id"))],component:p(rjt,{})}),children:[p(_e,{path:"",element:p(pjt,{})}),p(_e,{path:"quotes",element:p(ojt,{})}),p(_e,{path:"payments",element:p(sjt,{})}),p(_e,{path:"recurring_invoices",element:p(ajt,{})}),p(_e,{path:"credits",element:p(ljt,{})}),p(_e,{path:"projects",element:p(cjt,{})}),p(_e,{path:"tasks",element:p(ujt,{})}),p(_e,{path:"expenses",element:p(djt,{})}),p(_e,{path:"recurring_expenses",element:p(hjt,{})}),p(_e,{path:"activities",element:p(gjt,{})}),p(_e,{path:"documents",element:p(mjt,{})})]}),p(_e,{path:":id/statement",element:p(zn,{guards:[Ai(en("edit_client"),Ta("/api/v1/clients/:id"))],component:p(fjt,{})})})]});/**
* 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 Y2(){return({companyUser:n})=>Promise.resolve(!!(n!=null&&n.is_admin))}const $J=w.lazy(()=>ie(()=>import("./bundle.8488046c.js"),[])),vjt=w.lazy(()=>ie(()=>import("./bundle.b785b7b6.js"),[])),bjt=w.lazy(()=>ie(()=>import("./bundle.c324ffd8.js"),["bundle.c324ffd8.js","bundle.f60c32a7.js","bundle.6f604da1.js"])),yjt=w.lazy(()=>ie(()=>import("./bundle.16238339.js"),[])),Cjt=w.lazy(()=>ie(()=>import("./bundle.6e7e5c79.js"),[])),wjt=w.lazy(()=>ie(()=>import("./bundle.4bb4c8cf.js"),[])),Sjt=w.lazy(()=>ie(()=>import("./bundle.139ca5c2.js"),[])),Ejt=w.lazy(()=>ie(()=>import("./bundle.deed2ed1.js"),[])),xjt=O(_e,{path:"products",children:[p(_e,{path:"",element:p(zn,{guards:[Ai(en("view_product"),en("create_product"),en("edit_product"))],component:p(bjt,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ai(en("create_product"),en("edit_product"))],component:p(vjt,{})})}),p(_e,{path:"create",element:p(zn,{guards:[en("create_product")],component:p(yjt,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ai(en("view_product"),en("edit_product"),Ta("/api/v1/products/:id"))],component:p($J,{})}),children:[p(_e,{path:"",element:p(wjt,{})}),p(_e,{path:"documents",element:p(Sjt,{})})]}),p(_e,{path:":id",element:p(zn,{guards:[Y2()],component:p($J,{})}),children:p(_e,{path:"product_fields",element:p(Ejt,{})})}),p(_e,{path:":id/edit",element:p(zn,{guards:[Ai(en("view_product"),en("edit_product"),Ta("/api/v1/products/:id"))],component:p($J,{})}),children:p(_e,{path:"",element:p(Cjt,{})})})]}),Tjt=w.lazy(()=>ie(()=>import("./bundle.22bfc707.js"),[])),kjt=w.lazy(()=>ie(()=>import("./bundle.4c86525f.js"),["bundle.4c86525f.js","bundle.6f604da1.js","bundle.f60c32a7.js","bundle.9549d325.js","bundle.1672f6d5.js","bundle.05fb4c91.js","bundle.598e34cb.js","bundle.5513f517.js"])),Ijt=w.lazy(()=>ie(()=>import("./bundle.141d400f.js"),["bundle.141d400f.js","bundle.5982b56d.js"])),Ljt=w.lazy(()=>ie(()=>import("./bundle.d9a3fac6.js"),["bundle.d9a3fac6.js","bundle.ca06b7b6.js","bundle.5982b56d.js"])),Djt=w.lazy(()=>ie(()=>import("./bundle.571e022b.js"),["bundle.571e022b.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.42dd5b5d.js","bundle.2965f621.js"])),Y2e=w.lazy(()=>ie(()=>import("./bundle.f31d6c06.js"),[])),Q2e=w.lazy(()=>ie(()=>import("./bundle.bbca3d65.js"),["bundle.bbca3d65.js","bundle.23e92eea.js","bundle.1145e4b9.js","bundle.7934b7d8.js"])),Ajt=w.lazy(()=>ie(()=>import("./bundle.8f84b6aa.js"),["bundle.8f84b6aa.js","bundle.9549d325.js","bundle.1672f6d5.js"])),Rjt=w.lazy(()=>ie(()=>import("./bundle.1df3910d.js"),[])),Njt=w.lazy(()=>ie(()=>import("./bundle.fd88d0c3.js"),[])),Ojt=w.lazy(()=>ie(()=>import("./bundle.23ae8144.js"),["bundle.23ae8144.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.42dd5b5d.js","bundle.2965f621.js"])),Pjt=w.lazy(()=>ie(()=>import("./bundle.ff7709cf.js"),["bundle.ff7709cf.js","bundle.b6ced983.js"])),Mjt=O(_e,{path:"/recurring_invoices",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.RecurringInvoices),Ai(en("view_recurring_invoice"),en("create_recurring_invoice"),en("edit_recurring_invoice"))],component:p(kjt,{})})}),O(_e,{path:"create",element:p(zn,{guards:[Ir(wi.RecurringInvoices),en("create_recurring_invoice")],component:p(Ljt,{})}),children:[p(_e,{path:"",element:p(Djt,{})}),p(_e,{path:"documents",element:p(Y2e,{})}),p(_e,{path:"settings",element:p(Q2e,{})})]}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.RecurringInvoices),Ai(en("view_recurring_invoice"),en("edit_recurring_invoice"),Ta("/api/v1/recurring_invoices/:id"))],component:p(Ijt,{})}),children:[p(_e,{path:"edit",element:p(Ojt,{})}),p(_e,{path:"documents",element:p(Y2e,{})}),p(_e,{path:"settings",element:p(Q2e,{})}),p(_e,{path:"activity",element:p(Ajt,{})}),p(_e,{path:"history",element:p(Rjt,{})}),p(_e,{path:"schedule",element:p(Njt,{})})]}),p(_e,{path:":id/pdf",element:p(zn,{guards:[Ir(wi.RecurringInvoices),Ai(en("edit_recurring_invoice"),Ta("/api/v1/recurring_invoices/:id"))],component:p(Pjt,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ir(wi.Invoices),Ai(en("create_recurring_invoice"),en("edit_recurring_invoice"))],component:p(Tjt,{})})})]}),VJ=w.lazy(()=>ie(()=>import("./bundle.3459a709.js"),["bundle.3459a709.js","bundle.461c2575.js","bundle.ff1a9b64.js"])),Fjt=w.lazy(()=>ie(()=>import("./bundle.5244c9c5.js"),["bundle.5244c9c5.js","bundle.b0d988bb.js","bundle.ea1db7a3.js","bundle.51e1486d.js","bundle.f60c32a7.js","bundle.ff1a9b64.js","bundle.461c2575.js","bundle.1672f6d5.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.872bfadd.js"])),Bjt=w.lazy(()=>ie(()=>import("./bundle.6f02c53e.js"),["bundle.6f02c53e.js","bundle.461c2575.js","bundle.6cc38fb5.js","bundle.4c2c3539.js"])),$jt=w.lazy(()=>ie(()=>import("./bundle.c17e2896.js"),["bundle.c17e2896.js","bundle.6cc38fb5.js","bundle.ea1db7a3.js","bundle.51e1486d.js","bundle.ef23c84d.js","bundle.e711acbd.js"])),Vjt=w.lazy(()=>ie(()=>import("./bundle.73ea682a.js"),["bundle.73ea682a.js","bundle.461c2575.js"])),Hjt=w.lazy(()=>ie(()=>import("./bundle.6ead8357.js"),[])),Wjt=w.lazy(()=>ie(()=>import("./bundle.092931f5.js"),["bundle.092931f5.js","bundle.461c2575.js"])),zjt=w.lazy(()=>ie(()=>import("./bundle.1d2d142d.js"),["bundle.1d2d142d.js","bundle.461c2575.js"])),Ujt=O(_e,{path:"/payments",children:[p(_e,{path:"",element:p(zn,{guards:[Ai(en("view_payment"),en("create_payment"),en("edit_payment"))],component:p(Fjt,{})})}),p(_e,{path:"create",element:p(zn,{guards:[en("create_payment")],component:p(Bjt,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ai(en("edit_payment"),Ta("/api/v1/payments/:id"))],component:p(VJ,{})}),children:[p(_e,{path:"apply",element:p(Wjt,{})}),p(_e,{path:"refund",element:p(zjt,{})})]}),O(_e,{path:":id",element:p(zn,{guards:[Ai(en("view_payment"),en("edit_payment"),Ta("/api/v1/payments/:id"))],component:p(VJ,{})}),children:[p(_e,{path:"edit",element:p($jt,{})}),p(_e,{path:"documents",element:p(Vjt,{})})]}),p(_e,{path:":id",element:p(zn,{guards:[Y2()],component:p(VJ,{})}),children:p(_e,{path:"payment_fields",element:p(Hjt,{})})})]});/**
* 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 aa(n){return({companyUser:e})=>new Promise(t=>t(!0))}function jjt(){const n=ki();return w.useEffect(()=>{n("/settings/company_details")}),p(St,{})}/**
* 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 Pc(n){const e=Ti(),t=Zi(),i=zi(),{isCompanySettingsActive:r}=$s();return w.useEffect(()=>{t&&(n==null?void 0:n.overwrite)===!1||r&&i(AT({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 Mi(n,e=!0){const[t]=ve();Ti();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 qjt(n){const[e]=ve(),{entity:t}=n||{};return(i,r)=>i==="id"&&t==="client"?O("div",{className:"inline-flex flex-col justify-center",children:[O("div",{className:"flex items-center space-x-2",children:[O("span",{children:[e("clients_limit"),"!"]}),O(qi,{className:"underline",to:"/settings/account_management",children:[e("unlock_unlimited_clients"),"!"]})]}),p("span",{children:r})]}):r}function Gjt(n){const{entity:e,withoutTopMessage:t,withoutListBullets:i}=n,r=qjt({entity:e});return O(Fs,{className:"mb-6",type:"danger",children:[!t&&p("p",{children:n.errors.message}),p("ul",{children:Object.keys(n.errors.errors).map((o,s)=>O("li",{children:[!i&&p(St,{children:" "}),r(o,n.errors.errors[o])]},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 jWe(){const n=zi();return()=>{n(Xpe("company")),n(LF({status:{name:"",level:"company"}}))}}const X2e=rl(k1)`
color: ${n=>n.theme.color};
background-color: ${n=>n.theme.backgroundColor};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function sr(n){const[e]=ve(),[t,i]=us(Bs),r=I_e(),o=jWe(),{isGroupSettingsActive:s,isClientSettingsActive:a}=$s(),l=ml(),c=ki(),u=l.pathname.split("/")[2],{basic:d,advanced:h}=H$t();w.useEffect(()=>{i(void 0)},[u]);const f=si();return p(MR,{onSaveClick:n.onSaveClick,onCancelClick:n.onCancelClick,title:n.title,docsLink:n.docsLink,navigationTopRight:n.navigationTopRight,disableSaveButton:n.disableSaveButton,breadcrumbs:[],children:O("div",{className:"grid grid-cols-12 lg:gap-10",children:[O("div",{className:"col-span-12 lg:col-span-3",children:[(s||a)&&O("div",{className:"flex items-center justify-between border py-3 rounded space-x-3 px-2",style:{backgroundColor:f.$1,borderColor:f.$5},children:[O("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[p("div",{children:p(nt,{element:s?l4t:$9e,size:20})}),O("span",{className:"text-sm truncate",children:[e(s?"group_settings":"client_settings"),": ",r.name]})]}),p("div",{className:"cursor-pointer",onClick:()=>{o(),s&&c("/settings/group_settings"),a&&c("/clients")},children:p(nt,{element:p1,size:20})})]}),p("a",{className:"flex items-center py-4 px-3 text-xs uppercase font-medium",children:p("span",{className:"truncate",children:e("basic_settings")})}),p(En,{className:"lg:hidden",value:l.pathname,onValueChange:g=>c(g),withBlank:!0,children:d.map(g=>g.enabled&&p("option",{value:g.href,children:g.name},g.name))}),p("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:d.map(g=>g.enabled&&p(X2e,{to:g.href,className:_Z("flex items-center px-3 py-2 text-sm font-medium rounded"),"aria-current":g.current?"page":void 0,theme:{backgroundColor:g.current?f.$5:"",color:g.current?f.$3:"",hoverColor:f.$5},children:p("span",{className:"truncate",children:g.name})},g.name))}),h.filter(g=>g.enabled).length>0&&O("div",{className:"flex items-center py-4 px-3 text-xs uppercase font-medium mt-8 truncate space-x-1",children:[p("span",{children:e("advanced_settings")}),p("sup",{children:e("pro")})]}),p(En,{className:"lg:hidden",value:l.pathname,onValueChange:g=>c(g),withBlank:!0,children:h.map(g=>g.enabled&&p("option",{value:g.href,children:g.name},g.name))}),p("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:h.map((g,m)=>O("div",{children:[g.enabled&&p(X2e,{to:g.href,className:_Z("flex items-center px-3 py-2 text-sm font-medium rounded"),"aria-current":g.current?"page":void 0,theme:{backgroundColor:g.current?f.$5:"",color:g.current?f.$3:"",hoverColor:f.$5},children:p("span",{className:"truncate",children:g.name})},g.name),g.children&&g.current&&p("div",{className:"bg-gray-100 space-y-4 py-3 rounded-b",children:g.children&&g.children.map((v,_)=>p(k1,{to:v.href,className:_Z(v.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:v.name},_))})]},m))})]}),O("div",{className:"col-span-12 lg:col-start-4 space-y-6 mt-5",children:[n.breadcrumbs&&p(Bme,{pages:n.breadcrumbs}),t&&p(Gjt,{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 Uk=Ro(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 lp(){const n=zi(),{isCompanySettingsActive:e,isGroupSettingsActive:t,isClientSettingsActive:i}=$s(),r=Gi(Uk);return()=>{e&&n(Xpe("company")),(t||i)&&r&&n(go({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 Zq=Ro(!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 qWe={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 GWe(n){const{id:e}=il(),t=Co(),i=zi(),r=Zi(),o=Gi(Uk),s=Gi(Eu),{isGroupSettingsActive:a}=$s(),{groupSettings:l,setErrors:c,setIsFormBusy:u,isFormBusy:d}=n,h=()=>{const f=An.cloneDeep(r==null?void 0:r.settings);return f&&((!f.email_template_custom1||!f.email_subject_custom1)&&(delete f.email_template_custom1,delete f.email_subject_custom1),(!f.email_template_custom2||!f.email_subject_custom2)&&(delete f.email_template_custom2,delete f.email_subject_custom2),(!f.email_template_custom3||!f.email_subject_custom3)&&(delete f.email_template_custom3,delete f.email_subject_custom3),Object.entries(f).forEach(([g,m])=>{m===null&&(f[g]=qWe[g])})),{...o,settings:f}};return()=>{d||(he.processing(),c==null||c(void 0),u==null||u(!0),$e("PUT",Ae("/api/v1/group_settings/:id",{id:e||(o==null?void 0:o.id)}),l||h()).then(f=>{he.success("updated_group"),In(["group_settings"]),a&&(i(go({object:"company",property:"settings",value:f.data.data.settings})),i(LF({status:{name:f.data.data.name,level:"group"}}))),s&&t.invalidateQueries([s])}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(he.dismiss(),c==null||c(f.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 Kjt(){const n=zi(),e=Zi(),t=Gi(Uk),i=Wi(Bs),r=()=>{const o=An.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]=qWe[s])})),{...t,settings:o}};return()=>{he.processing(),i(void 0),$e("PUT",Ae("/api/v1/clients/:id",{id:t==null?void 0:t.id}),r()).then(o=>{he.success("updated_settings"),In(["clients"]),n(go({object:"company",property:"settings",value:o.data.data.settings})),n(LF({status:{name:o.data.data.display_name,level:"client"}}))}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(he.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 xu(){const n=zi(),e=Pc(),t=GWe({}),i=Kjt(),{isGroupSettingsActive:r,isCompanySettingsActive:o,isClientSettingsActive:s}=$s(),[,a]=us(Bs),[l,c]=us(Zq),u=nmt();return async d=>{if(!u()&&o)return;if(r)return t();if(s)return i();const h=typeof d=="boolean"&&d;return!h&&he.processing(),a(void 0),$e("PUT",Ae("/api/v1/companies/:id",{id:e==null?void 0:e.id}),e).then(f=>{n(US({object:"company",data:f.data.data})),!h&&he.dismiss(),l&&(In(["statics"]),c(!1)),!h&&he.success("updated_settings")}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(a(f.response.data),he.dismiss())})}}function KS(n){var f;const e=ki(),{visible:t=!0,withoutDefaultTabSpace:i,tabBarClassName:r}=n,o=il(),s=ml(),a=si(),l=Ss(),[c]=lF(),u=w.useRef(null),d=g=>{var m;return s.pathname===g.href||((m=g.matcher)==null?void 0:m.some(v=>v(o)===At(s.pathname,o)))},h=g=>{const m=g.currentTarget,v=u.current,_=v.scrollWidth/6,b=m.getBoundingClientRect().width/2;v.scrollTo({left:m.offsetLeft-_-b})};return w.useEffect(()=>{if(n.tabs.length&&!n.disableBackupNavigation){const g=n.tabs.some(({href:m})=>m===s.pathname);if(c.get("redirect")==="false")return;g||e(n.tabs[0].href)}},[]),t?O("div",{className:n.className,"data-cy":"tabs",children:[O("div",{className:"flex flex-col space-y-5 sm:hidden",children:[p("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),p("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:(f=n.tabs.find(g=>g))==null?void 0:f.name,children:n.tabs.map(g=>{var m;return(typeof g.enabled>"u"||g.enabled)&&p("option",{children:((m=g.formatName)==null?void 0:m.call(g))||g.name},g.name)})}),n.rightSide]}),p("div",{className:"hidden sm:block",children:O("div",{className:"flex justify-between border-b",style:{borderColor:a.$5},children:[p("nav",{ref:u,className:zt("-mb-px flex relative scroll-smooth overflow-x-auto",{"space-x-8":!i},r),"aria-label":"Tabs",children:n.tabs.map(g=>{var m;return(typeof g.enabled>"u"||g.enabled)&&p(k1,{to:g.href,onClick:v=>h(v),style:{borderColor:d(g)?l:"transparent",color:d(g)?l:a.$3},className:"whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm","aria-current":d(g)?"page":void 0,children:((m=g.formatName)==null?void 0:m.call(g))||g.name},g.name)})}),n.rightSide]})})]}):p(St,{})}/**
* 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 KWe(n){return Ii(["/api/v1/documents",n],()=>$e("GET",Ae("/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 YWe=()=>(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/documents/bulk?per_page=100"),{action:e,ids:n}).then(()=>he.success("exported_data"))},QWe=()=>async(n,e)=>(he.processing(),$e("PUT",Ae("/api/v1/documents/:id",{id:n}),{is_public:e}).then(()=>he.success("success")));function O_e(n){const[e]=ve(),{numberOfDocuments:t}=n;return O("div",{className:"flex space-x-1",children:[p("span",{children:e("documents")}),!!t&&O("span",{className:"font-bold",children:["(",t,")"]})]})}function Yjt(){const{t:n}=ve(),{data:e}=KWe({companyDocuments:"true"}),{isGroupSettingsActive:t,isClientSettingsActive:i}=$s();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 p(O_e,{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 Qjt(){const[n]=ve();Mi("company_details");const e=[{name:n("settings"),href:"/settings"},{name:n("company_details"),href:"/settings/company_details"}],t=xu(),i=lp(),r=Yjt();return Pc(),O(sr,{onSaveClick:t,onCancelClick:i,title:n("company_details"),breadcrumbs:e,docsLink:"en/basic-settings/#company_details",children:[p(KS,{tabs:r,className:"mt-6"}),p("div",{className:"my-4",children:p(sp,{})})]})}function FR(){return(FR=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 Jq(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 X4(n){var e=w.useRef(n),t=w.useRef(function(i){e.current&&e.current(i)});return e.current=n,t.current}var Z4=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n<e?e:n},cM=function(n){return"touches"in n},Mse=function(n){return n&&n.ownerDocument.defaultView||self},Z2e=function(n,e,t){var i=n.getBoundingClientRect(),r=cM(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:Z4((r.pageX-(i.left+Mse(n).pageXOffset))/i.width),top:Z4((r.pageY-(i.top+Mse(n).pageYOffset))/i.height)}},J2e=function(n){!cM(n)&&n.preventDefault()},XWe=ce.memo(function(n){var e=n.onMove,t=n.onKey,i=Jq(n,["onMove","onKey"]),r=w.useRef(null),o=X4(e),s=X4(t),a=w.useRef(null),l=w.useRef(!1),c=w.useMemo(function(){var f=function(v){J2e(v),(cM(v)?v.touches.length>0:v.buttons>0)&&r.current?o(Z2e(r.current,v,a.current)):m(!1)},g=function(){return m(!1)};function m(v){var _=l.current,b=Mse(r.current),y=v?b.addEventListener:b.removeEventListener;y(_?"touchmove":"mousemove",f),y(_?"touchend":"mouseup",g)}return[function(v){var _=v.nativeEvent,b=r.current;if(b&&(J2e(_),!function(C,E){return E&&!cM(C)}(_,l.current)&&b)){if(cM(_)){l.current=!0;var y=_.changedTouches||[];y.length&&(a.current=y[0].identifier)}b.focus(),o(Z2e(b,_,a.current)),m(!0)}},function(v){var _=v.which||v.keyCode;_<37||_>40||(v.preventDefault(),s({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},m]},[s,o]),u=c[0],d=c[1],h=c[2];return w.useEffect(function(){return h},[h]),ce.createElement("div",FR({},i,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:r,onKeyDown:d,tabIndex:0,role:"slider"}))}),P_e=function(n){return n.filter(Boolean).join(" ")},ZWe=function(n){var e=n.color,t=n.left,i=n.top,r=i===void 0?.5:i,o=P_e(["react-colorful__pointer",n.className]);return ce.createElement("div",{className:o,style:{top:100*r+"%",left:100*t+"%"}},ce.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},wd=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t},Xjt=function(n){return nqt(Fse(n))},Fse=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?wd(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?wd(parseInt(n.substring(6,8),16)/255,2):1}},Zjt=function(n){return tqt(eqt(n))},Jjt=function(n){var e=n.s,t=n.v,i=n.a,r=(200-e)*t/100;return{h:wd(n.h),s:wd(r>0&&r<200?e*t/100/(r<=100?r:200-r)*100:0),l:wd(r/2),a:wd(i,2)}},Bse=function(n){var e=Jjt(n);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},eqt=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:wd(255*[i,a,s,s,l,i][c]),g:wd(255*[l,i,i,a,s,s][c]),b:wd(255*[s,s,l,i,i,a][c]),a:wd(r,2)}},Y8=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},tqt=function(n){var e=n.r,t=n.g,i=n.b,r=n.a,o=r<1?Y8(wd(255*r)):"";return"#"+Y8(e)+Y8(t)+Y8(i)+o},nqt=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:wd(60*(a<0?a+6:a)),s:wd(o?s/o*100:0),v:wd(o/255*100),a:r}},iqt=ce.memo(function(n){var e=n.hue,t=n.onChange,i=P_e(["react-colorful__hue",n.className]);return ce.createElement("div",{className:i},ce.createElement(XWe,{onMove:function(r){t({h:360*r.left})},onKey:function(r){t({h:Z4(e+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":wd(e),"aria-valuemax":"360","aria-valuemin":"0"},ce.createElement(ZWe,{className:"react-colorful__hue-pointer",left:e/360,color:Bse({h:e,s:100,v:100,a:1})})))}),rqt=ce.memo(function(n){var e=n.hsva,t=n.onChange,i={backgroundColor:Bse({h:e.h,s:100,v:100,a:1})};return ce.createElement("div",{className:"react-colorful__saturation",style:i},ce.createElement(XWe,{onMove:function(r){t({s:100*r.left,v:100-100*r.top})},onKey:function(r){t({s:Z4(e.s+100*r.left,0,100),v:Z4(e.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+wd(e.s)+"%, Brightness "+wd(e.v)+"%"},ce.createElement(ZWe,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:Bse(e)})))}),JWe=function(n,e){if(n===e)return!0;for(var t in n)if(n[t]!==e[t])return!1;return!0},oqt=function(n,e){return n.toLowerCase()===e.toLowerCase()||JWe(Fse(n),Fse(e))};function sqt(n,e,t){var i=X4(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;JWe(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 aqt=typeof window<"u"?w.useLayoutEffect:w.useEffect,lqt=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},eLe=new Map,cqt=function(n){aqt(function(){var e=n.current?n.current.ownerDocument:document;if(e!==void 0&&!eLe.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}`,eLe.set(e,t);var i=lqt();i&&t.setAttribute("nonce",i),e.head.appendChild(t)}},[])},uqt=function(n){var e=n.className,t=n.colorModel,i=n.color,r=i===void 0?t.defaultColor:i,o=n.onChange,s=Jq(n,["className","colorModel","color","onChange"]),a=w.useRef(null);cqt(a);var l=sqt(t,r,o),c=l[0],u=l[1],d=P_e(["react-colorful",e]);return ce.createElement("div",FR({},s,{ref:a,className:d}),ce.createElement(rqt,{hsva:c,onChange:u}),ce.createElement(iqt,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},dqt={defaultColor:"000",toHsva:Xjt,fromHsva:function(n){return Zjt({h:n.h,s:n.s,v:n.v,a:1})},equal:oqt},hqt=function(n){return ce.createElement(uqt,FR({},n,{colorModel:dqt}))},fqt=/^#?([0-9A-F]{3,8})$/i,pqt=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=Jq(n,["color","onChange","onBlur","escape","validate","format","process"]),u=w.useState(function(){return o(t)}),d=u[0],h=u[1],f=X4(i),g=X4(r),m=w.useCallback(function(_){var b=o(_.target.value);h(b),s(b)&&f(l?l(b):b)},[o,l,s,f]),v=w.useCallback(function(_){s(_.target.value)||h(o(t)),g(_)},[t,o,s,g]);return w.useEffect(function(){h(o(t))},[t,o]),ce.createElement("input",FR({},c,{value:a?a(d):d,spellCheck:"false",onChange:m,onBlur:v}))},tLe=function(n){return"#"+n},gqt=function(n){var e=n.prefixed,t=n.alpha,i=Jq(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=fqt.exec(a),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8}(s,t)},[t]);return ce.createElement(pqt,FR({},i,{escape:r,format:e?tLe:void 0,process:tLe,validate:o}))};const mqt=["#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 jk(n){const{t:e}=ve(),{includeDefaultPalette:t}=n,i=si(),[r,o]=w.useState(n.value||"#000000"),[s,a]=w.useState(!1),[l,c]=w.useState(!1);return YD(()=>{var u;return(u=n.onValueChange)==null?void 0:u.call(n,r)},500,[r]),w.useEffect(()=>{n.value&&o(n.value)},[n.value]),O("div",{children:[O(Or,{title:e("color"),visible:s,onClose:a,centerContent:!0,disableClosing:l,children:[p(hqt,{color:r,onChange:o}),p(gqt,{color:r,onChange:o,className:"border rounded-md my-2 p-2 border-gray-300",style:{backgroundColor:i.$1,borderColor:i.$4}}),O("div",{className:"flex w-full justify-between",children:[t&&p(un,{behavior:"button",type:"secondary",onClick:()=>c(!0),children:e("default")}),p(un,{className:zt({"w-full":!t}),behavior:"button",onClick:()=>a(!1),children:e("done")})]})]}),p(Or,{title:e("default"),visible:l,size:"small",onClose:()=>c(!1),children:O("div",{className:"flex flex-col space-y-6",children:[p("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:mqt.map(u=>p("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>o(u),style:{height:32,backgroundColor:u},children:r===u&&p(nt,{className:"absolute",element:sme,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},u))}),p("div",{className:"flex justify-end",children:p(un,{behavior:"button",onClick:()=>c(!1),children:e("done")})})]})}),p("div",{style:{backgroundColor:r},className:zt("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 _qt(){var i,r;const[n]=ve(),e=zi(),t=Nc(o=>o.user.changes);return p(tn,{title:n("accent_color"),children:p(G,{leftSide:n("accent_color"),children:p(jk,{value:((r=(i=t==null?void 0:t.company_user)==null?void 0:i.settings)==null?void 0:r.accent_color)||t9e.primary,onValueChange:o=>e(Ak({property:"company_user.settings.accent_color",value:o}))})})})}const vqt=w.createContext(null);function bqt(){const n=w.useContext(vqt);if(!n)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return n}function yqt(n){var e;return(e=n==null?void 0:n.clientId)!==null&&e!==void 0?e:n==null?void 0:n.client_id}const Cqt={large:40,medium:32,small:20};function eze({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:f,...g}){const m=w.useRef(null),{clientId:v,scriptLoadedSuccessfully:_}=bqt(),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 E,x,k,L,D,A,N,P,M;if(_)return(k=(x=(E=window==null?void 0:window.google)===null||E===void 0?void 0:E.accounts)===null||x===void 0?void 0:x.id)===null||k===void 0||k.initialize({client_id:v,callback:B=>{var F;if(!(B!=null&&B.credential))return(F=y.current)===null||F===void 0?void 0:F.call(y);const{credential:U,select_by:H}=B;b.current({credential:U,clientId:yqt(B),select_by:H})},...g}),(A=(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||A===void 0||A.renderButton(m.current,{type:r,theme:o,size:s,text:a,shape:l,logo_alignment:c,width:u,locale:d,click_listener:h}),t&&((M=(P=(N=window==null?void 0:window.google)===null||N===void 0?void 0:N.accounts)===null||P===void 0?void 0:P.id)===null||M===void 0||M.prompt(C.current)),()=>{var B,F,U;t&&((U=(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||U===void 0||U.cancel())}},[v,_,t,r,o,s,a,l,c,u,d]),ce.createElement("div",{...f,ref:m,style:{height:Cqt[s],...f==null?void 0:f.style}})}/*! @azure/msal-common v14.3.0 2023-10-30 */const Dt={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"},Q8={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},YF=[Dt.OPENID_SCOPE,Dt.PROFILE_SCOPE,Dt.OFFLINE_ACCESS_SCOPE],nLe=[...YF,Dt.EMAIL_SCOPE],Ib={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"},id={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"},uM={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},jr={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"},X8={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},oh={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},HJ={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"},iLe={PLAIN:"plain",S256:"S256"},QF={QUERY:"query",FRAGMENT:"fragment"},wqt={...QF,FORM_POST:"form_post"},tze={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"},Z8={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},gd={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},Fr={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},$se="appmetadata",Sqt="client_info",dM="1",hM={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Dp={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},od={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"},Sa={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},fM={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},rLe={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},oLe={username:"username",password:"password"},J8={httpSuccess:200,httpBadRequest:400},UI={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},WJ={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},JE={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},Eqt={Jwt:"JWT",Jwk:"JWK",Pop:"pop"};/*! @azure/msal-common v14.3.0 2023-10-30 */const M_e="unexpected_error",xqt="post_request_failed";/*! @azure/msal-common v14.3.0 2023-10-30 */const sLe={[M_e]:"Unexpected error in authentication.",[xqt]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class Fl extends Error{constructor(e,t,i){const r=t?`${e}: ${t}`:e;super(r),Object.setPrototypeOf(this,Fl.prototype),this.errorCode=e||Dt.EMPTY_STRING,this.errorMessage=t||Dt.EMPTY_STRING,this.subError=i||Dt.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function nze(n,e){return new Fl(n,e?`${sLe[n]} ${e}`:sLe[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */const F_e="client_info_decoding_error",ize="client_info_empty_error",B_e="token_parsing_error",rze="null_or_empty_token",ly="endpoints_resolution_error",oze="network_error",sze="openid_config_error",Vse="hash_not_deserialized",nA="invalid_state",aze="state_mismatch",cW="state_not_found",lze="nonce_mismatch",$_e="auth_time_not_found",cze="max_age_transpired",Tqt="multiple_matching_tokens",kqt="multiple_matching_accounts",uze="multiple_matching_appMetadata",dze="request_cannot_be_made",hze="cannot_remove_empty_scope",fze="cannot_append_scopeset",Hse="empty_input_scopeset",Iqt="device_code_polling_cancelled",Lqt="device_code_expired",Dqt="device_code_unknown_error",V_e="no_account_in_silent_request",pze="invalid_cache_record",H_e="invalid_cache_environment",Wse="no_account_found",zse="no_crypto_object",Use="unexpected_credential_type",Aqt="invalid_assertion",Rqt="invalid_client_credential",JC="token_refresh_required",Nqt="user_timeout_reached",gze="token_claims_cnf_required_for_signedjwt",mze="authorization_code_missing_from_server_response",_ze="binding_key_not_removed",vze="end_session_endpoint_not_supported",W_e="key_id_missing",Oqt="no_network_connectivity",Pqt="user_canceled",Mqt="missing_tenant_id_error",zo="method_not_implemented",Fqt="nested_app_auth_bridge_disabled";/*! @azure/msal-common v14.3.0 2023-10-30 */const aLe={[F_e]:"The client info could not be parsed/decoded correctly",[ize]:"The client info was empty",[B_e]:"Token cannot be parsed",[rze]:"The token is null or empty",[ly]:"Endpoints cannot be resolved",[oze]:"Network request failed",[sze]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[Vse]:"The hash parameters could not be deserialized",[nA]:"State was not the expected format",[aze]:"State mismatch error",[cW]:"State not found",[lze]:"Nonce mismatch error",[$_e]:"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.",[cze]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[Tqt]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[kqt]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[uze]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[dze]:"Token request cannot be made without authorization code or refresh token.",[hze]:"Cannot remove null or empty scope from ScopeSet",[fze]:"Cannot append ScopeSet",[Hse]:"Empty input ScopeSet cannot be processed",[Iqt]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[Lqt]:"Device code is expired.",[Dqt]:"Device code stopped polling for unknown reasons.",[V_e]:"Please pass an account object, silent flow is not supported without account information",[pze]:"Cache record object was null or undefined.",[H_e]:"Invalid environment when attempting to create cache entry",[Wse]:"No account found in cache for given key.",[zse]:"No crypto object detected.",[Use]:"Unexpected credential type.",[Aqt]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[Rqt]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[JC]:"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.",[Nqt]:"User defined timeout for device code polling reached",[gze]:"Cannot generate a POP jwt if the token_claims are not populated",[mze]:"Server response does not contain an authorization code to proceed",[_ze]:"Could not remove the credential's binding key from storage.",[vze]:"The provided authority does not support logout",[W_e]:"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.",[Oqt]:"No network connectivity. Check your internet connection.",[Pqt]:"User cancelled the flow.",[Mqt]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[zo]:"This method has not been implemented",[Fqt]:"The nested app auth bridge is disabled"};class eG extends Fl{constructor(e,t){super(e,t?`${aLe[e]}: ${t}`:aLe[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,eG.prototype)}}function On(n,e){return new eG(n,e)}/*! @azure/msal-common v14.3.0 2023-10-30 */const uW={createNewGuid:()=>{throw On(zo)},base64Decode:()=>{throw On(zo)},base64Encode:()=>{throw On(zo)},async getPublicKeyThumbprint(){throw On(zo)},async removeTokenBindingKey(){throw On(zo)},async clearKeystore(){throw On(zo)},async signJwt(){throw On(zo)},async hashString(){throw On(zo)}};/*! @azure/msal-common v14.3.0 2023-10-30 */var Nu;(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"})(Nu||(Nu={}));class MT{constructor(e,t,i){this.level=Nu.Info;const r=()=>{},o=e||MT.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||r,this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level=typeof o.logLevel=="number"?o.logLevel:Nu.Info,this.correlationId=o.correlationId||Dt.EMPTY_STRING,this.packageName=t||Dt.EMPTY_STRING,this.packageVersion=i||Dt.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Nu.Info}}clone(e,t,i){return new MT({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} : ${Nu[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:Nu.Error,containsPii:!1,correlationId:t||Dt.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:Nu.Error,containsPii:!0,correlationId:t||Dt.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:Nu.Warning,containsPii:!1,correlationId:t||Dt.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:Nu.Warning,containsPii:!0,correlationId:t||Dt.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:Nu.Info,containsPii:!1,correlationId:t||Dt.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:Nu.Info,containsPii:!0,correlationId:t||Dt.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:Nu.Verbose,containsPii:!1,correlationId:t||Dt.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:Nu.Verbose,containsPii:!0,correlationId:t||Dt.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:Nu.Trace,containsPii:!1,correlationId:t||Dt.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:Nu.Trace,containsPii:!0,correlationId:t||Dt.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */const bze="@azure/msal-common",z_e="14.3.0";/*! @azure/msal-common v14.3.0 2023-10-30 */const U_e={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 lS(n,e){const t=Bqt(n);try{const i=e(t);return JSON.parse(i)}catch{throw On(B_e)}}function Bqt(n){if(!n)throw On(rze);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(n);if(!t||t.length<4)throw On(B_e);return t[2]}function yze(n,e){if(e===0||Date.now()-3e5>n+e)throw On(cze)}/*! @azure/msal-common v14.3.0 2023-10-30 */class Hh{static nowSeconds(){return Math.round(new Date().getTime()/1e3)}static isTokenExpired(e,t){const i=Number(e)||0;return Hh.nowSeconds()+t>i}static wasClockTurnedBack(e){return Number(e)>Hh.nowSeconds()}static delay(e,t){return new Promise(i=>setTimeout(()=>i(t),e))}}/*! @azure/msal-common v14.3.0 2023-10-30 */function Q2(n){return[$qt(n),Vqt(n),Hqt(n),Wqt(n),zqt(n)].join(gd.CACHE_KEY_SEPARATOR).toLowerCase()}function tG(n,e,t,i,r){return{credentialType:Fr.ID_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t,realm:r}}function nG(n,e,t,i,r,o,s,a,l,c,u,d,h,f,g){var v,_;const m={homeAccountId:n,credentialType:Fr.ACCESS_TOKEN,secret:t,cachedAt:Hh.nowSeconds().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:i,realm:r,target:o,tokenType:u||Sa.BEARER};if(d&&(m.userAssertionHash=d),c&&(m.refreshOn=c.toString()),f&&(m.requestedClaims=f,m.requestedClaimsHash=g),((v=m.tokenType)==null?void 0:v.toLowerCase())!==Sa.BEARER.toLowerCase())switch(m.credentialType=Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case Sa.POP:const b=lS(t,l);if(!((_=b==null?void 0:b.cnf)!=null&&_.kid))throw On(gze);m.keyId=b.cnf.kid;break;case Sa.SSH:m.keyId=h}return m}function Cze(n,e,t,i,r,o){const s={credentialType:Fr.REFRESH_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t};return o&&(s.userAssertionHash=o),r&&(s.familyId=r),s}function j_e(n){return n.hasOwnProperty("homeAccountId")&&n.hasOwnProperty("environment")&&n.hasOwnProperty("credentialType")&&n.hasOwnProperty("clientId")&&n.hasOwnProperty("secret")}function lLe(n){return n?j_e(n)&&n.hasOwnProperty("realm")&&n.hasOwnProperty("target")&&(n.credentialType===Fr.ACCESS_TOKEN||n.credentialType===Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function cLe(n){return n?j_e(n)&&n.hasOwnProperty("realm")&&n.credentialType===Fr.ID_TOKEN:!1}function uLe(n){return n?j_e(n)&&n.credentialType===Fr.REFRESH_TOKEN:!1}function $qt(n){return[n.homeAccountId,n.environment].join(gd.CACHE_KEY_SEPARATOR).toLowerCase()}function Vqt(n){const e=n.credentialType===Fr.REFRESH_TOKEN&&n.familyId||n.clientId;return[n.credentialType,e,n.realm||""].join(gd.CACHE_KEY_SEPARATOR).toLowerCase()}function Hqt(n){return(n.target||"").toLowerCase()}function Wqt(n){return(n.requestedClaimsHash||"").toLowerCase()}function zqt(n){return n.tokenType&&n.tokenType.toLowerCase()!==Sa.BEARER.toLowerCase()?n.tokenType.toLowerCase():""}/*! @azure/msal-common v14.3.0 2023-10-30 */const wze="redirect_uri_empty",Uqt="claims_request_parsing_error",Sze="authority_uri_insecure",cP="url_parse_error",q_e="empty_url_error",Eze="empty_input_scopes_error",xze="invalid_prompt_value",G_e="invalid_claims",Tze="token_request_empty",kze="logout_request_empty",Ize="invalid_code_challenge_method",K_e="pkce_params_missing",Y_e="invalid_cloud_discovery_metadata",Lze="invalid_authority_metadata",Dze="untrusted_authority",iG="missing_ssh_jwk",Aze="missing_ssh_kid",jqt="missing_nonce_authentication_header",qqt="invalid_authentication_header",Rze="cannot_set_OIDCOptions",Nze="cannot_allow_native_broker",Oze="authority_mismatch";/*! @azure/msal-common v14.3.0 2023-10-30 */const Gqt={[wze]:"A redirect URI is required for all calls, and none has been set.",[Uqt]:"Could not parse the given claims request object.",[Sze]:"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",[cP]:"URL could not be parsed into appropriate segments.",[q_e]:"URL was empty or null.",[Eze]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[xze]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[G_e]:"Given claims parameter must be a stringified JSON object.",[Tze]:"Token request was empty and not found in cache.",[kze]:"The logout request was null or undefined.",[Ize]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[K_e]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Y_e]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Lze]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[Dze]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[iG]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Aze]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[jqt]:"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.",[qqt]:"Invalid authentication header provided",[Rze]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[Nze]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[Oze]:"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 Q_e extends Fl{constructor(e){super(e,Gqt[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,Q_e.prototype)}}function Ea(n){return new Q_e(n)}/*! @azure/msal-common v14.3.0 2023-10-30 */class Bp{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 jc{constructor(e){const t=e?Bp.trimArrayEntries([...e]):[],i=t?Bp.removeEmptyStringsFromArray(t):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(r=>this.scopes.add(r))}static fromString(e){const i=(e||Dt.EMPTY_STRING).split(" ");return new jc(i)}static createSearchScopes(e){const t=new jc(e);return t.containsOnlyOIDCScopes()?t.removeScope(Dt.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw Ea(Eze)}containsScope(e){const t=this.printScopesLowerCase().split(" "),i=new jc(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 nLe.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 On(fze)}}removeScope(e){if(!e)throw On(hze);this.scopes.delete(e.trim())}removeOIDCScopes(){nLe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw On(Hse);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 On(Hse);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(" "):Dt.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v14.3.0 2023-10-30 */function jse(n,e){if(!n)throw On(ize);try{const t=e.base64Decode(n);return JSON.parse(t)}catch{throw On(F_e)}}function X2(n){if(!n)throw On(F_e);const e=n.split(gd.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?Dt.EMPTY_STRING:e[1]}}/*! @azure/msal-common v14.3.0 2023-10-30 */const A_={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 Tc{generateAccountId(){return[this.homeAccountId,this.environment].join(gd.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return Tc.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||Dt.EMPTY_STRING,e.tenantId||Dt.EMPTY_STRING].join(gd.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t){const i=new Tc;t.authorityType===A_.Adfs?i.authorityType=Z8.ADFS_ACCOUNT_TYPE:t.protocolMode===Ky.AAD?i.authorityType=Z8.MSSTS_ACCOUNT_TYPE:i.authorityType=Z8.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 On(H_e);i.environment=r,i.realm=e.idTokenClaims.tid||Dt.EMPTY_STRING,i.localAccountId=e.idTokenClaims.oid||e.idTokenClaims.sub||Dt.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||Dt.EMPTY_STRING,i.name=e.idTokenClaims.name,i.cloudGraphHostName=e.cloudGraphHostName,i.msGraphHost=e.msGraphHost,i}static createFromAccountInfo(e,t,i){const r=new Tc;return r.authorityType=e.authorityType||Z8.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:Dt.EMPTY_STRING;if(t===A_.Adfs||t===A_.Dsts)return s;if(e)try{const a=jse(e,r);if(a.uid&&a.utid)return`${a.uid}${gd.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 xr{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Ea(q_e);this.getHash()||(this._urlString=xr.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Bp.endsWith(t,"?")?t=t.slice(0,-1):Bp.endsWith(t,"?/")&&(t=t.slice(0,-2)),Bp.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Ea(cP)}if(!e.HostNameAndPort||!e.PathSegments)throw Ea(cP);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Ea(Sze)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return xr.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),i=t.PathSegments;return e&&i.length!==0&&(i[0]===uM.COMMON||i[0]===uM.ORGANIZATIONS)&&(i[0]=e),xr.constructAuthorityUriFromObject(t)}getHash(){return xr.parseHash(this.urlString)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Ea(cP);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 Ea(cP);return i[2]}static getAbsoluteUrl(e,t){if(e[0]===Dt.FORWARD_SLASH){const r=new xr(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):Dt.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):Dt.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):Dt.EMPTY_STRING}static constructAuthorityUriFromObject(e){return new xr(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static getDeserializedHash(e){if(!e)return{};const t=xr.parseHash(e),i=Bp.queryStringToObject(t||e);if(!i)throw On(Vse);return i}static getDeserializedQueryString(e){if(!e)return{};const t=xr.parseQueryString(e),i=Bp.queryStringToObject(t||e);if(!i)throw On(Vse);return i}static getDeserializedCodeResponse(e,t){const i=new xr(t);let r;return e===QF.QUERY?r=xr.getDeserializedQueryString(t):r=xr.getDeserializedHash(i.getHash()),r}static hashContainsKnownProperties(e){if(!e||e.indexOf("=")<0)return!1;const t=xr.getDeserializedHash(e);return!!(t.code||t.error_description||t.error||t.state)}}/*! @azure/msal-common v14.3.0 2023-10-30 */const Pze={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"]}]}},dLe=Pze.endpointMetadata,X_e=Pze.instanceDiscoveryMetadata,Mze=new Set;X_e.metadata.forEach(n=>{n.aliases.forEach(e=>{Mze.add(e)})});function Kqt(n,e){var r;let t;const i=n.canonicalAuthority;if(i){const o=new xr(i).getUrlComponents().HostNameAndPort;t=hLe(o,(r=n.cloudDiscoveryMetadata)==null?void 0:r.metadata,Dp.CONFIG,e)||hLe(o,X_e.metadata,Dp.HARDCODED_VALUES,e)||n.knownAuthorities}return t||[]}function hLe(n,e,t,i){if(i==null||i.trace(`getAliasesFromMetadata called with source: ${t}`),n&&e){const r=dW(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 Yqt(n){return dW(X_e.metadata,n)}function dW(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 DC{constructor(e,t,i,r){this.clientId=e,this.cryptoImpl=t,this.commonLogger=i.clone(bze,z_e),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=lS(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 On(pze);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=jc.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)&&jc.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(gd.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||i&&!e.toLowerCase().includes(i.toLowerCase()))}isCredentialKey(e){if(e.split(gd.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(t.indexOf(Fr.ID_TOKEN.toLowerCase())===-1&&t.indexOf(Fr.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(Fr.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(Fr.REFRESH_TOKEN.toLowerCase())>-1){const i=`${Fr.REFRESH_TOKEN}${gd.CACHE_KEY_SEPARATOR}${this.clientId}${gd.CACHE_KEY_SEPARATOR}`,r=`${Fr.REFRESH_TOKEN}${gd.CACHE_KEY_SEPARATOR}${dM}${gd.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===Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===Sa.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()===Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===Sa.POP){const r=t.keyId;if(r)try{await this.cryptoImpl.removeTokenBindingKey(r)}catch{throw On(_ze)}}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=lS(s.secret,this.cryptoImpl.base64Decode)),{account:o,idToken:s,accessToken:a,refreshToken:l,appMetadata:c}}readAccountFromCache(e){const t=Tc.generateAccountCacheKey(e);return this.getAccount(t)}getIdToken(e,t){this.commonLogger.trace("CacheManager - getIdToken called");const i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Fr.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(Q2(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=jc.createSearchScopes(t.scopes),o=t.authenticationScheme||Sa.BEARER,s=o&&o.toLowerCase()!==Sa.BEARER.toLowerCase()?Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME:Fr.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(Q2(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?dM:void 0,o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Fr.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 On(uze);return r[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===dM)}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=Kqt(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!==Fr.ACCESS_TOKEN&&e.credentialType!==Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:jc.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($se)!==-1}isAuthorityMetadata(e){return e.indexOf(hM.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${hM.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const i in t)e[i]=t[i];return e}}class Qqt extends DC{setAccount(){throw On(zo)}getAccount(){throw On(zo)}setIdTokenCredential(){throw On(zo)}getIdTokenCredential(){throw On(zo)}setAccessTokenCredential(){throw On(zo)}getAccessTokenCredential(){throw On(zo)}setRefreshTokenCredential(){throw On(zo)}getRefreshTokenCredential(){throw On(zo)}setAppMetadata(){throw On(zo)}getAppMetadata(){throw On(zo)}setServerTelemetry(){throw On(zo)}getServerTelemetry(){throw On(zo)}setAuthorityMetadata(){throw On(zo)}getAuthorityMetadata(){throw On(zo)}getAuthorityMetadataKeys(){throw On(zo)}setThrottlingCache(){throw On(zo)}getThrottlingCache(){throw On(zo)}removeItem(){throw On(zo)}containsKey(){throw On(zo)}getKeys(){throw On(zo)}getAccountKeys(){throw On(zo)}getTokenKeys(){throw On(zo)}async clear(){throw On(zo)}updateCredentialCacheKey(){throw On(zo)}}/*! @azure/msal-common v14.3.0 2023-10-30 */const Xqt=300,Fze={tokenRenewalOffsetSeconds:Xqt,preventCorsPreflight:!1},Zqt={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Nu.Info,correlationId:Dt.EMPTY_STRING},Jqt={claimsBasedCachingEnabled:!1},eGt={async sendGetRequestAsync(){throw On(zo)},async sendPostRequestAsync(){throw On(zo)}},tGt={sku:Dt.SKU,version:z_e,cpu:Dt.EMPTY_STRING,os:Dt.EMPTY_STRING},nGt={clientSecret:Dt.EMPTY_STRING,clientAssertion:void 0},iGt={azureCloudInstance:U_e.None,tenant:`${Dt.DEFAULT_COMMON_TENANT}`},rGt={application:{appName:"",appVersion:""}};function oGt({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 f={...Zqt,...t};return{authOptions:sGt(n),systemOptions:{...Fze,...e},loggerOptions:f,cacheOptions:{...Jqt,...i},storageInterface:r||new Qqt(n.clientId,uW,new MT(f)),networkInterface:o||eGt,cryptoInterface:s||uW,clientCredentials:a||nGt,libraryInfo:{...tGt,...l},telemetry:{...rGt,...c},serverTelemetryManager:u||null,persistencePlugin:d||null,serializableCache:h||null}}function sGt(n){return{clientCapabilities:[],azureCloudOptions:iGt,skipAuthorityMetadataCache:!1,...n}}function qse(n){return n.authOptions.authority.options.protocolMode===Ky.OIDC}/*! @azure/msal-common v14.3.0 2023-10-30 */class cS extends Fl{constructor(e,t,i){super(e,t,i),this.name="ServerError",Object.setPrototypeOf(this,cS.prototype)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class fb{static generateThrottlingStorageKey(e){return`${fM.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var o;const i=fb.generateThrottlingStorageKey(t),r=e.getThrottlingCache(i);if(r){if(r.throttleTime<Date.now()){e.removeItem(i);return}throw new cS(((o=r.errorCodes)==null?void 0:o.join(" "))||Dt.EMPTY_STRING,r.errorMessage,r.subError)}}static postProcess(e,t,i){if(fb.checkResponseStatus(i)||fb.checkResponseForRetryAfter(i)){const r={throttleTime:fb.calculateThrottleTime(parseInt(i.headers[Ib.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(fb.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(Ib.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||fM.DEFAULT_THROTTLE_TIME_SECONDS),i+fM.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 aGt{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,i){fb.preProcess(this.cacheManager,e);let r;try{r=await this.networkClient.sendPostRequestAsync(t,i)}catch(o){throw o instanceof Fl?o:On(oze)}return fb.postProcess(this.cacheManager,e,r),r}}/*! @azure/msal-common v14.3.0 2023-10-30 */const Kp={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v14.3.0 2023-10-30 */class ex{static validateRedirectUri(e){if(!e)throw Ea(wze)}static validatePrompt(e){const t=[];for(const i in oh)t.push(oh[i]);if(t.indexOf(e)<0)throw Ea(xze)}static validateClaims(e){try{JSON.parse(e)}catch{throw Ea(G_e)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw Ea(K_e);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([iLe.PLAIN,iLe.S256].indexOf(e)<0)throw Ea(Ize)}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 pM{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(jr.RESPONSE_TYPE,encodeURIComponent(Dt.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(jr.RESPONSE_TYPE,encodeURIComponent(`${Dt.TOKEN_RESPONSE_TYPE} ${Dt.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set(jr.RESPONSE_MODE,encodeURIComponent(e||wqt.QUERY))}addNativeBroker(){this.parameters.set(jr.NATIVE_BROKER,encodeURIComponent("1"))}addScopes(e,t=!0,i=YF){t&&!i.includes("openid")&&!e.includes("openid")&&i.push("openid");const r=t?[...e||[],...i]:e||[],o=new jc(r);this.parameters.set(jr.SCOPE,encodeURIComponent(o.printScopes()))}addClientId(e){this.parameters.set(jr.CLIENT_ID,encodeURIComponent(e))}addRedirectUri(e){ex.validateRedirectUri(e),this.parameters.set(jr.REDIRECT_URI,encodeURIComponent(e))}addPostLogoutRedirectUri(e){ex.validateRedirectUri(e),this.parameters.set(jr.POST_LOGOUT_URI,encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set(jr.ID_TOKEN_HINT,encodeURIComponent(e))}addDomainHint(e){this.parameters.set(HJ.DOMAIN_HINT,encodeURIComponent(e))}addLoginHint(e){this.parameters.set(HJ.LOGIN_HINT,encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(Ib.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(Ib.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set(HJ.SID,encodeURIComponent(e))}addClaims(e,t){const i=this.addClientCapabilitiesToClaims(e,t);ex.validateClaims(i),this.parameters.set(jr.CLAIMS,encodeURIComponent(i))}addCorrelationId(e){this.parameters.set(jr.CLIENT_REQUEST_ID,encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set(jr.X_CLIENT_SKU,e.sku),this.parameters.set(jr.X_CLIENT_VER,e.version),e.os&&this.parameters.set(jr.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(jr.X_CLIENT_CPU,e.cpu)}addApplicationTelemetry(e){e!=null&&e.appName&&this.parameters.set(jr.X_APP_NAME,e.appName),e!=null&&e.appVersion&&this.parameters.set(jr.X_APP_VER,e.appVersion)}addPrompt(e){ex.validatePrompt(e),this.parameters.set(`${jr.PROMPT}`,encodeURIComponent(e))}addState(e){e&&this.parameters.set(jr.STATE,encodeURIComponent(e))}addNonce(e){this.parameters.set(jr.NONCE,encodeURIComponent(e))}addCodeChallengeParams(e,t){if(ex.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(jr.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(jr.CODE_CHALLENGE_METHOD,encodeURIComponent(t));else throw Ea(K_e)}addAuthorizationCode(e){this.parameters.set(jr.CODE,encodeURIComponent(e))}addDeviceCode(e){this.parameters.set(jr.DEVICE_CODE,encodeURIComponent(e))}addRefreshToken(e){this.parameters.set(jr.REFRESH_TOKEN,encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set(jr.CODE_VERIFIER,encodeURIComponent(e))}addClientSecret(e){this.parameters.set(jr.CLIENT_SECRET,encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set(jr.CLIENT_ASSERTION,encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set(jr.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))}addOboAssertion(e){this.parameters.set(jr.OBO_ASSERTION,encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set(jr.REQUESTED_TOKEN_USE,encodeURIComponent(e))}addGrantType(e){this.parameters.set(jr.GRANT_TYPE,encodeURIComponent(e))}addClientInfo(){this.parameters.set(Sqt,"1")}addExtraQueryParameters(e){const t=ex.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 Ea(G_e)}return t&&t.length>0&&(i.hasOwnProperty(X8.ACCESS_TOKEN)||(i[X8.ACCESS_TOKEN]={}),i[X8.ACCESS_TOKEN][X8.XMS_CC]={values:t}),JSON.stringify(i)}addUsername(e){this.parameters.set(oLe.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(oLe.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(jr.TOKEN_TYPE,Sa.POP),this.parameters.set(jr.REQ_CNF,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(jr.TOKEN_TYPE,Sa.SSH),this.parameters.set(jr.REQ_CNF,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set(jr.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(jr.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set(jr.X_MS_LIB_CAPABILITY,fM.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set(jr.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 lGt(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 Gse{constructor(){this.expiresAt=Hh.nowSeconds()+hM.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=Hh.nowSeconds()+hM.REFRESH_TIME_SECONDS}isExpired(){return this.expiresAt<=Hh.nowSeconds()}static isAuthorityMetadataEntity(e,t){return t?e.indexOf(hM.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 cGt(n){return n.hasOwnProperty("tenant_discovery_endpoint")&&n.hasOwnProperty("metadata")}/*! @azure/msal-common v14.3.0 2023-10-30 */function uGt(n){return n.hasOwnProperty("error")&&n.hasOwnProperty("error_description")}/*! @azure/msal-common v14.3.0 2023-10-30 */const Ot={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"},dGt={NotStarted:0,InProgress:1,Completed:2};/*! @azure/msal-common v14.3.0 2023-10-30 */const XF=(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}},ai=(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 rG{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(Ot.RegionDiscoveryDetectRegion,this.correlationId);let i=e;if(i)t.region_source=UI.ENVIRONMENT_VARIABLE;else{const o=rG.IMDS_OPTIONS;try{const s=await ai(this.getRegionFromIMDS.bind(this),Ot.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(Dt.IMDS_VERSION,o);if(s.status===J8.httpSuccess&&(i=s.body,t.region_source=UI.IMDS),s.status===J8.httpBadRequest){const a=await ai(this.getCurrentVersion.bind(this),Ot.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(o);if(!a)return t.region_source=UI.FAILED_AUTO_DETECTION,null;const l=await ai(this.getRegionFromIMDS.bind(this),Ot.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(a,o);l.status===J8.httpSuccess&&(i=l.body,t.region_source=UI.IMDS)}}catch{return t.region_source=UI.FAILED_AUTO_DETECTION,null}}return i||(t.region_source=UI.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,t){var i;return(i=this.performanceClient)==null||i.addQueueMeasurement(Ot.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${Dt.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,Dt.IMDS_TIMEOUT)}async getCurrentVersion(e){var t;(t=this.performanceClient)==null||t.addQueueMeasurement(Ot.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const i=await this.networkInterface.sendGetRequestAsync(`${Dt.IMDS_ENDPOINT}?format=json`,e);return i.status===J8.httpBadRequest&&i.body&&i.body["newest-versions"]&&i.body["newest-versions"].length>0?i.body["newest-versions"][0]:null}catch{return null}}}rG.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v14.3.0 2023-10-30 */class Zd{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 rG(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Dt.CIAM_AUTH_URL))return A_.Ciam;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case Dt.ADFS:return A_.Adfs;case Dt.DSTS:return A_.Dsts}return A_.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 xr(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 On(ly)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw On(ly)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw On(ly)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw On(vze);return this.replacePath(this.metadata.end_session_endpoint)}else throw On(ly)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw On(ly)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw On(ly)}canReplaceTenant(e){return e.PathSegments.length===1&&!Zd.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===A_.Default&&this.protocolMode===Ky.AAD}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new xr(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 xr(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===A_.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(Ot.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await ai(this.updateCloudDiscoveryMetadata.bind(this),Ot.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const i=await ai(this.updateEndpointMetadata.bind(this),Ot.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 Gse,e.updateCanonicalAuthority(this.canonicalAuthority)),e}updateCachedMetadata(e,t,i){t!==Dp.CACHE&&(i==null?void 0:i.source)!==Dp.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(Ot.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===Dp.HARDCODED_VALUES&&(o=this.authorityOptions.azureRegionConfiguration)!=null&&o.azureRegion&&t.metadata){const a=await ai(this.updateMetadataWithRegionalInformation.bind(this),Ot.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata);e.updateEndpointMetadata(a,!1)}return t.source}let i=await ai(this.getEndpointMetadataFromNetwork.bind(this),Ot.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(i=await ai(this.updateMetadataWithRegionalInformation.bind(this),Ot.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(i)),e.updateEndpointMetadata(i,!0),Dp.NETWORK;throw On(sze,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:Dp.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:Dp.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:Dp.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new xr(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Ea(Lze)}return null}async getEndpointMetadataFromNetwork(){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(Ot.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 lGt(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 dLe?dLe[this.canonicalAuthority]:null}async updateMetadataWithRegionalInformation(e){var i,r,o;(i=this.performanceClient)==null||i.addQueueMeasurement(Ot.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const t=(r=this.authorityOptions.azureRegionConfiguration)==null?void 0:r.azureRegion;if(t){if(t!==Dt.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=WJ.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,Zd.replaceWithRegionalInformation(e,t);const s=await ai(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Ot.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=WJ.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,Zd.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=WJ.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Ot.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const i=await ai(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Ot.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return e.updateCloudDiscoveryMetadata(i,!0),Dp.NETWORK;throw Ea(Dze)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||Dt.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||Dt.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||Dt.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),e.updateCloudDiscoveryMetadata(t,!1),Dp.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=Yqt(this.hostnameAndPort);if(r)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(r,!1),Dp.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."),Dp.CACHE):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===A_.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),Zd.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=dW(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."),Ea(Y_e)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Zd.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(Ot.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${Dt.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(cGt(o.body))s=o.body,a=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${s.tenant_discovery_endpoint}`);else if(uGt(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===Dt.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=dW(a,this.hostnameAndPort)}catch(o){if(o instanceof Fl)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=Zd.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>xr.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let i;if(t&&t.azureCloudInstance!==U_e.None){const r=t.tenant?t.tenant:Dt.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 On(ly)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Mze.has(e)}static isPublicCloudAuthority(e){return Dt.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,i){const r=new xr(e);r.validateAsUri();const o=r.getUrlComponents();let s=`${t}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(s=`${t}.${Dt.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=xr.constructAuthorityUriFromObject({...r.getUrlComponents(),HostNameAndPort:s}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,t){const i={...e};return i.authorization_endpoint=Zd.buildRegionalAuthorityString(i.authorization_endpoint,t),i.token_endpoint=Zd.buildRegionalAuthorityString(i.token_endpoint,t,Dt.REGIONAL_AUTH_NON_MSI_QUERY_STRING),i.end_session_endpoint&&(i.end_session_endpoint=Zd.buildRegionalAuthorityString(i.end_session_endpoint,t)),i}static transformCIAMAuthority(e){let t=e;const r=new xr(e).getUrlComponents();if(r.PathSegments.length===0&&r.HostNameAndPort.endsWith(Dt.CIAM_AUTH_URL)){const o=r.HostNameAndPort.split(".")[0];t=`${t}${o}${Dt.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}Zd.reservedTenantDomains=new Set(["{tenant}","{tenantid}",uM.COMMON,uM.CONSUMERS,uM.ORGANIZATIONS]);function Bze(n){return n.endsWith(Dt.FORWARD_SLASH)?n:`${n}${Dt.FORWARD_SLASH}`}function hGt(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw Ea(Y_e)}return{canonicalAuthority:n.authority?Bze(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.3.0 2023-10-30 */class FT{static async createDiscoveredInstance(e,t,i,r,o,s,a){s==null||s.addQueueMeasurement(Ot.AuthorityFactoryCreateDiscoveredInstance,a);const l=Zd.transformCIAMAuthority(Bze(e)),c=FT.createInstance(l,t,i,r,o,s,a);try{return await ai(c.resolveEndpointsAsync.bind(c),Ot.AuthorityResolveEndpointsAsync,o,s,a)(),c}catch{throw On(ly)}}static createInstance(e,t,i,r,o,s,a){if(!e)throw Ea(q_e);return new Zd(e,t,i,r,o,s,a)}}/*! @azure/msal-common v14.3.0 2023-10-30 */let Z_e=class{constructor(e,t){this.config=oGt(e),this.logger=new MT(this.config.loggerOptions,bze,z_e),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new aGt(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[Ib.CONTENT_TYPE]=Dt.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Kp.HOME_ACCOUNT_ID:try{const i=X2(e.credential);t[Ib.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case Kp.UPN:t[Ib.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[Ib.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(Ot.UpdateTokenEndpointAuthority,t);const i=`https://${e}/${this.authority.tenant}/`,r=await FT.createDiscoveredInstance(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,this.performanceClient,t);this.authority=r}createTokenQueryParameters(e){const t=new pM;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}};/*! @azure/msal-common v14.3.0 2023-10-30 */const hW="no_tokens_found",$ze="native_account_unavailable",fGt="interaction_required",pGt="consent_required",gGt="login_required";/*! @azure/msal-common v14.3.0 2023-10-30 */const fLe=[fGt,pGt,gGt],mGt=["message_only","additional_action","basic_action","user_password_expired","consent_required"],_Gt={[hW]:"No refresh token found in the cache. Please sign-in.",[$ze]:"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 Kb extends Fl{constructor(e,t,i,r,o,s,a){super(e,t,i),Object.setPrototypeOf(this,Kb.prototype),this.timestamp=r||Dt.EMPTY_STRING,this.traceId=o||Dt.EMPTY_STRING,this.correlationId=s||Dt.EMPTY_STRING,this.claims=a||Dt.EMPTY_STRING,this.name="InteractionRequiredAuthError"}}function pLe(n,e,t){const i=!!n&&fLe.indexOf(n)>-1,r=!!t&&mGt.indexOf(t)>-1,o=!!e&&fLe.some(s=>e.indexOf(s)>-1);return i||o||r}function Vze(n){return new Kb(n,_Gt[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */class WL{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 lv{static setRequestState(e,t,i){const r=lv.generateLibraryState(e,i);return t?`${r}${Dt.RESOURCE_DELIM}${t}`:r}static generateLibraryState(e,t){if(!e)throw On(zse);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 On(zse);if(!t)throw On(nA);try{const i=t.split(Dt.RESOURCE_DELIM),r=i[0],o=i.length>1?i.slice(1).join(Dt.RESOURCE_DELIM):Dt.EMPTY_STRING,s=e.base64Decode(r),a=JSON.parse(s);return{userRequestState:o||Dt.EMPTY_STRING,libraryState:a}}catch{throw On(nA)}}}/*! @azure/msal-common v14.3.0 2023-10-30 */const vGt={SW:"sw",UHW:"uhw"};class iA{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(Ot.PopTokenGenerateCnf,e.correlationId);const i=await ai(this.generateKid.bind(this),Ot.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(Ot.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:vGt.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 xr(s):void 0,u=c==null?void 0:c.getUrlComponents();return await this.cryptoUtils.signJwt({at:e,ts:Hh.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 rA{generateAppMetadataKey(){return rA.generateAppMetadataCacheKey(this.environment,this.clientId)}static generateAppMetadataCacheKey(e,t){return[$se,e,t].join(gd.CACHE_KEY_SEPARATOR).toLowerCase()}static createAppMetadataEntity(e,t,i){const r=new rA;return r.clientId=e,r.environment=t,i&&(r.familyId=i),r}static isAppMetadataEntity(e,t){return t?e.indexOf($se)===0&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"):!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */class bGt{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 BT{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?On(cW,"Cached State"):On(cW,"Server State");let i,r;try{i=decodeURIComponent(e.state)}catch{throw On(nA,e.state)}try{r=decodeURIComponent(t)}catch{throw On(nA,e.state)}if(i!==r)throw On(aze);if(e.error||e.error_description||e.suberror)throw pLe(e.error,e.error_description,e.suberror)?new Kb(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||""):new cS(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 cS(e.error,i,e.suberror);if(t&&e.status&&e.status>=Q8.SERVER_ERROR_RANGE_START&&e.status<=Q8.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>=Q8.CLIENT_ERROR_RANGE_START&&e.status<=Q8.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
${r}`);return}throw pLe(e.error,e.error_description,e.suberror)?new Kb(e.error,e.error_description,e.suberror,e.timestamp||Dt.EMPTY_STRING,e.trace_id||Dt.EMPTY_STRING,e.correlation_id||Dt.EMPTY_STRING,e.claims||Dt.EMPTY_STRING):r}}async handleServerTokenResponse(e,t,i,r,o,s,a,l,c){var g;(g=this.performanceClient)==null||g.addQueueMeasurement(Ot.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=lS(e.id_token||Dt.EMPTY_STRING,this.cryptoObj.base64Decode),o&&o.nonce&&u.nonce!==o.nonce)throw On(lze);if(r.maxAge||r.maxAge===0){const m=u.auth_time;if(!m)throw On($_e);yze(m,r.maxAge)}}this.homeAccountIdentifier=Tc.generateHomeAccountId(e.client_info||Dt.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,u);let d;o&&o.state&&(d=lv.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 f;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new bGt(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(f)),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"),BT.generateAuthenticationResult(this.cryptoObj,t,h,!1,r,u,d,void 0,c)}await this.cacheStorage.saveCacheRecord(h,r.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&f&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(f))}return BT.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 On(H_e);let c,u;e.id_token&&o&&(c=tG(this.homeAccountIdentifier,l,e.id_token,this.clientId,o.tid||""),u=Tc.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 g=e.scope?jc.fromString(e.scope):new jc(r.scopes||[]),m=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,v=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,_=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,b=i+m,y=b+v,C=_&&_>0?i+_:void 0;d=nG(this.homeAccountIdentifier,l,e.access_token,this.clientId,(o==null?void 0:o.tid)||t.tenant,g.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=Cze(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,s));let f=null;return e.foci&&(f=rA.createAppMetadataEntity(this.clientId,l,e.foci)),new WL(u,c,d,h,f)}static async generateAuthenticationResult(e,t,i,r,o,s,a,l,c){var y,C,E,x;let u=Dt.EMPTY_STRING,d=[],h=null,f,g,m=Dt.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType===Sa.POP){const k=new iA(e),{secret:L,keyId:D}=i.accessToken;if(!D)throw On(W_e);u=await k.signPopToken(L,D,o)}else u=i.accessToken.secret;d=jc.fromString(i.accessToken.target).asArray(),h=new Date(Number(i.accessToken.expiresOn)*1e3),f=new Date(Number(i.accessToken.extendedExpiresOn)*1e3),i.accessToken.refreshOn&&(g=new Date(Number(i.accessToken.refreshOn)*1e3))}i.appMetadata&&(m=i.appMetadata.familyId===dM?dM:"");const v=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",_=(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:v,tenantId:_,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:f,refreshOn:g,correlationId:o.correlationId,requestId:c||Dt.EMPTY_STRING,familyId:m,tokenType:((C=i.accessToken)==null?void 0:C.tokenType)||Dt.EMPTY_STRING,state:a?a.userRequestState:Dt.EMPTY_STRING,cloudGraphHostName:((E=i.account)==null?void 0:E.cloudGraphHostName)||Dt.EMPTY_STRING,msGraphHost:((x=i.account)==null?void 0:x.msGraphHost)||Dt.EMPTY_STRING,code:l==null?void 0:l.spa_code,fromNativeBroker:!1}}}/*! @azure/msal-common v14.3.0 2023-10-30 */class Hze extends Z_e{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(Ot.GetAuthCodeUrl,e.correlationId);const t=await ai(this.createAuthCodeUrlQueryString.bind(this),Ot.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return xr.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var a,l;if((a=this.performanceClient)==null||a.addQueueMeasurement(Ot.AuthClientAcquireToken,e.correlationId),!e.code)throw On(dze);const i=Hh.nowSeconds(),r=await ai(this.executeTokenRequest.bind(this),Ot.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=(l=r.headers)==null?void 0:l[Ib.X_MS_REQUEST_ID],s=new BT(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(r.body),ai(s.handleServerTokenResponse.bind(s),Ot.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 BT(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),r=xr.getDeserializedCodeResponse((o=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:o.serverResponseType,e);if(i.validateServerAuthorizationCodeResponse(r,t),!r.code)throw On(mze);return{...r,code:r.code}}getLogoutUri(e){if(!e)throw Ea(kze);const t=this.createLogoutUrlQueryString(e);return xr.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var c,u;(c=this.performanceClient)==null||c.addQueueMeasurement(Ot.AuthClientExecuteTokenRequest,t.correlationId);const i=this.createTokenQueryParameters(t),r=xr.appendQueryString(e.tokenEndpoint,i),o=await ai(this.createTokenRequestBody.bind(this),Ot.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const d=jse(t.clientInfo,this.cryptoUtils);s={credential:`${d.uid}${gd.CLIENT_INFO_SEPARATOR}${d.utid}`,type:Kp.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 ai(this.executePostToTokenEndpoint.bind(this),Ot.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(r,o,a,l,t.correlationId,Ot.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,s;(o=this.performanceClient)==null||o.addQueueMeasurement(Ot.AuthClientCreateTokenRequestBody,e.correlationId);const t=new pM;if(t.addClientId(((s=e.tokenBodyParameters)==null?void 0:s[jr.CLIENT_ID])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):ex.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&&!qse(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(tze.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Sa.POP){const a=new iA(this.cryptoUtils,this.performanceClient),l=await ai(a.generateCnf.bind(a),Ot.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);t.addPopToken(l.reqCnfString)}else if(e.authenticationScheme===Sa.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Ea(iG);const i=e.correlationId||this.config.cryptoInterface.createNewGuid();t.addCorrelationId(i),(!Bp.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=jse(e.clientInfo,this.cryptoUtils);r={credential:`${a.uid}${gd.CLIENT_INFO_SEPARATOR}${a.utid}`,type:Kp.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 Kp.HOME_ACCOUNT_ID:try{const a=X2(r.credential);t.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case Kp.UPN:t.addCcsUpn(r.credential);break}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[jr.RETURN_SPA_CODE])&&t.addExtraQueryParameters({[jr.RETURN_SPA_CODE]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var o,s;(o=this.performanceClient)==null||o.addQueueMeasurement(Ot.AuthClientCreateQueryString,e.correlationId);const t=new pM;t.addClientId(((s=e.extraQueryParameters)==null?void 0:s[jr.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),qse(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!==oh.SELECT_ACCOUNT)if(e.sid&&e.prompt===oh.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=X2(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===oh.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(a);try{const c=X2(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=X2(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===Sa.POP)){const a=new iA(this.cryptoUtils),l=await ai(a.generateCnf.bind(a),Ot.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);t.addPopToken(l.reqCnfHash)}return t.createQueryString()}createLogoutUrlQueryString(e){const t=new pM;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 Kse extends Z_e{constructor(e,t){super(e,t)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(Ot.RefreshTokenClientAcquireToken,e.correlationId);const t=Hh.nowSeconds(),i=await ai(this.executeTokenRequest.bind(this),Ot.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),r=(a=i.headers)==null?void 0:a[Ib.X_MS_REQUEST_ID],o=new BT(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body),ai(o.handleServerTokenResponse.bind(o),Ot.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 Ea(Tze);if((i=this.performanceClient)==null||i.addQueueMeasurement(Ot.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw On(V_e);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return ai(this.acquireTokenWithCachedRefreshToken.bind(this),Ot.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(r){const o=r instanceof Kb&&r.errorCode===hW,s=r instanceof cS&&r.errorCode===rLe.INVALID_GRANT_ERROR&&r.subError===rLe.CLIENT_MISMATCH_ERROR;if(o||s)return ai(this.acquireTokenWithCachedRefreshToken.bind(this),Ot.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw r}return ai(this.acquireTokenWithCachedRefreshToken.bind(this),Ot.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(Ot.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const i=XF(this.cacheManager.getRefreshToken.bind(this.cacheManager),Ot.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t);if(!i)throw Vze(hW);const r={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||Sa.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Kp.HOME_ACCOUNT_ID}};return ai(this.acquireToken.bind(this),Ot.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(r)}async executeTokenRequest(e,t){var l,c;(l=this.performanceClient)==null||l.addQueueMeasurement(Ot.RefreshTokenClientExecuteTokenRequest,e.correlationId);const i=this.createTokenQueryParameters(e),r=xr.appendQueryString(t.tokenEndpoint,i),o=await ai(this.createTokenRequestBody.bind(this),Ot.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 ai(this.executePostToTokenEndpoint.bind(this),Ot.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(r,o,s,a,e.correlationId,Ot.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,o,s;(r=this.performanceClient)==null||r.addQueueMeasurement(Ot.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,i=new pM;if(i.addClientId(((o=e.tokenBodyParameters)==null?void 0:o[jr.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(tze.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&!qse(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===Sa.POP){const a=new iA(this.cryptoUtils,this.performanceClient),l=await ai(a.generateCnf.bind(a),Ot.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);i.addPopToken(l.reqCnfString)}else if(e.authenticationScheme===Sa.SSH)if(e.sshJwk)i.addSshJwk(e.sshJwk);else throw Ea(iG);if((!Bp.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 Kp.HOME_ACCOUNT_ID:try{const a=X2(e.ccsCredential.credential);i.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case Kp.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 yGt extends Z_e{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,i]=await this.acquireCachedToken(e);return i===JE.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 Kse(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),t}catch(t){if(t instanceof eG&&t.errorCode===JC)return new Kse(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw t}}async acquireCachedToken(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(Ot.SilentFlowClientAcquireCachedToken,e.correlationId);let t=JE.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Bp.isEmptyObj(e.claims))throw this.setCacheOutcome(JE.FORCE_REFRESH_OR_CLAIMS,e.correlationId),On(JC);if(!e.account)throw On(V_e);const i=e.authority||this.authority.getPreferredCache(),r=this.cacheManager.readCacheRecord(e.account,e,i);if(r.accessToken){if(Hh.wasClockTurnedBack(r.accessToken.cachedAt)||Hh.isTokenExpired(r.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(JE.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),On(JC);r.accessToken.refreshOn&&Hh.isTokenExpired(r.accessToken.refreshOn,0)&&(t=JE.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(JE.NO_CACHED_ACCESS_TOKEN,e.correlationId),On(JC);return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await ai(this.generateResultFromCacheRecord.bind(this),Ot.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(Ot.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let i;if(e.idToken&&(i=lS(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const o=i==null?void 0:i.auth_time;if(!o)throw On($_e);yze(o,t.maxAge)}return await BT.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,i)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class fW{constructor(){this.failedRequests=[],this.errors=[],this.cacheHits=0}static isServerTelemetryEntity(e,t){const i=e.indexOf(od.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 gLe{static isThrottlingEntity(e,t){let i=!1;e&&(i=e.indexOf(fM.THROTTLING_PREFIX)===0);let r=!0;return t&&(r=t.hasOwnProperty("throttleTime")),i&&r}}/*! @azure/msal-common v14.3.0 2023-10-30 */const CGt={sendGetRequestAsync:()=>Promise.reject(On(zo)),sendPostRequestAsync:()=>Promise.reject(On(zo))};/*! @azure/msal-common v14.3.0 2023-10-30 */const Wze="missing_kid_error",zze="missing_alg_error";/*! @azure/msal-common v14.3.0 2023-10-30 */const wGt={[Wze]:"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.",[zze]:"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 J_e extends Fl{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,J_e.prototype)}}function mLe(n){return new J_e(n,wGt[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */class eve{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw mLe(Wze);if(!e.alg)throw mLe(zze);const t=new eve({typ:e.typ||Eqt.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class pW{constructor(e,t){this.cacheOutcome=JE.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||Dt.EMPTY_STRING,this.wrapperVer=e.wrapperVer||Dt.EMPTY_STRING,this.telemetryCacheKey=od.CACHE_KEY+gd.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${od.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer].join(od.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),r=[e,i].join(od.VALUE_SEPARATOR);return[od.SCHEMA_VERSION,r,t].join(od.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=pW.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*t).join(od.VALUE_SEPARATOR),r=e.errors.slice(0,t).join(od.VALUE_SEPARATOR),o=e.errors.length,s=t<o?od.OVERFLOW_TRUE:od.OVERFLOW_FALSE,a=[o,s].join(od.VALUE_SEPARATOR);return[od.SCHEMA_VERSION,e.cacheHits,i,r,a].join(od.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=od.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 Fl?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(od.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 fW;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=pW.maxErrorsToSend(e),i=e.errors.length;if(t===i)this.cacheManager.removeItem(this.telemetryCacheKey);else{const r=new fW;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]||Dt.EMPTY_STRING,a=e.failedRequests[2*t+1]||Dt.EMPTY_STRING,l=e.errors[t]||Dt.EMPTY_STRING;if(r+=s.toString().length+a.toString().length+l.length+3,r<od.MAX_LAST_HEADER_BYTES)i+=1;else break}return i}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||Dt.EMPTY_STRING),e.push(this.regionSource||Dt.EMPTY_STRING),e.push(this.regionOutcome||Dt.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 _Le{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class SGt{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:dGt.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new _Le}}startPerformanceMeasurement(){return new _Le}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 tve="pkce_not_created",Uze="crypto_nonexistent",oG="empty_navigate_uri",sG="hash_empty_error",jze="no_state_in_hash",nve="hash_does_not_contain_known_properties",qze="unable_to_parse_state",Gze="state_interaction_type_mismatch",Kze="interaction_in_progress",Yze="popup_window_error",Qze="empty_window_error",$T="user_cancelled",Xze="monitor_popup_timeout",Zze="monitor_window_timeout",Jze="redirect_in_iframe",eUe="block_iframe_reload",tUe="block_nested_popups",EGt="iframe_closed_prematurely",aG="silent_logout_unsupported",nUe="no_account_error",iUe="silent_prompt_value_error",rUe="no_token_request_cache_error",oUe="unable_to_parse_token_request_cache_error",ive="no_cached_authority_error",xGt="auth_request_not_set_error",TGt="invalid_cache_type",sUe="non_browser_environment",C2="database_not_open",gW="no_network_connectivity",aUe="post_request_failed",lUe="get_request_failed",Yse="failed_to_parse_response",v_="unable_to_load_token",rve="crypto_key_not_found",cUe="auth_code_required",uUe="auth_code_or_nativeAccountId_required",dUe="spa_code_and_nativeAccountId_present",ove="database_unavailable",hUe="unable_to_acquire_token_from_native_platform",fUe="native_handshake_timeout",pUe="native_extension_not_installed",ZF="native_connection_not_established",gUe="uninitialized_public_client_application",mUe="native_prompt_not_supported",_Ue="invalid_base64_string";/*! @azure/msal-browser v3.4.0 2023-10-30 */const q0="For more visit: aka.ms/msaljs/browser-errors",kGt={[tve]:"The PKCE code challenge and verifier could not be generated.",[Uze]:"The crypto object or function is not available.",[oG]:"Navigation URI is empty. Please check stack trace for more info.",[sG]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${q0}`,[jze]:"Hash does not contain state. Please verify that the request originated from msal.",[nve]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${q0}`,[qze]:"Unable to parse state. Please verify that the request originated from msal.",[Gze]:"Hash contains state but the interaction type does not match the caller.",[Kze]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${q0}`,[Yze]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Qze]:"window.open returned null or undefined window object.",[$T]:"User cancelled the flow.",[Xze]:`Token acquisition in popup failed due to timeout. ${q0}`,[Zze]:`Token acquisition in iframe failed due to timeout. ${q0}`,[Jze]:"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.",[eUe]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${q0}`,[tUe]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[EGt]:"The iframe being monitored was closed prematurely.",[aG]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[nUe]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[iUe]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[rUe]:"No token request found in cache.",[oUe]:"The cached token request could not be parsed.",[ive]:"No cached authority found.",[xGt]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[TGt]:"Invalid cache type",[sUe]:"Login and token requests are not supported in non-browser environments.",[C2]:"Database is not open!",[gW]:"No network connectivity. Check your internet connection.",[aUe]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[lUe]:"Network request failed. Please check the network trace to determine root cause.",[Yse]:"Failed to parse network response. Check network trace.",[v_]:"Error loading token to cache.",[rve]:"Cryptographic Key or Keypair not found in browser storage.",[cUe]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[uUe]:"An authorization code or nativeAccountId must be provided to this flow.",[dUe]:"Request cannot contain both spa code and native account id.",[ove]:"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.",[hUe]:`Unable to acquire token from native platform. ${q0}`,[fUe]:"Timed out while attempting to establish connection to browser extension",[pUe]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[ZF]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${q0}`,[gUe]:`You must call and await the initialize function before attempting to call any other MSAL API. ${q0}`,[mUe]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[_Ue]:"Invalid base64 encoded string."};class JF extends Fl{constructor(e){super(e,kGt[e]),Object.setPrototypeOf(this,JF.prototype),this.name="BrowserAuthError"}}function gi(n){return new JF(n)}/*! @azure/msal-browser v3.4.0 2023-10-30 */const $_={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"},uP={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},$x={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Hu={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},vLe={GET:"GET",POST:"POST"},Ns={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"},nC={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},e9={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ul={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var Fi;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(Fi||(Fi={}));const bLe={scopes:YF},vUe="jwk",Qse="msal.db",IGt=1,LGt=`${Qse}.keys`,Yg={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5};/*! @azure/msal-browser v3.4.0 2023-10-30 */function DGt(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function AGt(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function sve(){return window.parent!==window}function RGt(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${$_.POPUP_NAME_PREFIX}.`)===0}function Ny(){return window.location.href.split("?")[0].split("#")[0]}function NGt(){const e=new xr(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function zJ(){if(xr.hashContainsKnownProperties(window.location.hash)&&sve())throw gi(eUe)}function OGt(n,e){const t=sve();if(n===Fi.Redirect&&t&&!e)throw gi(Jze)}function PGt(){if(RGt())throw gi(tUe)}function MGt(n){if(!n)throw gi(sUe)}function yLe(n){if(!n)throw gi(gUe)}function bUe(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 mW{navigateInternal(e,t){return mW.defaultNavigateWindow(e,t)}navigateExternal(e,t){return mW.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 FGt{async sendGetRequestAsync(e,t){let i;try{i=await fetch(e,{method:vLe.GET,headers:this.getFetchHeaders(t)})}catch{throw window.navigator.onLine?gi(lUe):gi(gW)}try{return{headers:this.getHeaderDict(i.headers),body:await i.json(),status:i.status}}catch{throw gi(Yse)}}async sendPostRequestAsync(e,t){const i=t&&t.body||Dt.EMPTY_STRING;let r;try{r=await fetch(e,{method:vLe.POST,headers:this.getFetchHeaders(t),body:i})}catch{throw window.navigator.onLine?gi(aUe):gi(gW)}try{return{headers:this.getHeaderDict(r.headers),body:await r.json(),status:r.status}}catch{throw gi(Yse)}}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 BGt=6e4,Xse=6e3,$Gt=3e4,VGt=2e3;function HGt({auth:n,cache:e,system:t,telemetry:i},r){const o={clientId:Dt.EMPTY_STRING,authority:`${Dt.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:Dt.EMPTY_STRING,authorityMetadata:Dt.EMPTY_STRING,redirectUri:Dt.EMPTY_STRING,postLogoutRedirectUri:Dt.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Ky.AAD,OIDCOptions:{serverResponseType:QF.FRAGMENT,defaultScopes:[Dt.OPENID_SCOPE,Dt.PROFILE_SCOPE,Dt.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:U_e.None,tenant:Dt.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1},s={cacheLocation:Hu.SessionStorage,temporaryCacheLocation:Hu.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Hu.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:Nu.Info,piiLoggingEnabled:!1},c={...{...Fze,loggerOptions:a,networkClient:r?new FGt:CGt,navigationClient:new mW,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||BGt,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||Xse,navigateFrameWait:0,redirectNavigationTimeout:$Gt,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||VGt,pollIntervalMilliseconds:$_.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},u={application:{appName:Dt.EMPTY_STRING,appVersion:Dt.EMPTY_STRING},client:new SGt};if((n==null?void 0:n.protocolMode)!==Ky.OIDC&&(n!=null&&n.OIDCOptions)&&new MT(c.loggerOptions).warning(JSON.stringify(Ea(Rze))),n!=null&&n.protocolMode&&n.protocolMode!==Ky.AAD&&(c!=null&&c.allowNativeBroker))throw Ea(Nze);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 WGt="@azure/msal-browser",ave="3.4.0";/*! @azure/msal-browser v3.4.0 2023-10-30 */class zGt{constructor(e){this.browserEnvironment=typeof window<"u",this.config=HGt(e,this.browserEnvironment),this.logger=new MT(this.config.system.loggerOptions,WGt,ave),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 VT extends zGt{getModuleName(){return VT.MODULE_NAME}getId(){return VT.ID}async initialize(){return this.available=typeof window<"u",this.available}}VT.MODULE_NAME="";VT.ID="StandardOperatingContext";async function UGt(n){const e=new VT(n);return await e.initialize(),await(await ie(()=>Promise.resolve().then(()=>AKt),void 0)).StandardController.createController(e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */function UJ(n){return encodeURIComponent(lve(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function _W(n){return yUe(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lve(n){return yUe(new TextEncoder().encode(n))}function yUe(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */function Iw(n){return new TextDecoder().decode(jGt(n))}function jGt(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 gi(_Ue)}const t=atob(e);return Uint8Array.from(t,i=>i.codePointAt(0)||0)}/*! @azure/msal-browser v3.4.0 2023-10-30 */const qGt="RSASSA-PKCS1-v1_5",CUe="SHA-256",GGt=2048,KGt=new Uint8Array([1,0,1]),cve={name:qGt,hash:CUe,modulusLength:GGt,publicExponent:KGt};function YGt(n){if("crypto"in window)n.verbose("BrowserCrypto: modern crypto interface available");else throw n.error("BrowserCrypto: crypto interface is unavailable"),gi(Uze)}async function wUe(n,e,t){e==null||e.addQueueMeasurement(Ot.Sha256Digest,t);const r=new TextEncoder().encode(n);return window.crypto.subtle.digest(CUe,r)}function QGt(n){return window.crypto.getRandomValues(n)}function uS(){return window.crypto.randomUUID()}async function XGt(n,e){return window.crypto.subtle.generateKey(cve,n,e)}async function jJ(n){return window.crypto.subtle.exportKey(vUe,n)}async function ZGt(n,e,t){return window.crypto.subtle.importKey(vUe,n,cve,e,t)}async function JGt(n,e){return window.crypto.subtle.sign(cve,n,e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class eKt{constructor(){this.dbName=Qse,this.version=IGt,this.tableName=LGt,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(gi(ove)))})}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(gi(C2));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(gi(C2));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(gi(C2));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(gi(C2));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(gi(C2));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(Qse);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 Zse{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 CLe{constructor(e,t){this.inMemoryCache=new Zse,this.indexedDBCache=new eKt,this.logger=e,this.storeName=t}handleDatabaseAccessError(e){if(e instanceof JF&&e.errorCode===ove)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 wLe={asymmetricKeys:"asymmetricKeys",symmetricKeys:"symmetricKeys"};class tKt{constructor(e){this.logger=e,this.asymmetricKeys=new CLe(this.logger,wLe.asymmetricKeys),this.symmetricKeys=new CLe(this.logger,wLe.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 oA{constructor(e,t){this.logger=e,YGt(e),this.cache=new tKt(this.logger),this.performanceClient=t}createNewGuid(){return uS()}base64Encode(e){return lve(e)}base64Decode(e){return Iw(e)}async getPublicKeyThumbprint(e){var u;const t=(u=this.performanceClient)==null?void 0:u.startMeasurement(Ot.CryptoOptsGetPublicKeyThumbprint,e.correlationId),i=await XGt(oA.EXTRACTABLE,oA.POP_KEY_USAGES),r=await jJ(i.publicKey),o={e:r.e,kty:r.kty,n:r.n},s=SLe(o),a=await this.hashString(s),l=await jJ(i.privateKey),c=await ZGt(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(Ot.CryptoOptsSignJwt,i),o=await this.cache.asymmetricKeys.getItem(t);if(!o)throw gi(rve);const s=await jJ(o.publicKey),a=SLe(s),l=UJ(JSON.stringify({kid:t})),c=eve.getShrHeaderString({kid:l,alg:s.alg}),u=UJ(c);e.cnf={jwk:JSON.parse(a)};const d=UJ(JSON.stringify(e)),h=`${u}.${d}`,g=new TextEncoder().encode(h),m=await JGt(o.privateKey,g),v=_W(new Uint8Array(m)),_=`${h}.${v}`;return r&&r.end({success:!0}),_}async hashString(e){const t=await wUe(e),i=new Uint8Array(t);return _W(i)}}oA.POP_KEY_USAGES=["sign","verify"];oA.EXTRACTABLE=!0;function SLe(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.4.0 2023-10-30 */const SUe="storage_not_supported",nKt="stubbed_public_client_application_called",EUe="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.4.0 2023-10-30 */const iKt={[SUe]:"Given storage configuration option was not supported.",[nKt]:"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",[EUe]:"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 uve extends Fl{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,uve.prototype)}}function xUe(n){return new uve(n,iKt[n])}/*! @azure/msal-browser v3.4.0 2023-10-30 */class ELe{constructor(e){this.validateWindowStorage(e),this.windowStorage=window[e]}validateWindowStorage(e){if(e!==Hu.LocalStorage&&e!==Hu.SessionStorage||!window[e])throw xUe(SUe)}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 TUe{static extractBrowserRequestState(e,t){if(!t)return null;try{return lv.parseRequestState(e,t).libraryState.meta}catch{throw On(nA)}}static parseServerResponseFromHash(e){if(!e)return{};const t=new xr(e);return xr.getDeserializedHash(t.getHash())}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Jse extends DC{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 Zse,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 Hu.LocalStorage:case Hu.SessionStorage:try{return new ELe(e)}catch(t){this.logger.verbose(t);break}}return this.cacheConfig.cacheLocation=Hu.MemoryStorage,new Zse}setupTemporaryCacheStorage(e,t){switch(t){case Hu.LocalStorage:case Hu.SessionStorage:try{return new ELe(e||Hu.SessionStorage)}catch(i){return this.logger.verbose(i),this.internalStorage}case Hu.MemoryStorage:default:return this.internalStorage}}migrateCacheEntries(){const e=`${Dt.CACHE_PREFIX}.${id.ID_TOKEN}`,t=`${Dt.CACHE_PREFIX}.${id.CLIENT_INFO}`,i=`${Dt.CACHE_PREFIX}.${id.ERROR}`,r=`${Dt.CACHE_PREFIX}.${id.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];[id.ID_TOKEN,id.CLIENT_INFO,id.ERROR,id.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(nC.ACCOUNT_KEYS),t=this.getItem(`${nC.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 Fr.ID_TOKEN:if(cLe(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,Fr.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 Fr.ACCESS_TOKEN:case Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(lLe(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,Fr.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 Fr.REFRESH_TOKEN:if(uLe(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,Fr.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&&Tc.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||!Tc.isAccountEntity(i)?(this.removeAccountKeyFromMap(e),null):DC.toObject(new Tc,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(nC.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(nC.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(nC.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,Fr.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,Fr.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,Fr.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${nC.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 Fr.ID_TOKEN:i.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(e));break;case Fr.ACCESS_TOKEN:i.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(e));break;case Fr.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}`),On(Use)}this.setItem(`${nC.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const i=this.getTokenKeys();switch(t){case Fr.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 Fr.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 Fr.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}`),On(Use)}this.setItem(`${nC.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,Fr.ID_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!cLe(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,Fr.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=Q2(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,Fr.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,Fr.ACCESS_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!lLe(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,Fr.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=Q2(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,Fr.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,Fr.REFRESH_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!uLe(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,Fr.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=Q2(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,Fr.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||!rA.isAppMetadataEntity(e,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),DC.toObject(new rA,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||!fW.isServerTelemetryEntity(e,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),DC.toObject(new fW,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&&Gse.isAuthorityMetadataEntity(e,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),DC.toObject(new Gse,i)):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(e9.WRAPPER_SKU,e),this.internalStorage.setItem(e9.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(e9.WRAPPER_SKU)||Dt.EMPTY_STRING,t=this.internalStorage.getItem(e9.WRAPPER_VER)||Dt.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(id.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(id.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(id.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(id.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||!gLe.isThrottlingEntity(e,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),DC.toObject(new gLe,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===Hu.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(Dt.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e){e.addQueueMeasurement(Ot.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 Dt.EMPTY_STRING}clearMsalCookies(){const e=`${Dt.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,Dt.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):Bp.startsWith(e,Dt.CACHE_PREFIX)||Bp.startsWith(e,id.ADAL_ID_TOKEN)?e:`${Dt.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=lv.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ns.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=lv.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ns.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=lv.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ns.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:Kp.HOME_ACCOUNT_ID};this.setTemporaryCache(Ns.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(r){const c={credential:r,type:Kp.UPN};this.setTemporaryCache(Ns.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(Ns.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(Ns.ORIGIN_URI)),this.removeItem(this.generateCacheKey(Ns.URL_HASH)),this.removeItem(this.generateCacheKey(Ns.CORRELATION_ID)),this.removeItem(this.generateCacheKey(Ns.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(Ns.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||Dt.EMPTY_STRING)}this.clearMsalCookies()}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(t=>{if(t.indexOf(Ns.REQUEST_STATE)===-1)return;const i=this.temporaryCacheStorage.getItem(t);if(!i)return;const r=TUe.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=lve(JSON.stringify(e));this.setTemporaryCache(Ns.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Ns.REQUEST_PARAMS,!0);if(!t)throw gi(rUe);let i;try{i=JSON.parse(Iw(t))}catch(r){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${r}`),gi(oUe)}if(this.removeItem(this.generateCacheKey(Ns.REQUEST_PARAMS)),!i.authority){const r=this.generateAuthorityKey(e),o=this.getTemporaryCache(r);if(!o)throw gi(ive);i.authority=o}return i}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Ns.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=`${Dt.CACHE_PREFIX}.${Ns.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${Dt.CACHE_PREFIX}.${Ns.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw gi(Kze);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(id.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(id.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(id.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(id.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const i=t||e;if(i){const r=lS(i,Iw);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=Q2(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(Ns.REDIRECT_CONTEXT,!0)}setRedirectRequestContext(e){this.setTemporaryCache(Ns.REDIRECT_CONTEXT,e,!0)}async hydrateCache(e,t){var a,l,c,u,d;const i=tG((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=nG((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,Iw,void 0,e.tokenType,void 0,t.sshKid,t.claims,r),s=new WL(void 0,i,o);return this.saveCacheRecord(s)}}const rKt=(n,e)=>{const t={cacheLocation:Hu.MemoryStorage,temporaryCacheLocation:Hu.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new Jse(n,t,uW,e)};/*! @azure/msal-browser v3.4.0 2023-10-30 */const qr={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 oKt{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=uS();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"||!Tc.isAccountEntity(i))return;const o=DC.toObject(new Tc,i).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(qr.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(qr.ACCOUNT_REMOVED,void 0,o))}catch{return}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class kUe{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||uS(),this.logger=r.clone($_.MSAL_SKU,ave,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){Tc.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Tc.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(Ot.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=Sa.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(o.authenticationScheme===Sa.SSH){if(!e.sshJwk)throw Ea(iG);if(!e.sshKid)throw Ea(Aze)}this.logger.verbose(`Authentication Scheme set to "${o.authenticationScheme}" as configured in Auth request`)}return this.config.cache.claimsBasedCachingEnabled&&e.claims&&!Bp.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||Ny();return xr.getAbsoluteUrl(t,Ny())}async validateRequestAuthority(e,t){if(!(await this.getDiscoveredAuthority(e)).isAlias(t.environment))throw Ea(Oze)}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 pW(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 FT.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t,this.logger)):(this.logger.verbose("Creating discovered authority with configured authority"),await FT.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger))}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const sKt=32;async function aKt(n,e,t){n.addQueueMeasurement(Ot.GeneratePkceCodes,t);const i=XF(lKt,Ot.GenerateCodeVerifier,e,n,t)(n,e,t),r=await ai(cKt,Ot.GenerateCodeChallengeFromVerifier,e,n,t)(i,n,e,t);return{verifier:i,challenge:r}}function lKt(n,e,t){try{const i=new Uint8Array(sKt);return XF(QGt,Ot.GetRandomValues,e,n,t)(i),_W(i)}catch{throw gi(tve)}}async function cKt(n,e,t,i){e.addQueueMeasurement(Ot.GenerateCodeChallengeFromVerifier,i);try{const r=await ai(wUe,Ot.Sha256Digest,t,e,i)(n,e,i);return _W(new Uint8Array(r))}catch{throw gi(tve)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class BR extends kUe{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(Ot.StandardInteractionClientInitializeAuthorizationCodeRequest,e.correlationId);const t=await ai(aKt,Ot.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),i={...e,redirectUri:e.redirectUri,code:Dt.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=Dt.S256_CODE_CHALLENGE_METHOD,i}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||uS(),...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=xr.getAbsoluteUrl(e.postLogoutRedirectUri,Ny())):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=xr.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Ny())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=xr.getAbsoluteUrl(Ny(),Ny())):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(Ot.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const r=await ai(this.getClientConfiguration.bind(this),Ot.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new Hze(r,this.performanceClient)}async getClientConfiguration(e,t,i){this.performanceClient.addQueueMeasurement(Ot.StandardInteractionClientGetClientConfiguration,this.correlationId);const r=await ai(this.getDiscoveredAuthority.bind(this),Ot.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:$_.MSAL_SKU,version:ave,cpu:Dt.EMPTY_STRING,os:Dt.EMPTY_STRING},telemetry:this.config.telemetry}}validateAndExtractStateFromHash(e,t,i){if(this.logger.verbose("validateAndExtractStateFromHash called",i),!e.state)throw gi(jze);const r=TUe.extractBrowserRequestState(this.browserCrypto,e.state);if(!r)throw gi(qze);if(r.interactionType!==t)throw gi(Gze);return this.logger.verbose("Returning state from hash",i),e.state}async getDiscoveredAuthority(e,t){this.performanceClient.addQueueMeasurement(Ot.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=Zd.generateAuthority(r,t||this.config.auth.azureCloudOptions);return await ai(FT.createDiscoveredInstance.bind(FT),Ot.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(Ot.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const i=this.getRedirectUri(e.redirectUri),r={interactionType:t},o=lv.setRequestState(this.browserCrypto,e&&e.state||Dt.EMPTY_STRING,r),a={...await ai(this.initializeBaseRequest.bind(this),Ot.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)(e),redirectUri:i,state:o,nonce:e.nonce||uS(),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 uKt="ContentError",IUe="user_switch";/*! @azure/msal-browser v3.4.0 2023-10-30 */const dKt="USER_INTERACTION_REQUIRED",hKt="USER_CANCEL",fKt="NO_NETWORK",pKt="PERSISTENT_ERROR",gKt="DISABLED",mKt="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.4.0 2023-10-30 */const _Kt=-2147186943,vKt={[IUe]:"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 Fl{constructor(e,t,i){super(e,t),Object.setPrototypeOf(this,yy.prototype),this.name="NativeAuthError",this.ext=i}}function w2(n){if(n.ext&&n.ext.status&&(n.ext.status===pKt||n.ext.status===gKt)||n.ext&&n.ext.error&&n.ext.error===_Kt)return!0;switch(n.errorCode){case uKt:return!0;default:return!1}}function eae(n,e,t){if(t&&t.status)switch(t.status){case mKt:return Vze($ze);case dKt:return new Kb(n,e);case hKt:return gi($T);case fKt:return gi(gW)}return new yy(n,vKt[n]||e,t)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class LUe extends BR{async acquireToken(e){this.performanceClient.addQueueMeasurement(Ot.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(ul.acquireTokenSilent_silentFlow),i=await this.createSilentFlowClient(t,e.authority,e.azureCloudOptions);this.logger.verbose("Silent auth client created");try{const o=(await ai(i.acquireCachedToken.bind(i),Ot.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(r){throw r instanceof JF&&r.errorCode===rve&&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 ai(this.getClientConfiguration.bind(this),Ot.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new yGt(r,this.performanceClient)}async initializeSilentRequest(e,t){this.performanceClient.addQueueMeasurement(Ot.InitializeSilentRequest,this.correlationId);const i=await ai(this.initializeBaseRequest.bind(this),Ot.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 qJ={BROKER_CLIENT_ID:"brk_client_id",BROKER_REDIRECT_URI:"brk_redirect_uri"};class zL extends kUe{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 LUe(e,this.nativeStorageManager,i,r,o,s,l,c,h)}async acquireToken(e){this.performanceClient.addQueueMeasurement(Ot.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(Ot.NativeInteractionClientAcquireToken,e.correlationId),i=Hh.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:$x.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:jc.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),On(Wse);const i=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!i)throw On(Wse);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:$x.GetToken,request:t};try{const s=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(s)}catch(s){if(s instanceof yy&&w2(s))throw s}this.browserStorage.setTemporaryCache(Ns.NATIVE_REQUEST,JSON.stringify(t),!0);const r={apiId:ul.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(Ns.NATIVE_REQUEST));const r={method:$x.GetToken,request:i},o=Hh.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 eae(IUe);const r=await this.getDiscoveredAuthority(t.authority),o=lS(e.id_token,Iw),s=this.createHomeAccountIdentifier(e,o),a=Tc.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 Tc.generateHomeAccountId(e.client_info||Dt.EMPTY_STRING,A_.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?jc.fromString(e.scope):jc.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Sa.POP){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const i=new iA(this.browserCrypto),r={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw On(W_e);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?jc.fromString(e.scope):jc.fromString(t.scope),c=e.account.properties||{},u=c.UID||i.oid||i.sub||Dt.EMPTY_STRING,d=c.TenantId||i.tid||Dt.EMPTY_STRING,f=(i?Object.assign(new Tc,{...r,idTokenClaims:i}):r).getAccountInfo(),g=await this.generatePopAccessToken(e,t),m=t.tokenType===Sa.POP?Sa.POP:Sa.BEARER;return{authority:o,uniqueId:u,tenantId:d,scopes:l.asArray(),account:f,idToken:e.id_token,idTokenClaims:i,accessToken:g,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=tG(i,t.authority,e.id_token||"",t.clientId,r.tid||""),c=t.tokenType===Sa.POP?Dt.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=nG(i,t.authority,o,t.clientId,r.tid||s,d.printScopes(),u,0,Iw),f=new WL(void 0,l,h);this.nativeStorageManager.saveCacheRecord(f,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 nze(M_e,"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 xr(t);i.validateAsUri();const{scopes:r,...o}=e,s=new jc(r||[]);s.appendScopes(YF);const a=()=>{switch(this.apiId){case ul.ssoSilent:case ul.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),oh.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case oh.NONE:case oh.CONSENT:case oh.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`),gi(mUe)}},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=uP.MATS_TELEMETRY,e.authenticationScheme===Sa.POP){const c={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new iA(this.browserCrypto),d=await ai(u.generateCnf.bind(u),Ot.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(qJ.BROKER_CLIENT_ID)&&e.extraParameters.hasOwnProperty(qJ.BROKER_REDIRECT_URI)&&e.extraParameters.hasOwnProperty(jr.CLIENT_ID)){const t=e.extraParameters[jr.CLIENT_ID],i=e.redirectUri,r=e.extraParameters[qJ.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 Lb{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(Ot.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:uP.CHANNEL_ID,extensionId:this.extensionId,responseId:uS(),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 Lb(e,t,i,uP.PREFERRED_EXTENSION_ID);return await r.sendHandshakeRequest(),r}catch{const o=new Lb(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:uP.CHANNEL_ID,extensionId:this.extensionId,responseId:uS(),body:{method:$x.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(gi(fUe)),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!==uP.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===$x.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(gi(pUe))}}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===$x.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(eae(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?i.reject(eae(s.result.code,s.result.description,s.result.ext)):i.resolve(s.result);else throw nze(M_e,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(o===$x.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 Sa.BEARER:case Sa.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 dve{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(Ot.HandleCodeResponseFromHash,t.correlationId),!e)throw gi(sG);let i;try{i=this.authModule.handleFragmentResponse(e,t.state)}catch(r){throw r instanceof cS&&r.subError===$T?gi($T):r}return ai(this.handleCodeResponseFromServer.bind(this),Ot.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(i,t)}async handleCodeResponseFromServer(e,t,i=!0){if(this.performanceClient.addQueueMeasurement(Ot.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await ai(this.authModule.updateAuthority.bind(this.authModule),Ot.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 ai(this.authModule.acquireToken.bind(this.authModule),Ot.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Kp.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Kp.UPN}:null}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class bKt extends BR{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||YF,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(ul.acquireTokenPopup),s=await ai(this.initializeAuthorizationRequest.bind(this),Ot.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Fi.Popup);bUe(s.authority);try{const a=await ai(this.initializeAuthorizationCodeRequest.bind(this),Ot.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(s),l=await ai(this.createAuthCodeClient.bind(this),Ot.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(o,s.authority,s.azureCloudOptions),c=Lb.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let u;c&&(u=this.performanceClient.startMeasurement(Ot.FetchAccountIdWithNativeBroker,e.correlationId));const d=await l.getAuthCodeUrl({...s,nativeBroker:c}),h=new dve(l,this.browserStorage,a,this.logger,this.performanceClient),f={popup:r,popupName:t,popupWindowAttributes:i},g=this.initiateAuthRequest(d,f);this.eventHandler.emitEvent(qr.POPUP_OPENED,Fi.Popup,{popupWindow:g},null);const m=await this.monitorPopupForHash(g),v=xr.getDeserializedHash(m);if(fb.removeThrottle(this.browserStorage,this.config.auth.clientId,a),v.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),u&&u.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw gi(ZF);const b=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,v.accountId,this.nativeStorage,s.correlationId),{userRequestState:y}=lv.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 Fl&&(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(qr.LOGOUT_START,Fi.Popup,e);const a=this.initializeServerTelemetryManager(ul.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await ai(this.createAuthCodeClient.bind(this),Ot.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(qr.LOGOUT_SUCCESS,Fi.Popup,e),s){const f={apiId:ul.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},g=xr.getAbsoluteUrl(s,Ny());await this.navigationClient.navigateInternal(g,f)}o&&o.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(qr.LOGOUT_SUCCESS,Fi.Popup,e);const h=this.openPopup(d,{popupName:t,popupWindowAttributes:i,popup:o});if(this.eventHandler.emitEvent(qr.POPUP_OPENED,Fi.Popup,{popupWindow:h},null),await this.waitForLogoutPopup(h),s){const f={apiId:ul.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},g=xr.getAbsoluteUrl(s,Ny());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${g}`),await this.navigationClient.navigateInternal(g,f)}else this.logger.verbose("No main window navigation requested")}catch(u){throw o&&o.close(),u instanceof Fl&&(u.setCorrelationId(this.correlationId),a.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(qr.LOGOUT_FAILURE,Fi.Popup,null,u),this.eventHandler.emitEvent(qr.LOGOUT_END,Fi.Popup),u}this.eventHandler.emitEvent(qr.LOGOUT_END,Fi.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"),gi(oG)}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(gi($T));return}let a=Dt.EMPTY_STRING,l=Dt.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),xr.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(gi(nve)))):o>r&&(this.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(s),i(gi(Xze))))},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=Dt.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 gi(Qze);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),gi(Yze)}}openSizedPopup(e,t,i){var h,f,g,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=(f=i.popupSize)==null?void 0:f.height,u=(g=i.popupPosition)==null?void 0:g.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=$_.POPUP_WIDTH),(!c||c<0||c>a)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=$_.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-$_.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-$_.POPUP_WIDTH/2+r)),window.open(e,t,`width=${l}, height=${c}, top=${u}, left=${d}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(Fi.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`${$_.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${$_.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)===QF.QUERY?i=xr.parseQueryServerResponse(t):i=e.location.hash,i}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class xLe{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(Ns.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ns.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const i={apiId:ul.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"),gi(oG)}async handleCodeResponseFromHash(e,t){if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),!e)throw gi(sG);this.browserStorage.setInteractionInProgress(!1);const i=this.browserStorage.generateStateKey(t),r=this.browserStorage.getTemporaryCache(i);if(!r)throw On(cW,"Cached State");let o;try{o=this.authModule.handleFragmentResponse(e,r)}catch(c){throw c instanceof cS&&c.subError===$T?gi($T):c}const s=this.browserStorage.generateNonceKey(r),a=this.browserStorage.getTemporaryCache(s);if(this.authCodeRequest.code=o.code,o.cloud_instance_host_name&&await ai(this.authModule.updateAuthority.bind(this.authModule),Ot.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(Ns.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 yKt extends BR{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 ai(this.initializeAuthorizationRequest.bind(this),Ot.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Fi.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const i=this.initializeServerTelemetryManager(ul.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(qr.RESTORE_FROM_BFCACHE,Fi.Redirect))};try{const o=await ai(this.initializeAuthorizationCodeRequest.bind(this),Ot.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),s=await ai(this.createAuthCodeClient.bind(this),Ot.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,t.authority,t.azureCloudOptions),a=new xLe(s,this.browserStorage,o,this.logger,this.performanceClient),l=await s.getAuthCodeUrl({...t,nativeBroker:Lb.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 Fl&&(o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o)),window.removeEventListener("pageshow",r),this.browserStorage.cleanRequestByState(t.state),o}}async handleRedirectPromise(e){const t=this.initializeServerTelemetryManager(ul.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(Fi.Redirect),null;let r;try{const l=xr.getDeserializedHash(i);r=this.validateAndExtractStateFromHash(l,Fi.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(Fi.Redirect),null}const o=this.browserStorage.getTemporaryCache(Ns.ORIGIN_URI,!0)||Dt.EMPTY_STRING,s=xr.removeHashFromUrl(o),a=xr.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&&AGt(o),l}else if(this.config.auth.navigateToLoginRequestUrl){if(!sve()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Ns.URL_HASH,i,!0);const l={apiId:ul.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let c=!0;if(!o||o==="null"){const u=NGt();this.browserStorage.setTemporaryCache(Ns.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 Fl&&(i.setCorrelationId(this.correlationId),t.cacheFailedRequest(i)),this.browserStorage.cleanRequestByInteractionType(Fi.Redirect),i}}getRedirectResponseHash(e){if(this.logger.verbose("getRedirectResponseHash called"),xr.hashContainsKnownProperties(e))return DGt(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;const i=this.browserStorage.getTemporaryCache(Ns.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ns.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=xr.getDeserializedHash(e);if(o.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw gi(ZF);const c=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,o.accountId,this.nativeStorage,r.correlationId),{userRequestState:u}=lv.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 gi(ive);const a=await ai(this.createAuthCodeClient.bind(this),Ot.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,s);return fb.removeThrottle(this.browserStorage,this.config.auth.clientId,r),await new xLe(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(ul.logout);try{this.eventHandler.emitEvent(qr.LOGOUT_START,Fi.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:ul.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await ai(this.createAuthCodeClient.bind(this),Ot.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(qr.LOGOUT_SUCCESS,Fi.Redirect,t);return}}const l=a.getLogoutUri(t);if(this.eventHandler.emitEvent(qr.LOGOUT_SUCCESS,Fi.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 Fl&&(s.setCorrelationId(this.correlationId),i.cacheFailedRequest(s)),this.eventHandler.emitEvent(qr.LOGOUT_FAILURE,Fi.Redirect,null,s),this.eventHandler.emitEvent(qr.LOGOUT_END,Fi.Redirect),s}this.eventHandler.emitEvent(qr.LOGOUT_END,Fi.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return xr.getAbsoluteUrl(t,Ny())}}/*! @azure/msal-browser v3.4.0 2023-10-30 */async function CKt(n,e,t,i,r){if(e.addQueueMeasurement(Ot.SilentHandlerInitiateAuthRequest,i),!n)throw t.info("Navigate url is empty"),gi(oG);return r?await ai(SKt,Ot.SilentHandlerLoadFrame,t,e,i)(n,r,e,i):XF(EKt,Ot.SilentHandlerLoadFrameSync,t,e,i)(n)}async function wKt(n,e,t,i,r,o){return i.addQueueMeasurement(Ot.SilentHandlerMonitorIframeForHash,o),new Promise((s,a)=>{e<Xse&&r.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${Xse}ms). This may result in timeouts.`);const l=window.setTimeout(()=>{window.clearInterval(c),a(gi(Zze))},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(()=>{XF(xKt,Ot.RemoveHiddenIframe,r,i,o)(n)})}function SKt(n,e,t,i){return t.addQueueMeasurement(Ot.SilentHandlerLoadFrame,i),new Promise((r,o)=>{const s=DUe();window.setTimeout(()=>{if(!s){o("Unable to load iframe");return}s.src=n,r(s)},e)})}function EKt(n){const e=DUe();return e.src=n,e}function DUe(){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 xKt(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class TKt extends BR{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(Ot.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!==oh.NONE&&e.prompt!==oh.NO_SESSION)throw gi(iUe);const t=await ai(this.initializeAuthorizationRequest.bind(this),Ot.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)({...e,prompt:e.prompt||oh.NONE},Fi.Silent);bUe(t.authority);const i=this.initializeServerTelemetryManager(this.apiId);try{const r=await ai(this.createAuthCodeClient.bind(this),Ot.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)(i,t.authority,t.azureCloudOptions);return await ai(this.silentTokenHelper.bind(this),Ot.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(r,t)}catch(r){throw r instanceof Fl&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),r}}logout(){return Promise.reject(gi(aG))}async silentTokenHelper(e,t){const i=t.correlationId;this.performanceClient.addQueueMeasurement(Ot.SilentIframeClientTokenHelper,i);const r=await ai(this.initializeAuthorizationCodeRequest.bind(this),Ot.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,i)(t),o=await ai(e.getAuthCodeUrl.bind(e),Ot.GetAuthCodeUrl,this.logger,this.performanceClient,i)({...t,nativeBroker:Lb.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),s=new dve(e,this.browserStorage,r,this.logger,this.performanceClient),a=await ai(CKt,Ot.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,i)(o,this.performanceClient,this.logger,i,this.config.system.navigateFrameWait),l=await ai(wKt,Ot.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,i)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,i);if(l){if(!xr.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}`),gi(nve)}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."),gi(sG);const c=xr.getDeserializedHash(l);if(c.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw gi(ZF);const u=new zL(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}=lv.parseRequestState(this.browserCrypto,t.state);return ai(u.acquireToken.bind(u),Ot.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,i)({...t,state:d,prompt:t.prompt||oh.NONE})}return ai(s.handleCodeResponseFromHash.bind(s),Ot.HandleCodeResponseFromHash,this.logger,this.performanceClient,i)(l,t)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class kKt extends BR{async acquireToken(e){this.performanceClient.addQueueMeasurement(Ot.SilentRefreshClientAcquireToken,e.correlationId);const t=await ai(this.initializeBaseRequest.bind(this),Ot.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,e.account),i={...e,...t},r=this.initializeServerTelemetryManager(ul.acquireTokenSilent_silentFlow),o=await this.createRefreshTokenClient(r,i.authority,i.azureCloudOptions);return ai(o.acquireTokenByRefreshToken.bind(o),Ot.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(i).catch(s=>{throw s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s),s})}logout(){return Promise.reject(gi(aG))}async createRefreshTokenClient(e,t,i){const r=await ai(this.getClientConfiguration.bind(this),Ot.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new Kse(r,this.performanceClient)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class IKt{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 gi(v_);const r=lS(t.id_token,Iw);let o,s,a;if(e.account)a=Tc.createFromAccountInfo(e.account),o=new WL(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=Zd.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 Zd(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 WL(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 WL(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 gi(v_)}else throw gi(v_);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=Tc.generateHomeAccountId(i,t.authorityType,this.logger,this.cryptoObj,e)),!o)throw gi(v_);const s=Tc.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 gi(v_)}loadIdToken(e,t,i,r){const o=tG(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 gi(v_)}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 gi(v_);const a=new jc(e.scopes).printScopes(),l=s.expiresOn||t.expires_in+new Date().getTime()/1e3,c=s.extendedExpiresOn,u=nG(i,r,t.access_token,this.config.auth.clientId,o,a,l,c,Iw);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(u),u;throw gi(v_)}loadRefreshToken(e,t,i,r){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;const o=Cze(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 gi(v_)}generateAuthenticationResult(e,t,i,r,o){var h,f;let s=Dt.EMPTY_STRING,a=[],l=null,c;i!=null&&i.accessToken&&(s=i.accessToken.secret,a=jc.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||Dt.EMPTY_STRING,d=t.tid||Dt.EMPTY_STRING;return{authority:o?o.canonicalAuthority:Dt.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||Dt.EMPTY_STRING,requestId:Dt.EMPTY_STRING,extExpiresOn:c,familyId:Dt.EMPTY_STRING,tokenType:((f=i==null?void 0:i.accessToken)==null?void 0:f.tokenType)||Dt.EMPTY_STRING,state:Dt.EMPTY_STRING,cloudGraphHostName:r.cloudGraphHostName||Dt.EMPTY_STRING,msGraphHost:r.msGraphHost||Dt.EMPTY_STRING,code:void 0,fromNativeBroker:!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class LKt extends Hze{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class DKt extends BR{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 gi(cUe);const t=await ai(this.initializeAuthorizationRequest.bind(this),Ot.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,Fi.Silent),i=this.initializeServerTelemetryManager(this.apiId);try{const r={...t,code:e.code},o=await ai(this.getClientConfiguration.bind(this),Ot.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)(i,t.authority),s=new LKt(o);this.logger.verbose("Auth code client created");const a=new dve(s,this.browserStorage,r,this.logger,this.performanceClient);return ai(a.handleCodeResponseFromServer.bind(a),Ot.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 Fl&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),r}}logout(){return Promise.reject(gi(aG))}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class lG{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 oA(this.logger,this.performanceClient):uW,this.eventHandler=new oKt(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Jse(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,hGt(this.config.auth)):rKt(this.config.auth.clientId,this.logger);const t={cacheLocation:Hu.MemoryStorage,temporaryCacheLocation:Hu.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Jse(this.config.auth.clientId,t,this.browserCrypto,this.logger),this.tokenCache=new IKt(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 lG(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(Ot.InitializeClientApplication);if(this.eventHandler.emitEvent(qr.INITIALIZE_START),e)try{this.nativeExtensionProvider=await Lb.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 ai(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),Ot.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient)(this.performanceClient)),this.initialized=!0,this.eventHandler.emitEvent(qr.INITIALIZE_END),t.end({allowNativeBroker:e,success:!0})}async handleRedirectPromise(e){var r;this.logger.verbose("handleRedirectPromise called"),yLe(this.initialized);let t=e;if(((r=this.config.auth.OIDCOptions)==null?void 0:r.serverResponseType)===QF.QUERY){const o=window.location.href;t=xr.parseQueryServerResponse(o)}const i=this.getAllAccounts();if(this.isBrowserEnvironment){const o=t||Dt.EMPTY_STRING;let s=this.redirectResponse.get(o);if(typeof s>"u"){this.eventHandler.emitEvent(qr.HANDLE_REDIRECT_START,Fi.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise");const a=this.browserStorage.getCachedNativeRequest();let l;if(a&&Lb.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!t)this.logger.trace("handleRedirectPromise - acquiring token from native platform"),l=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.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(Ns.CORRELATION_ID,!0)||Dt.EMPTY_STRING;l=this.createRedirectClient(c).handleRedirectPromise(t)}s=l.then(c=>(c&&(i.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(qr.LOGIN_SUCCESS,Fi.Redirect,c),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_SUCCESS,Fi.Redirect,c),this.logger.verbose("handleRedirectResponse returned result, acquire token success"))),this.eventHandler.emitEvent(qr.HANDLE_REDIRECT_END,Fi.Redirect),c)).catch(c=>{throw i.length>0?this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_FAILURE,Fi.Redirect,null,c):this.eventHandler.emitEvent(qr.LOGIN_FAILURE,Fi.Redirect,null,c),this.eventHandler.emitEvent(qr.HANDLE_REDIRECT_END,Fi.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(Fi.Redirect);const i=this.getAllAccounts().length>0;i?this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_START,Fi.Redirect,e):this.eventHandler.emitEvent(qr.LOGIN_START,Fi.Redirect,e);let r;return this.nativeExtensionProvider&&this.canUseNative(e)?r=new zL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireTokenRedirect(e).catch(s=>{if(s instanceof yy&&w2(s))return this.nativeExtensionProvider=void 0,this.createRedirectClient(e.correlationId).acquireToken(e);if(s instanceof Kb)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(qr.ACQUIRE_TOKEN_FAILURE,Fi.Redirect,null,o):this.eventHandler.emitEvent(qr.LOGIN_FAILURE,Fi.Redirect,null,o),o})}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Ot.AcquireTokenPopup,t);try{this.logger.verbose("acquireTokenPopup called",t),this.preflightBrowserEnvironmentCheck(Fi.Popup)}catch(s){return Promise.reject(s)}const r=this.getAllAccounts();r.length>0?this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_START,Fi.Popup,e):this.eventHandler.emitEvent(qr.LOGIN_START,Fi.Popup,e);let o;return this.canUseNative(e)?o=this.acquireTokenNative(e,ul.acquireTokenPopup).then(s=>(this.getBrowserStorage().setInteractionInProgress(!1),i.end({success:!0,isNativeBroker:!0,requestId:s.requestId}),s)).catch(s=>{if(s instanceof yy&&w2(s))return this.nativeExtensionProvider=void 0,this.createPopupClient(e.correlationId).acquireToken(e);if(s instanceof Kb)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(qr.LOGIN_SUCCESS,Fi.Popup,s):this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_SUCCESS,Fi.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(qr.ACQUIRE_TOKEN_FAILURE,Fi.Popup,null,s):this.eventHandler.emitEvent(qr.LOGIN_FAILURE,Fi.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(Fi.Silent),this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Ot.SsoSilent,t),(o=this.ssoSilentMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(qr.SSO_SILENT_START,Fi.Silent,i);let r;return this.canUseNative(i)?r=this.acquireTokenNative(i,ul.ssoSilent).catch(s=>{if(s instanceof yy&&w2(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(qr.SSO_SILENT_SUCCESS,Fi.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(qr.SSO_SILENT_FAILURE,Fi.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(Fi.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_BY_CODE_START,Fi.Silent,e);const i=this.performanceClient.startMeasurement(Ot.AcquireTokenByCode,e.correlationId);try{if(e.code&&e.nativeAccountId)throw gi(dUe);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(qr.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Fi.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(qr.ACQUIRE_TOKEN_BY_CODE_FAILURE,Fi.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,ul.acquireTokenByCode,e.nativeAccountId).catch(r=>{throw r instanceof yy&&w2(r)&&(this.nativeExtensionProvider=void 0),r});throw gi(hUe)}else throw gi(uUe)}catch(r){throw this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_BY_CODE_FAILURE,Fi.Silent,null,r),i.end({errorCode:r instanceof Fl&&r.errorCode||void 0,subErrorCode:r instanceof Fl&&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(Ot.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(Ot.AcquireTokenFromCache,t.correlationId),i){case Yg.Default:case Yg.AccessToken:case Yg.AccessTokenAndRefreshToken:return ai(e.acquireToken.bind(e),Ot.SilentCacheClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(t);default:throw On(JC)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(Ot.AcquireTokenByRefreshToken,e.correlationId),t){case Yg.Default:case Yg.AccessTokenAndRefreshToken:case Yg.RefreshToken:case Yg.RefreshTokenAndNetwork:const i=this.createSilentRefreshClient(e.correlationId);return ai(i.acquireToken.bind(i),Ot.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw On(JC)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(Ot.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return ai(t.acquireToken.bind(t),Ot.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(Fi.Redirect),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(Fi.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=Tc.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"),MGt(this.isBrowserEnvironment),OGt(e,this.config.system.allowRedirectInIframe),zJ(),PGt(),yLe(this.initialized),e===Fi.Redirect&&this.config.cache.cacheLocation===Hu.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw xUe(EUe);(e===Fi.Redirect||e===Fi.Popup)&&this.preflightInteractiveRequest(!t)}preflightInteractiveRequest(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),zJ(),e&&this.getBrowserStorage().setInteractionInProgress(!0)}async acquireTokenNative(e,t,i){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw gi(ZF);return new zL(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"),!Lb.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 oh.NONE:case oh.CONSENT:case oh.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 bKt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new yKt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new TKt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new LUe(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new kKt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new DKt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ul.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?uS():Dt.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||bLe})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||bLe})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(Ot.AcquireTokenSilent,t);i.add({cacheLookupPolicy:e.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(Fi.Silent),this.logger.verbose("acquireTokenSilent called",t);const r=e.account||this.getActiveAccount();if(!r)throw gi(nUe);const o={clientId:this.config.auth.clientId,authority:e.authority||Dt.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=ai(this.acquireTokenSilentAsync.bind(this),Ot.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(Ot.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_START,Fi.Silent,e),this.atsAsyncMeasurement=this.performanceClient.startMeasurement(Ot.AcquireTokenSilentAsync,e.correlationId),(r=this.atsAsyncMeasurement)==null||r.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibility);let i;if(Lb.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,ul.acquireTokenSilent_silentFlow).catch(async s=>{if(s instanceof yy&&w2(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 ai(o.initializeSilentRequest.bind(o),Ot.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t),a=e.cacheLookupPolicy||Yg.Default;i=ai(this.acquireTokenFromCache.bind(this),Ot.AcquireTokenFromCache,this.logger,this.performanceClient,s.correlationId)(o,s,a).catch(l=>{if(e.cacheLookupPolicy===Yg.AccessToken)throw l;return zJ(),this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_NETWORK_START,Fi.Silent,s),ai(this.acquireTokenByRefreshToken.bind(this),Ot.AcquireTokenByRefreshToken,this.logger,this.performanceClient,s.correlationId)(s,a).catch(c=>{const u=!(c instanceof Kb)&&(c.errorCode===$_.INVALID_GRANT_ERROR||c.errorCode===JC)||c.errorCode===hW,d=a===Yg.Default||a===Yg.Skip||a===Yg.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),ai(this.acquireTokenBySilentIframe.bind(this),Ot.AcquireTokenBySilentIframe,this.logger,this.performanceClient,s.correlationId)(s);throw c})})}return i.then(o=>{var s;return this.eventHandler.emitEvent(qr.ACQUIRE_TOKEN_SUCCESS,Fi.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(qr.ACQUIRE_TOKEN_FAILURE,Fi.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 AKt=Object.freeze(Object.defineProperty({__proto__:null,StandardController:lG},Symbol.toStringTag,{value:"Module"}));/*! @azure/msal-browser v3.4.0 2023-10-30 */class hve{static async createPublicClientApplication(e){const t=await UGt(e);return new hve(e,t)}constructor(e,t){if(t)this.controller=t;else{const i=new VT(e);this.controller=new lG(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 J4=new hve({auth:{clientId:"",redirectUri:{}.VITE_MICROSOFT_REDIRECT_URI}});J4.initialize();function AUe(n){return p("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 RKt(){const n=zi(),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(_F({type:vR.TOKEN,user:r.data.data[o].user,token:r.data.data[o].token.token})),n(y0(r.data.data)),n(Kj(o))},t=r=>{$e("POST",Ae("/api/v1/oauth_login?provider=google&id_token=:token&create=true",{token:r})).then(o=>e(o))},i=r=>{$e("POST",Ae("/api/v1/oauth_login?provider=microsoft"),{accessToken:r}).then(o=>e(o))};return p("div",{className:"grid grid-cols-3 text-sm mt-4",children:O("div",{className:"col-span-3 flex flex-col items-center space-y-3",children:[p(eze,{onSuccess:r=>r.credential&&t(r.credential),onError:()=>he.error()}),O(AUe,{onClick:async()=>{await J4.handleRedirectPromise(),J4.loginPopup({scopes:["user.read"]}).then(r=>i(r.accessToken))},children:[O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 23 23",children:[p("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),p("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),p("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),p("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),p("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),p("p",{children:"Log in with Microsoft"})]})]})})}function NKt(){const[n]=ve(),e=zi(),t=I1(),i=Ti(),[r,o]=us(RUe),[s,a]=w.useState(!1),l=()=>{a(!1),o("false")},c=()=>{const u=(t==null?void 0:t.oauth_provider_id)==="google";he.processing(),$e("PUT",Ae("/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(US({object:"company",data:d.data.data})),he.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]),O(Or,{title:n("email_provider"),visible:s,onClose:l,children:[p("span",{className:"text-base font-medium",children:Ca("select_email_provider",{provider:(t==null?void 0:t.oauth_provider_id)==="google"?"Gmail":"Outlook"})}),p(un,{className:"self-end",behavior:"button",type:"primary",onClick:c,children:n("yes")})]})}const RUe=Yj("connectMailer","false");function OKt(){const[n]=ve(),e=Va(),t=Wi(RUe),i=l=>{he.processing(),window.location.href=Ae("/auth/:mailer?react=true",{mailer:l}),t("true")},r=()=>{he.processing(),$e("POST",Ae("/api/v1/users/:id/disconnect_mailer",{id:e.id}),{}).then(l=>{In(["users"]),he.success(l.data.message),window.location.reload()}).finally(()=>t("false"))},o=()=>{he.processing(),$e("POST",Ae("/api/v1/users/:id/disconnect_oauth",{id:e.id})).then(l=>{In(["users"]),he.success(l.data.message),window.location.reload()}).finally(()=>t("false"))},s=l=>{$e("POST",Ae("/api/v1/connected_account?include=company_user&provider=microsoft"),{accessToken:l}).then(()=>{window.location.reload()}).finally(()=>t("false"))},a=l=>{$e("POST",Ae("/api/v1/connected_account?include=company_user&provider=google&id_token=:token",{token:l})).then(()=>{window.location.reload()}).finally(()=>t("false"))};return O(St,{children:[p(NKt,{}),O(tn,{title:n("oneclick_login"),children:[!(e!=null&&e.oauth_provider_id)&&qo()&&O(St,{children:[p("div",{className:"grid grid-cols-3 text-sm mt-4",children:p(G,{leftSide:"Google",children:p(eze,{onSuccess:l=>l.credential&&a(l.credential),onError:()=>he.error()})})}),p("div",{className:zt("grid grid-cols-3 text-sm",{"mt-4":qo()}),children:p(G,{leftSide:"Microsoft",children:O(AUe,{onClick:async()=>{await J4.handleRedirectPromise(),J4.loginPopup({scopes:["user.read"]}).then(l=>s(l.accessToken))},children:[O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 23 23",children:[p("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),p("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),p("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),p("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),p("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),p("p",{style:{color:"#000"},children:"Log in with Microsoft"})]})})})]}),(e==null?void 0:e.oauth_provider_id)==="google"&&O(St,{children:[p(G,{leftSide:"Google",children:p(un,{type:"minimal",behavior:"button",onClick:o,children:n("disconnect_google")})}),p(G,{leftSide:"Gmail",children:e!=null&&e.oauth_user_token?p(un,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_gmail")}):p(un,{type:"minimal",behavior:"button",onClick:()=>i("google"),children:n("connect_gmail")})})]}),(e==null?void 0:e.oauth_provider_id)==="microsoft"&&O(St,{children:[p(G,{leftSide:"Microsoft",children:p(un,{type:"minimal",behavior:"button",onClick:o,children:n("disconnect_microsoft")})}),p(G,{leftSide:"Email",children:e!=null&&e.oauth_user_token?p(un,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_email")}):p(un,{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 fve(){const{isAdmin:n}=Fo();return!((Bm()||xc())&&n)}var BC=(n=>(n.SingleLineText="single_line_text",n.MultiLineText="multi_line_text",n.Switch="switch",n.Dropdown="dropdown",n.Date="date",n))(BC||{});function Zf(n){const[e]=ve(),[t,i]=w.useState(""),[r,o]=w.useState(""),s=fve(),[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 g=n.initialValue.split("|");n.initialValue.includes("|")?c.includes(g[1])?l(g[1]):(l("dropdown"),o(g[1])):l("multi_line_text"),i(g[0])}},[]);const f=()=>{var v,_,b,y,C,E;const g=((v=h.current)==null?void 0:v.value)==="dropdown"?(_=d.current)==null?void 0:_.value.split(",").map(x=>x.trim()).join(","):(b=h.current)==null?void 0:b.value,m=g==="multi_line_text"?`${((y=u.current)==null?void 0:y.value)||""}`:`${((C=u.current)==null?void 0:C.value)||""}|${g}`;n.onChange&&n.onChange(m,n.field,(E=h.current)==null?void 0:E.value)};return O(St,{children:[p(G,{noExternalPadding:n.noExternalPadding,leftSide:p(Ze,{innerRef:u,id:n.field,placeholder:n.placeholder,onChange:f,value:t,disabled:s}),children:O(En,{innerRef:h,onChange:g=>{l(g.target.value),f()},value:a,children:[p("option",{value:"single_line_text",children:e("single_line_text")}),p("option",{value:"multi_line_text",children:e("multi_line_text")}),p("option",{value:"switch",children:e("switch")}),p("option",{value:"dropdown",children:e("dropdown")}),p("option",{value:"date",children:e("date")})]})}),a==="dropdown"&&p(S0,{children:p(Ze,{innerRef:d,id:"multi_line_text",placeholder:e("comma_sparated_list"),onChange:f,value:r})})]})}function TLe(n){const[e,t]=w.useState("single_line_text"),i=si();return w.useEffect(()=>{const[,r]=n.value.includes("|")?n.value.split("|"):[n.value,"multi_line_text"];t(r)},[n.field]),O(St,{children:[e===BC.SingleLineText&&p(Ze,{style:{color:i.$3,colorScheme:i.$0},type:"text",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===BC.MultiLineText&&p(Ze,{style:{color:i.$3,colorScheme:i.$0},element:"textarea",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===BC.Switch&&p(kt,{style:{color:i.$3,colorScheme:i.$0},onChange:r=>{const o=r?"yes":"no";n.onValueChange(o)},checked:typeof n.defaultValue=="string"?n.defaultValue==="true"||n.defaultValue==="1"||n.defaultValue==="yes":n.defaultValue}),e===BC.Date&&p(Ze,{style:{color:i.$3,colorScheme:i.$0},type:"date",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),!Object.values(BC).includes(e)&&O(En,{style:{color:i.$3,colorScheme:i.$0},value:n.defaultValue||"",onChange:r=>n.onValueChange(r.target.value),children:[p("option",{value:""}),e.split(",").map((r,o)=>p("option",{value:r,children:r},o))]})]})}function vW(n){const[e,t]=n.includes("|")?n.split("|"):[n,""];return{label:()=>e,type:()=>t}}function QTr(){const n=Ti();return e=>n&&n.custom_fields[e]?vW(n.custom_fields[e]):vW("")}function rs(n){const[e,t]=w.useState("");return w.useEffect(()=>{const[i]=n.value.includes("|")?n.value.split("|"):[n.value,""];t(i||"")},[]),n.fieldOnly?p(TLe,{...n}):p(G,{leftSide:e,noExternalPadding:n.noExternalPadding,children:p(TLe,{...n})})}const PKt=n=>ce.isValidElement(n)&&n.type==="option";function A1({children:n,value:e,errorMessage:t,disabled:i,onValueChange:r,label:o,dismissable:s,clearAfterSelection:a}){if(ce.Children.toArray(n).every(PKt)===!1)throw new Error("SearchableSelect must have only <option> elements as children.");const c=ce.Children.map(n,g=>w.isValidElement(g)&&{id:Qq(),label:Array.isArray(g.props.children)?g.props.children.join(""):g.props.children,value:g.props.value,resource:null,eventType:"external",searchable:`${g.props.children??""} ${g.props.value??""}`}),u=ce.Children.map(n,g=>w.isValidElement(g)&&{label:Array.isArray(g.props.children)?g.props.children.join(""):g.props.children,value:g.props.value}),d=a?"":c==null?void 0:c.find(g=>g.value===e),h=si();return O("div",{className:"space-y-2",children:[o?p(pg,{children:o}):null,p(_v,{options:u,value:d,onChange:g=>r(g===null?"":g.value),isDisabled:i,isClearable:s,styles:{input:g=>({...g,color:h.$3}),singleValue:g=>({...g,color:h.$3}),menu:g=>({...g,width:"max-content",minWidth:"100%",backgroundColor:h.$4,borderColor:h.$4,zIndex:50}),control:(g,{isDisabled:m})=>({...g,borderRadius:"3px",backgroundColor:h.$1,color:h.$3,borderColor:h.$5,cursor:m?"not-allowed":"pointer",pointerEvents:m?"auto":"unset"}),option:(g,{isSelected:m,isFocused:v})=>({...g,color:h.$3,backgroundColor:m||v?h.$7:h.$1,":hover":{backgroundColor:h.$7}})}}),t&&p(Fs,{className:"mt-2",type:"danger",children:t})]})}function e6(n){const e=Bj();return p(A1,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,children:e.map((t,i)=>p("option",{value:t.id,children:t.name},i))})}var tae=globalThis&&globalThis.__assign||function(){return tae=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},tae.apply(this,arguments)},NUe={onActivate:_n.func,onAddUndo:_n.func,onBeforeAddUndo:_n.func,onBeforeExecCommand:_n.func,onBeforeGetContent:_n.func,onBeforeRenderUI:_n.func,onBeforeSetContent:_n.func,onBeforePaste:_n.func,onBlur:_n.func,onChange:_n.func,onClearUndos:_n.func,onClick:_n.func,onContextMenu:_n.func,onCommentChange:_n.func,onCompositionEnd:_n.func,onCompositionStart:_n.func,onCompositionUpdate:_n.func,onCopy:_n.func,onCut:_n.func,onDblclick:_n.func,onDeactivate:_n.func,onDirty:_n.func,onDrag:_n.func,onDragDrop:_n.func,onDragEnd:_n.func,onDragGesture:_n.func,onDragOver:_n.func,onDrop:_n.func,onExecCommand:_n.func,onFocus:_n.func,onFocusIn:_n.func,onFocusOut:_n.func,onGetContent:_n.func,onHide:_n.func,onInit:_n.func,onInput:_n.func,onKeyDown:_n.func,onKeyPress:_n.func,onKeyUp:_n.func,onLoadContent:_n.func,onMouseDown:_n.func,onMouseEnter:_n.func,onMouseLeave:_n.func,onMouseMove:_n.func,onMouseOut:_n.func,onMouseOver:_n.func,onMouseUp:_n.func,onNodeChange:_n.func,onObjectResizeStart:_n.func,onObjectResized:_n.func,onObjectSelected:_n.func,onPaste:_n.func,onPostProcess:_n.func,onPostRender:_n.func,onPreProcess:_n.func,onProgressState:_n.func,onRedo:_n.func,onRemove:_n.func,onReset:_n.func,onSaveContent:_n.func,onSelectionChange:_n.func,onSetAttrib:_n.func,onSetContent:_n.func,onShow:_n.func,onSubmit:_n.func,onUndo:_n.func,onVisualAid:_n.func,onSkinLoadError:_n.func,onThemeLoadError:_n.func,onModelLoadError:_n.func,onPluginLoadError:_n.func,onIconsLoadError:_n.func,onLanguageLoadError:_n.func,onScriptsLoad:_n.func,onScriptsLoadError:_n.func},MKt=tae({apiKey:_n.string,licenseKey:_n.string,id:_n.string,inline:_n.bool,init:_n.object,initialValue:_n.string,onEditorChange:_n.func,value:_n.string,tagName:_n.string,cloudChannel:_n.string,plugins:_n.oneOfType([_n.string,_n.array]),toolbar:_n.oneOfType([_n.string,_n.array]),disabled:_n.bool,textareaName:_n.string,tinymceScriptSrc:_n.oneOfType([_n.string,_n.arrayOf(_n.string),_n.arrayOf(_n.shape({src:_n.string,async:_n.bool,defer:_n.bool}))]),rollback:_n.oneOfType([_n.number,_n.oneOf([!1])]),scriptLoading:_n.shape({async:_n.bool,defer:_n.bool,delay:_n.number})},NUe),GJ=function(n){return typeof n=="function"},kLe=function(n){return n in NUe},ILe=function(n){return n.substr(2)},FKt=function(n,e,t,i,r,o,s){var a=Object.keys(r).filter(kLe),l=Object.keys(o).filter(kLe),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=ILe(d),f=s[h];t(h,f),delete s[h]}),u.forEach(function(d){var h=i(n,d),f=ILe(d);s[f]=h,e(f,h)})},BKt=function(n,e,t,i,r){return FKt(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)},LLe=0,OUe=function(n){var e=Date.now(),t=Math.floor(Math.random()*1e9);return LLe++,n+"_"+t+LLe+String(e)},DLe=function(n){return n!==null&&(n.tagName.toLowerCase()==="textarea"||n.tagName.toLowerCase()==="input")},ALe=function(n){return typeof n>"u"||n===""?[]:Array.isArray(n)?n:n.split(" ")},$Kt=function(n,e){return ALe(n).concat(ALe(e))},VKt=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},HKt=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},RLe=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))},nae=globalThis&&globalThis.__assign||function(){return nae=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},nae.apply(this,arguments)},WKt=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)},zKt=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())},f=0,g=s;f<g.length;f++){var m=g[f],v=e[m.src];if(v)v.done?h(m.src,v.error):v.handlers.push(h);else{var _=OUe("tiny-");e[m.src]={id:_,src:m.src,done:!1,error:null,handlers:[h]},WKt(n,nae({id:_},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}},UKt=function(){var n=[],e=function(r){var o=n.find(function(s){return s.getDocument()===r});return o===void 0&&(o=zKt(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}},jKt=UKt(),KJ=function(n){var e=n;return e&&e.tinymce?e.tinymce:null},qKt=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)}}(),Z2=globalThis&&globalThis.__assign||function(){return Z2=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},Z2.apply(this,arguments)},GKt=function(n){qKt(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,GJ(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(!HKt(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=KJ(s.view);if(!h)throw new Error("tinymce should have been loaded into global scope");var f=Z2(Z2(Z2(Z2({},s.props.init),{selector:void 0,target:d,readonly:s.props.disabled,inline:s.inline,plugins:$Kt((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(g){s.editor=g,s.bindHandlers({}),s.inline&&!DLe(d)&&g.once("PostRender",function(m){g.setContent(s.getInitialValue(),{no_events:!0})}),s.props.init&&GJ(s.props.init.setup)&&s.props.init.setup(g)},init_instance_callback:function(g){var m,v,_=s.getInitialValue();s.currentContent=(m=s.currentContent)!==null&&m!==void 0?m:g.getContent(),s.currentContent!==_&&(s.currentContent=_,g.setContent(_),g.undoManager.clear(),g.undoManager.add(),g.setDirty(!1));var b=(v=s.props.disabled)!==null&&v!==void 0?v:!1;RLe(s.editor,b?"readonly":"design"),s.props.init&&GJ(s.props.init.init_instance_callback)&&s.props.init.init_instance_callback(g)}});s.inline||(d.style.visibility=""),DLe(d)&&(d.value=s.getInitialValue()),h.init(f)}},s.id=s.props.id||OUe("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;RLe(this.editor,a?"readonly":"design")}}},e.prototype.componentDidMount=function(){var t=this,i,r,o,s,a;if(KJ(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)};jKt.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=KJ(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 VKt()?"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){BKt(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=MKt,e.defaultProps={cloudChannel:"7"},e}(w.Component);function dd(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(An.debounce(l=>r(l),500)).current,s=l=>{t(l||""),o(l||"")},a=si();return O("div",{className:"space-y-4",style:{zIndex:0},children:[n.label&&p(pg,{children:n.label}),p(GKt,{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})]})}function KKt(){var l,c,u,d,h,f,g,m,v;const[n]=ve(),e=UBe(),t=Va(),i=zi(),r=Ti(),[,o]=us(Zq),s=Nc(_=>_.user.changes),a=(_,b)=>{i(Ak({property:_,value:b}))};return p(St,{children:s&&O(tn,{title:n("details"),children:[p(G,{leftSide:n("first_name"),children:p(Ze,{value:(s==null?void 0:s.first_name)||(t==null?void 0:t.first_name)||"",onValueChange:_=>a("first_name",_),errorMessage:(((l=e==null?void 0:e.errors)==null?void 0:l.first_name)??[])[0]})}),p(G,{leftSide:n("last_name"),children:p(Ze,{value:(s==null?void 0:s.last_name)||(t==null?void 0:t.last_name)||"",onValueChange:_=>a("last_name",_),errorMessage:(((c=e==null?void 0:e.errors)==null?void 0:c.last_name)??[])[0]})}),p(G,{leftSide:n("email"),children:p(Ze,{value:(s==null?void 0:s.email)||(t==null?void 0:t.email)||"",type:"email",onValueChange:_=>a("email",_),errorMessage:(((u=e==null?void 0:e.errors)==null?void 0:u.email)??[])[0]})}),p(G,{leftSide:n("language"),children:p(e6,{value:(s==null?void 0:s.language_id)||"",onChange:_=>{o(!0),a("language_id",_)},errorMessage:(((d=e==null?void 0:e.errors)==null?void 0:d.language_id)??[])[0],dismissable:!0})}),p(G,{leftSide:n("phone"),children:p(Ze,{value:(s==null?void 0:s.phone)||(t==null?void 0:t.phone)||"",onValueChange:_=>a("phone",_),errorMessage:(((h=e==null?void 0:e.errors)==null?void 0:h.phone)??[])[0]})}),p(G,{leftSide:n("signature"),children:p(dd,{value:(s==null?void 0:s.signature)||"",onChange:_=>a("signature",_)})}),((f=r==null?void 0:r.custom_fields)==null?void 0:f.user1)&&p(rs,{field:"user1",defaultValue:s.custom_value1,value:r.custom_fields.user1,onValueChange:_=>a("custom_value1",_)}),((g=r==null?void 0:r.custom_fields)==null?void 0:g.user2)&&p(rs,{field:"user2",defaultValue:s.custom_value2,value:r.custom_fields.user2,onValueChange:_=>a("custom_value2",_)}),((m=r==null?void 0:r.custom_fields)==null?void 0:m.user3)&&p(rs,{field:"user3",defaultValue:s.custom_value3,value:r.custom_fields.user3,onValueChange:_=>a("custom_value3",_)}),((v=r==null?void 0:r.custom_fields)==null?void 0:v.user4)&&p(rs,{field:"user4",defaultValue:s.custom_value4,value:r.custom_fields.user4,onValueChange:_=>a("custom_value4",_)})]})})}/**
* 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 YKt(){const[n]=ve();return[{key:"invoice_created",label:n("invoice_created")},{key:"invoice_sent",label:n("invoice_sent_notification_label")},{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 QKt(){var d,h,f;const[n]=ve(),e=zi(),t=YKt(),i=Nc(g=>g.user.changes),r=NF(),[o,s]=w.useState(""),a=g=>{s(g);const m=An.cloneDeep(i),v=g==="custom"?[]:[g];An.set(m,"company_user.notifications.email",v),e(kZ(m))},l=g=>{var m,v,_;return o==="all_notifications"?`${g}_all`:o==="all_user_notifications"?`${g}_user`:((_=(v=(m=i==null?void 0:i.company_user)==null?void 0:m.notifications)==null?void 0:v.email)==null?void 0:_.find(b=>b.startsWith(g)))||"none"},c=(g,m)=>{var C,E;const v=(E=(C=i==null?void 0:i.company_user)==null?void 0:C.notifications)==null?void 0:E.email,_=v.findIndex(x=>x.startsWith(g));let b=[...v];_>-1?m!=="none"?b=v.map((x,k)=>_===k?m:x):b=v.filter((x,k)=>_!==k):b=[...b,m];const y=An.cloneDeep(i);An.set(y,"company_user.notifications.email",b),e(kZ(y))},u=g=>{var b,y;let v=[...(y=(b=i==null?void 0:i.company_user)==null?void 0:b.notifications)==null?void 0:y.email];g?v.find(E=>E==="task_assigned")||(v=[...v,"task_assigned"]):v=v.filter(C=>C!=="task_assigned");const _=An.cloneDeep(i);An.set(_,"company_user.notifications.email",v),e(kZ(_))};return w.useEffect(()=>{var m,v;const g=(v=(m=i==null?void 0:i.company_user)==null?void 0:m.notifications)==null?void 0:v.email;g&&!o&&(g.includes("all_notifications")||g.includes("all_user_notifications")?s(g[0]):s("custom"))},[i]),O(tn,{title:n("notifications"),children:[p(G,{leftSide:n("login_notification"),leftSideHelp:n("login_notification_help"),children:p(kt,{checked:i==null?void 0:i.user_logged_in_notification,onChange:g=>r("user_logged_in_notification",g)})}),p(G,{className:"mb-4",leftSide:n("task_assigned_notification"),leftSideHelp:n("task_assigned_notification_help"),children:p(kt,{checked:!!((f=(h=(d=i==null?void 0:i.company_user)==null?void 0:d.notifications)==null?void 0:h.email)!=null&&f.find(g=>g==="task_assigned")),onChange:g=>u(g)})}),p(vi,{withoutPadding:!0}),p(G,{className:"my-4",leftSide:n("all_events"),children:O(En,{value:o,onValueChange:g=>a(g),children:[p("option",{value:"all_notifications",children:n("all_records")}),p("option",{value:"all_user_notifications",children:n("owned_by_user")}),p("option",{value:"custom",children:n("custom")})]})}),p(vi,{withoutPadding:!0}),p("div",{className:"flex flex-col",children:t.map((g,m)=>p(G,{className:"mt-0",leftSide:g.label,children:O(En,{value:l(g.key),onValueChange:v=>c(g.key,v),disabled:!!o&&o!=="custom",children:[p("option",{value:`${g.key}_all`,children:n("all_records")}),p("option",{value:`${g.key}_user`,children:n("owned_by_user")}),p("option",{value:"none",children:n("none")})]})},m))})]})}function XKt(){var s;const[n]=ve(),e=zi(),t=UBe(),i=Nc(a=>a.user.changes),[r,o]=w.useState(!1);return w.useEffect(()=>{r&&window.addEventListener("user.updated",()=>e(s1t()))},[r]),p(tn,{title:n("password"),children:p(G,{leftSide:n("new_password"),children:p(Ze,{type:"password",value:i.password||"",onValueChange:a=>{e(Ak({property:"password",value:a})),!r&&o(!0)},errorMessage:(s=t==null?void 0:t.errors)==null?void 0:s.password})})})}var cG={},PUe={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ZKt=PUe;function MUe(n){this.mode=ZKt.MODE_8BIT_BYTE,this.data=n}MUe.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 JKt=MUe,FUe={L:1,M:0,Q:3,H:2},t9=FUe;function pb(n,e){this.totalCount=n,this.dataCount=e}pb.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]];pb.getRSBlocks=function(n,e){var t=pb.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 pb(a,l));return r};pb.getRsBlockTable=function(n,e){switch(e){case t9.L:return pb.RS_BLOCK_TABLE[(n-1)*4+0];case t9.M:return pb.RS_BLOCK_TABLE[(n-1)*4+1];case t9.Q:return pb.RS_BLOCK_TABLE[(n-1)*4+2];case t9.H:return pb.RS_BLOCK_TABLE[(n-1)*4+3];default:return}};var eYt=pb;function BUe(){this.buffer=new Array,this.length=0}BUe.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 tYt=BUe,G_={glog:function(n){if(n<1)throw new Error("glog("+n+")");return G_.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return G_.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var fd=0;fd<8;fd++)G_.EXP_TABLE[fd]=1<<fd;for(var fd=8;fd<256;fd++)G_.EXP_TABLE[fd]=G_.EXP_TABLE[fd-4]^G_.EXP_TABLE[fd-5]^G_.EXP_TABLE[fd-6]^G_.EXP_TABLE[fd-8];for(var fd=0;fd<255;fd++)G_.LOG_TABLE[G_.EXP_TABLE[fd]]=fd;var $Ue=G_,RE=$Ue;function D$(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]}D$.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]^=RE.gexp(RE.glog(this.get(t))+RE.glog(n.get(i)));return new D$(e,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var e=RE.glog(this.get(0))-RE.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]^=RE.gexp(RE.glog(n.get(i))+e);return new D$(t,0).mod(n)}};var VUe=D$,Qg=PUe,NLe=VUe,nYt=$Ue,iC={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},sd={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;sd.getBCHDigit(e)-sd.getBCHDigit(sd.G15)>=0;)e^=sd.G15<<sd.getBCHDigit(e)-sd.getBCHDigit(sd.G15);return(n<<10|e)^sd.G15_MASK},getBCHTypeNumber:function(n){for(var e=n<<12;sd.getBCHDigit(e)-sd.getBCHDigit(sd.G18)>=0;)e^=sd.G18<<sd.getBCHDigit(e)-sd.getBCHDigit(sd.G18);return n<<12|e},getBCHDigit:function(n){for(var e=0;n!=0;)e++,n>>>=1;return e},getPatternPosition:function(n){return sd.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,e,t){switch(n){case iC.PATTERN000:return(e+t)%2==0;case iC.PATTERN001:return e%2==0;case iC.PATTERN010:return t%3==0;case iC.PATTERN011:return(e+t)%3==0;case iC.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case iC.PATTERN101:return e*t%2+e*t%3==0;case iC.PATTERN110:return(e*t%2+e*t%3)%2==0;case iC.PATTERN111:return(e*t%3+(e+t)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){for(var e=new NLe([1],0),t=0;t<n;t++)e=e.multiply(new NLe([1,nYt.gexp(t)],0));return e},getLengthInBits:function(n,e){if(1<=e&&e<10)switch(n){case Qg.MODE_NUMBER:return 10;case Qg.MODE_ALPHA_NUM:return 9;case Qg.MODE_8BIT_BYTE:return 8;case Qg.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(e<27)switch(n){case Qg.MODE_NUMBER:return 12;case Qg.MODE_ALPHA_NUM:return 11;case Qg.MODE_8BIT_BYTE:return 16;case Qg.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(e<41)switch(n){case Qg.MODE_NUMBER:return 14;case Qg.MODE_ALPHA_NUM:return 13;case Qg.MODE_8BIT_BYTE:return 16;case Qg.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}},iYt=sd,rYt=JKt,HUe=eYt,WUe=tYt,YS=iYt,oYt=VUe;function Db(n,e){this.typeNumber=n,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Ig=Db.prototype;Ig.addData=function(n){var e=new rYt(n);this.dataList.push(e),this.dataCache=null};Ig.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]};Ig.getModuleCount=function(){return this.moduleCount};Ig.make=function(){if(this.typeNumber<1){var n=1;for(n=1;n<40;n++){for(var e=HUe.getRSBlocks(n,this.errorCorrectLevel),t=new WUe,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(),YS.getLengthInBits(o.mode,n)),o.write(t)}if(t.getLengthInBits()<=i*8)break}this.typeNumber=n}this.makeImpl(!1,this.getBestMaskPattern())};Ig.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=Db.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};Ig.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)};Ig.getBestMaskPattern=function(){for(var n=0,e=0,t=0;t<8;t++){this.makeImpl(!0,t);var i=YS.getLostPoint(this);(t==0||n>i)&&(n=i,e=t)}return e};Ig.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};Ig.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)};Ig.setupPositionAdjustPattern=function(){for(var n=YS.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}};Ig.setupTypeNumber=function(n){for(var e=YS.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}};Ig.setupTypeInfo=function(n,e){for(var t=this.errorCorrectLevel<<3|e,i=YS.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};Ig.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=YS.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}}};Db.PAD0=236;Db.PAD1=17;Db.createData=function(n,e,t){for(var i=HUe.getRSBlocks(n,e),r=new WUe,o=0;o<t.length;o++){var s=t[o];r.put(s.mode,4),r.put(s.getLength(),YS.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(Db.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Db.PAD1,8);return Db.createBytes(r,i)};Db.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=YS.getErrorCorrectPolynomial(c),h=new oYt(o[a],d.getLength()-1),f=h.mod(d);s[a]=new Array(d.getLength()-1);for(var u=0;u<s[a].length;u++){var g=u+f.getLength()-s[a].length;s[a][u]=g>=0?f.get(g):0}}for(var m=0,u=0;u<e.length;u++)m+=e[u].totalCount;for(var v=new Array(m),_=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 v};var sYt=Db,pve={};Object.defineProperty(pve,"__esModule",{value:!0});var aYt=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},lYt=_n,Xg=UUe(lYt),zUe=w,n9=UUe(zUe);function UUe(n){return n&&n.__esModule?n:{default:n}}function cYt(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 uYt={bgColor:Xg.default.oneOfType([Xg.default.object,Xg.default.string]).isRequired,bgD:Xg.default.string.isRequired,fgColor:Xg.default.oneOfType([Xg.default.object,Xg.default.string]).isRequired,fgD:Xg.default.string.isRequired,size:Xg.default.number.isRequired,title:Xg.default.string,viewBoxSize:Xg.default.number.isRequired,xmlns:Xg.default.string},dYt={title:void 0,xmlns:"http://www.w3.org/2000/svg"},uG=(0,zUe.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=cYt(n,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize"]);return n9.default.createElement("svg",aYt({},c,{height:s,ref:e,viewBox:"0 0 "+l+" "+l,width:s}),a?n9.default.createElement("title",null,a):null,n9.default.createElement("path",{d:i,fill:t}),n9.default.createElement("path",{d:r,fill:o}))});uG.displayName="QRCodeSvg";uG.propTypes=uYt;uG.defaultProps=dYt;pve.default=uG;Object.defineProperty(cG,"__esModule",{value:!0});cG.QRCode=void 0;var hYt=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},fYt=sYt,pYt=t6(fYt),gYt=FUe,mYt=t6(gYt),_Yt=_n,G0=t6(_Yt),jUe=w,vYt=t6(jUe),bYt=pve,yYt=t6(bYt);function t6(n){return n&&n.__esModule?n:{default:n}}function CYt(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 wYt={bgColor:G0.default.oneOfType([G0.default.object,G0.default.string]),fgColor:G0.default.oneOfType([G0.default.object,G0.default.string]),level:G0.default.string,size:G0.default.number,value:G0.default.string.isRequired},SYt={bgColor:"#FFFFFF",fgColor:"#000000",level:"L",size:256},n6=(0,jUe.forwardRef)(function(n,e){var t=n.bgColor,i=n.fgColor,r=n.level,o=n.size,s=n.value,a=CYt(n,["bgColor","fgColor","level","size","value"]),l=new pYt.default(-1,mYt.default[r]);l.addData(s),l.make();var c=l.modules;return vYt.default.createElement(yYt.default,hYt({},a,{bgColor:t,bgD:c.map(function(u,d){return u.map(function(h,f){return h?"":"M "+f+" "+d+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:i,fgD:c.map(function(u,d){return u.map(function(h,f){return h?"M "+f+" "+d+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:e,size:o,viewBoxSize:c.length}))});cG.QRCode=n6;n6.displayName="QRCode";n6.propTypes=wYt;n6.defaultProps=SYt;var EYt=cG.default=n6;function xYt(n){const[e]=ve(),{resendSmsCode:t,verifyPhoneNumber:i,setVisible:r}=n,[o,s]=w.useState("");return p(Or,{title:e("sms_code"),visible:n.visible,onClose:()=>{r(!1),s("")},children:O("div",{children:[p("div",{className:"flex justify-end mb-1",children:p(un,{behavior:"button",type:"minimal",onClick:()=>s(""),children:e("clear")})}),p("div",{className:"flex justify-center",children:p(RWe,{value:o,onChange:s})}),O("div",{className:"flex justify-between mt-8",children:[p(un,{behavior:"button",type:"minimal",onClick:()=>{t(),s("")},children:e("resend_code")}),p(un,{behavior:"button",onClick:()=>i(o),disableWithoutIcon:!0,disabled:o.length!==6,children:e("verify")})]})]})})}function qUe(n){const[e]=ve(),t=Va(),i=zi(),{checkVerification:r,setCheckVerification:o,isDisableModalOpen:s,setIsDisableModalOpen:a,checkOnlyPhoneNumberVerification:l}=n,[c,u]=w.useState(!1),[d,h]=w.useState(!1),[f,g]=w.useState(""),[m,v]=w.useState(""),[_,b]=w.useState(""),[y,C]=w.useState(!1),[E,x]=w.useState(),k=()=>{he.processing(),$e("GET",Ae("/api/v1/settings/enable_two_factor")).then(B=>{he.dismiss(),g(B.data.data.qrCode),v(B.data.data.secret),u(!0)})},L=()=>{he.processing(),x(void 0),$e("POST",Ae("/api/v1/settings/enable_two_factor"),{secret:m,one_time_password:_}).then(B=>{he.success(B.data.message),i(qy(An.merge({},t,{google_2fa_secret:!0}))),u(!1)}).catch(B=>{var F;((F=B.response)==null?void 0:F.status)===422&&(x(B.response.data),he.dismiss())}).finally(()=>C(!1))},D=()=>{he.processing(),$e("POST",Ae("/api/v1/settings/disable_two_factor")).then(()=>{he.success("disabled_two_factor"),i(qy(An.merge({},t,{google_2fa_secret:!1}))),a==null||a(!1)})},A=()=>{he.processing(),$e("POST",Ae("/api/v1/sms_reset"),{email:t.email}).then(()=>{he.success("code_was_sent")})},N=B=>{he.processing(),$e("POST",Ae("/api/v1/sms_reset/confirm?validate_only=true"),{code:B,email:t.email}).then(()=>{he.success("verified_phone_number"),i(qy(An.merge({},t,{verified_phone_number:!0}))),h(!1),l||(k(),u(!0))})},P=()=>{k(),u(!0)};w.useEffect(()=>{r&&P()},[r]),w.useEffect(()=>{(!d||!c)&&o(!1)},[d,c]);const M=si();return O(St,{children:[p(xYt,{visible:d,setVisible:h,resendSmsCode:A,verifyPhoneNumber:N}),O(Or,{title:e("enable_two_factor"),visible:c,onClose:u,children:[O("div",{className:"flex flex-col items-center pb-8 space-y-4",children:[p(EYt,{size:156,value:f}),p("p",{className:"font-semibold",style:{backgroundColor:M.$2,color:M.$3,colorScheme:M.$0},children:m})]}),p(Ze,{id:"one_time_password",type:"text",label:e("one_time_password"),onValueChange:B=>b(B),errorMessage:E==null?void 0:E.errors.one_time_password}),p(un,{behavior:"button",disabled:y,onClick:L,children:e("continue")}),p(qi,{external:!0,to:"https://github.com/antonioribeiro/google2fa#google-authenticator-apps",children:e("learn_more")})]}),a&&typeof s=="boolean"&&p(Or,{title:e("disable_two_factor"),visible:s,onClose:a,children:p(un,{behavior:"button",disabled:y,onClick:D,children:e("confirm")})})]})}function TYt(){const[n]=ve(),e=Va(),[t,i]=w.useState(!1),[r,o]=w.useState(!1);return O(St,{children:[p(qUe,{checkVerification:r,setCheckVerification:o,isDisableModalOpen:t,setIsDisableModalOpen:i}),p(tn,{title:n("enable_two_factor"),children:O(G,{leftSide:"2FA",children:[!(e!=null&&e.google_2fa_secret)&&p(un,{behavior:"button",type:"minimal",onClick:()=>o(!0),children:n("enable")}),(e==null?void 0:e.google_2fa_secret)&&p(un,{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 Qm(){const n=Pc({overwrite:!1}),e=zi();return(t,i)=>{const[r]=i.split("|");if(r===""){const o=An.cloneDeep(n);return o&&delete o.custom_fields[t],e(AT({object:"company",data:o}))}e(go({object:"company",property:`custom_fields.${t}`,value:i}))}}function gve(n){const[e]=ve(),t=Va(),i=fve(),{isAdmin:r}=Fo();return p(St,{children:i&&O("div",{className:n.className,children:[!r&&p(Fs,{className:"mb-4",type:"warning",disableClosing:!0,children:O("div",{className:"flex items-center space-x-1",children:[p(qD,{fontSize:18}),O("span",{children:[e("not_allowed"),"."]})]})}),r&&p(Fs,{className:"mb-4",type:"warning",disableClosing:!0,children:O("div",{className:"flex items-center justify-between",children:[O("p",{className:"inline-flex items-center space-x-1",children:[p(qD,{fontSize:18}),O("span",{children:[e("upgrade_to_paid_plan"),"."]})]}),(t==null?void 0:t.company_user)&&p(qi,{to:t.company_user.ninja_portal_url||At("/settings/account_management"),className:"ml-10",external:!0,children:e("plan_change")})]})})]})})}function kYt(){const[n]=ve(),e=Ti(),t=Qm();return O(St,{children:[p(gve,{}),p(tn,{title:n("custom_fields"),children:e&&["user1","user2","user3","user4"].map(i=>p(Zf,{initialValue:e.custom_fields[i],field:i,placeholder:n("user_field"),onChange:r=>t(i,r)},i))})]})}function IYt(n){return Hn({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 LYt(n){return Hn({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 QS(){const n=I1({overwrite:!1}),[e]=ve(),[t,i]=w.useState(!1),[r,o]=w.useState(null),s=zi(),a=(h,f)=>s(Ak({property:`company_user.react_settings.${h}`,value:f})),{getState:l}=G6e(),c=async({silent:h})=>{!h&&he.processing(),$e("PUT",Ae(`/api/v1/company_users/${n==null?void 0:n.id}/preferences?include=company_user`),{react_settings:l().user.changes.company_user.react_settings}).then(f=>{!h&&he.success("updated_user"),In(["company_users"]),s(qy(f.data.data)),s(Zpe()),i(!1)}).catch(f=>{var g;h&&he.dismiss(),((g=f.response)==null?void 0:g.status)===412&&o(f.response.data)})},u=w.useMemo(()=>({children:h})=>O(St,{children:[O(Or,{visible:t,onClose:i,title:e("preferences"),overflowVisible:!0,children:[h,p(un,{onClick:c,children:e("save")})]}),p(un,{type:"minimal",onClick:()=>i(!0),noBackgroundColor:!0,children:p(LYt,{})})]}),[t,r]),d=_l();return{Preferences:u,update:a,preferences:d.preferences,save:c}}/*!
* currency.js - v2.0.4
* http://scurker.github.io/currency.js
*
* Copyright (c) 2021 Jason Wilson
* Released under MIT license
*/var DYt={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:OYt,fromCents:!1},GUe=function(e){return Math.round(e)},mve=function(e){return Math.pow(10,e)},AYt=function(e,t){return GUe(e/t)*t},RYt=/(\d)(?=(\d{3})+\b)/g,NYt=/(\d)(?=(\d\d)+\d\b)/g;function V_(n,e){var t=this;if(!(t instanceof V_))return new V_(n,e);var i=Object.assign({},DYt,e),r=mve(i.precision),o=A$(n,i);t.intValue=o,t.value=o/r,i.increment=i.increment||1/r,i.useVedic?i.groups=NYt:i.groups=RYt,this.s=i,this.p=r}function A$(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=mve(s),c=typeof n=="number",u=n instanceof V_;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?GUe(i):i}function OYt(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:""))}V_.prototype={add:function(e){var t=this.intValue,i=this.s,r=this.p;return V_((t+=A$(e,i))/(i.fromCents?1:r),i)},subtract:function(e){var t=this.intValue,i=this.s,r=this.p;return V_((t-=A$(e,i))/(i.fromCents?1:r),i)},multiply:function(e){var t=this.intValue,i=this.s;return V_((t*=e)/(i.fromCents?1:mve(i.precision)),i)},divide:function(e){var t=this.intValue,i=this.s;return V_(t/=A$(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=V_(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 AYt(e/t,i.increment).toFixed(i.precision)},toJSON:function(){return this.value}};function KUe(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}var e3;(function(n){n.event="event",n.props="prop"})(e3||(e3={}));function $C(){}function PYt(n){var e,t=void 0;return function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e&&i.length===e.length&&i.every(function(o,s){return o===e[s]})||(e=i,t=n.apply(void 0,i)),t}}function t3(n){return!!(n||"").match(/\d/)}function UL(n){return n==null}function MYt(n){return typeof n=="number"&&isNaN(n)}function YUe(n){return UL(n)||MYt(n)||typeof n=="number"&&!isFinite(n)}function QUe(n){return n.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function FYt(n){switch(n){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function BYt(n,e,t){var i=FYt(t),r=n.search(/[1-9]/);return r=r===-1?n.length:r,n.substring(0,r)+n.substring(r,n.length).replace(i,"$1"+e)}function $Yt(n){var e=w.useRef(n);e.current=n;var t=w.useRef(function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e.current.apply(e,i)});return t.current}function _ve(n,e){e===void 0&&(e=!0);var t=n[0]==="-",i=t&&e;n=n.replace("-","");var r=n.split("."),o=r[0],s=r[1]||"";return{beforeDecimal:o,afterDecimal:s,hasNegation:t,addNegation:i}}function VYt(n){if(!n)return n;var e=n[0]==="-";e&&(n=n.substring(1,n.length));var t=n.split("."),i=t[0].replace(/^0+/,"")||"0",r=t[1]||"";return(e?"-":"")+i+(r?"."+r:"")}function XUe(n,e,t){for(var i="",r=t?"0":"",o=0;o<=e-1;o++)i+=n[o]||r;return i}function OLe(n,e){return Array(e+1).join(n)}function ZUe(n){var e=n+"",t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var i=e.split(/[eE]/g),r=i[0],o=i[1];if(o=Number(o),!o)return t+r;r=r.replace(".","");var s=1+o,a=r.length;return s<0?r="0."+OLe("0",Math.abs(s))+r:s>=a?r=r+OLe("0",s-a):r=(r.substring(0,s)||"0")+"."+r.substring(s),t+r}function PLe(n,e,t){if(["","-"].indexOf(n)!==-1)return n;var i=(n.indexOf(".")!==-1||t)&&e,r=_ve(n),o=r.beforeDecimal,s=r.afterDecimal,a=r.hasNegation,l=parseFloat("0."+(s||"0")),c=s.length<=e?"0."+s:l.toFixed(e),u=c.split("."),d=o;o&&Number(u[0])&&(d=o.split("").reverse().reduce(function(m,v,_){return m.length>_?(Number(m[0])+Number(v)).toString()+m.substring(1,m.length):v+m},u[0]));var h=XUe(u[1]||"",e,t),f=a?"-":"",g=i?".":"";return""+f+d+g+h}function px(n,e){if(n.value=n.value,n!==null){if(n.createTextRange){var t=n.createTextRange();return t.move("character",e),t.select(),!0}return n.selectionStart||n.selectionStart===0?(n.focus(),n.setSelectionRange(e,e),!0):(n.focus(),!1)}}var JUe=PYt(function(n,e){for(var t=0,i=0,r=n.length,o=e.length;n[t]===e[t]&&t<r;)t++;for(;n[r-1-i]===e[o-1-i]&&o-i>t&&r-i>t;)i++;return{from:{start:t,end:r-i},to:{start:t,end:o-i}}}),HYt=function(n,e){var t=Math.min(n.selectionStart,e);return{from:{start:t,end:n.selectionEnd},to:{start:t,end:e}}};function WYt(n,e,t){return Math.min(Math.max(n,e),t)}function YJ(n){return Math.max(n.selectionStart,n.selectionEnd)}function zYt(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function UYt(n){return{from:{start:0,end:0},to:{start:0,end:n.length},lastValue:""}}function jYt(n){var e=n.currentValue,t=n.formattedValue,i=n.currentValueIndex,r=n.formattedValueIndex;return e[i]===t[r]}function qYt(n,e,t,i,r,o,s){s===void 0&&(s=jYt);var a=r.findIndex(function(C){return C}),l=n.slice(0,a);!e&&!t.startsWith(l)&&(e=l,t=l+t,i=i+l.length);for(var c=t.length,u=n.length,d={},h=new Array(c),f=0;f<c;f++){h[f]=-1;for(var g=0,m=u;g<m;g++){var v=s({currentValue:t,lastValue:e,formattedValue:n,currentValueIndex:f,formattedValueIndex:g});if(v&&d[g]!==!0){h[f]=g,d[g]=!0;break}}}for(var _=i;_<c&&(h[_]===-1||!o(t[_]));)_++;var b=_===c||h[_]===-1?u:h[_];for(_=i-1;_>0&&h[_]===-1;)_--;var y=_===-1||h[_]===-1?0:h[_]+1;return y>b?b:i-y<b-i?y:b}function MLe(n,e,t,i){var r=n.length;if(e=WYt(e,0,r),i==="left"){for(;e>=0&&!t[e];)e--;e===-1&&(e=t.indexOf(!0))}else{for(;e<=r&&!t[e];)e++;e>r&&(e=t.lastIndexOf(!0))}return e===-1&&(e=r),e}function GYt(n){for(var e=Array.from({length:n.length+1}).map(function(){return!0}),t=0,i=e.length;t<i;t++)e[t]=!!(t3(n[t])||t3(n[t-1]));return e}function eje(n,e,t,i,r,o){o===void 0&&(o=$C);var s=$Yt(function(g,m){var v,_;return YUe(g)?(_="",v=""):typeof g=="number"||m?(_=typeof g=="number"?ZUe(g):g,v=i(_)):(_=r(g,void 0),v=i(_)),{formattedValue:v,numAsString:_}}),a=w.useState(function(){return s(UL(n)?e:n,t)}),l=a[0],c=a[1],u=function(g,m){g.formattedValue!==l.formattedValue&&c({formattedValue:g.formattedValue,numAsString:g.value}),o(g,m)},d=n,h=t;UL(n)&&(d=l.numAsString,h=!0);var f=s(d,h);return w.useMemo(function(){c(f)},[f.formattedValue]),[l,u]}function KYt(n){return n.replace(/[^0-9]/g,"")}function YYt(n){return n}function QYt(n){var e=n.type;e===void 0&&(e="text");var t=n.displayType;t===void 0&&(t="input");var i=n.customInput,r=n.renderText,o=n.getInputRef,s=n.format;s===void 0&&(s=YYt);var a=n.removeFormatting;a===void 0&&(a=KYt);var l=n.defaultValue,c=n.valueIsNumericString,u=n.onValueChange,d=n.isAllowed,h=n.onChange;h===void 0&&(h=$C);var f=n.onKeyDown;f===void 0&&(f=$C);var g=n.onMouseUp;g===void 0&&(g=$C);var m=n.onFocus;m===void 0&&(m=$C);var v=n.onBlur;v===void 0&&(v=$C);var _=n.value,b=n.getCaretBoundary;b===void 0&&(b=GYt);var y=n.isValidInputCharacter;y===void 0&&(y=t3);var C=n.isCharacterSame,E=KUe(n,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),x=eje(_,l,!!c,s,a,u),k=x[0],L=k.formattedValue,D=k.numAsString,A=x[1],N=w.useRef(),P=w.useRef({formattedValue:L,numAsString:D}),M=function(Et,mt){P.current={formattedValue:Et.formattedValue,numAsString:Et.value},A(Et,mt)},B=w.useState(!1),F=B[0],U=B[1],H=w.useRef(null),W=w.useRef({setCaretTimeout:null,focusTimeout:null});w.useEffect(function(){return U(!0),function(){clearTimeout(W.current.setCaretTimeout),clearTimeout(W.current.focusTimeout)}},[]);var q=s,V=function(Et,mt){var Lt=parseFloat(mt);return{formattedValue:Et,value:mt,floatValue:isNaN(Lt)?void 0:Lt}},re=function(Et,mt,Lt){Et.selectionStart===0&&Et.selectionEnd===Et.value.length||(px(Et,mt),W.current.setCaretTimeout=setTimeout(function(){Et.value===Lt&&Et.selectionStart!==mt&&px(Et,mt)},0))},oe=function(Et,mt,Lt){return MLe(Et,mt,b(Et),Lt)},Q=function(Et,mt,Lt){var be=b(mt),Te=qYt(mt,L,Et,Lt,be,y,C);return Te=MLe(mt,Te,be),Te},Ne=function(Et){var mt=Et.formattedValue;mt===void 0&&(mt="");var Lt=Et.input,be=Et.source,Te=Et.event,se=Et.numAsString,Y;if(Lt){var X=Et.inputValue||Lt.value,le=YJ(Lt);Lt.value=mt,Y=Q(X,mt,le),Y!==void 0&&re(Lt,Y,mt)}mt!==L&&M(V(mt,se),{event:Te,source:be})};w.useEffect(function(){var Et=P.current,mt=Et.formattedValue,Lt=Et.numAsString;(L!==mt||D!==Lt)&&M(V(L,D),{event:void 0,source:e3.props})},[L,D]);var Ve=H.current?YJ(H.current):void 0,Ye=typeof window<"u"?w.useLayoutEffect:w.useEffect;Ye(function(){var Et=H.current;if(L!==P.current.formattedValue&&Et){var mt=Q(P.current.formattedValue,L,Ve);Et.value=L,re(Et,mt,L)}},[L]);var ye=function(Et,mt,Lt){var be=mt.target,Te=N.current?HYt(N.current,be.selectionEnd):JUe(L,Et),se=Object.assign(Object.assign({},Te),{lastValue:L}),Y=a(Et,se),X=q(Y);if(Y=a(X,void 0),d&&!d(V(X,Y))){var le=mt.target,te=YJ(le),me=Q(Et,L,te);return le.value=L,re(le,me,L),!1}return Ne({formattedValue:X,numAsString:Y,inputValue:Et,event:mt,source:Lt,input:mt.target}),!0},He=function(Et,mt){mt===void 0&&(mt=0);var Lt=Et.selectionStart,be=Et.selectionEnd;N.current={selectionStart:Lt,selectionEnd:be+mt}},Pe=function(Et){var mt=Et.target,Lt=mt.value,be=ye(Lt,Et,e3.event);be&&h(Et),N.current=void 0},Ge=function(Et){var mt=Et.target,Lt=Et.key,be=mt.selectionStart,Te=mt.selectionEnd,se=mt.value;se===void 0&&(se="");var Y;Lt==="ArrowLeft"||Lt==="Backspace"?Y=Math.max(be-1,0):Lt==="ArrowRight"?Y=Math.min(be+1,se.length):Lt==="Delete"&&(Y=be);var X=0;Lt==="Delete"&&be===Te&&(X=1);var le=Lt==="ArrowLeft"||Lt==="ArrowRight";if(Y===void 0||be!==Te&&!le){f(Et),He(mt,X);return}var te=Y;if(le){var me=Lt==="ArrowLeft"?"left":"right";te=oe(se,Y,me),te!==Y&&Et.preventDefault()}else Lt==="Delete"&&!y(se[Y])?te=oe(se,Y,"right"):Lt==="Backspace"&&!y(se[Y])&&(te=oe(se,Y,"left"));te!==Y&&re(mt,te,se),f(Et),He(mt,X)},Fe=function(Et){var mt=Et.target,Lt=function(){var be=mt.selectionStart,Te=mt.selectionEnd,se=mt.value;if(se===void 0&&(se=""),be===Te){var Y=oe(se,be);Y!==be&&re(mt,Y,se)}};Lt(),requestAnimationFrame(function(){Lt()}),g(Et),He(mt)},bt=function(Et){Et.persist&&Et.persist();var mt=Et.target,Lt=Et.currentTarget;H.current=mt,W.current.focusTimeout=setTimeout(function(){var be=mt.selectionStart,Te=mt.selectionEnd,se=mt.value;se===void 0&&(se="");var Y=oe(se,be);Y!==be&&!(be===0&&Te===se.length)&&re(mt,Y,se),m(Object.assign(Object.assign({},Et),{currentTarget:Lt}))},0)},Mt=function(Et){H.current=null,clearTimeout(W.current.focusTimeout),clearTimeout(W.current.setCaretTimeout),v(Et)},Ft=F&&zYt()?"numeric":void 0,Yt=Object.assign({inputMode:Ft},E,{type:e,value:L,onChange:Pe,onKeyDown:Ge,onMouseUp:Fe,onFocus:bt,onBlur:Mt});if(t==="text")return r?ce.createElement(ce.Fragment,null,r(L,E)||null):ce.createElement("span",Object.assign({},E,{ref:o}),L);if(i){var ln=i;return ce.createElement(ln,Object.assign({},Yt,{ref:o}))}return ce.createElement("input",Object.assign({},Yt,{ref:o}))}function iae(n,e){var t=e.decimalScale,i=e.fixedDecimalScale,r=e.prefix;r===void 0&&(r="");var o=e.suffix;o===void 0&&(o="");var s=e.allowNegative,a=e.thousandsGroupStyle;if(a===void 0&&(a="thousand"),n===""||n==="-")return n;var l=dG(e),c=l.thousandSeparator,u=l.decimalSeparator,d=t!==0&&n.indexOf(".")!==-1||t&&i,h=_ve(n,s),f=h.beforeDecimal,g=h.afterDecimal,m=h.addNegation;return t!==void 0&&(g=XUe(g,t,!!i)),c&&(f=BYt(f,c,a)),r&&(f=r+f),o&&(g=g+o),m&&(f="-"+f),n=f+(d&&u||"")+g,n}function dG(n){var e=n.decimalSeparator;e===void 0&&(e=".");var t=n.thousandSeparator,i=n.allowedDecimalSeparators;return t===!0&&(t=","),i||(i=[e,"."]),{decimalSeparator:e,thousandSeparator:t,allowedDecimalSeparators:i}}function XYt(n,e){n===void 0&&(n="");var t=new RegExp("(-)"),i=new RegExp("(-)(.)*(-)"),r=t.test(n),o=i.test(n);return n=n.replace(/-/g,""),r&&!o&&e&&(n="-"+n),n}function ZYt(n,e){return new RegExp("(^-)|[0-9]|"+QUe(n),e?"g":void 0)}function JYt(n,e,t){return n===""?!0:!(e!=null&&e.match(/\d/))&&!(t!=null&&t.match(/\d/))&&typeof n=="string"&&!isNaN(Number(n))}function eQt(n,e,t){var i;e===void 0&&(e=UYt(n));var r=t.allowNegative,o=t.prefix;o===void 0&&(o="");var s=t.suffix;s===void 0&&(s="");var a=t.decimalScale,l=e.from,c=e.to,u=c.start,d=c.end,h=dG(t),f=h.allowedDecimalSeparators,g=h.decimalSeparator,m=n[d]===g;if(t3(n)&&(n===o||n===s)&&e.lastValue==="")return n;if(d-u===1&&f.indexOf(n[u])!==-1){var v=a===0?"":g;n=n.substring(0,u)+v+n.substring(u+1,n.length)}var _=function(H,W,q){var V=!1,re=!1;o.startsWith("-")?V=!1:H.startsWith("--")?(V=!1,re=!0):s.startsWith("-")&&H.length===s.length?V=!1:H[0]==="-"&&(V=!0);var oe=V?1:0;return re&&(oe=2),oe&&(H=H.substring(oe),W-=oe,q-=oe),{value:H,start:W,end:q,hasNegation:V}},b=_(n,u,d),y=b.hasNegation;i=b,n=i.value,u=i.start,d=i.end;var C=_(e.lastValue,l.start,l.end),E=C.start,x=C.end,k=C.value,L=n.substring(u,d);n.length&&k.length&&(E>k.length-s.length||x<o.length)&&!(L&&s.startsWith(L))&&(n=k);var D=0;n.startsWith(o)?D+=o.length:u<o.length&&(D=u),n=n.substring(D),d-=D;var A=n.length,N=n.length-s.length;n.endsWith(s)?A=N:(d>N||d>n.length-s.length)&&(A=d),n=n.substring(0,A),n=XYt(y?"-"+n:n,r),n=(n.match(ZYt(g,!0))||[]).join("");var P=n.indexOf(g);n=n.replace(new RegExp(QUe(g),"g"),function(H,W){return W===P?".":""});var M=_ve(n,r),B=M.beforeDecimal,F=M.afterDecimal,U=M.addNegation;return c.end-c.start<l.end-l.start&&B===""&&m&&!parseFloat(F)&&(n=U?"-":""),n}function tQt(n,e){var t=e.prefix;t===void 0&&(t="");var i=e.suffix;i===void 0&&(i="");var r=Array.from({length:n.length+1}).map(function(){return!0}),o=n[0]==="-";r.fill(!1,0,t.length+(o?1:0));var s=n.length;return r.fill(!1,s-i.length+1,s+1),r}function nQt(n){var e=dG(n),t=e.thousandSeparator,i=e.decimalSeparator,r=n.prefix;r===void 0&&(r="");var o=n.allowNegative;if(o===void 0&&(o=!0),t===i)throw new Error(`
Decimal separator can't be same as thousand separator.
thousandSeparator: `+t+` (thousandSeparator = {true} is same as thousandSeparator = ",")
decimalSeparator: `+i+` (default value for decimalSeparator is .)
`);return r.startsWith("-")&&o&&(console.error(`
Prefix can't start with '-' when allowNegative is true.
prefix: `+r+`
allowNegative: `+o+`
`),o=!1),Object.assign(Object.assign({},n),{allowNegative:o})}function iQt(n){n=nQt(n),n.decimalSeparator,n.allowedDecimalSeparators,n.thousandsGroupStyle;var e=n.suffix,t=n.allowNegative,i=n.allowLeadingZeros,r=n.onKeyDown;r===void 0&&(r=$C);var o=n.onBlur;o===void 0&&(o=$C);var s=n.thousandSeparator,a=n.decimalScale,l=n.fixedDecimalScale,c=n.prefix;c===void 0&&(c="");var u=n.defaultValue,d=n.value,h=n.valueIsNumericString,f=n.onValueChange,g=KUe(n,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),m=dG(n),v=m.decimalSeparator,_=m.allowedDecimalSeparators,b=function(U){return iae(U,n)},y=function(U,H){return eQt(U,H,n)},C=UL(d)?u:d,E=h??JYt(C,c,e);UL(d)?UL(u)||(E=E||typeof u=="number"):E=E||typeof d=="number";var x=function(U){return YUe(U)?U:(typeof U=="number"&&(U=ZUe(U)),E&&typeof a=="number"?PLe(U,a,!!l):U)},k=eje(x(d),x(u),!!E,b,y,f),L=k[0],D=L.numAsString,A=L.formattedValue,N=k[1],P=function(U){var H=U.target,W=U.key,q=H.selectionStart,V=H.selectionEnd,re=H.value;if(re===void 0&&(re=""),(W==="Backspace"||W==="Delete")&&V<c.length){U.preventDefault();return}if(q!==V){r(U);return}W==="Backspace"&&re[0]==="-"&&q===c.length+1&&t&&px(H,1),a&&l&&(W==="Backspace"&&re[q-1]===v?(px(H,q-1),U.preventDefault()):W==="Delete"&&re[q]===v&&U.preventDefault()),_!=null&&_.includes(W)&&re[q]===v&&px(H,q+1);var oe=s===!0?",":s;W==="Backspace"&&re[q-1]===oe&&px(H,q-1),W==="Delete"&&re[q]===oe&&px(H,q+1),r(U)},M=function(U){var H=D;if(H.match(/\d/g)||(H=""),i||(H=VYt(H)),l&&a&&(H=PLe(H,a,l)),H!==D){var W=iae(H,n);N({formattedValue:W,value:H,floatValue:parseFloat(H)},{event:U,source:e3.event})}o(U)},B=function(U){return U===v?!0:t3(U)},F=function(U){var H=U.currentValue,W=U.lastValue,q=U.formattedValue,V=U.currentValueIndex,re=U.formattedValueIndex,oe=H[V],Q=q[re],Ne=JUe(W,H),Ve=Ne.to,Ye=function(ye){return y(ye).indexOf(".")+c.length};return d===0&&l&&a&&H[Ve.start]===v&&Ye(H)<V&&Ye(q)>re?!1:V>=Ve.start&&V<Ve.end&&_&&_.includes(oe)&&Q===v?!0:oe===Q};return Object.assign(Object.assign({},g),{value:A,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:F,onValueChange:N,format:b,removeFormatting:y,getCaretBoundary:function(U){return tQt(U,n)},onKeyDown:P,onBlur:M})}function rQt(n){var e=iQt(n);return ce.createElement(QYt,Object.assign({},e))}function mo(n){const e=si(),t=Ti(),i=_l({overwrite:!1}),[r,o]=w.useState(typeof n.value=="number"?n.value:n.value?parseFloat(String(n.value)):void 0),s=()=>{if(n.precision!==0)return t!=null&&t.use_comma_as_decimal_place?",":"."},a=c=>{var d,h;const u=s();if(u===void 0)return 0;if(n.disablePrecision&&c)return c.includes(u)?((h=(d=c.split(u))==null?void 0:d[1])==null?void 0:h.length)||2:void 0;if(!n.disablePrecision)return typeof n.precision=="number"?n.precision:i!=null&&i.number_precision&&(i==null?void 0:i.number_precision)>0&&(i==null?void 0:i.number_precision)<=100?i.number_precision:2},l=()=>{if(n.precision!==0)return t!=null&&t.use_comma_as_decimal_place?".":","};return YD(()=>{n.onValueChange&&n.changeOverride&&n.onValueChange(typeof r=="number"?String(r):"0")},500,[r]),w.useEffect(()=>{o(n.value?parseFloat(String(n.value)):void 0)},[n.value]),O("section",{children:[n.label&&O(pg,{className:zt("mb-2",{"whitespace-nowrap":n.withoutLabelWrapping}),for:n.id,children:[n.label,n.required&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),p("div",{className:"relative",children:p(rQt,{className:zt(`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}),value:r||"",placeholder:n.placeholder??void 0,onChange:c=>{if(n.onValueChange&&n.changeOverride){const u=c.target.value,d=u?V_(u,{separator:l(),decimal:s(),symbol:"",precision:a(u)===void 0?0:a(u)}).value:void 0;o(d)}},onBlur:c=>{if(n.onValueChange&&!n.changeOverride){const u=c.target.value,d=u?String(V_(u,{separator:l(),decimal:s(),symbol:"",precision:a(u)===void 0?0:a(u)}).value):"0";n.onValueChange(d)}},thousandSeparator:l(),decimalSeparator:s(),decimalScale:a(),allowNegative:!0,style:{backgroundColor:e.$1,borderColor:e.$5,color:e.$3,...n.style},disabled:n.disabled})}),n.errorMessage&&p(Fs,{className:"mt-2",type:"danger",children:n.errorMessage})]})}function oQt(){const[n]=ve(),e=zi(),t=_l(),i=(r,o)=>{e(Ak({property:r,value:o}))};return O("div",{className:"space-y-4",children:[O(tn,{title:n("preferences"),children:[p(G,{leftSide:n("show_pdf_preview"),children:p(kt,{checked:typeof t.show_pdf_preview=="boolean"?t.show_pdf_preview:!0,onValueChange:r=>i("company_user.react_settings.show_pdf_preview",r)})}),p(G,{leftSide:n("show_document_preview"),children:p(kt,{checked:!!t.show_document_preview,onValueChange:r=>i("company_user.react_settings.show_document_preview",r)})}),p(G,{leftSide:n("react_notification_link"),leftSideHelp:n("react_notification_link_help"),children:p(kt,{checked:t.react_notification_link,onValueChange:r=>i("company_user.react_settings.react_notification_link",r)})}),p(G,{leftSide:n("number_precision"),leftSideHelp:n("number_precision_help"),children:p(mo,{precision:0,value:(t==null?void 0:t.number_precision)||"",onValueChange:r=>i("company_user.react_settings.number_precision",Number(r)),placeholder:n("number_precision"),disablePrecision:!0})}),p(G,{leftSide:n("dark_mode"),children:p(kt,{checked:!!(t!=null&&t.dark_mode),onChange:r=>i("company_user.react_settings.dark_mode",r)})}),p(G,{leftSide:n("show_table_footer"),leftSideHelp:n("show_table_footer_help"),children:p(kt,{checked:!!(t!=null&&t.show_table_footer),onValueChange:r=>i("company_user.react_settings.show_table_footer",r)})}),p(G,{leftSide:n("auto_expand_product_table_notes"),leftSideHelp:n("auto_expand_product_table_notes_help"),children:p(kt,{checked:!!t.preferences.auto_expand_product_table_notes,onValueChange:r=>i("company_user.react_settings.preferences.auto_expand_product_table_notes",r)})}),p(i3t,{})]}),O(QJ,{title:`${n("dashboard")} ${n("charts")}`,path:"dashboard_charts",children:[p(cO,{path:"dashboard_charts.default_view"}),p(cO,{path:"dashboard_charts.currency"}),p(cO,{path:"dashboard_charts.range"})]}),p(QJ,{title:n("datatable"),path:"datatables",children:p(cO,{path:"datatables.clients.sort"})}),p(QJ,{title:n("reports"),path:"reports",children:p(cO,{path:"reports.columns"})})]})}function QJ({title:n,children:e,path:t}){const{preferences:i}=QS();return JSON.stringify(An.get(wH,t))===JSON.stringify(An.get(i,t))?null:p(tn,{title:n,children:e})}function cO({path:n}){const{preferences:e,update:t}=QS(),{t:i}=ve(),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 An.get(wH,n)===An.get(e,n)?null:p(Nl,{onClick:()=>t(`preferences.${n}`,An.get(wH,n)),children:O(Q4,{className:"space-x-2",children:[p("div",{children:r[n]}),p(qm,{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 sQt(){const{t:n}=ve();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 aQt(){Mi("user_details");const[n]=ve(),e=sQt(),[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]=us(Zq),c=Va(),u=zi(),d=Pc(),h=Wi(ap),[f,g]=w.useState(!1),m=Nc(y=>y.user),{isAdmin:v}=Fo(),{save:_}=QS(),b=(y,C)=>{he.processing(),i(void 0);const E=[$e("PUT",Ae("/api/v1/users/:id?include=company_user",{id:c.id}),m.changes,{headers:{"X-Api-Password":y}})];v&&E.push($e("PUT",Ae("/api/v1/companies/:id",{id:d==null?void 0:d.id}),d)),vBe.all(E).then(x=>{he.success("updated_settings"),In(["users"]),a&&(In(["statics"]),l(!1)),x[0].data.data.phone!==(c==null?void 0:c.phone)&&(c!=null&&c.google_2fa_secret)&&!x[0].data.data.verified_phone_number&&o(!0),u(qy(x[0].data.data)),window.dispatchEvent(new CustomEvent("user.updated")),v&&u(US({object:"company",data:x[1].data.data}))}).catch(x=>{var k,L;((k=x.response)==null?void 0:k.status)===412&&(he.error("password_error_incorrect"),h(0)),((L=x.response)==null?void 0:L.status)==422&&(he.dismiss(),i(x.response.data))}),_({silent:!0})};return w.useEffect(()=>{u(Zpe())},[c]),O(St,{children:[O(sr,{onSaveClick:()=>g(!0),onCancelClick:()=>u(r1t()),title:n("user_details"),breadcrumbs:s,docsLink:"en/basic-settings/#user_details",children:[p(Tg,{show:f,onClose:g,onSave:b}),p(KS,{tabs:e,className:"mt-6"}),p("div",{className:"my-4",children:p(sp,{context:t})})]}),p(qUe,{checkVerification:r,setCheckVerification:o,checkOnlyPhoneNumberVerification:!0})]})}function lQt(){var g,m;const[n]=ve(),e=Zi(),t=zi(),[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 _;const v=Object.keys(((_=e==null?void 0:e.settings)==null?void 0:_.translations)??[]);c(a.filter(b=>!v.includes(b.property)))},[e]);const u=v=>{const _=a.find(b=>b.property===v);return _?_.translation:n(v)},d=v=>{var b;const _=An.cloneDeep(e);(((b=_.settings.translations)==null?void 0:b.length)<=1||!_.settings.translations)&&(_.settings.translations={}),_.settings.translations[v]="",t(AT({object:"company",data:_}))},h=v=>t(go({object:"company",property:v.target.id,value:v.target.value})),f=v=>{var b;const _=An.cloneDeep(e);(b=_==null?void 0:_.settings)==null||delete b.translations[v],t(AT({object:"company",data:_}))};return O(St,{children:[O(Or,{title:n("add_custom"),visible:i,onClose:r,children:[p(Ze,{onChange:v=>s(v.target.value),id:"custom_field",label:n("custom_field")}),p(un,{onClick:()=>{d(o),s(""),r(!1)},children:n("submit")}),p(qi,{external:!0,to:"https://github.com/invoiceninja/invoiceninja/blob/master/resources/lang/en/texts.php",children:n("labels")})]}),O(tn,{title:n("custom_labels"),onFormSubmit:v=>v.preventDefault(),children:[p(G,{leftSide:O(En,{onChange:v=>d(v.target.value),defaultValue:"",children:[p("option",{value:""}),l.map(v=>p("option",{value:v.property,children:v.translation},v.property))]}),children:p(un,{behavior:"button",type:"minimal",onClick:()=>r(!0),children:n("add_custom")})}),Object.keys(((g=e==null?void 0:e.settings)==null?void 0:g.translations)??[]).length>0&&p(vi,{}),Object.keys(((m=e==null?void 0:e.settings)==null?void 0:m.translations)??[]).map(v=>{var _;return p(G,{leftSide:u(v),children:O("div",{className:"flex items-center space-x-4",children:[p(Ze,{value:((_=e==null?void 0:e.settings)==null?void 0:_.translations[v])||"",onChange:h,id:`settings.translations.${v}`}),p(qm,{className:"cursor-pointer",onClick:()=>f(v)})]})},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 tje(){const n=zi();return e=>{n(go({object:"company",property:e.target.id,value:e.target.value}))}}function Bo(){const n=zi();return(e,t)=>{n(go({object:"company",property:e,value:t}))}}function Ht(n){const{propertyKey:e,defaultValue:t="",onCheckboxChange:i}=n,{isCompanySettingsActive:r}=$s(),o=Zi(),s=Bo(),[a,l]=w.useState(typeof(o==null?void 0:o.settings[e])<"u"),c=u=>{l(u);const d=An.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]),O("div",{className:"flex items-center",children:[!r&&p(Oh,{checked:a,onValueChange:(u,d)=>{l(!!d),i==null||i(!!d)}}),p("div",{className:zt({"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 pa(){const n=Zi(),{isCompanySettingsActive:e}=$s();return t=>n&&typeof n.settings[t]>"u"&&!e}function Wt(n){const{label:e,helpLabel:t,required:i}=n,r=si();return O("div",{className:"flex flex-col text-sm",children:[O("span",{className:"font-medium",style:{color:r.$3},children:[e,i&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),t&&p(St,{children:typeof t=="string"?p("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:t},style:{color:r.$3,opacity:.8}}):p("div",{className:"text-xs",style:{color:r.$3,opacity:.8},children: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 vve(){const{data:n}=ph(),[e,t]=w.useState([]);return w.useEffect(()=>{n!=null&&n.currencies&&t(n.currencies)},[n]),e}function sA(n){const e=vve();return p(A1,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,children:e.map((t,i)=>O("option",{value:t.id,children:[t.name," (",t.code,")"]},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
*/function rae(n,e=0,t=".",i=","){const r=typeof n=="string"?parseFloat(n):n,o=r<0?"-":"",s=Math.abs(r).toFixed(e).toString().split("."),a=s[0],l=s[1]||"",c=[];for(let d=a.length;d>0;d-=3)c.unshift(a.substring(Math.max(0,d-3),d));const u=c.join(i);return o+u+(l?t+l:"")}/**
* 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 bve=class{static formatValue(e,t){const i=t.thousand_separator,r=t.decimal_separator,o=t.precision;return rae(e,o,r,i)}static formatMoney(e,t,i,r){var h,f;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),((f=i.decimal_separator)==null?void 0:f.length)>=1&&(s=i.decimal_separator),i.swap_currency_symbol&&(a=i.swap_currency_symbol);const u=rae(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 yve(){const{data:n}=ph(),[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 $R(){const n=yve();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
*/function XS(n){const e=vve(),{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 ef(){const n=$R(),e=XS(),t=Ti();return(i,r,o,s,a)=>{const l=r||(t==null?void 0:t.settings.country_id),c=o&&o!=="999"?o:t==null?void 0:t.settings.currency_id,u=n(l),d=e(c);return u&&d?bve.formatMoney(isNaN(Number(i))?0:i,d,u,{showCurrencyCode:a??t.settings.show_currency_code}):s?Number(i).toFixed(s):i}}function cQt(){var h,f,g,m,v,_,b;const[n]=ve(),{data:e}=ph(),t=Pc(),{isCompanySettingsActive:i}=$s(),r=zi(),o=ef(),s=tje(),a=pa(),l=Bo(),c=Gi(Bs),u=Wi(Zq),d=[{id:"symbol",title:`${n("currency_symbol")}: ${o(1e3,t==null?void 0:t.settings.country_id,t==null?void 0:t.settings.currency_id,2)}`,value:"false"},{id:"code",title:`${n("currency_code")}: ${o(1e3,t==null?void 0:t.settings.country_id,t==null?void 0:t.settings.currency_id,2,!0)}`,value:"true"}];return p(St,{children:O(tn,{title:n("settings"),children:[p(G,{leftSide:p(Ht,{propertyKey:"currency_id",labelElement:p(Wt,{label:n("currency")}),defaultValue:"1"}),children:p(sA,{value:(t==null?void 0:t.settings.currency_id)||"",onChange:y=>l("settings.currency_id",y),disabled:a("currency_id"),errorMessage:c==null?void 0:c.errors["settings.currency_id"]})}),p(G,{leftSide:p(Ht,{propertyKey:"show_currency_code",labelElement:p(Wt,{label:n("currency_format")}),defaultValue:"false"}),children:p(A7e,{onValueChange:y=>r(go({object:"company",property:"settings.show_currency_code",value:y==="true"})),name:"show_currency_code",options:d,defaultSelected:((f=(h=t==null?void 0:t.settings)==null?void 0:h.show_currency_code)==null?void 0:f.toString())??"false",disabled:a("show_currency_code")})}),!d1()&&p(G,{leftSide:p(Ht,{propertyKey:"language_id",labelElement:p(Wt,{label:n("language")}),defaultValue:"1"}),children:p(e6,{onChange:y=>{u(!0),l("settings.language_id",y)},value:((g=t==null?void 0:t.settings)==null?void 0:g.language_id)||"",disabled:a("language_id"),errorMessage:c==null?void 0:c.errors["settings.language_id"]})}),p(G,{leftSide:p(Ht,{propertyKey:"timezone_id",labelElement:p(Wt,{label:n("timezone")}),defaultValue:"1"}),children:p(A1,{value:((m=t==null?void 0:t.settings)==null?void 0:m.timezone_id)||"1",disabled:a("timezone_id"),errorMessage:c==null?void 0:c.errors["settings.timezone_id"],onValueChange:y=>l("settings.timezone_id",y),children:e==null?void 0:e.timezones.sort((y,C)=>y.name.localeCompare(C.name)).map(y=>p("option",{value:y.id,children:y.name},y.id))})}),p(G,{leftSide:p(Ht,{propertyKey:"date_format_id",labelElement:p(Wt,{label:n("date_format")}),defaultValue:"1"}),children:p(En,{onChange:s,id:"settings.date_format_id",value:((v=t==null?void 0:t.settings)==null?void 0:v.date_format_id)||"1",disabled:a("date_format_id"),errorMessage:c==null?void 0:c.errors["settings.date_format_id"],children:e==null?void 0:e.date_formats.map(y=>p("option",{value:y.id,children:Un().format(y.format_moment)},y.id))})}),p(G,{leftSide:p(Ht,{propertyKey:"military_time",labelElement:p(Wt,{label:n("military_time")}),defaultValue:!1}),children:p(kt,{checked:!!((_=t==null?void 0:t.settings)!=null&&_.military_time),onChange:y=>r(go({object:"company",property:"settings.military_time",value:y})),disabled:a("military_time"),cypressRef:"militaryTimeToggle"})}),p(G,{leftSide:p(Ht,{propertyKey:"enable_rappen_rounding",labelElement:p(Wt,{label:n("rappen_rounding")}),defaultValue:!1}),children:p(kt,{checked:!!((b=t==null?void 0:t.settings)!=null&&b.enable_rappen_rounding),onChange:y=>r(go({object:"company",property:"settings.enable_rappen_rounding",value:y})),disabled:a("enable_rappen_rounding")})}),i&&p(G,{leftSide:n("decimal_comma"),leftSideHelp:n("use_comma_as_decimal_place"),children:p(kt,{checked:!!(t!=null&&t.use_comma_as_decimal_place),onChange:y=>l("use_comma_as_decimal_place",y)})}),i&&p(vi,{}),i&&p(G,{leftSide:n("first_month_of_the_year"),children:O(En,{id:"first_month_of_year",value:(t==null?void 0:t.first_month_of_year)||"1",onChange:s,errorMessage:c==null?void 0:c.errors["settings.first_month_of_year"],children:[p("option",{value:"1",children:n("january")}),p("option",{value:"2",children:n("february")}),p("option",{value:"3",children:n("march")}),p("option",{value:"4",children:n("april")}),p("option",{value:"5",children:n("may")}),p("option",{value:"6",children:n("june")}),p("option",{value:"7",children:n("july")}),p("option",{value:"8",children:n("august")}),p("option",{value:"9",children:n("september")}),p("option",{value:"10",children:n("october")}),p("option",{value:"11",children:n("november")}),p("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 uQt(){const[n]=ve(),{isGroupSettingsActive:e,isClientSettingsActive:t}=$s();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 dQt(){const[n]=ve();Mi("localization");const e=uQt(),t=[{name:n("settings"),href:"/settings"},{name:n("localization"),href:"/settings/localization"}],i=xu(),r=lp();return O(sr,{onSaveClick:i,onCancelClick:r,title:n("localization"),breadcrumbs:t,docsLink:"en/basic-settings/#localization",children:[p(KS,{tabs:e,className:"mt-6"}),p("div",{className:"my-4",children:p(sp,{})})]})}const hQt={variant:"generic"};function _r(n){n={...hQt,...n};const e=Ss(),t={...n.style};return n.variant==="primary"&&(t.backgroundColor=t.backgroundColor||e,t.color="white"),p("span",{style:t,className:zt("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 $m(n){const[e]=ve(),t=Tr(n.entity);return t===nr.Active?p(_r,{variant:"primary",children:e("active")}):t===nr.Archived?p(_r,{variant:"yellow",children:e("archived")}):t===nr.Deleted?p(_r,{variant:"red",children:e("deleted")}):p(St,{})}const fQt={totalPages:1,currentPage:1,currentPerPage:"10",onPageChange:n=>n,onRowsChange:n=>n,totalRecords:0};function nje(n){n={...fQt,...n};const[e]=ve(),t=r=>{r>=1&&r<=n.totalPages&&n.onPageChange(r)},i=si();return O("div",{className:"flex items-center justify-between space-x-2 my-3 overflow-y-auto pb-2",children:[p("div",{className:"flex justify-center md:justify-start items-center space-x-4",children:O("div",{className:"flex items-center space-x-2 flex-wrap",children:[O(En,{value:n.currentPerPage,onValueChange:r=>n.onRowsChange(r),children:[p("option",{value:"10",children:"10"}),p("option",{value:"50",children:"50"}),p("option",{value:"100",children:"100"})]}),p("label",{htmlFor:"location",className:"block text-sm font-medium",style:{color:i.$3},children:e("rows")})]})}),O("p",{className:"hidden lg:block text-sm font-medium",style:{color:i.$3},children:[Ca("pdf_page_info",{current:n.currentPage,total:n.totalPages}),".",n.totalRecords&&O("span",{className:"ml-1",children:[e("total_results"),": ",n.totalRecords]})]}),O("nav",{className:"flex justify-center md:justify-end my-4 md:my-0 items-center",style:{color:i.$3},children:[n.leftSideChevrons,p("button",{onClick:()=>t(1),className:"py-1.5 px-2 border rounded-l",style:{backgroundColor:i.$1,borderColor:i.$5},children:p(Z1t,{})}),p("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:p(Q8e,{})}),p("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:p(Xj,{})}),p("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:p(tm,{})})]})]})}function ZS(n){var f,g;const{onVerticalOverflowChange:e}=n,[t,i]=w.useState(),[r,o]=w.useState(),[s,a]=w.useState((f=n.style)==null?void 0:f.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)},[(g=n.style)==null?void 0:g.height]),w.useEffect(()=>{!l&&e&&a("auto")},[l]);const h=si();return p("div",{className:zt("flex flex-col",{"mt-2":!n.withoutPadding}),children:p("div",{className:zt("align-middle inline-block min-w-full",{"py-1.5":!n.withoutPadding}),children:p("div",{className:zt("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:p("div",{ref:u,className:`overflow-y-auto rounded ${n.className}`,style:{...n.style,height:s},children:p("table",{ref:d,className:"min-w-full table-auto",children:n.children})})})})})}function JS(n){const[e]=ve();return O("tbody",{style:n.style,ref:n.innerRef,children:[!n.data&&n.showHelperPlaceholders&&p(wc,{children:p(To,{colSpan:20,children:p(ds,{})})}),n.data&&n.showHelperPlaceholders&&n.data.data.meta.pagination.total===0&&p(wc,{children:p(To,{colSpan:20,children:p("p",{children:e("empty_table")})})}),n.children]})}function To(n){const{customizeTextColor:e}=n,t=FF(),i=si(),r=Ss(),{red:o,green:s,blue:a,hex:l}=DR(r),c=MF(o,s,a)?-220:220;return p("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 pQt={isCurrentlyUsed:!1};function Ma(n){n={...pQt,...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=si();return p("th",{style:{color:n.textColor||r.$9,borderColor:r.$4},onClick:i,className:zt(`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:O("div",{className:`flex items-center space-x-1 ${n.childrenClassName}`,children:[p("span",{children:n.children}),n.onColumnClick&&O("div",{className:"flex items-center",children:[p(X8e,{className:zt("opacity-25",{"opacity-100":e==="asc"&&n.isCurrentlyUsed}),size:16}),p(bR,{className:zt("opacity-25",{"opacity-100":e==="desc"&&n.isCurrentlyUsed}),size:16})]})]})})}function eE(n){const{backgroundColor:e}=n,t=Ss();return p("thead",{style:{backgroundColor:e||t},children:p("tr",{children:n.children})})}function wc(n){const{onClick:e,innerRef:t,backgroundColor:i,...r}=n,o=si();return p("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:zt(`${n.className}`,{"cursor-pointer":e}),tabIndex:n.tabIndex,children:n.children})}function gQt(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 ije(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&&gQt(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 mQt(n,e){return ije(function(){return n},e)}var os=ije,tr=mQt,_Qt="Invariant failed";function vQt(n,e){if(!n)throw new Error(_Qt)}var ev=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},Cve=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},FLe=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},bQt=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},XJ={top:0,right:0,bottom:0,left:0},wve=function(e){var t=e.borderBox,i=e.margin,r=i===void 0?XJ:i,o=e.border,s=o===void 0?XJ:o,a=e.padding,l=a===void 0?XJ:a,c=ev(Cve(t,r)),u=ev(FLe(t,s)),d=ev(FLe(u,l));return{marginBox:c,borderBox:ev(t),paddingBox:u,contentBox:d,margin:r,border:s,padding:l}},Zg=function(e){var t=e.slice(0,-2),i=e.slice(-2);if(i!=="px")return 0;var r=Number(t);return isNaN(r)&&vQt(!1),r},yQt=function(){return{x:window.pageXOffset,y:window.pageYOffset}},bW=function(e,t){var i=e.borderBox,r=e.border,o=e.margin,s=e.padding,a=bQt(i,t);return wve({borderBox:a,border:r,margin:o,padding:s})},yW=function(e,t){return t===void 0&&(t=yQt()),bW(e,t)},rje=function(e,t){var i={top:Zg(t.marginTop),right:Zg(t.marginRight),bottom:Zg(t.marginBottom),left:Zg(t.marginLeft)},r={top:Zg(t.paddingTop),right:Zg(t.paddingRight),bottom:Zg(t.paddingBottom),left:Zg(t.paddingLeft)},o={top:Zg(t.borderTopWidth),right:Zg(t.borderRightWidth),bottom:Zg(t.borderBottomWidth),left:Zg(t.borderLeftWidth)};return wve({borderBox:e,margin:i,padding:r,border:o})},oje=function(e){var t=e.getBoundingClientRect(),i=window.getComputedStyle(e);return rje(t,i)},CQt=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 n3=CQt;function sje(n,e){}sje.bind(null,"warn");sje.bind(null,"error");function Lw(){}function wQt(n,e){return{...n,...e}}function fm(n,e,t){const i=e.map(r=>{const o=wQt(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 SQt="Invariant failed";class CW extends Error{}CW.prototype.toString=function(){return this.message};function Zn(n,e){if(!n)throw new CW(SQt)}class EQt extends ce.Component{constructor(){super(...arguments),this.callbacks=null,this.unbind=Lw,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof CW&&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=fm(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof CW){this.setState({});return}throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const xQt=`
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
`,wW=n=>n+1,TQt=n=>`
You have lifted an item in position ${wW(n.source.index)}
`,aje=(n,e)=>{const t=n.droppableId===e.droppableId,i=wW(n.index),r=wW(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}
`},lje=(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}
`,kQt=n=>{const e=n.destination;if(e)return aje(n.source,e);const t=n.combine;return t?lje(n.draggableId,n.source,t):"You are over an area that cannot be dropped on"},BLe=n=>`
The item has returned to its starting position
of ${wW(n.index)}
`,IQt=n=>{if(n.reason==="CANCEL")return`
Movement cancelled.
${BLe(n.source)}
`;const e=n.destination,t=n.combine;return e?`
You have dropped the item.
${aje(n.source,e)}
`:t?`
You have dropped the item.
${lje(n.draggableId,n.source,t)}
`:`
The item has been dropped while not over a drop area.
${BLe(n.source)}
`},LQt={dragHandleUsageInstructions:xQt,onDragStart:TQt,onDragUpdate:kQt,onDragEnd:IQt};var R$=LQt;const Qu={x:0,y:0},Sd=(n,e)=>({x:n.x+e.x,y:n.y+e.y}),Yp=(n,e)=>({x:n.x-e.x,y:n.y-e.y}),Dw=(n,e)=>n.x===e.x&&n.y===e.y,VR=n=>({x:n.x!==0?-n.x:0,y:n.y!==0?-n.y:0}),HT=function(n,e,t){return t===void 0&&(t=0),n==="x"?{x:e,y:t}:{x:t,y:e}},i3=(n,e)=>Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2),$Le=(n,e)=>Math.min(...e.map(t=>i3(n,t))),cje=n=>e=>({x:n(e.x),y:n(e.y)});var DQt=(n,e)=>{const t=ev({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 i6=(n,e)=>({top:n.top+e.y,left:n.left+e.x,bottom:n.bottom+e.y,right:n.right+e.x}),VLe=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}],AQt={top:0,right:0,bottom:0,left:0},RQt=(n,e)=>e?i6(n,e.scroll.diff.displacement):n,NQt=(n,e,t)=>t&&t.increasedBy?{...n,[e.end]:n[e.end]+t.increasedBy[e.line]}:n,OQt=(n,e)=>e&&e.shouldClipSubject?DQt(e.pageMarginBox,n):ev(n);var aA=n=>{let{page:e,withPlaceholder:t,axis:i,frame:r}=n;const o=RQt(e.marginBox,r),s=NQt(o,i,t),a=OQt(s,r);return{page:e,withPlaceholder:t,active:a}},Sve=(n,e)=>{n.frame||Zn(!1);const t=n.frame,i=Yp(e,t.scroll.initial),r=VR(i),o={...t,scroll:{initial:t.scroll.initial,current:e,diff:{value:i,displacement:r},max:t.scroll.max}},s=aA({page:n.subject.page,withPlaceholder:n.subject.withPlaceholder,axis:n.axis,frame:o});return{...n,frame:o,subject:s}};const uje=bu(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),dje=bu(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),hG=bu(n=>Object.values(n)),PQt=bu(n=>Object.values(n));var HR=bu((n,e)=>PQt(e).filter(i=>n===i.descriptor.droppableId).sort((i,r)=>i.descriptor.index-r.descriptor.index));function Eve(n){return n.at&&n.at.type==="REORDER"?n.at.destination:null}function fG(n){return n.at&&n.at.type==="COMBINE"?n.at.combine:null}var pG=bu((n,e)=>e.filter(t=>t.descriptor.id!==n.descriptor.id)),MQt=n=>{let{isMovingForward:e,draggable:t,destination:i,insideDestination:r,previousImpact:o}=n;if(!i.isCombineEnabled||!Eve(o))return null;function a(g){const m={type:"COMBINE",combine:{draggableId:g,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=pG(t,r);if(!c){if(!u.length)return null;const g=u[u.length-1];return a(g.descriptor.id)}const d=u.findIndex(g=>g.descriptor.id===c);d===-1&&Zn(!1);const h=d-1;if(h<0)return null;const f=u[h];return a(f.descriptor.id)},WR=(n,e)=>n.descriptor.droppableId===e.descriptor.id;const hje={point:Qu,value:0},r3={invisible:{},visible:{},all:[]},FQt={displaced:r3,displacedBy:hje,at:null};var BQt=FQt,Sm=(n,e)=>t=>n<=t&&t<=e,fje=n=>{const e=Sm(n.top,n.bottom),t=Sm(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}},$Qt=n=>{const e=Sm(n.top,n.bottom),t=Sm(n.left,n.right);return i=>e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right)};const xve={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},pje={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var VQt=n=>e=>{const t=Sm(e.top,e.bottom),i=Sm(e.left,e.right);return r=>n===xve?t(r.top)&&t(r.bottom):i(r.left)&&i(r.right)};const HQt=(n,e)=>{const t=e.frame?e.frame.scroll.diff.displacement:Qu;return i6(n,t)},WQt=(n,e,t)=>e.subject.active?t(e.subject.active)(n):!1,zQt=(n,e,t)=>t(e)(n),Tve=n=>{let{target:e,destination:t,viewport:i,withDroppableDisplacement:r,isVisibleThroughFrameFn:o}=n;const s=r?HQt(e,t):e;return WQt(s,t,o)&&zQt(s,i,o)},UQt=n=>Tve({...n,isVisibleThroughFrameFn:fje}),gje=n=>Tve({...n,isVisibleThroughFrameFn:$Qt}),jQt=n=>Tve({...n,isVisibleThroughFrameFn:VQt(n.destination.axis)}),qQt=(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 GQt(n,e){const t=n.page.marginBox,i={top:e.point.y,right:0,bottom:0,left:e.point.x};return ev(Cve(t,i))}function o3(n){let{afterDragging:e,destination:t,displacedBy:i,viewport:r,forceShouldAnimate:o,last:s}=n;return e.reduce(function(l,c){const u=GQt(c,i),d=c.descriptor.id;if(l.all.push(d),!UQt({target:u,destination:t,viewport:r,withDroppableDisplacement:!0}))return l.invisible[c.descriptor.id]=!0,l;const f=qQt(d,s,o),g={draggableId:d,shouldAnimate:f};return l.visible[d]=g,l},{all:[],visible:{},invisible:{}})}function KQt(n,e){if(!n.length)return 0;const t=n[n.length-1].descriptor.index;return e.inHomeList?t:t+1}function HLe(n){let{insideDestination:e,inHomeList:t,displacedBy:i,destination:r}=n;const o=KQt(e,{inHomeList:t});return{displaced:r3,displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function SW(n){let{draggable:e,insideDestination:t,destination:i,viewport:r,displacedBy:o,last:s,index:a,forceShouldAnimate:l}=n;const c=WR(e,i);if(a==null)return HLe({insideDestination:t,inHomeList:c,displacedBy:o,destination:i});const u=t.find(m=>m.descriptor.index===a);if(!u)return HLe({insideDestination:t,inHomeList:c,displacedBy:o,destination:i});const d=pG(e,t),h=t.indexOf(u),f=d.slice(h);return{displaced:o3({afterDragging:f,destination:i,displacedBy:o,last:s,viewport:r.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:a}}}}function dS(n,e){return!!e.effected[n]}var YQt=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 dS(s,o)?e?l:l-1:e?l+1:l},QQt=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},XQt=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||Zn(!1),u.type==="REORDER"){const h=QQt({isMovingForward:e,isInHomeList:t,location:u.destination,insideDestination:s});return h==null?null:SW({draggable:i,insideDestination:s,destination:o,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:h})}const d=YQt({isMovingForward:e,destination:o,displaced:a.displaced,draggables:r,combine:u.combine,afterCritical:c});return d==null?null:SW({draggable:i,insideDestination:s,destination:o,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:d})},ZQt=n=>{let{displaced:e,afterCritical:t,combineWith:i,displacedBy:r}=n;const o=!!(e.visible[i]||e.invisible[i]);return dS(i,t)?o?Qu:VR(r.point):o?r.point:Qu},JQt=n=>{let{afterCritical:e,impact:t,draggables:i}=n;const r=fG(t);r||Zn(!1);const o=r.draggableId,s=i[o].page.borderBox.center,a=ZQt({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return Sd(s,a)};const mje=(n,e)=>e.margin[n.start]+e.borderBox[n.size]/2,eXt=(n,e)=>e.margin[n.end]+e.borderBox[n.size]/2,kve=(n,e,t)=>e[n.crossAxisStart]+t.margin[n.crossAxisStart]+t.borderBox[n.crossAxisSize]/2,WLe=n=>{let{axis:e,moveRelativeTo:t,isMoving:i}=n;return HT(e.line,t.marginBox[e.end]+mje(e,i),kve(e,t.marginBox,i))},zLe=n=>{let{axis:e,moveRelativeTo:t,isMoving:i}=n;return HT(e.line,t.marginBox[e.start]-eXt(e,i),kve(e,t.marginBox,i))},tXt=n=>{let{axis:e,moveInto:t,isMoving:i}=n;return HT(e.line,t.contentBox[e.start]+mje(e,i),kve(e,t.contentBox,i))};var nXt=n=>{let{impact:e,draggable:t,draggables:i,droppable:r,afterCritical:o}=n;const s=HR(r.descriptor.id,i),a=t.page,l=r.axis;if(!s.length)return tXt({axis:l,moveInto:r.page,isMoving:a});const{displaced:c,displacedBy:u}=e,d=c.all[0];if(d){const f=i[d];if(dS(d,o))return zLe({axis:l,moveRelativeTo:f.page,isMoving:a});const g=bW(f.page,u.point);return zLe({axis:l,moveRelativeTo:g,isMoving:a})}const h=s[s.length-1];if(h.descriptor.id===t.descriptor.id)return a.borderBox.center;if(dS(h.descriptor.id,o)){const f=bW(h.page,VR(o.displacedBy.point));return WLe({axis:l,moveRelativeTo:f,isMoving:a})}return WLe({axis:l,moveRelativeTo:h.page,isMoving:a})},oae=(n,e)=>{const t=n.frame;return t?Sd(e,t.scroll.diff.displacement):e};const iXt=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"?nXt({impact:e,draggable:t,draggables:r,droppable:i,afterCritical:o}):JQt({impact:e,draggables:r,afterCritical:o})};var gG=n=>{const e=iXt(n),t=n.droppable;return t?oae(t,e):e},_je=(n,e)=>{const t=Yp(e,n.scroll.initial),i=VR(t);return{frame:ev({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 ULe(n,e){return n.map(t=>e[t])}function rXt(n,e){for(let t=0;t<e.length;t++){const i=e[t].visible[n];if(i)return i}return null}var oXt=n=>{let{impact:e,viewport:t,destination:i,draggables:r,maxScrollChange:o}=n;const s=_je(t,Sd(t.scroll.current,o)),a=i.frame?Sve(i,Sd(i.frame.scroll.current,o)):i,l=e.displaced,c=o3({afterDragging:ULe(l.all,r),destination:i,displacedBy:e.displacedBy,viewport:s.frame,last:l,forceShouldAnimate:!1}),u=o3({afterDragging:ULe(l.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:l,forceShouldAnimate:!1}),d={},h={},f=[l,c,u];return l.all.forEach(m=>{const v=rXt(m,f);if(v){h[m]=v;return}d[m]=!0}),{...e,displaced:{all:l.all,invisible:d,visible:h}}},sXt=(n,e)=>Sd(n.scroll.diff.displacement,e),Ive=n=>{let{pageBorderBoxCenter:e,draggable:t,viewport:i}=n;const r=sXt(i,e),o=Yp(r,t.page.borderBox.center);return Sd(t.client.borderBox.center,o)},vje=n=>{let{draggable:e,destination:t,newPageBorderBoxCenter:i,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:s=!1}=n;const a=Yp(i,e.page.borderBox.center),c={target:i6(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:r};return s?jQt(c):gje(c)},aXt=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=HR(i.descriptor.id,r),d=WR(t,i),h=MQt({isMovingForward:e,draggable:t,destination:i,insideDestination:u,previousImpact:o})||XQt({isMovingForward:e,isInHomeList:d,draggable:t,draggables:r,destination:i,insideDestination:u,previousImpact:o,viewport:s,afterCritical:c});if(!h)return null;const f=gG({impact:h,draggable:t,droppable:i,draggables:r,afterCritical:c});if(vje({draggable:t,destination:i,newPageBorderBoxCenter:f,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Ive({pageBorderBoxCenter:f,draggable:t,viewport:s}),impact:h,scrollJumpRequest:null};const m=Yp(f,a),v=oXt({impact:h,viewport:s,destination:i,draggables:r,maxScrollChange:m});return{clientSelection:l,impact:v,scrollJumpRequest:m}};const xh=n=>{const e=n.subject.active;return e||Zn(!1),e};var lXt=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=Sm(s[a.start],s[a.end]),c=hG(r).filter(d=>d!==i).filter(d=>d.isEnabled).filter(d=>!!d.subject.active).filter(d=>fje(o.frame)(xh(d))).filter(d=>{const h=xh(d);return e?s[a.crossAxisEnd]<h[a.crossAxisEnd]:h[a.crossAxisStart]<s[a.crossAxisStart]}).filter(d=>{const h=xh(d),f=Sm(h[a.start],h[a.end]);return l(h[a.start])||l(h[a.end])||f(s[a.start])||f(s[a.end])}).sort((d,h)=>{const f=xh(d)[a.crossAxisStart],g=xh(h)[a.crossAxisStart];return e?f-g:g-f}).filter((d,h,f)=>xh(d)[a.crossAxisStart]===xh(f[0])[a.crossAxisStart]);if(!c.length)return null;if(c.length===1)return c[0];const u=c.filter(d=>Sm(xh(d)[a.start],xh(d)[a.end])(t[a.line]));return u.length===1?u[0]:u.length>1?u.sort((d,h)=>xh(d)[a.start]-xh(h)[a.start])[0]:c.sort((d,h)=>{const f=$Le(t,VLe(xh(d))),g=$Le(t,VLe(xh(h)));return f!==g?f-g:xh(d)[a.start]-xh(h)[a.start]})[0]};const jLe=(n,e)=>{const t=n.page.borderBox.center;return dS(n.descriptor.id,e)?Yp(t,e.displacedBy.point):t},cXt=(n,e)=>{const t=n.page.borderBox;return dS(n.descriptor.id,e)?i6(t,VR(e.displacedBy.point)):t};var uXt=n=>{let{pageBorderBoxCenter:e,viewport:t,destination:i,insideDestination:r,afterCritical:o}=n;return r.filter(a=>gje({target:cXt(a,o),destination:i,viewport:t.frame,withDroppableDisplacement:!0})).sort((a,l)=>{const c=i3(e,oae(i,jLe(a,o))),u=i3(e,oae(i,jLe(l,o)));return c<u?-1:u<c?1:a.descriptor.index-l.descriptor.index})[0]||null},r6=bu(function(e,t){const i=t[e.line];return{value:i,point:HT(e.line,i)}});const dXt=(n,e,t)=>{const i=n.axis;if(n.descriptor.mode==="virtual")return HT(i.line,e[i.line]);const r=n.subject.page.contentBox[i.size],l=HR(n.descriptor.id,t).reduce((c,u)=>c+u.client.marginBox[i.size],0)+e[i.line]-r;return l<=0?null:HT(i.line,l)},bje=(n,e)=>({...n,scroll:{...n.scroll,max:e}}),yje=(n,e,t)=>{const i=n.frame;WR(e,n)&&Zn(!1),n.subject.withPlaceholder&&Zn(!1);const r=r6(n.axis,e.displaceBy).point,o=dXt(n,r,t),s={placeholderSize:r,increasedBy:o,oldFrameMaxScroll:n.frame?n.frame.scroll.max:null};if(!i){const u=aA({page:n.subject.page,withPlaceholder:s,axis:n.axis,frame:n.frame});return{...n,subject:u}}const a=o?Sd(i.scroll.max,o):i.scroll.max,l=bje(i,a),c=aA({page:n.subject.page,withPlaceholder:s,axis:n.axis,frame:l});return{...n,subject:c,frame:l}},hXt=n=>{const e=n.subject.withPlaceholder;e||Zn(!1);const t=n.frame;if(!t){const s=aA({page:n.subject.page,axis:n.axis,frame:null,withPlaceholder:null});return{...n,subject:s}}const i=e.oldFrameMaxScroll;i||Zn(!1);const r=bje(t,i),o=aA({page:n.subject.page,axis:n.axis,frame:r,withPlaceholder:null});return{...n,subject:o,frame:r}};var fXt=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:r3,displacedBy:hje,at:{type:"REORDER",destination:{droppableId:s.descriptor.id,index:0}}},f=gG({impact:h,draggable:r,droppable:s,draggables:o,afterCritical:l}),g=WR(r,s)?s:yje(s,r,o);return vje({draggable:r,destination:g,newPageBorderBoxCenter:f,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=r6(s.axis,r.displaceBy);return SW({draggable:r,insideDestination:i,destination:s,viewport:a,displacedBy:d,last:r3,index:u})},pXt=n=>{let{isMovingForward:e,previousPageBorderBoxCenter:t,draggable:i,isOver:r,draggables:o,droppables:s,viewport:a,afterCritical:l}=n;const c=lXt({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:s,viewport:a});if(!c)return null;const u=HR(c.descriptor.id,o),d=uXt({pageBorderBoxCenter:t,viewport:a,destination:c,insideDestination:u,afterCritical:l}),h=fXt({previousPageBorderBoxCenter:t,destination:c,draggable:i,draggables:o,moveRelativeTo:d,insideDestination:u,viewport:a,afterCritical:l});if(!h)return null;const f=gG({impact:h,draggable:i,droppable:c,draggables:o,afterCritical:l});return{clientSelection:Ive({pageBorderBoxCenter:f,draggable:i,viewport:a}),impact:h,scrollJumpRequest:null}},rg=n=>{const e=n.at;return e?e.type==="REORDER"?e.destination.droppableId:e.combine.droppableId:null};const gXt=(n,e)=>{const t=rg(n);return t?e[t]:null};var mXt=n=>{let{state:e,type:t}=n;const i=gXt(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:f}=e.dimensions;return l?aXt({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:s,draggables:h,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):pXt({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:s,draggables:h,droppables:f,viewport:e.viewport,afterCritical:e.afterCritical})};function tx(n){return n.phase==="DRAGGING"||n.phase==="COLLECTING"}function Cje(n){const e=Sm(n.top,n.bottom),t=Sm(n.left,n.right);return function(r){return e(r.y)&&t(r.x)}}function _Xt(n,e){return n.left<e.right&&n.right>e.left&&n.top<e.bottom&&n.bottom>e.top}function vXt(n){let{pageBorderBox:e,draggable:t,candidates:i}=n;const r=t.page.borderBox.center,o=i.map(s=>{const a=s.axis,l=HT(s.axis.line,e.center[a.line],s.page.borderBox.center[a.crossAxisLine]);return{id:s.descriptor.id,distance:i3(r,l)}}).sort((s,a)=>a.distance-s.distance);return o[0]?o[0].id:null}function bXt(n){let{pageBorderBox:e,draggable:t,droppables:i}=n;const r=hG(i).filter(o=>{if(!o.isEnabled)return!1;const s=o.subject.active;if(!s||!_Xt(e,s))return!1;if(Cje(s)(e.center))return!0;const a=o.axis,l=s.center[a.crossAxisLine],c=e[a.crossAxisStart],u=e[a.crossAxisEnd],d=Sm(s[a.crossAxisStart],s[a.crossAxisEnd]),h=d(c),f=d(u);return!h&&!f?!0:h?c<l:u>l});return r.length?r.length===1?r[0].descriptor.id:vXt({pageBorderBox:e,draggable:t,candidates:r}):null}const wje=(n,e)=>ev(i6(n,e));var yXt=(n,e)=>{const t=n.frame;return t?wje(e,t.scroll.diff.value):e};function Sje(n){let{displaced:e,id:t}=n;return!!(e.visible[t]||e.invisible[t])}function CXt(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 wXt=n=>{let{pageBorderBoxWithDroppableScroll:e,draggable:t,destination:i,insideDestination:r,last:o,viewport:s,afterCritical:a}=n;const l=i.axis,c=r6(i.axis,t.displaceBy),u=c.value,d=e[l.start],h=e[l.end],g=pG(t,r).find(v=>{const _=v.descriptor.id,b=v.page.borderBox.center[l.line],y=dS(_,a),C=Sje({displaced:o,id:_});return y?C?h<=b:d<b-u:C?h<=b+u:d<b})||null,m=CXt({draggable:t,closest:g,inHomeList:WR(t,i)});return SW({draggable:t,insideDestination:r,destination:i,viewport:s,last:o,displacedBy:c,index:m})};const SXt=4;var EXt=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=r6(r.axis,e.displaceBy),c=l.value,u=t[a.start],d=t[a.end],f=pG(e,o).find(m=>{const v=m.descriptor.id,_=m.page.borderBox,y=_[a.size]/SXt,C=dS(v,s),E=Sje({displaced:i.displaced,id:v});return C?E?d>_[a.start]+y&&d<_[a.end]-y:u>_[a.start]-c+y&&u<_[a.end]-c-y:E?d>_[a.start]+c+y&&d<_[a.end]+c-y:u>_[a.start]+y&&u<_[a.end]-y});return f?{displacedBy:l,displaced:i.displaced,at:{type:"COMBINE",combine:{draggableId:f.descriptor.id,droppableId:r.descriptor.id}}}:null},Eje=n=>{let{pageOffset:e,draggable:t,draggables:i,droppables:r,previousImpact:o,viewport:s,afterCritical:a}=n;const l=wje(t.page.borderBox,e),c=bXt({pageBorderBox:l,draggable:t,droppables:r});if(!c)return BQt;const u=r[c],d=HR(u.descriptor.id,i),h=yXt(u,l);return EXt({pageBorderBoxWithDroppableScroll:h,draggable:t,previousImpact:o,destination:u,insideDestination:d,afterCritical:a})||wXt({pageBorderBoxWithDroppableScroll:h,draggable:t,destination:u,insideDestination:d,last:o.displaced,viewport:s,afterCritical:a})},Lve=(n,e)=>({...n,[e.descriptor.id]:e});const xXt=n=>{let{previousImpact:e,impact:t,droppables:i}=n;const r=rg(e),o=rg(t);if(!r||r===o)return i;const s=i[r];if(!s.subject.withPlaceholder)return i;const a=hXt(s);return Lve(i,a)};var TXt=n=>{let{draggable:e,draggables:t,droppables:i,previousImpact:r,impact:o}=n;const s=xXt({previousImpact:r,impact:o,droppables:i}),a=rg(o);if(!a)return s;const l=i[a];if(WR(e,l)||l.subject.withPlaceholder)return s;const c=yje(l,e,t);return Lve(s,c)},gM=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=Yp(c,e.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:Sd(e.initial.client.borderBoxCenter,u)},h={selection:Sd(d.selection,a.scroll.current),borderBoxCenter:Sd(d.borderBoxCenter,a.scroll.current),offset:Sd(d.offset,a.scroll.diff.value)},f={client:d,page:h};if(e.phase==="COLLECTING")return{...e,dimensions:l,viewport:a,current:f};const g=l.draggables[e.critical.draggable.id],m=o||Eje({pageOffset:h.offset,draggable:g,draggables:l.draggables,droppables:l.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),v=TXt({draggable:g,impact:m,previousImpact:e.impact,draggables:l.draggables,droppables:l.droppables});return{...e,current:f,dimensions:{draggables:l.draggables,droppables:v},impact:m,viewport:a,scrollJumpRequest:s||null,forceShouldAnimate:s?!1:null}};function kXt(n,e){return n.map(t=>e[t])}var xje=n=>{let{impact:e,viewport:t,draggables:i,destination:r,forceShouldAnimate:o}=n;const s=e.displaced,a=kXt(s.all,i),l=o3({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:s});return{...e,displaced:l}},Tje=n=>{let{impact:e,draggable:t,droppable:i,draggables:r,viewport:o,afterCritical:s}=n;const a=gG({impact:e,draggable:t,draggables:r,droppable:i,afterCritical:s});return Ive({pageBorderBoxCenter:a,draggable:t,viewport:o})},kje=n=>{let{state:e,dimensions:t,viewport:i}=n;e.movementMode!=="SNAP"&&Zn(!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=rg(r);u||Zn(!1);const d=l[u],h=xje({impact:r,viewport:o,destination:d,draggables:a}),f=Tje({impact:h,draggable:c,droppable:d,draggables:a,viewport:o,afterCritical:e.afterCritical});return gM({impact:h,clientSelection:f,state:e,dimensions:s,viewport:o})},IXt=n=>({index:n.index,droppableId:n.droppableId}),Ije=n=>{let{draggable:e,home:t,draggables:i,viewport:r}=n;const o=r6(t.axis,e.displaceBy),s=HR(t.descriptor.id,i),a=s.indexOf(e);a===-1&&Zn(!1);const l=s.slice(a+1),c=l.reduce((f,g)=>(f[g.descriptor.id]=!0,f),{}),u={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:c};return{impact:{displaced:o3({afterDragging:l,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:IXt(e.descriptor)}},afterCritical:u}},LXt=(n,e)=>({draggables:n.draggables,droppables:Lve(n.droppables,e)}),DXt=n=>{let{draggable:e,offset:t,initialWindowScroll:i}=n;const r=bW(e.client,t),o=yW(r,i);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},AXt=n=>{const e=n.frame;return e||Zn(!1),e},RXt=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=AXt(a).scroll.diff.value,u=Sd(r,c);return DXt({draggable:o,offset:u,initialWindowScroll:i.scroll.initial})})},NXt=n=>{let{state:e,published:t}=n;const i=t.modified.map(b=>{const y=e.dimensions.droppables[b.droppableId];return Sve(y,b.scroll)}),r={...e.dimensions.droppables,...uje(i)},o=dje(RXt({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=rg(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:f}=Ije({draggable:u,home:d,draggables:s,viewport:e.viewport}),g=c&&c.isCombineEnabled?e.impact:h,m=Eje({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:g,viewport:e.viewport,afterCritical:f}),v={...e,phase:"DRAGGING",impact:m,onLiftImpact:h,dimensions:a,afterCritical:f,forceShouldAnimate:!1};return e.phase==="COLLECTING"?v:{...v,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const sae=n=>n.movementMode==="SNAP",ZJ=(n,e,t)=>{const i=LXt(n.dimensions,e);return!sae(n)||t?gM({state:n,dimensions:i}):kje({state:n,dimensions:i})};function JJ(n){return n.isDragging&&n.movementMode==="SNAP"?{...n,scrollJumpRequest:null}:n}const qLe={phase:"IDLE",completed:null,shouldFlush:!1};var OXt=function(n,e){if(n===void 0&&(n=qLe),e.type==="FLUSH")return{...qLe,shouldFlush:!0};if(e.type==="INITIAL_PUBLISH"){n.phase!=="IDLE"&&Zn(!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:Qu},u={client:c,page:{selection:Sd(c.selection,r.scroll.initial),borderBoxCenter:Sd(c.selection,r.scroll.initial),offset:Sd(c.selection,r.scroll.diff.value)}},d=hG(o.droppables).every(m=>!m.isFixedOnPage),{impact:h,afterCritical:f}=Ije({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:f,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"&&Zn(!1),{...n,phase:"COLLECTING"});if(e.type==="PUBLISH_WHILE_DRAGGING")return n.phase==="COLLECTING"||n.phase==="DROP_PENDING"||Zn(!1),NXt({state:n,published:e.payload});if(e.type==="MOVE"){if(n.phase==="DROP_PENDING")return n;tx(n)||Zn(!1);const{client:t}=e.payload;return Dw(t,n.current.client.selection)?n:gM({state:n,clientSelection:t,impact:sae(n)?n.impact:null})}if(e.type==="UPDATE_DROPPABLE_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="COLLECTING")return JJ(n);tx(n)||Zn(!1);const{id:t,newScroll:i}=e.payload,r=n.dimensions.droppables[t];if(!r)return n;const o=Sve(r,i);return ZJ(n,o,!1)}if(e.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(n.phase==="DROP_PENDING")return n;tx(n)||Zn(!1);const{id:t,isEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||Zn(!1),r.isEnabled===i&&Zn(!1);const o={...r,isEnabled:i};return ZJ(n,o,!0)}if(e.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(n.phase==="DROP_PENDING")return n;tx(n)||Zn(!1);const{id:t,isCombineEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||Zn(!1),r.isCombineEnabled===i&&Zn(!1);const o={...r,isCombineEnabled:i};return ZJ(n,o,!0)}if(e.type==="MOVE_BY_WINDOW_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="DROP_ANIMATING")return n;tx(n)||Zn(!1),n.isWindowScrollAllowed||Zn(!1);const t=e.payload.newScroll;if(Dw(n.viewport.scroll.current,t))return JJ(n);const i=_je(n.viewport,t);return sae(n)?kje({state:n,viewport:i}):gM({state:n,viewport:i})}if(e.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!tx(n))return n;const t=e.payload.maxScroll;if(Dw(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"&&Zn(!1);const t=mXt({state:n,type:e.type});return t?gM({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"&&Zn(!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"||Zn(!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 PXt=n=>({type:"BEFORE_INITIAL_CAPTURE",payload:n}),MXt=n=>({type:"LIFT",payload:n}),FXt=n=>({type:"INITIAL_PUBLISH",payload:n}),BXt=n=>({type:"PUBLISH_WHILE_DRAGGING",payload:n}),$Xt=()=>({type:"COLLECTION_STARTING",payload:null}),VXt=n=>({type:"UPDATE_DROPPABLE_SCROLL",payload:n}),HXt=n=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:n}),WXt=n=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:n}),Lje=n=>({type:"MOVE",payload:n}),zXt=n=>({type:"MOVE_BY_WINDOW_SCROLL",payload:n}),UXt=n=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:n}),jXt=()=>({type:"MOVE_UP",payload:null}),qXt=()=>({type:"MOVE_DOWN",payload:null}),GXt=()=>({type:"MOVE_RIGHT",payload:null}),KXt=()=>({type:"MOVE_LEFT",payload:null}),Dve=()=>({type:"FLUSH",payload:null}),YXt=n=>({type:"DROP_ANIMATE",payload:n}),Ave=n=>({type:"DROP_COMPLETE",payload:n}),Dje=n=>({type:"DROP",payload:n}),QXt=n=>({type:"DROP_PENDING",payload:n}),Aje=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var XXt=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(Ave({completed:c.completed})),t().phase!=="IDLE"&&Zn(!1),i(Dve()),i(PXt({draggableId:s,movementMode:l}));const d={draggableId:s,scrollOptions:{shouldPublishImmediately:l==="SNAP"}},{critical:h,dimensions:f,viewport:g}=n.startPublishing(d);i(FXt({critical:h,dimensions:f,clientSelection:a,movementMode:l,viewport:g}))}},ZXt=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 Rve={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},s3={opacity:{drop:0,combining:.7},scale:{drop:.75}},Rje={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},NE=`${Rje.outOfTheWay}s ${Rve.outOfTheWay}`,mM={fluid:`opacity ${NE}`,snap:`transform ${NE}, opacity ${NE}`,drop:n=>{const e=`${n}s ${Rve.drop}`;return`transform ${e}, opacity ${e}`},outOfTheWay:`transform ${NE}`,placeholder:`height ${NE}, width ${NE}, margin ${NE}`},GLe=n=>Dw(n,Qu)?void 0:`translate(${n.x}px, ${n.y}px)`,aae={moveTo:GLe,drop:(n,e)=>{const t=GLe(n);if(t)return e?`${t} scale(${s3.scale.drop})`:t}},{minDropTime:lae,maxDropTime:Nje}=Rje,JXt=Nje-lae,KLe=1500,eZt=.6;var tZt=n=>{let{current:e,destination:t,reason:i}=n;const r=i3(e,t);if(r<=0)return lae;if(r>=KLe)return Nje;const o=r/KLe,s=lae+JXt*o,a=i==="CANCEL"?s*eZt:s;return Number(a.toFixed(2))},nZt=n=>{let{impact:e,draggable:t,dimensions:i,viewport:r,afterCritical:o}=n;const{draggables:s,droppables:a}=i,l=rg(e),c=l?a[l]:null,u=a[t.descriptor.droppableId],d=Tje({impact:e,draggable:t,draggables:s,afterCritical:o,droppable:c||u,viewport:r});return Yp(d,t.client.borderBox.center)},iZt=n=>{let{draggables:e,reason:t,lastImpact:i,home:r,viewport:o,onLiftImpact:s}=n;return!i.at||t!=="DROP"?{impact:xje({draggables:e,impact:s,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:i.at.type==="REORDER"?{impact:i,didDropInsideDroppable:!0}:{impact:{...i,displaced:r3},didDropInsideDroppable:!0}};const rZt=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(QXt({reason:s}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&Zn(!1),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||Zn(!1);const l=o.critical,c=o.dimensions,u=c.draggables[o.critical.draggable.id],{impact:d,didDropInsideDroppable:h}=iZt({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}),f=h?Eve(d):null,g=h?fG(d):null,m={index:l.draggable.index,droppableId:l.droppable.id},v={draggableId:u.descriptor.id,type:u.descriptor.type,source:m,reason:s,mode:o.movementMode,destination:f,combine:g},_=nZt({impact:d,draggable:u,dimensions:c,viewport:o.viewport,afterCritical:o.afterCritical}),b={critical:o.critical,afterCritical:o.afterCritical,result:v,impact:d};if(!(!Dw(o.current.client.offset,_)||!!v.combine)){t(Ave({completed:b}));return}const C=tZt({current:o.current.client.offset,destination:_,reason:s});t(YXt({newHomeClientOffset:_,dropDuration:C,completed:b}))}};var oZt=rZt,Oje=()=>({x:window.pageXOffset,y:window.pageYOffset});function sZt(n){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:e=>{e.target!==window&&e.target!==window.document||n()}}}function aZt(n){let{onWindowScroll:e}=n;function t(){e(Oje())}const i=n3(t),r=sZt(i);let o=Lw;function s(){return o!==Lw}function a(){s()&&Zn(!1),o=fm(window,[r])}function l(){s()||Zn(!1),i.cancel(),o(),o=Lw}return{start:a,stop:l,isActive:s}}const lZt=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH",cZt=n=>{const e=aZt({onWindowScroll:t=>{n.dispatch(zXt({newScroll:t}))}});return t=>i=>{!e.isActive()&&i.type==="INITIAL_PUBLISH"&&e.start(),e.isActive()&&lZt(i)&&e.stop(),t(i)}};var uZt=cZt,dZt=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},hZt=()=>{const n=[],e=r=>{const o=n.findIndex(a=>a.timerId===r);o===-1&&Zn(!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 fZt=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.droppableId===e.droppableId&&n.index===e.index,pZt=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.draggableId===e.draggableId&&n.droppableId===e.droppableId,gZt=(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},uO=(n,e)=>{e()},i9=(n,e)=>({draggableId:n.draggable.id,type:n.droppable.type,source:{droppableId:n.droppable.id,index:n.draggable.index},mode:e});function eee(n,e,t,i){if(!n){t(i(e));return}const r=dZt(t);n(e,{announce:r}),r.wasCalled()||t(i(e))}var mZt=(n,e)=>{const t=hZt();let i=null;const r=(d,h)=>{i&&Zn(!1),uO("onBeforeCapture",()=>{const f=n().onBeforeCapture;f&&f({draggableId:d,mode:h})})},o=(d,h)=>{i&&Zn(!1),uO("onBeforeDragStart",()=>{const f=n().onBeforeDragStart;f&&f(i9(d,h))})},s=(d,h)=>{i&&Zn(!1);const f=i9(d,h);i={mode:h,lastCritical:d,lastLocation:f.source,lastCombine:null},t.add(()=>{uO("onDragStart",()=>eee(n().onDragStart,f,e,R$.onDragStart))})},a=(d,h)=>{const f=Eve(h),g=fG(h);i||Zn(!1);const m=!gZt(d,i.lastCritical);m&&(i.lastCritical=d);const v=!fZt(i.lastLocation,f);v&&(i.lastLocation=f);const _=!pZt(i.lastCombine,g);if(_&&(i.lastCombine=g),!m&&!v&&!_)return;const b={...i9(d,i.mode),combine:g,destination:f};t.add(()=>{uO("onDragUpdate",()=>eee(n().onDragUpdate,b,e,R$.onDragUpdate))})},l=()=>{i||Zn(!1),t.flush()},c=d=>{i||Zn(!1),i=null,uO("onDragEnd",()=>eee(n().onDragEnd,d,e,R$.onDragEnd))};return{beforeCapture:r,beforeStart:o,start:s,update:a,flush:l,drop:c,abort:()=>{if(!i)return;const d={...i9(i.lastCritical,i.mode),combine:null,destination:null,reason:"CANCEL"};c(d)}}},_Zt=(n,e)=>{const t=mZt(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 vZt=n=>e=>t=>{if(t.type!=="DROP_ANIMATION_FINISHED"){e(t);return}const i=n.getState();i.phase!=="DROP_ANIMATING"&&Zn(!1),n.dispatch(Ave({completed:i.completed}))};var bZt=vZt;const yZt=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(Aje())}};t=requestAnimationFrame(()=>{t=null,e=fm(window,[s])})}};var CZt=yZt,wZt=n=>()=>e=>t=>{(t.type==="DROP_COMPLETE"||t.type==="FLUSH"||t.type==="DROP_ANIMATE")&&n.stopPublishing(),e(t)},SZt=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 EZt=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH";var xZt=n=>e=>t=>i=>{if(EZt(i)){n.stop(),t(i);return}if(i.type==="INITIAL_PUBLISH"){t(i);const r=e.getState();r.phase!=="DRAGGING"&&Zn(!1),n.start(r);return}t(i),n.scroll(e.getState())};const TZt=n=>e=>t=>{if(e(t),t.type!=="PUBLISH_WHILE_DRAGGING")return;const i=n.getState();i.phase==="DROP_PENDING"&&(i.isWaiting||n.dispatch(Dje({reason:i.reason})))};var kZt=TZt;const IZt=PD;var LZt=n=>{let{dimensionMarshal:e,focusMarshal:t,styleMarshal:i,getResponders:r,announce:o,autoScroller:s}=n;return uF(OXt,IZt(jpe(ZXt(i),wZt(e),XXt(e),oZt,bZt,CZt,kZt,xZt(s),uZt,SZt(t),_Zt(r,o))))};const tee=()=>({additions:{},removals:{},modified:{}});function DZt(n){let{registry:e,callbacks:t}=n,i=tee(),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(Qu)).sort((m,v)=>m.descriptor.index-v.descriptor.index),f=Object.keys(d).map(m=>{const _=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:_}}),g={additions:h,removals:Object.keys(u),modified:f};i=tee(),t.publish(g)}))};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=tee())}}}var Pje=n=>{let{scrollHeight:e,scrollWidth:t,height:i,width:r}=n;const o=Yp({x:t,y:e},{x:r,y:i});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Mje=()=>{const n=document.documentElement;return n||Zn(!1),n},Fje=()=>{const n=Mje();return Pje({scrollHeight:n.scrollHeight,scrollWidth:n.scrollWidth,width:n.clientWidth,height:n.clientHeight})},AZt=()=>{const n=Oje(),e=Fje(),t=n.y,i=n.x,r=Mje(),o=r.clientWidth,s=r.clientHeight,a=i+o,l=t+s;return{frame:ev({top:t,left:i,right:a,bottom:l}),scroll:{initial:n,current:n,max:e,diff:{value:Qu,displacement:Qu}}}},RZt=n=>{let{critical:e,scrollOptions:t,registry:i}=n;const r=AZt(),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:dje(l),droppables:uje(a)},critical:e,viewport:r}};function YLe(n,e,t){return!(t.descriptor.id===e.id||t.descriptor.type!==e.type||n.droppable.getById(t.descriptor.droppableId).descriptor.mode!=="virtual")}var NZt=(n,e)=>{let t=null;const i=DZt({callbacks:{publish:e.publishWhileDragging,collectionStarting:e.collectionStarting},registry:n}),r=(h,f)=>{n.droppable.exists(h)||Zn(!1),t&&e.updateDroppableIsEnabled({id:h,isEnabled:f})},o=(h,f)=>{t&&(n.droppable.exists(h)||Zn(!1),e.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:f}))},s=(h,f)=>{t&&(n.droppable.exists(h)||Zn(!1),e.updateDroppableScroll({id:h,newScroll:f}))},a=(h,f)=>{t&&n.droppable.getById(h).callbacks.scroll(f)},l=()=>{if(!t)return;i.stop();const h=t.critical.droppable;n.droppable.getAllByType(h.type).forEach(f=>f.callbacks.dragStopped()),t.unsubscribe(),t=null},c=h=>{t||Zn(!1);const f=t.critical.draggable;h.type==="ADDITION"&&YLe(n,f,h.value)&&i.add(h.value),h.type==="REMOVAL"&&YLe(n,f,h.value)&&i.remove(h.value)};return{updateDroppableIsEnabled:r,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:s,startPublishing:h=>{t&&Zn(!1);const f=n.draggable.getById(h.draggableId),g=n.droppable.getById(f.descriptor.droppableId),m={draggable:f.descriptor,droppable:g.descriptor},v=n.subscribe(c);return t={critical:m,unsubscribe:v},RZt({critical:m,registry:n,scrollOptions:h.scrollOptions})},stopPublishing:l}},Bje=(n,e)=>n.phase==="IDLE"?!0:n.phase!=="DROP_ANIMATING"||n.completed.result.draggableId===e?!1:n.completed.result.reason==="DROP",OZt=n=>{window.scrollBy(n.x,n.y)};const PZt=bu(n=>hG(n).filter(e=>!(!e.isEnabled||!e.frame))),MZt=(n,e)=>PZt(e).find(i=>(i.frame||Zn(!1),Cje(i.frame.pageMarginBox)(n)))||null;var FZt=n=>{let{center:e,destination:t,droppables:i}=n;if(t){const o=i[t];return o.frame?o:null}return MZt(e,i)};const a3={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var BZt=function(n,e,t){t===void 0&&(t=()=>a3);const i=t(),r=n[e.size]*i.startFromPercentage,o=n[e.size]*i.maxScrollAtPercentage;return{startScrollingFrom:r,maxScrollValueAt:o}},$je=n=>{let{startOfRange:e,endOfRange:t,current:i}=n;const r=t-e;return r===0?0:(i-e)/r},Nve=1,$Zt=function(n,e,t){t===void 0&&(t=()=>a3);const i=t();if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return i.maxPixelScroll;if(n===e.startScrollingFrom)return Nve;const o=1-$je({startOfRange:e.maxScrollValueAt,endOfRange:e.startScrollingFrom,current:n}),s=i.maxPixelScroll*i.ease(o);return Math.ceil(s)},VZt=(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 Nve;const u=$je({startOfRange:r,endOfRange:a,current:c}),d=n*i.ease(u);return Math.ceil(d)},QLe=n=>{let{distanceToEdge:e,thresholds:t,dragStartTime:i,shouldUseTimeDampening:r,getAutoScrollerOptions:o}=n;const s=$Zt(e,t,o);return s===0?0:r?Math.max(VZt(s,i,o),Nve):s},XLe=n=>{let{container:e,distanceToEdges:t,dragStartTime:i,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=BZt(e,r,s);return t[r.end]<t[r.start]?QLe({distanceToEdge:t[r.end],thresholds:a,dragStartTime:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s}):-1*QLe({distanceToEdge:t[r.start],thresholds:a,dragStartTime:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s})},HZt=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 WZt=cje(n=>n===0?0:n);var Vje=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=XLe({container:t,distanceToEdges:a,dragStartTime:e,axis:xve,shouldUseTimeDampening:o,getAutoScrollerOptions:s}),c=XLe({container:t,distanceToEdges:a,dragStartTime:e,axis:pje,shouldUseTimeDampening:o,getAutoScrollerOptions:s}),u=WZt({x:c,y:l});if(Dw(u,Qu))return null;const d=HZt({container:t,subject:i,proposedScroll:u});return d?Dw(d,Qu)?null:d:null};const zZt=cje(n=>n===0?0:n>0?1:-1),Ove=(()=>{const n=(e,t)=>e<0?e:e>t?e-t:0;return e=>{let{current:t,max:i,change:r}=e;const o=Sd(t,r),s={x:n(o.x,i.x),y:n(o.y,i.y)};return Dw(s,Qu)?null:s}})(),Hje=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=zZt(i),s=Ove({max:r,current:t,change:o});return!s||o.x!==0&&s.x===0||o.y!==0&&s.y===0},Pve=(n,e)=>Hje({current:n.scroll.current,max:n.scroll.max,change:e}),UZt=(n,e)=>{if(!Pve(n,e))return null;const t=n.scroll.max,i=n.scroll.current;return Ove({current:i,max:t,change:e})},Mve=(n,e)=>{const t=n.frame;return t?Hje({current:t.scroll.current,max:t.scroll.max,change:e}):!1},jZt=(n,e)=>{const t=n.frame;return!t||!Mve(n,e)?null:Ove({current:t.scroll.current,max:t.scroll.max,change:e})};var qZt=n=>{let{viewport:e,subject:t,center:i,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=Vje({dragStartTime:r,container:e.frame,subject:t,center:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s});return a&&Pve(e,a)?a:null},GZt=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=Vje({dragStartTime:r,container:a.pageMarginBox,subject:t,center:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s});return l&&Mve(e,l)?l:null},ZLe=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,f=qZt({dragStartTime:t,viewport:h,subject:c,center:a,shouldUseTimeDampening:i,getAutoScrollerOptions:s});if(f){r(f);return}}const u=FZt({center:a,destination:rg(e.impact),droppables:e.dimensions.droppables});if(!u)return;const d=GZt({dragStartTime:t,droppable:u,subject:c,center:a,shouldUseTimeDampening:i,getAutoScrollerOptions:s});d&&o(u.descriptor.id,d)},KZt=n=>{let{scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:i=()=>a3}=n;const r=n3(e),o=n3(t);let s=null;const a=u=>{s||Zn(!1);const{shouldUseTimeDampening:d,dragStartTime:h}=s;ZLe({state:u,scrollWindow:r,scrollDroppable:o,dragStartTime:h,shouldUseTimeDampening:d,getAutoScrollerOptions:i})};return{start:u=>{s&&Zn(!1);const d=Date.now();let h=!1;const f=()=>{h=!0};ZLe({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:f,scrollDroppable:f,getAutoScrollerOptions:i}),s={dragStartTime:d,shouldUseTimeDampening:h},h&&a(u)},stop:()=>{s&&(r.cancel(),o.cancel(),s=null)},scroll:a}},YZt=n=>{let{move:e,scrollDroppable:t,scrollWindow:i}=n;const r=(l,c)=>{const u=Sd(l.current.client.selection,c);e({client:u})},o=(l,c)=>{if(!Mve(l,c))return c;const u=jZt(l,c);if(!u)return t(l.descriptor.id,c),null;const d=Yp(c,u);return t(l.descriptor.id,d),Yp(c,d)},s=(l,c,u)=>{if(!l||!Pve(c,u))return u;const d=UZt(c,u);if(!d)return i(u),null;const h=Yp(u,d);return i(h),Yp(u,h)};return l=>{const c=l.scrollJumpRequest;if(!c)return;const u=rg(l.impact);u||Zn(!1);const d=o(l.dimensions.droppables[u],c);if(!d)return;const h=l.viewport,f=s(l.isWindowScrollAllowed,h,d);f&&r(l,f)}},QZt=n=>{let{scrollDroppable:e,scrollWindow:t,move:i,getAutoScrollerOptions:r}=n;const o=KZt({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),s=YZt({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 lA="data-rfd",cA=(()=>{const n=`${lA}-drag-handle`;return{base:n,draggableId:`${n}-draggable-id`,contextId:`${n}-context-id`}})(),cae=(()=>{const n=`${lA}-draggable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),XZt=(()=>{const n=`${lA}-droppable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),JLe={contextId:`${lA}-scroll-container-context-id`},ZZt=n=>e=>`[${e}="${n}"]`,dO=(n,e)=>n.map(t=>{const i=t.styles[e];return i?`${t.selector} { ${i} }`:""}).join(" "),JZt="pointer-events: none;";var eJt=n=>{const e=ZZt(n),t=(()=>{const a=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:e(cA.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:a,dragging:JZt,dropAnimating:a}}})(),i=(()=>{const a=`
transition: ${mM.outOfTheWay};
`;return{selector:e(cae.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}})(),r={selector:e(XZt.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:dO(s,"always"),resting:dO(s,"resting"),dragging:dO(s,"dragging"),dropAnimating:dO(s,"dropAnimating"),userCancel:dO(s,"userCancel")}};const tJt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;var og=tJt;const nee=()=>{const n=document.querySelector("head");return n||Zn(!1),n},eDe=n=>{const e=document.createElement("style");return n&&e.setAttribute("nonce",n),e.type="text/css",e};function nJt(n,e){const t=os(()=>eJt(n),[n]),i=w.useRef(null),r=w.useRef(null),o=tr(bu(d=>{const h=r.current;h||Zn(!1),h.textContent=d}),[]),s=tr(d=>{const h=i.current;h||Zn(!1),h.textContent=d},[]);og(()=>{!i.current&&!r.current||Zn(!1);const d=eDe(e),h=eDe(e);return i.current=d,r.current=h,d.setAttribute(`${lA}-always`,n),h.setAttribute(`${lA}-dynamic`,n),nee().appendChild(d),nee().appendChild(h),s(t.always),o(t.resting),()=>{const f=g=>{const m=g.current;m||Zn(!1),nee().removeChild(m),g.current=null};f(i),f(r)}},[e,s,o,t.always,t.resting,n]);const a=tr(()=>o(t.dragging),[o,t.dragging]),l=tr(d=>{if(d==="DROP"){o(t.dropAnimating);return}o(t.userCancel)},[o,t.dropAnimating,t.userCancel]),c=tr(()=>{r.current&&o(t.resting)},[o,t.resting]);return os(()=>({dragging:a,dropping:l,resting:c}),[a,l,c])}function Wje(n,e){return Array.from(n.querySelectorAll(e))}var zje=n=>{var e;return((e=n==null?void 0:n.ownerDocument)==null?void 0:e.defaultView)||window};function mG(n){return n instanceof zje(n).HTMLElement}function iJt(n,e){const t=`[${cA.contextId}="${n}"]`,i=Wje(document,t);if(!i.length)return null;const r=i.find(o=>o.getAttribute(cA.draggableId)===e);return!r||!mG(r)?null:r}function rJt(n){const e=w.useRef({}),t=w.useRef(null),i=w.useRef(null),r=w.useRef(!1),o=tr(function(h,f){const g={id:h,focus:f};return e.current[h]=g,function(){const v=e.current;v[h]!==g&&delete v[h]}},[]),s=tr(function(h){const f=iJt(n,h);f&&f!==document.activeElement&&f.focus()},[n]),a=tr(function(h,f){t.current===h&&(t.current=f)},[]),l=tr(function(){i.current||r.current&&(i.current=requestAnimationFrame(()=>{i.current=null;const h=t.current;h&&s(h)}))},[s]),c=tr(function(h){t.current=null;const f=document.activeElement;f&&f.getAttribute(cA.draggableId)===h&&(t.current=h)},[]);return og(()=>(r.current=!0,function(){r.current=!1;const h=i.current;h&&cancelAnimationFrame(h)}),[]),os(()=>({register:o,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}),[o,c,l,a])}function oJt(){const n={draggables:{},droppables:{}},e=[];function t(d){return e.push(d),function(){const f=e.indexOf(d);f!==-1&&e.splice(f,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||Zn(!1),h}const s={register:d=>{n.draggables[d.descriptor.id]=d,i({type:"ADDITION",value:d})},update:(d,h)=>{const f=n.draggables[h.descriptor.id];f&&f.uniqueId===d.uniqueId&&(delete n.draggables[h.descriptor.id],n.draggables[d.descriptor.id]=d)},unregister:d=>{const h=d.descriptor.id,f=r(h);f&&d.uniqueId===f.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||Zn(!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 sJt(){const n=os(oJt,[]);return w.useEffect(()=>function(){ce.version.startsWith("16")||ce.version.startsWith("17")?requestAnimationFrame(n.clean):n.clean()},[n]),n}var Fve=ce.createContext(null),EW=()=>{const n=document.body;return n||Zn(!1),n};const aJt={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 lJt=aJt;const cJt=n=>`rfd-announcement-${n}`;function uJt(n){const e=os(()=>cJt(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"),Tt(o.style,lJt),EW().appendChild(o),function(){setTimeout(function(){const l=EW();l.contains(o)&&l.removeChild(o),o===t.current&&(t.current=null)})}},[e]),tr(r=>{const o=t.current;if(o){o.textContent=r;return}},[])}let dJt=0;const Uje={separator:"::"};function hJt(n,e){return e===void 0&&(e=Uje),os(()=>`${n}${e.separator}${dJt++}`,[e.separator,n])}function fJt(n,e){e===void 0&&(e=Uje);const t=ce.useId();return os(()=>`${n}${e.separator}${t}`,[e.separator,n,t])}var Bve="useId"in ce?fJt:hJt;function pJt(n){let{contextId:e,uniqueId:t}=n;return`rfd-hidden-text-${e}-${t}`}function gJt(n){let{contextId:e,text:t}=n;const i=Bve("hidden-text",{separator:"-"}),r=os(()=>pJt({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",EW().appendChild(s),function(){const l=EW();l.contains(s)&&l.removeChild(s)}},[r,t]),r}var _G=ce.createContext(null);function jje(n){const e=w.useRef(n);return w.useEffect(()=>{e.current=n}),e}function mJt(){let n=null;function e(){return!!n}function t(s){return s===n}function i(s){n&&Zn(!1);const a={abandon:s};return n=a,a}function r(){n||Zn(!1),n=null}function o(){n&&(n.abandon(),r())}return{isClaimed:e,isActive:t,claim:i,release:r,tryAbandon:o}}function l3(n){return n.phase==="IDLE"||n.phase==="DROP_ANIMATING"?!1:n.isDragging}const _Jt=9,vJt=13,$ve=27,qje=32,bJt=33,yJt=34,CJt=35,wJt=36,SJt=37,EJt=38,xJt=39,TJt=40,kJt={[vJt]:!0,[_Jt]:!0};var Gje=n=>{kJt[n.keyCode]&&n.preventDefault()};const IJt=(()=>{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 vG=IJt;const Kje=0,tDe=5;function LJt(n,e){return Math.abs(e.x-n.x)>=tDe||Math.abs(e.y-n.y)>=tDe}const nDe={type:"IDLE"};function DJt(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!==Kje)return;const c={x:a,y:l},u=i();if(u.type==="DRAGGING"){o.preventDefault(),u.actions.move(c);return}u.type!=="PENDING"&&Zn(!1);const d=u.point;if(!LJt(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===$ve){o.preventDefault(),e();return}Gje(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"&&Zn(!1),s.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:vG,fn:e}]}function AJt(n){const e=w.useRef(nDe),t=w.useRef(Lw),i=os(()=>({eventName:"mousedown",fn:function(d){if(d.defaultPrevented||d.button!==Kje||d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)return;const h=n.findClosestDraggableId(d);if(!h)return;const f=n.tryGetLock(h,s,{sourceEvent:d});if(!f)return;d.preventDefault();const g={x:d.clientX,y:d.clientY};t.current(),c(f,g)}}),[n]),r=os(()=>({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=tr(function(){const d={passive:!1,capture:!0};t.current=fm(window,[r,i],d)},[r,i]),s=tr(()=>{e.current.type!=="IDLE"&&(e.current=nDe,t.current(),o())},[o]),a=tr(()=>{const u=e.current;s(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[s]),l=tr(function(){const d={capture:!0,passive:!1},h=DJt({cancel:a,completed:s,getPhase:()=>e.current,setPhase:f=>{e.current=f}});t.current=fm(window,h,d)},[a,s]),c=tr(function(d,h){e.current.type!=="IDLE"&&Zn(!1),e.current={type:"PENDING",point:h,actions:d},l()},[l]);og(function(){return o(),function(){t.current()}},[o])}function RJt(){}const NJt={[yJt]:!0,[bJt]:!0,[wJt]:!0,[CJt]:!0};function OJt(n,e){function t(){e(),n.cancel()}function i(){e(),n.drop()}return[{eventName:"keydown",fn:r=>{if(r.keyCode===$ve){r.preventDefault(),t();return}if(r.keyCode===qje){r.preventDefault(),i();return}if(r.keyCode===TJt){r.preventDefault(),n.moveDown();return}if(r.keyCode===EJt){r.preventDefault(),n.moveUp();return}if(r.keyCode===xJt){r.preventDefault(),n.moveRight();return}if(r.keyCode===SJt){r.preventDefault(),n.moveLeft();return}if(NJt[r.keyCode]){r.preventDefault();return}Gje(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:vG,fn:t}]}function PJt(n){const e=w.useRef(RJt),t=os(()=>({eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==qje)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||Zn(!1),l=!1,e.current(),i()}e.current=fm(window,OJt(c,u),{capture:!0,passive:!1})}}),[n]),i=tr(function(){const o={passive:!1,capture:!0};e.current=fm(window,[t],o)},[t]);og(function(){return i(),function(){e.current()}},[i])}const iee={type:"IDLE"},MJt=120,FJt=.15;function BJt(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===$ve&&i.preventDefault(),e()}},{eventName:vG,fn:e}]}function $Jt(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"&&Zn(!1);const s=r.touches[0];if(!s||!(s.force>=FJt))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:vG,fn:e}]}function VJt(n){const e=w.useRef(iee),t=w.useRef(Lw),i=tr(function(){return e.current},[]),r=tr(function(f){e.current=f},[]),o=os(()=>({eventName:"touchstart",fn:function(f){if(f.defaultPrevented)return;const g=n.findClosestDraggableId(f);if(!g)return;const m=n.tryGetLock(g,a,{sourceEvent:f});if(!m)return;const v=f.touches[0],{clientX:_,clientY:b}=v,y={x:_,y:b};t.current(),d(m,y)}}),[n]),s=tr(function(){const f={capture:!0,passive:!1};t.current=fm(window,[o],f)},[o]),a=tr(()=>{const h=e.current;h.type!=="IDLE"&&(h.type==="PENDING"&&clearTimeout(h.longPressTimerId),r(iee),t.current(),s())},[s,r]),l=tr(()=>{const h=e.current;a(),h.type==="DRAGGING"&&h.actions.cancel({shouldBlockNextClick:!0}),h.type==="PENDING"&&h.actions.abort()},[a]),c=tr(function(){const f={capture:!0,passive:!1},g={cancel:l,completed:a,getPhase:i},m=fm(window,$Jt(g),f),v=fm(window,BJt(g),f);t.current=function(){m(),v()}},[l,i,a]),u=tr(function(){const f=i();f.type!=="PENDING"&&Zn(!1);const g=f.actions.fluidLift(f.point);r({type:"DRAGGING",actions:g,hasMoved:!1})},[i,r]),d=tr(function(f,g){i().type!=="IDLE"&&Zn(!1);const m=setTimeout(u,MJt);r({type:"PENDING",point:g,actions:f,longPressTimerId:m}),c()},[c,i,r,u]);og(function(){return s(),function(){t.current();const g=i();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),r(iee))}},[i,s,r]),og(function(){return fm(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const HJt=["input","button","textarea","select","option","optgroup","video","audio"];function Yje(n,e){if(e==null)return!1;if(HJt.includes(e.tagName.toLowerCase()))return!0;const i=e.getAttribute("contenteditable");return i==="true"||i===""?!0:e===n?!1:Yje(n,e.parentElement)}function WJt(n,e){const t=e.target;return mG(t)?Yje(n,t):!1}var zJt=n=>ev(n.getBoundingClientRect()).center;function UJt(n){return n instanceof zje(n).Element}const jJt=(()=>{const n="matches";return typeof document>"u"?n:[n,"msMatchesSelector","webkitMatchesSelector"].find(i=>i in Element.prototype)||n})();function Qje(n,e){return n==null?null:n[jJt](e)?n:Qje(n.parentElement,e)}function qJt(n,e){return n.closest?n.closest(e):Qje(n,e)}function GJt(n){return`[${cA.contextId}="${n}"]`}function KJt(n,e){const t=e.target;if(!UJt(t))return null;const i=GJt(n),r=qJt(t,i);return!r||!mG(r)?null:r}function YJt(n,e){const t=KJt(n,e);return t?t.getAttribute(cA.draggableId):null}function QJt(n,e){const t=`[${cae.contextId}="${n}"]`,r=Wje(document,t).find(o=>o.getAttribute(cae.id)===e);return!r||!mG(r)?null:r}function XJt(n){n.preventDefault()}function r9(n){let{expected:e,phase:t,isLockActive:i,shouldWarn:r}=n;return!(!i()||e!==t)}function Xje(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||!Bje(t.getState(),r))}function ZJt(n){let{lockAPI:e,contextId:t,store:i,registry:r,draggableId:o,forceSensorStop:s,sourceEvent:a}=n;if(!Xje({lockAPI:e,store:i,registry:r,draggableId:o}))return null;const c=r.draggable.getById(o),u=QJt(t,c.descriptor.id);if(!u||a&&!c.options.canDragInteractiveElements&&WJt(u,a))return null;const d=e.claim(s||Lw);let h="PRE_DRAG";function f(){return c.options.shouldRespectForcePress}function g(){return e.isActive(d)}function m(x,k){r9({expected:x,phase:h,isLockActive:g,shouldWarn:!0})&&i.dispatch(k())}const v=m.bind(null,"DRAGGING");function _(x){function k(){e.release(),h="COMPLETED"}h!=="PRE_DRAG"&&(k(),Zn(!1)),i.dispatch(MXt(x.liftActionArgs)),h="DRAGGING";function L(D,A){if(A===void 0&&(A={shouldBlockNextClick:!1}),x.cleanup(),A.shouldBlockNextClick){const N=fm(window,[{eventName:"click",fn:XJt,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(N)}k(),i.dispatch(Dje({reason:D}))}return{isActive:()=>r9({expected:"DRAGGING",phase:h,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:f,drop:D=>L("DROP",D),cancel:D=>L("CANCEL",D),...x.actions}}function b(x){const k=n3(D=>{v(()=>Lje({client:D}))});return{..._({liftActionArgs:{id:o,clientSelection:x,movementMode:"FLUID"},cleanup:()=>k.cancel(),actions:{move:k}}),move:k}}function y(){const x={moveUp:()=>v(jXt),moveRight:()=>v(GXt),moveDown:()=>v(qXt),moveLeft:()=>v(KXt)};return _({liftActionArgs:{id:o,clientSelection:zJt(u),movementMode:"SNAP"},cleanup:Lw,actions:x})}function C(){r9({expected:"PRE_DRAG",phase:h,isLockActive:g,shouldWarn:!0})&&e.release()}return{isActive:()=>r9({expected:"PRE_DRAG",phase:h,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:f,fluidLift:b,snapLift:y,abort:C}}const JJt=[AJt,PJt,VJt];function een(n){let{contextId:e,store:t,registry:i,customSensors:r,enableDefaultSensors:o}=n;const s=[...o?JJt:[],...r||[]],a=w.useState(()=>mJt())[0],l=tr(function(_,b){l3(_)&&!l3(b)&&a.tryAbandon()},[a]);og(function(){let _=t.getState();return t.subscribe(()=>{const y=t.getState();l(_,y),_=y})},[a,t,l]),og(()=>a.tryAbandon,[a.tryAbandon]);const c=tr(v=>Xje({lockAPI:a,registry:i,store:t,draggableId:v}),[a,i,t]),u=tr((v,_,b)=>ZJt({lockAPI:a,registry:i,contextId:e,store:t,draggableId:v,forceSensorStop:_||null,sourceEvent:b&&b.sourceEvent?b.sourceEvent:null}),[e,a,i,t]),d=tr(v=>YJt(e,v),[e]),h=tr(v=>{const _=i.draggable.findById(v);return _?_.options:null},[i.draggable]),f=tr(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Dve()))},[a,t]),g=tr(()=>a.isClaimed(),[a]),m=os(()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:h,tryReleaseLock:f,isLockClaimed:g}),[c,u,d,h,f,g]);for(let v=0;v<s.length;v++)s[v](m)}const ten=n=>({onBeforeCapture:e=>{const t=()=>{n.onBeforeCapture&&n.onBeforeCapture(e)};ce.version.startsWith("16")||ce.version.startsWith("17")?t():op.flushSync(t)},onBeforeDragStart:n.onBeforeDragStart,onDragStart:n.onDragStart,onDragEnd:n.onDragEnd,onDragUpdate:n.onDragUpdate}),nen=n=>({...a3,...n.autoScrollerOptions,durationDampening:{...a3.durationDampening,...n.autoScrollerOptions}});function hO(n){return n.current||Zn(!1),n.current}function ien(n){const{contextId:e,setCallbacks:t,sensors:i,nonce:r,dragHandleUsageInstructions:o}=n,s=w.useRef(null),a=jje(n),l=tr(()=>ten(a.current),[a]),c=tr(()=>nen(a.current),[a]),u=uJt(e),d=gJt({contextId:e,text:o}),h=nJt(e,r),f=tr(A=>{hO(s).dispatch(A)},[]),g=os(()=>tre({publishWhileDragging:BXt,updateDroppableScroll:VXt,updateDroppableIsEnabled:HXt,updateDroppableIsCombineEnabled:WXt,collectionStarting:$Xt},f),[f]),m=sJt(),v=os(()=>NZt(m,g),[m,g]),_=os(()=>QZt({scrollWindow:OZt,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:c,...tre({move:Lje},f)}),[v.scrollDroppable,f,c]),b=rJt(e),y=os(()=>LZt({announce:u,autoScroller:_,dimensionMarshal:v,focusMarshal:b,getResponders:l,styleMarshal:h}),[u,_,v,b,l,h]);s.current=y;const C=tr(()=>{const A=hO(s);A.getState().phase!=="IDLE"&&A.dispatch(Dve())},[]),E=tr(()=>{const A=hO(s).getState();return A.phase==="DROP_ANIMATING"?!0:A.phase==="IDLE"?!1:A.isDragging},[]),x=os(()=>({isDragging:E,tryAbort:C}),[E,C]);t(x);const k=tr(A=>Bje(hO(s).getState(),A),[]),L=tr(()=>tx(hO(s).getState()),[]),D=os(()=>({marshal:v,focus:b,contextId:e,canLift:k,isMovementAllowed:L,dragHandleUsageInstructionsId:d,registry:m}),[e,v,d,b,k,L,m]);return een({contextId:e,store:y,registry:m,customSensors:i||null,enableDefaultSensors:n.enableDefaultSensors!==!1}),w.useEffect(()=>C,[C]),ce.createElement(_G.Provider,{value:D},ce.createElement(j6e,{context:Fve,store:y},n.children))}let ren=0;function oen(){return os(()=>`${ren++}`,[])}function sen(){return ce.useId()}var aen="useId"in ce?sen:oen;function bG(n){const e=aen(),t=n.dragHandleUsageInstructions||R$.dragHandleUsageInstructions;return ce.createElement(EQt,null,i=>ce.createElement(ien,{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 iDe={dragging:5e3,dropAnimating:4500},len=(n,e)=>e?mM.drop(e.duration):n?mM.snap:mM.fluid,cen=(n,e)=>{if(n)return e?s3.opacity.drop:s3.opacity.combining},uen=n=>n.forceShouldAnimate!=null?n.forceShouldAnimate:n.mode==="SNAP";function den(n){const t=n.dimension.client,{offset:i,combineWith:r,dropping:o}=n,s=!!r,a=uen(n),l=!!o,c=l?aae.drop(i,s):aae.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:len(a,o),transform:c,opacity:cen(s,l),zIndex:l?iDe.dropAnimating:iDe.dragging,pointerEvents:"none"}}function hen(n){return{transform:aae.moveTo(n.offset),transition:n.shouldAnimateDisplacement?void 0:"none"}}function fen(n){return n.type==="DRAGGING"?den(n):hen(n)}function pen(n,e,t){t===void 0&&(t=Qu);const i=window.getComputedStyle(e),r=e.getBoundingClientRect(),o=rje(r,i),s=yW(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 gen(n){const e=Bve("draggable"),{descriptor:t,registry:i,getDraggableRef:r,canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}=n,l=os(()=>({canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}),[o,a,s]),c=tr(f=>{const g=r();return g||Zn(!1),pen(t,g,f)},[t,r]),u=os(()=>({uniqueId:e,descriptor:t,options:l,getDimension:c}),[t,c,l,e]),d=w.useRef(u),h=w.useRef(!0);og(()=>(i.draggable.register(d.current),()=>i.draggable.unregister(d.current)),[i.draggable]),og(()=>{if(h.current){h.current=!1;return}const f=d.current;d.current=u,i.draggable.update(u,f)},[u,i.draggable])}var Vve=ce.createContext(null);function xW(n){const e=w.useContext(n);return e||Zn(!1),e}function men(n){n.preventDefault()}const _en=n=>{const e=w.useRef(null),t=tr(function(x){x===void 0&&(x=null),e.current=x},[]),i=tr(()=>e.current,[]),{contextId:r,dragHandleUsageInstructionsId:o,registry:s}=xW(_G),{type:a,droppableId:l}=xW(Vve),c=os(()=>({id:n.draggableId,index:n.index,type:a,droppableId:l}),[n.draggableId,n.index,a,l]),{children:u,draggableId:d,isEnabled:h,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:v,dropAnimationFinished:_}=n;if(!m){const x=os(()=>({descriptor:c,registry:s,getDraggableRef:i,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:h}),[c,s,i,g,f,h]);gen(x)}const b=os(()=>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:men}:null,[r,o,d,h]),y=tr(x=>{v.type==="DRAGGING"&&v.dropping&&x.propertyName==="transform"&&(ce.version.startsWith("16")||ce.version.startsWith("17")?_():op.flushSync(_))},[_,v]),C=os(()=>{const x=fen(v),k=v.type==="DRAGGING"&&v.dropping?y:void 0;return{innerRef:t,draggableProps:{"data-rfd-draggable-context-id":r,"data-rfd-draggable-id":d,style:x,onTransitionEnd:k},dragHandleProps:b}},[r,b,d,v,y,t]),E=os(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return ce.createElement(ce.Fragment,null,u(C,v.snapshot,E))};var ven=_en,Zje=(n,e)=>n===e,Jje=n=>{const{combine:e,destination:t}=n;return t?t.droppableId:e?e.droppableId:null};const ben=n=>n.combine?n.combine.draggableId:null,yen=n=>n.at&&n.at.type==="COMBINE"?n.at.combine.draggableId:null;function Cen(){const n=bu((r,o)=>({x:r,y:o})),e=bu(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=bu(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(l3(r)){if(r.critical.draggable.id!==o.draggableId)return null;const s=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],l=rg(r.impact),c=yen(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=Jje(c),h=ben(c),g={duration:r.dropDuration,curve:Rve.drop,moveTo:r.newHomeClientOffset,opacity:h?s3.opacity.drop:null,scale:h?s3.scale.drop:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:l,dropping:g,draggingOver:d,combineWith:h,mode:u,forceShouldAnimate:null,snapshot:e(u,a,d,h,g)}}}return null}}function eqe(n){return n===void 0&&(n=null),{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:n,combineWith:null}}const wen={mapped:{type:"SECONDARY",offset:Qu,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:eqe(null)}};function Sen(){const n=bu((s,a)=>({x:s,y:a})),e=bu(eqe),t=bu(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(Qu,s,!0):null,r=(s,a,l,c)=>{const u=l.displaced.visible[s],d=!!(c.inVirtualList&&c.effected[s]),h=fG(l),f=h&&h.draggableId===s?a:null;if(!u){if(!d)return i(f);if(l.displaced.invisible[s])return null;const v=VR(c.displacedBy.point),_=n(v.x,v.y);return t(_,f,!0)}if(d)return i(f);const g=l.displacedBy.point,m=n(g.x,g.y);return t(m,f,u.shouldAnimate)};return(s,a)=>{if(l3(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 Een=()=>{const n=Cen(),e=Sen();return(i,r)=>n(i,r)||e(i,r)||wen},xen={dropAnimationFinished:Aje},Ten=U6e(Een,xen,null,{context:Fve,areStatePropsEqual:Zje})(ven);var ken=Ten;function tqe(n){return xW(Vve).isUsingCloneFor===n.draggableId&&!n.isClone?null:ce.createElement(ken,n)}function yG(n){const e=typeof n.isDragDisabled=="boolean"?!n.isDragDisabled:!0,t=!!n.disableInteractiveElementBlocking,i=!!n.shouldRespectForcePress;return ce.createElement(tqe,Tt({},n,{isClone:!1,isEnabled:e,canDragInteractiveElements:t,shouldRespectForcePress:i}))}const nqe=n=>e=>n===e,Ien=nqe("scroll"),Len=nqe("auto"),rDe=(n,e)=>e(n.overflowX)||e(n.overflowY),Den=n=>{const e=window.getComputedStyle(n),t={overflowX:e.overflowX,overflowY:e.overflowY};return rDe(t,Ien)||rDe(t,Len)},Aen=()=>!1,iqe=n=>n==null?null:n===document.body?Aen()?n:null:n===document.documentElement?null:Den(n)?n:iqe(n.parentElement);var Ren=iqe,uae=n=>({x:n.scrollLeft,y:n.scrollTop});const rqe=n=>n?window.getComputedStyle(n).position==="fixed"?!0:rqe(n.parentElement):!1;var Nen=n=>{const e=Ren(n),t=rqe(n);return{closestScrollable:e,isFixedOnPage:t}},Oen=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:f,client:g}=l,m=Pje({scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:g,scrollSize:f,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:m,diff:{value:Qu,displacement:Qu}}}})(),u=o==="vertical"?xve:pje,d=aA({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 Pen=(n,e)=>{const t=oje(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=Cve({top:i,right:s,bottom:o,left:r},t.border);return wve({borderBox:l,margin:t.margin,border:t.border,padding:t.padding})};var Men=n=>{let{ref:e,descriptor:t,env:i,windowScroll:r,direction:o,isDropDisabled:s,isCombineEnabled:a,shouldClipSubject:l}=n;const c=i.closestScrollable,u=Pen(e,c),d=yW(u,r),h=(()=>{if(!c)return null;const g=oje(c),m={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:g,page:yW(g,r),scroll:uae(c),scrollSize:m,shouldClipSubject:l}})();return Oen({descriptor:t,isEnabled:!s,isCombineEnabled:a,isFixedOnPage:i.isFixedOnPage,direction:o,client:u,page:d,closest:h})};const Fen={passive:!1},Ben={passive:!0};var oDe=n=>n.shouldPublishImmediately?Fen:Ben;const o9=n=>n&&n.env.closestScrollable||null;function $en(n){const e=w.useRef(null),t=xW(_G),i=Bve("droppable"),{registry:r,marshal:o}=t,s=jje(n),a=os(()=>({id:n.droppableId,type:n.type,mode:n.mode}),[n.droppableId,n.mode,n.type]),l=w.useRef(a),c=os(()=>bu((C,E)=>{e.current||Zn(!1);const x={x:C,y:E};o.updateDroppableScroll(a.id,x)}),[a.id,o]),u=tr(()=>{const C=e.current;return!C||!C.env.closestScrollable?Qu:uae(C.env.closestScrollable)},[]),d=tr(()=>{const C=u();c(C.x,C.y)},[u,c]),h=os(()=>n3(d),[d]),f=tr(()=>{const C=e.current,E=o9(C);if(C&&E||Zn(!1),C.scrollOptions.shouldPublishImmediately){d();return}h()},[h,d]),g=tr((C,E)=>{e.current&&Zn(!1);const x=s.current,k=x.getDroppableRef();k||Zn(!1);const L=Nen(k),D={ref:k,descriptor:a,env:L,scrollOptions:E};e.current=D;const A=Men({ref:k,descriptor:a,env:L,windowScroll:C,direction:x.direction,isDropDisabled:x.isDropDisabled,isCombineEnabled:x.isCombineEnabled,shouldClipSubject:!x.ignoreContainerClipping}),N=L.closestScrollable;return N&&(N.setAttribute(JLe.contextId,t.contextId),N.addEventListener("scroll",f,oDe(D.scrollOptions))),A},[t.contextId,a,f,s]),m=tr(()=>{const C=e.current,E=o9(C);return C&&E||Zn(!1),uae(E)},[]),v=tr(()=>{const C=e.current;C||Zn(!1);const E=o9(C);e.current=null,E&&(h.cancel(),E.removeAttribute(JLe.contextId),E.removeEventListener("scroll",f,oDe(C.scrollOptions)))},[f,h]),_=tr(C=>{const E=e.current;E||Zn(!1);const x=o9(E);x||Zn(!1),x.scrollTop+=C.y,x.scrollLeft+=C.x},[]),b=os(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:v,scroll:_}),[v,g,m,_]),y=os(()=>({uniqueId:i,descriptor:a,callbacks:b}),[b,a,i]);og(()=>(l.current=y.descriptor,r.droppable.register(y),()=>{e.current&&v(),r.droppable.unregister(y)}),[b,a,v,y,o,r.droppable]),og(()=>{e.current&&o.updateDroppableIsEnabled(l.current.id,!n.isDropDisabled)},[n.isDropDisabled,o]),og(()=>{e.current&&o.updateDroppableIsCombineEnabled(l.current.id,n.isCombineEnabled)},[n.isCombineEnabled,o])}function ree(){}const sDe={width:0,height:0,margin:AQt},Ven=n=>{let{isAnimatingOpenOnMount:e,placeholder:t,animate:i}=n;return e||i==="close"?sDe:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}},Hen=n=>{let{isAnimatingOpenOnMount:e,placeholder:t,animate:i}=n;const r=Ven({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"?mM.placeholder:null}},Wen=n=>{const e=w.useRef(null),t=tr(()=>{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),ree):e.current?ree:(e.current=setTimeout(()=>{e.current=null,l(!1)}),t):ree,[i,a,t]);const c=tr(d=>{d.propertyName==="height"&&(r(),i==="close"&&o())},[i,o,r]),u=Hen({isAnimatingOpenOnMount:a,animate:n.animate,placeholder:n.placeholder});return ce.createElement(n.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":s,onTransitionEnd:c,ref:n.innerRef})};var zen=ce.memo(Wen);class Uen extends ce.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 jen=n=>{const e=w.useContext(_G);e||Zn(!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:f,snapshot:g,useClone:m,updateViewportMaxScroll:v,getContainerForClone:_}=n,b=tr(()=>r.current,[]),y=tr(function(N){N===void 0&&(N=null),r.current=N},[]);tr(()=>o.current,[]);const C=tr(function(N){N===void 0&&(N=null),o.current=N},[]),E=tr(()=>{i()&&v({maxScroll:Fje()})},[i,v]);$en({droppableId:a,type:l,mode:c,direction:u,isDropDisabled:h,isCombineEnabled:f,ignoreContainerClipping:d,getDroppableRef:b});const x=os(()=>ce.createElement(Uen,{on:n.placeholder,shouldAnimate:n.shouldAnimatePlaceholder},N=>{let{onClose:P,data:M,animate:B}=N;return ce.createElement(zen,{placeholder:M,onClose:P,innerRef:C,animate:B,contextId:t,onTransitionEnd:E})}),[t,E,n.placeholder,n.shouldAnimatePlaceholder,C]),k=os(()=>({innerRef:y,placeholder:x,droppableProps:{"data-rfd-droppable-id":a,"data-rfd-droppable-context-id":t}}),[t,a,x,y]),L=m?m.dragging.draggableId:null,D=os(()=>({droppableId:a,type:l,isUsingCloneFor:L}),[a,L,l]);function A(){if(!m)return null;const{dragging:N,render:P}=m,M=ce.createElement(tqe,{draggableId:N.draggableId,index:N.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(B,F)=>P(B,F,N));return uj.createPortal(M,_())}return ce.createElement(Vve.Provider,{value:D},s(k,g),A())};var qen=jen;function Gen(){return document.body||Zn(!1),document.body}const aDe={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:Gen},oqe=n=>{let e={...n},t;for(t in aDe)n[t]===void 0&&(e={...e,[t]:aDe[t]});return e},oee=(n,e)=>n===e.droppable.type,lDe=(n,e)=>e.draggables[n.draggable.id],Ken=()=>{const n={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},e={...n,shouldAnimatePlaceholder:!1},t=bu(o=>({draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}})),i=bu((o,s,a,l,c,u)=>{const d=c.descriptor.id;if(c.descriptor.droppableId===o){const g=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:g}}if(!s)return e;if(!l)return n;const f={isDraggingOver:a,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:f,useClone:null}});return(o,s)=>{const a=oqe(s),l=a.droppableId,c=a.type,u=!a.isDropDisabled,d=a.renderClone;if(l3(o)){const h=o.critical;if(!oee(c,h))return e;const f=lDe(h,o.dimensions),g=rg(o.impact)===l;return i(l,u,g,g,f,d)}if(o.phase==="DROP_ANIMATING"){const h=o.completed;if(!oee(c,h.critical))return e;const f=lDe(h.critical,o.dimensions);return i(l,u,Jje(h.result)===l,rg(h.impact)===l,f,d)}if(o.phase==="IDLE"&&o.completed&&!o.shouldFlush){const h=o.completed;if(!oee(c,h.critical))return e;const f=rg(h.impact)===l,g=!!(h.impact.at&&h.impact.at.type==="COMBINE"),m=h.critical.droppable.id===l;return f?g?n:e:m?n:e}return e}},Yen={updateViewportMaxScroll:UXt},Qen=U6e(Ken,Yen,(n,e,t)=>({...oqe(t),...n,...e}),{context:Fve,areStatePropsEqual:Zje})(qen);var CG=Qen;function Xen(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 Hve(n,e,t){return n=[...n],Xen(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 Zen(n){const{isCompanySettingsActive:e}=$s(),{currentGateways:t,setCurrentGateways:i}=n,r=Zi(),o=Bo(),[s,a]=w.useState([]),[l,c]=w.useState("active"),{data:u}=EWe({status:l}),d=m=>{const v=m.map(_=>_.value);c(v.join(","))},h=m=>{const v=t.filter(({id:_})=>_!==m);i(v),v.length?o("settings.company_gateway_ids",v.map(({id:_})=>_).join(",")):o("settings.company_gateway_ids","0")},f=()=>{const m=(u==null?void 0:u.data.data)||[];m&&(i(m),o("settings.company_gateway_ids",m.map(({id:v})=>v).join(",")))},g=m=>{const v={};return m.forEach(_=>{v[_.id]||(v[_.id]=_)}),Object.values(v)};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(v=>u.data.data.find(_=>_.id===v));m=m.filter(v=>v),e&&u.data.data.forEach(v=>{m.some(b=>b.id===v.id)||m.push(v)}),a(g(m))}else a(g(u.data.data));else a([])},[u]),{gateways:s,handleRemoveGateway:h,handleReset:f,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 qk(){const n=si();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 Jen(n){return Hn({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 ZTr(n){return Hn({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 etn(n){return Hn({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 JTr(n){return Hn({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 ttn(n){const[e]=ve(),t=qk(),{isCompanySettingsActive:i}=$s(),r=Bo(),{includeRemoveAction:o,includeResetAction:s}=n,a=xWe(),l=Zi(),c=xu(),u=w.useRef(null),[d,h]=w.useState([]),[f,g]=w.useState(!1),[m,v]=w.useState([]),[_,b]=w.useState([]),{gateways:y,handleRemoveGateway:C,handleReset:E,onStatusChange:x}=Zen({currentGateways:d,setCurrentGateways:h}),k=()=>{v([]),u.current&&(u.current.checked=!1)},L=()=>_.every(M=>Tr(M)!==nr.Active),D=M=>{var F;const B=Hve(d,M.source.index,(F=M.destination)==null?void 0:F.index);r("settings.company_gateway_ids",B.map(({id:U})=>U).join(",")),h(B)},A=M=>{const B=JSON.parse(M.config);return ntn===M.gateway_key&&!B.account_id},N=M=>{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})=>!M.includes(F)).map(({id:F})=>F).join(",")):r("settings.company_gateway_ids","0"),g(!0))},P=[{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(()=>{f&&(c(f),g(!1))},[f]),w.useEffect(()=>{y&&h(y.filter(M=>M))},[y]),w.useEffect(()=>{if(y){const M=y.filter(B=>B&&m.includes(B.id));b(M)}},[m]),O("div",{className:"flex flex-col",children:[O("div",{className:"flex justify-between",children:[O("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:[O(Fm,{label:e("more_actions"),disabled:!m.length,children:[p(gt,{onClick:()=>{a(m,"archive").then(()=>N(m)),k()},icon:p(nt,{element:Dc}),children:e("archive")}),p(gt,{onClick:()=>{a(m,"delete").then(()=>N(m)),k()},icon:p(nt,{element:el}),children:e("delete")}),L()&&p(gt,{onClick:()=>{a(m,"restore"),k()},icon:p(nt,{element:Lc}),children:e("restore")})]}),p(_v,{styles:t,defaultValue:P[0],onChange:M=>x(M),placeholder:e("status"),options:P,isMulti:!0})]}),O("div",{className:"flex space-x-5",children:[s&&p(un,{behavior:"button",type:"secondary",onClick:E,children:e("reset")}),p(un,{to:"/settings/gateways/create",children:e("add_gateway")})]})]}),O(ZS,{children:[O(eE,{children:[p(Ma,{children:p(Oh,{innerRef:u,onChange:M=>{Array.from(document.querySelectorAll(".child-checkbox")).forEach(B=>{B.checked=M.target.checked,M.target.checked?v(F=>[...F,B.id]):v(F=>F.filter(U=>U!==B.id))})}})}),p(Ma,{children:e("status")}),p(Ma,{children:e("label")}),p(Ma,{children:e("test_mode")}),p(Ma,{disableUppercase:!0,children:p(Yu,{placement:"top",message:e("priority"),width:"auto",children:p(nt,{element:etn,color:"white",size:20})})})]}),p(bG,{onDragEnd:D,children:p(CG,{droppableId:"gateways-table",children:M=>O(JS,{...M.droppableProps,innerRef:M.innerRef,children:[d.map((B,F)=>p(yG,{draggableId:F.toString(),index:F,children:U=>w.createElement(wc,{...U.draggableProps,...U.dragHandleProps,innerRef:U.innerRef,key:F},p(To,{width:"10%",children:p(Oh,{checked:m.includes(B.id),className:"child-checkbox",value:B.id,id:B.id,onValueChange:H=>m.includes(H)?v(W=>W.filter(q=>q!==H)):v(W=>[...W,H])})}),p(To,{width:"30%",children:p($m,{entity:B})}),p(To,{width:o?"30%":"35%",children:O("div",{className:"flex items-center space-x-2",children:[p(qi,{to:At("/settings/gateways/:id/edit?tab=:tab",{id:B.id,tab:A(B)?1:0}),children:B.label}),A(B)&&p(Yu,{message:e("stripe_connect_migration_title"),width:"auto",placement:"top",children:O("div",{className:"flex space-x-2",children:[p(Ly,{color:"red",size:22}),p(Ly,{color:"red",size:22})]})})]})}),p(To,{width:o?"20%":"25%",children:B.test_mode?p(Qj,{size:20}):""}),p(To,{width:"25%",children:O("div",{className:"flex items-center space-x-7 py-1",children:[o&&p(un,{behavior:"button",type:"minimal",onClick:()=>C(B.id),children:e("remove")}),p(nt,{element:B9e,size:25})]})}))},F)),d.length?p(w.Fragment,{}):p(wc,{children:O(To,{colSpan:100,children:[e("no_records_found"),"."]})}),M.placeholder]})})})]})]})}const ntn="d14dd26a47cecc30fdd65700bfb67b34";function itn(){const{isGroupSettingsActive:n,isClientSettingsActive:e}=$s();return p(ttn,{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 sqe(n){return Ii(["/api/v1/payment_terms",n],()=>$e("GET",Ae("/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 rtn(n){return Ii(["/api/v1/payment_terms",n],()=>$e("GET",Ae("/api/v1/payment_terms/:id",n),{headers:LT()}),{staleTime:1/0})}function Wve(n,e){return $e("POST",Ae("/api/v1/payment_terms/bulk"),{action:e,ids:n})}function otn(){const{isAdmin:n}=Fo();return Ii(["/api/v1/payment_terms/create"],()=>$e("GET",Ae("/api/v1/payment_terms/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function stn(){var v,_,b,y,C;Mi("online_payments");const[n]=ve(),e=zi(),t=pa(),{isCompanySettingsActive:i}=$s(),{data:r}=ph(),o=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"}],[s,a]=w.useState(),{data:l}=sqe({}),c=Gi(Bs),u=Pc(),d=tje(),h=Bo(),f=xu(),g=lp(),m=(E,x)=>{e(go({object:"company",property:E,value:x}))};return w.useEffect(()=>{l&&a(l.data.data)},[l]),O(sr,{title:n("online_payments"),breadcrumbs:o,docsLink:"en/basic-settings/#online_payments",onSaveClick:f,onCancelClick:g,children:[p(itn,{}),O(tn,{title:n("settings"),children:[p(G,{leftSide:p(Ht,{propertyKey:"auto_bill_standard_invoices",labelElement:p(Wt,{label:n("auto_bill_standard_invoices"),helpLabel:n("auto_bill_standard_invoices_help")}),defaultValue:!1}),children:p(kt,{checked:!!((v=u==null?void 0:u.settings)!=null&&v.auto_bill_standard_invoices),onChange:E=>h("settings.auto_bill_standard_invoices",E),disabled:t("auto_bill_standard_invoices")})}),p(G,{leftSide:p(Ht,{propertyKey:"auto_bill",labelElement:p(Wt,{label:`${n("auto_bill")} ${n("recurring_invoices")}`}),defaultValue:"off"}),children:O(En,{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:[O("option",{value:"always",children:[n("enabled")," (",n("auto_bill_help_always"),")"]}),O("option",{value:"optout",children:[n("optout")," (",n("auto_bill_help_optout"),")"]}),O("option",{value:"optin",children:[n("optin")," (",n("auto_bill_help_optin"),")"]}),O("option",{value:"off",children:[n("disabled")," (",n("auto_bill_help_off"),")"]})]})}),p(G,{leftSide:p(Ht,{propertyKey:"auto_bill_date",labelElement:p(Wt,{label:n("auto_bill_on"),helpLabel:n("auto_bill_on_help")}),defaultValue:"on_send_date"}),children:O(En,{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:[p("option",{value:"on_send_date",children:n("send_date")}),p("option",{value:"on_due_date",children:n("due_date")})]})}),p(G,{leftSide:p(Ht,{propertyKey:"use_credits_payment",labelElement:p(Wt,{label:n("use_available_credits"),helpLabel:n("use_available_credits_help")}),defaultValue:"off"}),children:O(En,{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:[p("option",{value:"always",children:n("enabled")}),p("option",{value:"option",children:n("show_option")}),p("option",{value:"off",children:n("off")})]})}),p(G,{leftSide:p(Ht,{propertyKey:"use_unapplied_payment",labelElement:p(Wt,{label:n("use_unapplied_payments"),helpLabel:n("use_unapplied_payments_help")}),defaultValue:"off"}),children:O(En,{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:[p("option",{value:"always",children:n("enabled")}),p("option",{value:"option",children:n("show_option")}),p("option",{value:"off",children:n("off")})]})}),s&&O(St,{children:[p(G,{leftSide:p(Ht,{propertyKey:"payment_terms",labelElement:p(Wt,{label:n("payment_terms"),helpLabel:n("payment_terms_help")})}),children:O(En,{value:((_=u==null?void 0:u.settings)==null?void 0:_.payment_terms)||"",id:"settings.payment_terms",onChange:d,disabled:t("payment_terms"),errorMessage:c==null?void 0:c.errors["settings.payment_terms"],children:[p("option",{value:""}),s.map(E=>p("option",{value:E.num_days,children:E.name},E.id))]})}),p(G,{className:"py-0 sm:py-0",children:p(qi,{to:"/settings/payment_terms",children:n("configure_payment_terms")})})]}),p(G,{leftSide:p(Ht,{propertyKey:"payment_type_id",labelElement:p(Wt,{label:n("payment_type"),helpLabel:n("payment_type_help")})}),children:p(En,{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(E=>p("option",{value:E.id,children:E.name},E.id))})}),p(G,{leftSide:p(Ht,{propertyKey:"valid_until",labelElement:p(Wt,{label:n("quote_valid_until"),helpLabel:n("quote_valid_until_help")})}),children:p(En,{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(E=>p("option",{value:E.num_days,children:E.name},E.id))})}),p(G,{leftSide:p(Ht,{propertyKey:"default_expense_payment_type_id",labelElement:p(Wt,{label:n("expense_payment_type"),helpLabel:n("expense_payment_type_help")})}),children:p(En,{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(E=>p("option",{value:E.id,children:E.name},E.id))})}),p(G,{leftSideHelp:n("manual_payment_email_help"),leftSide:p(Ht,{propertyKey:"client_manual_payment_notification",labelElement:p(Wt,{label:n("manual_payment_email")}),defaultValue:!1}),children:p(kt,{checked:!!(u!=null&&u.settings.client_manual_payment_notification),onChange:E=>m("settings.client_manual_payment_notification",E),disabled:t("client_manual_payment_notification")})}),p(G,{leftSideHelp:n("online_payment_email_help"),leftSide:p(Ht,{propertyKey:"client_online_payment_notification",labelElement:p(Wt,{label:n("online_payment_email")}),defaultValue:!1}),children:p(kt,{checked:!!(u!=null&&u.settings.client_online_payment_notification),onChange:E=>m("settings.client_online_payment_notification",E),disabled:t("client_online_payment_notification")})}),p(G,{leftSide:p(Ht,{propertyKey:"send_email_on_mark_paid",labelElement:p(Wt,{label:n("mark_paid_payment_email"),helpLabel:n("mark_paid_payment_email_help")}),defaultValue:!1}),children:p(kt,{checked:!!(u!=null&&u.settings.send_email_on_mark_paid),onChange:E=>m("settings.send_email_on_mark_paid",E),disabled:t("send_email_on_mark_paid")})}),i&&p(G,{leftSide:n("enable_applying_payments"),leftSideHelp:n("enable_applying_payments_help"),children:p(kt,{id:"allow_over_payment",checked:!!(u!=null&&u.enable_applying_payments),onChange:E=>h("enable_applying_payments",E)})}),p(G,{leftSide:p(Ht,{propertyKey:"client_portal_allow_over_payment",labelElement:p(Wt,{label:n("allow_over_payment")}),defaultValue:!1}),leftSideHelp:n("allow_over_payment_help"),children:p(kt,{id:"allow_over_payment",checked:!!(u!=null&&u.settings.client_portal_allow_over_payment),onChange:E=>h("settings.client_portal_allow_over_payment",E),disabled:t("client_portal_allow_over_payment")})}),p(G,{leftSide:p(Ht,{propertyKey:"client_portal_allow_under_payment",labelElement:p(Wt,{label:n("allow_under_payment")}),defaultValue:!1}),leftSideHelp:n("allow_under_payment_help"),children:p(kt,{id:"allow_under_payment",checked:!!(u!=null&&u.settings.client_portal_allow_under_payment),onChange:E=>h("settings.client_portal_allow_under_payment",E),disabled:t("client_portal_allow_under_payment")})}),(u==null?void 0:u.settings.client_portal_allow_under_payment)&&p(G,{leftSide:p(Ht,{propertyKey:"client_portal_under_payment_minimum",labelElement:p(Wt,{label:n("minimum_under_payment_amount")})}),children:p(mo,{value:(u==null?void 0:u.settings.client_portal_under_payment_minimum)||"",onValueChange:E=>h("settings.client_portal_under_payment_minimum",parseFloat(E)||0),disabled:t("client_portal_under_payment_minimum"),errorMessage:c==null?void 0:c.errors["settings.client_portal_under_payment_minimum"]})}),p(G,{leftSide:p(Ht,{propertyKey:"client_initiated_payments",labelElement:p(Wt,{label:n("client_initiated_payments")}),defaultValue:!1}),leftSideHelp:n("client_initiated_payments_help"),children:p(kt,{id:"client_initiated_payments",checked:!!(u!=null&&u.settings.client_initiated_payments),onChange:E=>h("settings.client_initiated_payments",E),disabled:t("client_initiated_payments")})}),(u==null?void 0:u.settings.client_initiated_payments)&&p(G,{leftSide:p(Ht,{propertyKey:"client_initiated_payments_minimum",labelElement:p(Wt,{label:n("minimum_payment_amount")})}),children:p(mo,{value:(u==null?void 0:u.settings.client_initiated_payments_minimum)||"",onValueChange:E=>h("settings.client_initiated_payments_minimum",parseFloat(E)),disabled:t("client_initiated_payments_minimum"),errorMessage:c==null?void 0:c.errors["settings.client_initiated_payments_minimum"]})}),p(G,{leftSide:p(Ht,{propertyKey:"payment_email_all_contacts",labelElement:p(Wt,{label:n("payment_email_all_contacts")}),defaultValue:!1}),leftSideHelp:n("payment_email_all_contacts_help"),children:p(kt,{id:"payment_email_all_contacts",checked:!!(u!=null&&u.settings.payment_email_all_contacts),onChange:E=>h("settings.payment_email_all_contacts",E),disabled:t("payment_email_all_contacts")})}),p(G,{leftSide:p(Ht,{propertyKey:"payment_flow",labelElement:p(Wt,{label:n("one_page_checkout")}),defaultValue:!1}),leftSideHelp:n("one_page_checkout_help"),children:p(kt,{id:"payment_flow",checked:(u==null?void 0:u.settings.payment_flow)==="smooth",onChange:E=>h("settings.payment_flow",E?"smooth":"default"),disabled:t("payment_flow")})})]})]})}function cDe(n){var u,d,h;const[e]=ve(),t=Zi(),i=Bo(),r=pa(),{title:o}=n,s=Gi(Bs),{data:a}=IWe({perPage:100,status:["active"]}),l=f=>{const g=f.target.options[f.target.selectedIndex];i(f.target.id,parseFloat(g.dataset.rate||"0")),i(g.dataset.rateName,f.target.value)},c=f=>{const g=An.cloneDeep(t==null?void 0:t.settings);delete g[f],i("settings",g)};return p(St,{children:(t==null?void 0:t.enabled_tax_rates)>0&&O(tn,{title:o?e(o):void 0,children:[(t==null?void 0:t.enabled_tax_rates)>0&&p(G,{leftSide:p(Ht,{propertyKey:"tax_name1",labelElement:p(Wt,{label:e("default_tax_rate")}),onCheckboxChange:f=>{f?i("settings.tax_rate1",0):c("tax_rate1")}}),children:O(En,{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:[p("option",{"data-rate":0,"data-rate-name":"settings.tax_name1",value:""}),a&&a.data.data.map(f=>O("option",{"data-rate":f.rate,"data-rate-name":"settings.tax_name1",value:f.name,children:[f.rate,"% — ",f.name]},f.id))]})}),(t==null?void 0:t.enabled_tax_rates)>1&&p(G,{leftSide:p(Ht,{propertyKey:"tax_name2",labelElement:p(Wt,{label:e("default_tax_rate")}),onCheckboxChange:f=>{f?i("settings.tax_rate2",0):c("tax_rate2")}}),children:O(En,{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:[p("option",{"data-rate":0,"data-rate-name":"settings.tax_name2",value:""}),a&&a.data.data.map(f=>O("option",{"data-rate":f.rate,"data-rate-name":"settings.tax_name2",value:f.name,children:[f.rate,"% — ",f.name]},f.id))]})}),(t==null?void 0:t.enabled_tax_rates)>2&&p(G,{leftSide:p(Ht,{propertyKey:"tax_name3",labelElement:p(Wt,{label:e("default_tax_rate")}),onCheckboxChange:f=>{f?i("settings.tax_rate3",0):c("tax_rate3")}}),children:O(En,{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:[p("option",{"data-rate":0,"data-rate-name":"settings.tax_name3",value:""}),a&&a.data.data.map(f=>O("option",{"data-rate":f.rate,"data-rate-name":"settings.tax_name3",value:f.name,children:[f.rate,"% — ",f.name]},f.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 atn(){const n=Mk();return new Date(n==null?void 0:n.plan_expires)>new Date&&(xc()||Bm()),fR()}function zve(n){const[e]=ve(),{visible:t,setVisible:i,region:r,subregion:o,taxSetting:s}=n,a=Bo(),l=()=>{i(!1)};return O(Or,{title:`${r} - ${o}`,visible:t,onClose:l,children:[p(Ze,{label:e("tax_name"),value:s.tax_name,onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.tax_name`,c)}),p(mo,{label:e("tax_rate"),value:s.tax_rate||"",onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.tax_rate`,parseFloat(c))}),p(mo,{label:e("reduced_rate"),value:s.reduced_tax_rate||"",onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.reduced_tax_rate`,parseFloat(c))}),p(un,{className:"self-end",behavior:"button",onClick:l,disableWithoutIcon:!0,children:e("save")})]})}function ltn(){const[n]=ve(),e=Bo(),t=Zi(),[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]),f=(m,v)=>{e(m,v),r(!v)},g=m=>{const v=document.getElementById(m.replace(".apply_tax",""));v==null||v.click()};return O(St,{children:[p(G,{leftSide:"Australia",children:O("div",{className:"grid grid-cols-5 gap-4",children:[p("div",{className:"col-span-4",children:O(En,{id:"tax_data.regions.AU.tax_all_subregions",className:"",value:t.tax_data.regions.AU.tax_all_subregions,onValueChange:m=>f("tax_data.regions.AU.tax_all_subregions",m==="true"),children:[p("option",{value:"true",children:n("tax_all")}),O("option",{value:"false",children:[n("tax_selected")," - [ ",h," ",n("selected")," ]"]})]})}),!t.tax_data.regions.AU.tax_all_subregions&&p("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:p(un,{type:"primary",className:"",onClick:m=>{m.preventDefault(),r(v=>!v)},children:n(i?"hide":"show")})})]})},"AU"),i&&(a==null?void 0:a.map((m,v)=>O("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:[O("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:()=>g(`tax_data.regions.AU.subregions.${m[0]}.apply_tax`),children:[p(Oh,{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:(_,b)=>e(_,b)}),p("div",{className:"",children:m[0]})]}),O("div",{onClick:()=>g(`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}%`:""]}),p("div",{className:"flex justify-end",children:p(un,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.AU.tax_all_subregions,onClick:_=>{_.preventDefault(),c(m[1]),d(m[0]),s(!0)},children:n("edit")})})]},v))),p(zve,{visible:o,setVisible:s,region:"AU",subregion:u,taxSetting:l})]})}function ctn(){const[n]=ve(),e=Bo(),t=Zi(),[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=v=>!!v,f=w.useMemo(()=>a.filter(([,v])=>h(v.apply_tax)).length,[a]),g=(v,_)=>{e(v,_),r(!_)},m=v=>{const _=document.getElementById(v.replace(".apply_tax",""));_==null||_.click()};return O(St,{children:[p(G,{leftSide:"Europe",children:O("div",{className:"grid grid-cols-5 gap-4",children:[p("div",{className:"col-span-4",children:O(En,{id:"tax_data.regions.EU.tax_all_subregions",className:"",value:t.tax_data.regions.EU.tax_all_subregions,onValueChange:v=>g("tax_data.regions.EU.tax_all_subregions",v==="true"),children:[p("option",{value:"true",children:n("tax_all")}),O("option",{value:"false",children:[n("tax_selected")," - [ ",f," ",n("selected")," ]"]})]})}),!t.tax_data.regions.EU.tax_all_subregions&&p("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:p(un,{type:"primary",className:"",onClick:v=>{v.preventDefault(),r(_=>!_)},children:n(i?"hide":"show")})})]})},"EU"),i&&(a==null?void 0:a.map((v,_)=>O("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:[O("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:()=>m(`tax_data.regions.EU.subregions.${v[0]}.apply_tax`),children:[p(Oh,{id:`tax_data.regions.EU.subregions.${v[0]}`,value:`tax_data.regions.EU.subregions.${v[0]}.apply_tax`,checked:!!v[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)}),p("div",{className:"",children:v[0]})]}),O("div",{onClick:()=>m(`tax_data.regions.EU.subregions.${v[0]}.apply_tax`),children:[v[1].tax_name," ",v[1].tax_rate,"%"," ",v[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${v[1].reduced_tax_rate}%`:""]}),p("div",{className:"flex justify-end",children:p(un,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.EU.tax_all_subregions,onClick:b=>{b.preventDefault(),c(v[1]),d(v[0]),s(!0)},children:n("edit")})})]},_))),p(zve,{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 utn={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 dtn(n){return p(A1,{value:n.value,label:n.label,disabled:n.disabled,onValueChange:n.onChange,errorMessage:n.errorMessage,dismissable:!0,children:Object.entries(utn).map((e,t)=>p("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
*/const aqe={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","ES-CN":"Canary Islands","ES-ML":"Melilla","ES-CE":"Ceuta",SE:"Sweden"};function htn(n){return p(A1,{value:n.value,label:n.label,disabled:n.disabled,onValueChange:n.onChange,errorMessage:n.errorMessage,dismissable:!0,children:Object.entries(aqe).map((e,t)=>p("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 ftn(){const n=yve();return e=>{const t=n.find(i=>i.id===e);return!!(t&&aqe[t.iso_3166_2])}}function ptn(){var o,s,a,l,c,u;const[n]=ve(),e=Zi(),t=Bo(),i=$R(),r=ftn();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]),O(G,{leftSide:n("seller_subregion"),children:[((o=i(e==null?void 0:e.settings.country_id))==null?void 0:o.iso_3166_2)==="US"&&p(dtn,{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)&&p(htn,{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"&&p(Ze,{type:"text",disabled:!0,name:"tax_data.seller_subregion",value:"AU"})]})}function gtn(){const[n]=ve(),e=Bo(),t=Zi(),[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=v=>!!v,f=w.useMemo(()=>a.filter(([,v])=>h(v.apply_tax)).length,[a]),g=(v,_)=>{e(v,_),r(!_)},m=v=>{const _=document.getElementById(v.replace(".apply_tax",""));_==null||_.click()};return O(St,{children:[p(G,{leftSide:n("united_states"),children:O("div",{className:"grid grid-cols-5 gap-4",children:[p("div",{className:"col-span-4",children:O(En,{id:"tax_data.regions.US.tax_all_subregions",className:"",value:t.tax_data.regions.US.tax_all_subregions,onValueChange:v=>g("tax_data.regions.US.tax_all_subregions",v==="true"),children:[p("option",{value:"true",children:n("tax_all")}),O("option",{value:"false",children:[n("tax_selected")," - [ ",f," ",n("selected")," ]"]})]})}),!t.tax_data.regions.US.tax_all_subregions&&p("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:p(un,{type:"primary",className:"",onClick:v=>{v.preventDefault(),r(_=>!_)},children:n(i?"hide":"show")})})]})},"US"),i&&(a==null?void 0:a.map((v,_)=>O("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:[O("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:()=>m(`tax_data.regions.US.subregions.${v[0]}.apply_tax`),children:[p(Oh,{id:`tax_data.regions.US.subregions.${v[0]}`,value:`tax_data.regions.US.subregions.${v[0]}.apply_tax`,checked:!!v[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)}),p("div",{className:"",children:v[0]})]}),O("div",{onClick:()=>m(`tax_data.regions.US.subregions.${v[0]}.apply_tax`),children:[v[1].tax_name," ",v[1].tax_rate,"%"," ",v[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${v[1].reduced_tax_rate}%`:""]}),p("div",{className:"flex justify-end",children:p(un,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.US.tax_all_subregions,onClick:b=>{b.preventDefault(),c(v[1]),d(v[0]),s(!0)},children:n("edit")})})]},_))),p(zve,{visible:o,setVisible:s,region:"US",subregion:u,taxSetting:l})]})}function mtn(){return O(St,{children:[p(ptn,{}),p(gtn,{}),p(ctn,{}),p(ltn,{})]})}/**
* 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 _tn(){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=$R();return t=>{var i;return n.includes(((i=e(t))==null?void 0:i.iso_3166_2)||"")}}function vtn(){var f;const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("tax_settings"),href:"/settings/tax_settings"}];Pc(),Mi("tax_settings"),atn();const t=_tn(),{isCompanySettingsActive:i,isGroupSettingsActive:r,isClientSettingsActive:o}=$s(),s=Gi(Bs),a=zi(),l=Zi(),c=g=>{a(go({object:"company",property:g.target.id,value:g.target.value}))},u=(g,m)=>{a(go({object:"company",property:g,value:m}))},d=xu(),h=lp();return O(sr,{onSaveClick:d,onCancelClick:h,title:n("tax_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#tax_settings",children:[i&&O(St,{children:[O(tn,{title:n("tax_settings"),children:[p(G,{leftSide:n("invoice_tax_rates"),children:O(En,{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:[p("option",{value:"0",children:n("disabled")}),p("option",{value:"1",children:n("one_tax_rate")}),p("option",{value:"2",children:n("two_tax_rates")}),p("option",{value:"3",children:n("three_tax_rates")})]})}),p(G,{leftSide:n("line_item_tax_rates"),children:O(En,{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:[p("option",{value:"0",children:n("disabled")}),p("option",{value:"1",children:n("one_tax_rate")}),p("option",{value:"2",children:n("two_tax_rates")}),p("option",{value:"3",children:n("three_tax_rates")})]})}),p(G,{leftSide:n("expense_tax_rates"),children:O(En,{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:[p("option",{value:"0",children:n("disabled")}),p("option",{value:"1",children:n("one_tax_rate")}),p("option",{value:"2",children:n("two_tax_rates")}),p("option",{value:"3",children:n("three_tax_rates")})]})}),p(G,{leftSide:n("inclusive_taxes"),children:O("div",{className:"flex items-center space-x-7",children:[p(kt,{onChange:g=>u("settings.inclusive_taxes",g),checked:!!(l!=null&&l.settings.inclusive_taxes),cypressRef:"inclusiveTaxToggle"}),l!=null&&l.settings.inclusive_taxes?O("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]}):O("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]})]})}),t((f=l==null?void 0:l.settings)==null?void 0:f.country_id)&&O(St,{children:[p(vi,{}),p(G,{leftSide:n("calculate_taxes"),leftSideHelp:n("calculate_taxes_help"),children:p(kt,{checked:!!(l!=null&&l.calculate_taxes),onChange:g=>u("calculate_taxes",g)})}),l.calculate_taxes&&p(mtn,{})]})]}),p(cDe,{})]}),(r||o)&&p(cDe,{title:"tax_settings"}),p(Bdn,{})]})}function btn(){const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("product_settings"),href:"/settings/product_settings"}];Pc(),Mi("product_settings");const t=Gi(Bs),i=zi(),r=Zi(),o=(c,u)=>{i(go({object:"company",property:c,value:u}))},s=Bo(),a=xu(),l=lp();return p(sr,{onSaveClick:a,onCancelClick:l,title:n("product_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#product_settings",children:O(tn,{title:n("Settings"),children:[p(G,{leftSide:n("track_inventory"),leftSideHelp:n("track_inventory_help"),children:p(kt,{checked:r==null?void 0:r.track_inventory,onChange:c=>o("track_inventory",c)})}),p(G,{leftSide:n("stock_notifications"),leftSideHelp:n("stock_notifications_help"),children:p(kt,{checked:r==null?void 0:r.stock_notification,onChange:c=>o("stock_notification",c)})}),(r==null?void 0:r.stock_notification)===!0?p(St,{children:p(G,{leftSide:n("notification_threshold"),children:p(mo,{precision:0,value:(r==null?void 0:r.inventory_notification_threshold)||"",onValueChange:c=>s("inventory_notification_threshold",parseFloat(c)),errorMessage:t==null?void 0:t.errors.inventory_notification_threshold,disablePrecision:!0})})}):"",p(vi,{}),p(G,{leftSide:n("show_product_discount"),leftSideHelp:n("show_product_discount_help"),children:p(kt,{checked:r==null?void 0:r.enable_product_discount,onChange:c=>o("enable_product_discount",c)})}),p(G,{leftSide:n("show_product_cost"),leftSideHelp:n("show_cost_help"),children:p(kt,{checked:r==null?void 0:r.enable_product_cost,onChange:c=>o("enable_product_cost",c)})}),p(G,{leftSide:n("show_product_quantity"),leftSideHelp:n("show_product_quantity_help"),children:p(kt,{checked:r==null?void 0:r.enable_product_quantity,onChange:c=>o("enable_product_quantity",c)})}),p(G,{leftSide:n("default_quantity"),leftSideHelp:n("default_quantity_help"),children:p(kt,{checked:r==null?void 0:r.default_quantity,onChange:c=>o("default_quantity",c)})}),p(vi,{}),p(G,{leftSide:n("fill_products"),leftSideHelp:n("fill_products_help"),children:p(kt,{checked:r==null?void 0:r.fill_products,onChange:c=>o("fill_products",c)})}),p(G,{leftSide:n("update_products"),leftSideHelp:n("update_products_help"),children:p(kt,{checked:r==null?void 0:r.update_products,onChange:c=>o("update_products",c)})}),p(G,{leftSide:n("convert_products"),leftSideHelp:n("convert_products_help"),children:p(kt,{checked:r==null?void 0:r.convert_products,onChange:c=>o("convert_products",c)})})]})})}function ytn(){var f,g,m,v,_,b,y,C;Mi("task_settings");const[n]=ve();Pc();const e=zi(),t=lp(),i=xu(),r=pa(),o=Bo(),s=Zi(),a=Gi(Bs),{isCompanySettingsActive:l}=$s(),c=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"}],u=()=>{var E;return((E=s==null?void 0:s.settings)==null?void 0:E.task_round_to_nearest)===-1||![1,60,300,900,1800,3600,86400].find(x=>{var k;return x===((k=s==null?void 0:s.settings)==null?void 0:k.task_round_to_nearest)})},d=E=>e(go({object:"company",property:E.target.id,value:E.target.value})),h=(E,x)=>e(go({object:"company",property:E,value:x}));return O(sr,{onSaveClick:i,onCancelClick:t,title:n("task_settings"),breadcrumbs:c,docsLink:"en/basic-settings/#task_settings",children:[O(tn,{title:n("settings"),children:[p(G,{leftSide:p(Ht,{propertyKey:"default_task_rate",labelElement:p(Wt,{label:n("default_task_rate")})}),children:p(mo,{value:((f=s==null?void 0:s.settings)==null?void 0:f.default_task_rate)||"",onValueChange:E=>o("settings.default_task_rate",parseFloat(E)),disabled:r("default_task_rate"),errorMessage:a==null?void 0:a.errors["settings.default_task_rate"]})}),l&&p(G,{leftSide:n("auto_start_tasks"),leftSideHelp:n("auto_start_tasks_help"),children:p(kt,{checked:!!(s!=null&&s.auto_start_tasks),onChange:E=>h("auto_start_tasks",E)})}),l&&p(G,{leftSide:n("show_task_end_date"),leftSideHelp:n("show_task_end_date_help"),children:p(kt,{checked:!!(s!=null&&s.show_task_end_date),onChange:E=>h("show_task_end_date",E)})}),l&&p(G,{leftSide:n("show_task_item_description"),leftSideHelp:n("show_task_item_description_help"),children:p(kt,{checked:!!(s!=null&&s.settings.show_task_item_description),onChange:E=>h("settings.show_task_item_description",E)})}),l&&p(G,{leftSide:n("allow_billable_task_items"),leftSideHelp:n("allow_billable_task_items_help"),children:p(kt,{checked:!!(s!=null&&s.settings.allow_billable_task_items),onChange:E=>h("settings.allow_billable_task_items",E)})}),l&&p(vi,{}),l&&p(G,{leftSide:n("show_tasks_table"),leftSideHelp:n("show_tasks_table_help"),children:p(kt,{checked:!!(s!=null&&s.show_tasks_table),onChange:E=>h("show_tasks_table",E)})}),l&&p(G,{leftSide:n("invoice_task_datelog"),leftSideHelp:n("invoice_task_datelog_help"),children:p(kt,{checked:!!(s!=null&&s.invoice_task_datelog),onChange:E=>h("invoice_task_datelog",E)})}),l&&p(G,{leftSide:n("invoice_task_timelog"),leftSideHelp:n("invoice_task_timelog_help"),children:p(kt,{checked:!!(s!=null&&s.invoice_task_timelog),onChange:E=>h("invoice_task_timelog",E)})}),l&&p(G,{leftSide:n("invoice_task_hours"),leftSideHelp:n("invoice_task_hours_help"),children:p(kt,{checked:!!(s!=null&&s.invoice_task_hours),onChange:E=>h("invoice_task_hours",E)})}),l&&p(G,{leftSide:n("invoice_task_project"),leftSideHelp:n("invoice_task_project_help"),children:p(kt,{checked:!!(s!=null&&s.invoice_task_project),onChange:E=>h("invoice_task_project",E)})}),l&&p(G,{leftSide:n("invoice_task_item_description"),leftSideHelp:n("invoice_task_item_description_help"),children:p(kt,{checked:!!(s!=null&&s.invoice_task_item_description),onChange:E=>h("invoice_task_item_description",E)})}),l&&p(G,{leftSide:n("lock_invoiced_tasks"),leftSideHelp:n("lock_invoiced_tasks_help"),children:p(kt,{checked:!!(s!=null&&s.invoice_task_lock),onChange:E=>h("invoice_task_lock",E)})}),l&&p(G,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:p(kt,{checked:!!(s!=null&&s.invoice_task_documents),onChange:E=>h("invoice_task_documents",E)})}),p(vi,{}),p(G,{leftSide:p(Ht,{propertyKey:"enable_client_portal_tasks",labelElement:p(Wt,{label:n("show_tasks_in_client_portal")}),defaultValue:!1}),children:p(kt,{checked:!!((g=s==null?void 0:s.settings)!=null&&g.enable_client_portal_tasks),onChange:E=>h("settings.enable_client_portal_tasks",E),disabled:r("enable_client_portal_tasks")})}),p(G,{leftSide:p(Ht,{propertyKey:"show_all_tasks_client_portal",labelElement:p(Wt,{label:n("tasks_shown_in_portal")}),defaultValue:"invoiced"}),children:O(En,{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:v.show_all_tasks_client_portal)==null?void 0:_.toString())||"invoiced",errorMessage:a==null?void 0:a.errors["settings.show_all_tasks_client_portal"],children:[p("option",{value:"invoiced",children:n("invoiced")}),p("option",{value:"uninvoiced",children:n("uninvoiced")}),p("option",{value:"all",children:n("all")})]})}),p(G,{leftSide:p(Ht,{propertyKey:"task_round_up",labelElement:p(Wt,{label:n("round_tasks"),helpLabel:n("round_tasks_help")}),defaultValue:!0}),children:O("div",{className:"flex items-center space-x-7",children:[p(kt,{checked:!!(((b=s==null?void 0:s.settings)==null?void 0:b.task_round_up)??!0),onChange:E=>h("settings.task_round_up",E),disabled:r("task_round_up")}),s!=null&&s.settings.task_round_up?p("span",{children:n("round_up")}):p("span",{children:n("round_down")})]})}),p(G,{leftSideHelp:n("task_round_to_nearest_help"),leftSide:p(Ht,{propertyKey:"task_round_to_nearest",labelElement:p(Wt,{label:n("task_round_to_nearest")}),defaultValue:1}),children:O(En,{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:E=>o("settings.task_round_to_nearest",parseFloat(E)),disabled:r("task_round_to_nearest"),children:[O("option",{value:"1",children:[n("1_second")," (",n("disabled"),")"]}),p("option",{value:"60",children:n("1_minute")}),p("option",{value:"300",children:Ca("count_minutes",{count:5})}),p("option",{value:"900",children:Ca("count_minutes",{count:15})}),p("option",{value:"1800",children:Ca("count_minutes",{count:30})}),p("option",{value:"3600",children:n("1_hour")}),p("option",{value:"86400",children:n("1_day")}),p("option",{value:"-1",children:n("custom")})]})}),u()&&p(G,{leftSide:n("task_round_to_nearest"),children:p(mo,{precision:0,value:((C=s==null?void 0:s.settings)==null?void 0:C.task_round_to_nearest)||-1,onValueChange:E=>o("settings.task_round_to_nearest",parseFloat(E)),disabled:r("task_round_to_nearest"),disablePrecision:!0})})]}),l&&p(Kdn,{})]})}function Ctn(n){const[e]=ve(),{customFilter:t}=n,i=n.customFilters?Ja(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(f=>f.dropdownKey!==c&&t.some(g=>g===f.value)))||[];return n.onCustomFilterChange([...h.map(f=>f.value),...d])}else return n.onCustomFilterChange(d)}},s=si(),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 O("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:[O("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&&p(_v,{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&&p(_v,{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)})]}),O("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,p(Ze,{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 lqe(){const[n]=ve();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 wtn=W8e(()=>sessionStorage),cqe=Yj("dataTableFilters",{},wtn);function Stn(n){const{tableKey:e}=n,t=Wi(cqe);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 uqe(n){const e=vF(),{tableKey:t}=n,i=Gi(cqe);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 Etn(n){const e=lqe(),{isInitialConfiguration:t,tableKey:i,customFilters:r,apiEndpoint:o,customFilter:s}=n,a=uqe({tableKey:i}),l=()=>{if(!t){const d=a("status"),h=d!=null&&d.length?d:["active"];return e.filter(({value:f})=>h.includes(f))||[e[0]]}},c=()=>{if(!t&&r){const d=a("customFilter"),h=d!=null&&d.length?d:[];return r.filter(({value:f})=>h.includes(f))||[r[0]]}},u=()=>{r&&Ja(r).pluck("queryKey").unique().toArray().forEach(h=>{const f=h||"client_status",g=[];r.forEach((m,v)=>{(m.queryKey||null)===h&&(s!=null&&s.includes(m.value))&&g.push(m.value),v===r.length-1&&o.searchParams.set(f,g.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 xtn(n){const e=vF(),t=zi(),{apiEndpoint:i,customFilters:r,tableKey:o,isInitialConfiguration:s,customFilter:a,setFilter:l,setCustomFilter:c,setCurrentPage:u,setSort:d,setSortedBy:h,setStatus:f,setPerPage:g,withoutStoringPerPage:m}=n,v=uqe({tableKey:o}),_=Stn({tableKey:o}),b=C=>{$e("PUT",Ae("/api/v1/company_users/:id",{id:C.id}),C).then(E=>{An.set(C,"company_user",E.data.data),In(["company_users"]),t(qy(C))})},y=(C,E,x,k,L,D)=>{var B,F;if(!a)return;const A=(F=(B=e==null?void 0:e.company_user)==null?void 0:B.react_settings.table_filters)==null?void 0:F[o],N={...r&&{customFilter:[]},sort:i.searchParams.get("sort")||"id|asc",status:["active"],...!m&&{perPage:"10"}},P={...E&&{sortedBy:E},...r&&{customFilter:a},sort:x,status:L,...!m&&{perPage:D}};if(A&&m&&delete A.perPage,_(C,k),An.isEqual(N,P)&&!A||An.isEqual(A,P)&&A)return;const M=An.cloneDeep(e);M&&(An.set(M,`company_user.react_settings.table_filters.${o}`,P),b(M))};return w.useEffect(()=>{!s&&!a&&(l(v("filter")||""),r?v("customFilter").length?c(v("customFilter")):c([]):c([]),!m&&g(v("perPage")||"10"),u(v("currentPage")||1),d(v("sort")||"id|asc"),h(v("sortedBy")||void 0),v("status").length?f(v("status")):f(["active"]))},[s]),{handleUpdateTableFilters:y}}const Uve=Ro(null);function ekr(n){const[e]=ve(),[t,i]=w.useState(!1),{RangePicker:r}=SWe,[o,s]=w.useState(),[a,l]=w.useState(),{dateFormat:c}=sc(),u=Gi(Uve);w.useEffect(()=>{s(n.startDate),l(n.endDate)},[n.startDate,n.endDate]);const d=f=>{if(Un.extend(C_e),f[0]===""||f[1]==="")return;const g=["DD. MMM. YYYY","ddd MMM D, YYYY"];n.handleDateChange(Un(f[0],g.includes(c)?void 0:c,u==null?void 0:u.locale).format("YYYY-MM-DD")+","+Un(f[1],g.includes(c)?void 0:c,u==null?void 0:u.locale).format("YYYY-MM-DD"))},h=Ss();return O("div",{className:"flex justify-end items-center",children:[p(Y8e,{style:{color:h},className:"mx-2"}),O(En,{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:f=>{i(f==="custom"),n.handleDateRangeChange(f)},style:{width:"9.7rem"},children:[p("option",{value:"last7_days",children:e("last_7_days")}),p("option",{value:"last30_days",children:e("last_30_days")}),p("option",{value:"this_month",children:e("this_month")}),p("option",{value:"last_month",children:e("last_month")}),p("option",{value:"this_quarter",children:e("current_quarter")}),p("option",{value:"last_quarter",children:e("last_quarter")}),p("option",{value:"this_year",children:e("this_year")}),p("option",{value:"last_year",children:e("last_year")}),p("option",{value:"last365_days",children:`${e("last365_days")}`}),p("option",{value:"custom",children:`${e("custom")}`})]}),t&&p("div",{className:"flex flex-row space-x-2",children:p(d_e,{locale:u==null?void 0:u.default,children:p(r,{size:"large",defaultValue:[Un(o),Un(a)],format:c,onChange:(f,g)=>d(g)})})})]})}function Ttn(n){const e=w.useRef(null),{RangePicker:t}=SWe,i=si(),{setDateRange:r,onClick:o}=n,[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(""),h=Gi(Uve),{dateFormat:f}=sc();m1(e,()=>{s&&!l&&a(!1)});const g=v=>{Un.extend(C_e);const _=["DD. MMM. YYYY","ddd MMM D, YYYY"],b=v[0]?Un(v[0],_.includes(f)?void 0:f,h==null?void 0:h.locale).format("YYYY-MM-DD"):"",y=v[1]?Un(v[1],_.includes(f)?void 0:f,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 v=(b=u==null?void 0:u.split(","))==null?void 0:b[0],_=(y=u==null?void 0:u.split(","))==null?void 0:y[1];return!!(v&&_)};return w.useEffect(()=>{var v,_;if(s){const b=(v=u==null?void 0:u.split(","))==null?void 0:v[0],y=(_=u==null?void 0:u.split(","))==null?void 0:_[1];r((u==null?void 0:u.length)>1?[b,y].join(","):"")}},[s]),p("div",{ref:e,children:p(PF,{visible:s,placement:"bottom",interactive:!0,render:()=>{var v,_;return p("div",{className:"flex flex-col p-3",style:{backgroundColor:i.$2,border:`1px solid ${i.$5}`},onClick:b=>b.stopPropagation(),children:p(d_e,{locale:h==null?void 0:h.default,children:p(t,{size:"large",value:[(v=u==null?void 0:u.split(","))!=null&&v[0]?Un(u.split(",")[0]):null,(_=u==null?void 0:u.split(","))!=null&&_[1]?Un(u.split(",")[1]):null],format:f,onCalendarChange:(b,y)=>g(y),onOpenChange:b=>c(b)})})})},children:p("div",{className:"cursor-pointer",onClick:v=>{v.stopPropagation(),o(),a(_=>!_)},children:p(nt,{element:Y8e,color:m()?"lightgreen":"white",style:{width:"1.4rem",height:"1.4rem"}})})})})}function ktn(n){const{children:e}=n,t=Ss();return p("tfoot",{style:{backgroundColor:t},children:p("tr",{children:e})})}function Lg(n){var It,Qt;const[e]=ve(),t=ml(),i=lqe(),r=_l(),o=Zme(),[s,a]=w.useState(!1),[l,c]=w.useState(new URL(Ae(n.endpoint))),u=`${t.pathname}${n.endpoint.replace(".","")}`,d=Wi(Eu),{styleOptions:h,customFilters:f,onBulkActionCall:g,hideEditableOptions:m=!1,dateRangeColumns:v=[],excludeColumns:_=[],methodType:b="GET",queryIdentificator:y,disableQuery:C,footerColumns:E=[],bottomActionsKeys:x=[],withoutPerPageAsPreference:k=!1,withoutSortQueryParameter:L=!1,showRestoreBulk:D}=n,A=w.useRef(void 0),[N,P]=w.useState(""),[M,B]=w.useState(void 0),[F,U]=w.useState(1),[H,W]=w.useState(l.searchParams.get("per_page")||"10"),[q,V]=w.useState(l.searchParams.get("sort")||"id|asc"),[re,oe]=w.useState(void 0),[Q,Ne]=w.useState(["active"]),[Ve,Ye]=w.useState(""),[ye,He]=w.useState(""),[Pe,Ge]=w.useState([]),[Fe,bt]=w.useState([]),[Mt,Ft]=w.useState(!0),Yt=w.useRef(null),{handleUpdateTableFilters:ln}=xtn({apiEndpoint:l,isInitialConfiguration:Mt,customFilter:M,setCurrentPage:U,setCustomFilter:B,setFilter:P,setPerPage:W,setSort:V,setSortedBy:oe,setStatus:Ne,tableKey:u,customFilters:f,withoutStoringPerPage:k}),{defaultOptions:Et,defaultCustomFilterOptions:mt,handleChangingCustomFilters:Lt}=Etn({apiEndpoint:l,isInitialConfiguration:Mt,tableKey:u,customFilter:M,customFilters:f});w.useEffect(()=>{if(!Mt){clearTimeout(A.current);const pe=setTimeout(()=>ln(N,re,q,F,Q,H),1500);A.current=pe}if(l.searchParams.set("per_page",H),l.searchParams.set("page",F.toString()),l.searchParams.set("filter",N),Lt(),(!L||L&&q!=="id|asc")&&l.searchParams.set("sort",q),l.searchParams.set("status",Q),v.length&&ye){const pe=Ve==null?void 0:Ve.split(",")[0],We=Ve==null?void 0:Ve.split(",")[1];l.searchParams.set(ye,pe&&We?Ve:"")}return c(l),Mt&&Ft(!1),()=>{d(void 0)}},[H,F,N,q,Q,M,Ve,ye]);const{data:be,isLoading:Te,isError:se}=Ii([...y?[y]:[],l.pathname,n.endpoint,H,F,N,q,Q,M,Ve,ye],()=>$e(b,l.href),{staleTime:n.staleTime??1/0,enabled:!C}),Y=()=>Fe.every(pe=>Tr(pe)!==nr.Active),X=(pe,We)=>{he.processing(),$e("POST",Ae(n.bulkRoute??`${n.endpoint}/bulk`),{action:pe,ids:We?[We]:Array.from(Pe)}).then(ne=>{var Se;he.success(`${pe}d_${n.resource}`),(Se=n.onBulkActionSuccess)==null||Se.call(n,ne.data.data,pe),Yt.current.checked=!1,window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:Ae(n.endpoint)}}))}).finally(()=>{wbt([n.endpoint,l.pathname]),Ge([])})},le=w.useMemo(()=>n.customBulkActions?n.customBulkActions.some(pe=>ce.isValidElement(pe({selectedIds:Pe,selectedResources:Fe,setSelected:Ge}))):!1,[n.customBulkActions,Pe,Fe]),te=pe=>n.customActions?n.customActions.some(We=>ce.isValidElement(We(pe))):!1,me=pe=>{var Se,Ie;const We=(Se=v.find(Ke=>ye===Ke.column))==null?void 0:Se.column,ne=(Ie=v.find(Ke=>pe===Ke.column))==null?void 0:Ie.queryParameterKey;We!==pe&&ne&&He(ne)},Me=pe=>E.find(We=>We.id===pe),rt=pe=>be==null?void 0:be.data.data.map(We=>We[pe]);return w.useEffect(()=>{d(l.pathname)},[l.pathname]),w.useEffect(()=>{if(be){const pe=be.data.data.filter(ne=>Pe.includes(ne.id));bt(pe),be.data.data.some(ne=>!Pe.includes(ne.id))&&Yt.current?Yt.current.checked=!1:Yt.current&&(Yt.current.checked=!0)}},[Pe]),w.useEffect(()=>{be&&!be.data.data.length&&U(1)},[be]),w.useEffect(()=>{be&&(Number(H)<Pe.length||Number(H)===Pe.length?Ge(be.data.data.map(pe=>pe.id).filter(pe=>Pe.includes(pe))):Number(H)>Pe.length&&Yt.current&&(Yt.current.checked=!1))},[H]),w.useEffect(()=>{_fe.on("bulk.completed",()=>Ge([]))},[]),O("div",{"data-cy":"dataTable",children:[!n.withoutActions&&p(Ctn,{filter:N,onFilterChange:P,optionsMultiSelect:!0,options:i,defaultOptions:Et,defaultCustomFilterOptions:mt,onStatusChange:Ne,customFilters:n.customFilters,customFilterPlaceholder:n.customFilterPlaceholder,onCustomFilterChange:B,customFilter:M,rightSide:O(St,{children:[n.rightSide,n.linkToCreate&&p(zn,{type:"component",guards:n.linkToCreateGuards||[],component:p(un,{to:n.linkToCreate,children:p("span",{children:e(`new_${n.resource}`)})})})]}),beforeFilter:n.beforeFilter,withoutStatusFilter:n.withoutStatusFilter,children:!m&&O(Fm,{label:e("actions"),disabled:!Pe.length,cypressRef:"bulkActionsDropdown",children:[n.customBulkActions&&n.customBulkActions.map((pe,We)=>p("div",{children:pe({selectedIds:Pe,selectedResources:Fe,setSelected:Ge})},We)),n.customBulkActions&&le&&p(vi,{withoutPadding:!0}),!n.withoutDefaultBulkActions&&O(St,{children:[p(gt,{onClick:()=>{g?g(Pe,"archive"):X("archive")},icon:p(nt,{element:Dc}),children:e("archive")}),p(gt,{onClick:()=>{g?g(Pe,"delete"):X("delete")},icon:p(nt,{element:el}),children:e("delete")}),(D?D(Fe):Y())&&p(gt,{onClick:()=>{g?g(Pe,"restore"):X("restore")},icon:p(nt,{element:Lc}),children:e("restore")})]})]})}),O(ZS,{className:zt(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:pe=>a(pe),isDataLoading:Te,style:n.style,children:[O(eE,{backgroundColor:h==null?void 0:h.headerBackgroundColor,children:[!n.withoutActions&&!m&&p(Ma,{className:h==null?void 0:h.thClassName,children:p(Oh,{innerRef:Yt,onChange:pe=>{Array.from(document.querySelectorAll(".child-checkbox")).forEach(We=>{We.checked=pe.target.checked,pe.target.checked?Pe.find(Se=>Se===We.id)||Ge(Se=>[...Se,We.id]):Ge([])})},cypressRef:"dataTableCheckbox"})}),n.columns.map((pe,We)=>!_.includes(pe.id)&&p(Ma,{id:pe.id,className:h==null?void 0:h.thClassName,isCurrentlyUsed:re===pe.id,onColumnClick:ne=>{oe(ne.field),V(ne.sort)},childrenClassName:h==null?void 0:h.thChildrenClassName,children:O("div",{className:"flex items-center space-x-3",children:[v.some(ne=>pe.id===ne.column)&&p(Ttn,{setDateRange:Ye,onClick:()=>me(pe.id)}),p("span",{children:pe.label})]})},We)),n.withResourcefulActions&&!m&&p(Ma,{})]}),O(JS,{style:h==null?void 0:h.tBodyStyle,children:[Te&&p(wc,{className:zt({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),children:p(To,{colSpan:100,children:p(ds,{})})}),se&&p(wc,{className:zt({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),children:p(To,{className:"text-center",colSpan:100,children:e("error_refresh_page")})}),be&&be.data.data.length===0&&p(wc,{className:zt({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),children:p(To,{className:h==null?void 0:h.tdClassName,colSpan:100,children:e("no_records_found")})}),be&&((Qt=(It=be==null?void 0:be.data)==null?void 0:It.data)==null?void 0:Qt.map((pe,We)=>{var ne,Se,Ie,Ke,Je,ot;return O(wc,{className:zt({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),backgroundColor:We%2===0?o.$7:"",children:[!n.withoutActions&&!m&&p(To,{className:"cursor-pointer",onClick:()=>Pe.includes(pe.id)?Ge(wt=>wt.filter(pn=>pn!==pe.id)):Ge(wt=>[...wt,pe.id]),children:p(Oh,{checked:Pe.includes(pe.id),className:"child-checkbox",value:pe.id,id:pe.id,cypressRef:"dataTableCheckbox"})}),n.columns.map((wt,pn)=>!_.includes(wt.id)&&p(To,{className:zt({"cursor-pointer":pn<3,"py-4":m},h==null?void 0:h.tdClassName),onClick:()=>{var Kn;pn<3&&(n.onTableRowClick?n.onTableRowClick(pe):(Kn=document.getElementById(pe.id))==null||Kn.click())},children:wt.format?wt.format(pe[wt.id],pe):pe[wt.id]},pn)),n.withResourcefulActions&&!m&&p(To,{children:O(Fm,{label:e("actions"),children:[n.linkToEdit&&(((ne=n.showEdit)==null?void 0:ne.call(n,pe))||!n.showEdit)&&p(gt,{to:At(n.linkToEdit,{id:pe==null?void 0:pe.id}),icon:p(nt,{element:wF}),children:e("edit")}),n.linkToEdit&&n.customActions&&te(pe)&&(((Se=n.showEdit)==null?void 0:Se.call(n,pe))||!n.showEdit)&&p(vi,{withoutPadding:!0}),n.customActions&&n.customActions.map((wt,pn)=>{var Kn;return!x.includes(((Kn=wt(pe))==null?void 0:Kn.key)||"")&&p("div",{children:wt(pe)},pn)}),n.customActions&&(((Ie=n.showRestore)==null?void 0:Ie.call(n,pe))||!n.showRestore)&&p(vi,{withoutPadding:!0}),(pe==null?void 0:pe.archived_at)===0&&(((Ke=n.showArchive)==null?void 0:Ke.call(n,pe))||!n.showArchive)&&p(gt,{onClick:()=>X("archive",pe.id),icon:p(nt,{element:Dc}),children:e("archive")}),(pe==null?void 0:pe.archived_at)>0&&(((Je=n.showRestore)==null?void 0:Je.call(n,pe))||!n.showRestore)&&p(gt,{onClick:()=>X("restore",pe.id),icon:p(nt,{element:Lc}),children:e("restore")}),!(pe!=null&&pe.is_deleted)&&(((ot=n.showDelete)==null?void 0:ot.call(n,pe))||!n.showDelete)&&p(gt,{onClick:()=>X("delete",pe.id),icon:p(nt,{element:el}),children:e("delete")}),n.customActions&&n.customActions.map((wt,pn)=>{var Kn;return x.includes(((Kn=wt(pe))==null?void 0:Kn.key)||"")&&p("div",{children:wt(pe)},pn)})]})})]},We)}))]}),!!E.length&&!!(be!=null&&be.data.data.length)&&!!r.show_table_footer&&O(ktn,{children:[!n.withoutActions&&!m&&p(Ma,{}),n.columns.map((pe,We)=>{var ne;return!_.includes(pe.id)&&p(To,{customizeTextColor:!0,children:Me(pe.id)?p("div",{className:"flex items-center space-x-3",children:((ne=Me(pe.id))==null?void 0:ne.format(rt(pe.id)||[],(be==null?void 0:be.data.data)||[]))??"-/-"}):p(St,{})},We)}),n.withResourcefulActions&&!m&&p(Ma,{})]})]}),be&&!n.withoutPagination&&p(nje,{currentPerPage:H,currentPage:F,onPageChange:U,onRowsChange:W,totalPages:be.data.meta.pagination.total_pages,totalRecords:be.data.meta.pagination.total,leftSideChevrons:n.leftSideChevrons})]})}function Itn(){return p(Lg,{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)=>p(qi,{to:At("/settings/expense_categories/:id/edit",{id:t.id}),children:t.name})},{id:"color",label:"color",format:e=>p("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 jve(n){return Ii(["/api/v1/expense_categories",n],()=>{var e;return $e("GET",Ae("/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 Ltn(n){return Ii(["/api/v1/expense_categories",n.id],()=>$e("GET",Ae("/api/v1/expense_categories/:id",{id:n.id})),{enabled:n.enabled??!0,staleTime:1/0})}function Dtn(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/expense_categories/bulk"),{action:e,ids:[n]}).then(()=>{he.success(`${e}d_expense_category`),In(["expense_categories"])})}}function dqe(){const{isAdmin:n}=Fo();return Ii("/api/v1/expense_categories/create",()=>$e("GET",Ae("/api/v1/expense_categories/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function hqe(n){const[e]=ve(),{errors:t,setErrors:i,setExpenseCategory:r,expenseCategory:o,nameFieldRef:s}=n,a=si(),l=(c,u)=>{i(void 0),r(d=>d&&{...d,[c]:u})};return O(S0,{children:[p(Ze,{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"}),p(pg,{children:e("color")}),p(jk,{value:o==null?void 0:o.color,onValueChange:c=>l("color",c)})]})}function Atn(){Mi("new_expense_category");const[n]=ve(),e=ki(),t=Ss(),i=w.useRef(null),{data:r}=dqe(),[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()},f=m=>{a||(l(!0),he.processing(),$e("POST",Ae("/api/v1/expense_categories"),c).then(v=>{he.success("created_expense_category"),In(["expense_categories"]),m==="save"?e(At("/settings/expense_categories/:id/edit",{id:v.data.data.id})):r&&(u({...r,color:t}),h())}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(he.dismiss(),s(v.response.data))}).finally(()=>l(!1)))},g=[{onClick:()=>f("create"),text:`${n("save")} / ${n("create")}`,icon:p(nt,{element:qp})}];return w.useEffect(()=>{r&&u({...r,color:t})},[r]),w.useEffect(()=>{h()},[i]),p(sr,{title:n("expense_categories"),breadcrumbs:d,children:p(tn,{title:n("create_expense_category"),withSaveButton:!0,disableSubmitButton:a,onSaveClick:()=>f("save"),additionalSaveOptions:g,children:p(hqe,{nameFieldRef:i,expenseCategory:c,setExpenseCategory:u,errors:o,setErrors:s})})})}function Rtn(){const[n]=ve(),e=Dtn();return[i=>i.archived_at===0&&p(gt,{onClick:()=>e(i.id,"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),i=>i.archived_at>0&&p(gt,{onClick:()=>e(i.id,"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),i=>!i.is_deleted&&p(gt,{onClick:()=>e(i.id,"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function R1(n){const[e]=ve(),{onSaveClick:t,disableSaveButton:i,label:r,saveButtonLabel:o,disableSaveButtonOnly:s}=n;return O(St,{children:[t&&O("div",{className:"flex",children:[p(un,{behavior:"button",className:"rounded-br-none rounded-tr-none px-3",onClick:t,disabled:i||s,disableWithoutIcon:!0,children:o??e("save")}),p(Fm,{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((a,l)=>p(w.Fragment,{children:a(n.resource)},l))})]}),!t&&r&&p(Fm,{label:n.label,cypressRef:n.cypressRef,children:n.actions.map((a,l)=>p(w.Fragment,{children:a(n.resource)},l))})]})}function Ntn(){const{setDocumentTitle:n}=Mi("edit_expense_category"),[e]=ve(),{id:t}=il(),i=Rtn(),{data:r}=Ltn({id:t}),o=[{name:e("settings"),href:"/settings"},{name:e("expense_settings"),href:"/settings/expense_settings"},{name:e("edit_expense_category"),href:At("/settings/expense_categories/:id/edit",{id:t})}],[s,a]=w.useState(),[l,c]=w.useState(!1),[u,d]=w.useState({name:"",color:""}),h=(g,m)=>{a(void 0),d(v=>({...v,[g]:m}))},f=g=>{g.preventDefault(),l||(c(!0),a(void 0),he.processing(),$e("PUT",Ae("/api/v1/expense_categories/:id",{id:t}),u).then(()=>{he.success("updated_expense_category"),In(["expense_categories"])}).catch(m=>{var v;((v=m.response)==null?void 0:v.status)===422&&(a(m.response.data),he.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]),O(sr,{title:e("expense_categories"),breadcrumbs:o,navigationTopRight:u&&p(R1,{label:e("more_actions"),resource:u,actions:i}),children:[!r&&p("div",{className:"flex justify-center",children:p(ds,{})}),r&&O(tn,{withSaveButton:!0,disableSubmitButton:l,onFormSubmit:f,title:u==null?void 0:u.name,children:[O(G,{leftSide:e("status"),children:[!r.data.data.is_deleted&&!r.data.data.archived_at&&p(_r,{variant:"primary",children:e("active")}),r.data.data.archived_at&&!r.data.data.is_deleted?p(_r,{variant:"yellow",children:e("archived")}):null,r.data.data.is_deleted&&p(_r,{variant:"red",children:e("deleted")})]}),O(S0,{children:[p(Ze,{label:e("name"),onValueChange:g=>h("name",g),value:u==null?void 0:u.name,errorMessage:s==null?void 0:s.errors.name,required:!0}),p(pg,{children:e("color")}),p(jk,{value:u==null?void 0:u.color,onValueChange:g=>h("color",g)})]})]})]})}function Otn(){Mi("expense_settings");const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("expense_settings"),href:"/settings/expense_settings"}],t=Pc(),{isCompanySettingsActive:i}=$s(),r=zi(),o=lp(),s=xu(),a=Bo();return O(sr,{onSaveClick:s,onCancelClick:o,title:n("expense_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#expense_settings",children:[O(tn,{title:n("settings"),children:[p(G,{leftSide:n("should_be_invoiced"),leftSideHelp:n("should_be_invoiced_help"),children:p(kt,{checked:t==null?void 0:t.mark_expenses_invoiceable,onChange:l=>a("mark_expenses_invoiceable",l),cypressRef:"shouldBeInvoicedToggle"})}),p(G,{leftSide:n("mark_paid"),leftSideHelp:n("mark_paid_help"),children:p(kt,{checked:t==null?void 0:t.mark_expenses_paid,onChange:l=>a("mark_expenses_paid",l),cypressRef:"markPaidToggle"})}),p(G,{leftSide:n("convert_currency"),leftSideHelp:n("convert_expense_currency_help"),children:p(kt,{checked:t==null?void 0:t.convert_expense_currency,onChange:l=>a("convert_expense_currency",l),cypressRef:"convertCurrencyToggle"})}),p(G,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:p(kt,{checked:t==null?void 0:t.invoice_expense_documents,onChange:l=>a("invoice_expense_documents",l),cypressRef:"addDocumentsToInvoiceToggle"})}),p(G,{leftSide:n("notify_vendor_when_paid"),leftSideHelp:n("notify_vendor_when_paid_help"),children:p(kt,{onChange:l=>a("notify_vendor_when_paid",l),checked:(t==null?void 0:t.notify_vendor_when_paid)||!1})}),i&&fR()&&O(St,{children:[p(vi,{withoutPadding:!0}),p(G,{className:"mt-3.5",leftSide:n("expense_mailbox_active"),children:p(kt,{checked:!!(t!=null&&t.expense_mailbox_active),onChange:l=>a("expense_mailbox_active",l)})}),!!(t!=null&&t.expense_mailbox_active)&&O(St,{children:[p(G,{leftSide:n("expense_mailbox"),children:p(Ze,{value:(t==null?void 0:t.expense_mailbox)||"",onValueChange:l=>a("expense_mailbox",l)})}),p(G,{leftSide:n("inbound_mailbox_allow_company_users"),children:p(kt,{checked:!!(t!=null&&t.inbound_mailbox_allow_company_users),onChange:l=>a("inbound_mailbox_allow_company_users",l)})}),p(G,{leftSide:n("inbound_mailbox_allow_vendors"),children:p(kt,{checked:!!(t!=null&&t.inbound_mailbox_allow_vendors),onChange:l=>a("inbound_mailbox_allow_vendors",l)})}),p(G,{leftSide:n("inbound_mailbox_allow_clients"),children:p(kt,{checked:!!(t!=null&&t.inbound_mailbox_allow_clients),onChange:l=>a("inbound_mailbox_allow_clients",l)})}),p(G,{leftSide:n("inbound_mailbox_whitelist"),leftSideHelp:n("inbound_mailbox_whitelist_help"),children:p(Ze,{value:(t==null?void 0:t.inbound_mailbox_whitelist)||"",onValueChange:l=>a("inbound_mailbox_whitelist",l)})}),p(G,{leftSide:n("inbound_mailbox_blacklist"),leftSideHelp:n("inbound_mailbox_blacklist_help"),children:p(Ze,{value:(t==null?void 0:t.inbound_mailbox_blacklist)||"",onValueChange:l=>a("inbound_mailbox_blacklist",l)})}),p(G,{leftSide:n("inbound_mailbox_allow_unknown"),children:p(kt,{checked:!!(t!=null&&t.inbound_mailbox_allow_unknown),onChange:l=>a("inbound_mailbox_allow_unknown",l)})})]})]}),p(vi,{className:"pb-3.5",withoutPadding:!0}),p(G,{leftSide:n("enter_taxes"),children:p(A7e,{onValueChange:l=>r(go({object:"company",property:"calculate_expense_tax_by_amount",value:l==="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:t==null?void 0:t.calculate_expense_tax_by_amount.toString(),cypressRef:"taxByRadio"})}),p(G,{leftSide:n("inclusive_taxes"),leftSideHelp:O("span",{className:"flex flex-col",children:[O("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]}),O("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]})]}),children:p(kt,{onChange:l=>a("expense_inclusive_taxes",l),checked:(t==null?void 0:t.expense_inclusive_taxes)||!1,cypressRef:"inclusiveTaxesToggle"})})]}),p(Itn,{})]})}function kv(n){const e=si(),t=Ss(),{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]),O("div",{className:n.className,"data-cy":"tabs",children:[p("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 p("div",{className:zt({"w-full":n.width==="full"}),children:p("button",{type:"button",onClick:()=>s(l),style:{borderColor:r===l?t:"transparent",color:r===l?t:e.$3},className:zt("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)})}),p("div",{className:zt(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 ce.isValidElement(a)&&ce.cloneElement(a,{key:l,className:zt((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 Ptn(){var a,l,c,u;const[n]=ve(),e=zi(),t=Zi(),i=pa(),{isCompanySettingsActive:r}=$s(),o=Gi(Bs),s=(d,h)=>e(go({object:"company",property:d,value:h}));return O(tn,{title:n("invoices"),children:[p(G,{leftSide:p(Ht,{propertyKey:"auto_email_invoice",labelElement:p(Wt,{label:n("auto_email_invoice"),helpLabel:n("auto_email_invoice_help")}),defaultValue:!1}),children:p(kt,{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&&p(G,{leftSide:n("stop_on_unpaid"),leftSideHelp:n("stop_on_unpaid_help"),children:p(kt,{checked:!!(t!=null&&t.stop_on_unpaid_recurring),onChange:d=>s("stop_on_unpaid_recurring",d)})}),p(vi,{}),p(G,{leftSide:p(Ht,{propertyKey:"auto_archive_invoice",labelElement:p(Wt,{label:n("auto_archive_invoice"),helpLabel:n("auto_archive_invoice_help")}),defaultValue:!1}),children:p(kt,{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")})}),p(G,{leftSide:p(Ht,{propertyKey:"auto_archive_invoice_cancelled",labelElement:p(Wt,{label:n("auto_archive_invoice_cancelled"),helpLabel:n("auto_archive_invoice_cancelled_help")}),defaultValue:!1}),children:p(kt,{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")})}),p(vi,{}),p(G,{leftSide:p(Ht,{propertyKey:"lock_invoices",labelElement:p(Wt,{label:n("lock_invoices")}),defaultValue:"off"}),children:O(En,{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:[p("option",{value:"off",children:n("off")}),p("option",{value:"when_sent",children:n("when_sent")}),p("option",{value:"when_paid",children:n("when_paid")}),p("option",{value:"end_of_month",children:n("end_of_month")})]})})]})}function Mtn(){var s,a;const[n]=ve(),e=zi(),t=Zi(),{isCompanySettingsActive:i}=$s(),r=pa(),o=(l,c)=>e(go({object:"company",property:l,value:c}));return O(tn,{title:n("quotes"),children:[p(G,{leftSide:p(Ht,{propertyKey:"auto_convert_quote",labelElement:p(Wt,{label:n("auto_convert_quote"),helpLabel:n("auto_convert_quote_help")}),defaultValue:!1}),children:p(kt,{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")})}),p(G,{leftSide:p(Ht,{propertyKey:"auto_archive_quote",labelElement:p(Wt,{label:n("auto_archive_quote"),helpLabel:n("auto_archive_quote_help")}),defaultValue:!1}),children:p(kt,{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&&p(G,{leftSide:n("use_quote_terms"),leftSideHelp:n("use_quote_terms_help"),children:p(kt,{checked:!!(t!=null&&t.use_quote_terms_on_conversion),onChange:l=>o("use_quote_terms_on_conversion",l)})})]})}function Ftn(){const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("workflow_settings"),href:"/settings/workflow_settings"}];Mi("workflow_settings"),Pc();const t=xu(),i=lp(),r=[n("invoices"),n("quotes")];return p(sr,{onSaveClick:t,onCancelClick:i,title:n("workflow_settings"),breadcrumbs:e,docsLink:"en/advanced-settings/#workflow_settings",children:O(kv,{tabs:r,children:[p("div",{children:p(Ptn,{})}),p("div",{children:p(Mtn,{})})]})})}const see={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"]},Btn=[{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"}],uDe={date_key:"",date_range:"",end_date:"",report_keys:[],send_email:!0,start_date:""};function $tn(){const[n]=ve(),[e,t]=w.useState(),[i,r]=w.useState(!1),[o,s]=w.useState("activities"),[a,l]=w.useState(uDe),c=(d,h)=>{l(h==="date_key"?f=>({...f,date_key:d,date_range:d?"last7":""}):h==="date_range"?f=>({...f,date_range:d,start_date:d==="custom"?f.start_date:"",end_date:d==="custom"?f.end_date:""}):f=>({...f,[h]:d}))},u=()=>{i||(he.processing(),r(!0),$e("POST",Ae(`/api/v1/reports/${o}`),a).then(()=>he.success("exported_data")).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(he.dismiss(),t(d.response.data))}).finally(()=>r(!1)))};return w.useEffect(()=>{l(uDe)},[o]),O(tn,{title:n("export"),saveButtonLabel:n("export"),withSaveButton:!0,onSaveClick:d=>{d.preventDefault(),u()},disableSubmitButton:i,disableWithoutIcon:!0,children:[p(G,{leftSide:n("export"),children:n("csv")}),p(G,{leftSide:n("export_type"),children:p(En,{value:o,onValueChange:d=>s(d),children:Object.keys(see).map((d,h)=>p("option",{value:d,children:n(d)},h))})}),!!see[o].length&&p(G,{leftSide:n("date"),children:p(En,{value:a.date_key,onValueChange:d=>c(d,"date_key"),withBlank:!0,errorMessage:e==null?void 0:e.errors.date_key,children:see[o].map((d,h)=>p("option",{value:d,children:n(d)},h))})}),a.date_key&&p(G,{leftSide:n("date_range"),children:p(En,{value:a.date_range,onValueChange:d=>c(d,"date_range"),errorMessage:e==null?void 0:e.errors.date_range,children:Btn.map(({identifier:d,label:h},f)=>p("option",{value:d,children:n(h)},f))})}),a.date_range==="custom"&&O(St,{children:[p(G,{leftSide:n("start_date"),children:p(Ze,{type:"date",value:a.start_date,onValueChange:d=>c(d,"start_date"),errorMessage:e==null?void 0:e.errors.start_date})}),p(G,{leftSide:n("end_date"),children:p(Ze,{type:"date",value:a.end_date,onValueChange:d=>c(d,"end_date"),errorMessage:e==null?void 0:e.errors.end_date})})]})]})}var Vtn=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 o6(n,e){var t=Htn(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 Htn(n){var e=n.name,t=e&&e.lastIndexOf(".")!==-1;if(t&&!n.type){var i=e.split(".").pop().toLowerCase(),r=Vtn.get(i);r&&Object.defineProperty(n,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return n}var Wtn=[".DS_Store","Thumbs.db"];function ztn(n){return yR(this,void 0,void 0,function(){return CR(this,function(e){return TW(n)&&Utn(n.dataTransfer)?[2,Ktn(n.dataTransfer,n.type)]:jtn(n)?[2,qtn(n)]:Array.isArray(n)&&n.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,Gtn(n)]:[2,[]]})})}function Utn(n){return TW(n)}function jtn(n){return TW(n)&&TW(n.target)}function TW(n){return typeof n=="object"&&n!==null}function qtn(n){return dae(n.target.files).map(function(e){return o6(e)})}function Gtn(n){return yR(this,void 0,void 0,function(){var e;return CR(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 o6(i)})]}})})}function Ktn(n,e){return yR(this,void 0,void 0,function(){var t,i;return CR(this,function(r){switch(r.label){case 0:return n.items?(t=dae(n.items).filter(function(o){return o.kind==="file"}),e!=="drop"?[2,t]:[4,Promise.all(t.map(Ytn))]):[3,2];case 1:return i=r.sent(),[2,dDe(fqe(i))];case 2:return[2,dDe(dae(n.files).map(function(o){return o6(o)}))]}})})}function dDe(n){return n.filter(function(e){return Wtn.indexOf(e.name)===-1})}function dae(n){if(n===null)return[];for(var e=[],t=0;t<n.length;t++){var i=n[t];e.push(i)}return e}function Ytn(n){if(typeof n.webkitGetAsEntry!="function")return hDe(n);var e=n.webkitGetAsEntry();return e&&e.isDirectory?pqe(e):hDe(n)}function fqe(n){return n.reduce(function(e,t){return MD(MD([],nTe(e),!1),nTe(Array.isArray(t)?fqe(t):[t]),!1)},[])}function hDe(n){var e=n.getAsFile();if(!e)return Promise.reject("".concat(n," is not a File"));var t=o6(e);return Promise.resolve(t)}function Qtn(n){return yR(this,void 0,void 0,function(){return CR(this,function(e){return[2,n.isDirectory?pqe(n):Xtn(n)]})})}function pqe(n){var e=n.createReader();return new Promise(function(t,i){var r=[];function o(){var s=this;e.readEntries(function(a){return yR(s,void 0,void 0,function(){var l,c,u;return CR(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(Qtn)),r.push(u),o(),d.label=6;case 6:return[2]}})})},function(a){i(a)})}o()})}function Xtn(n){return yR(this,void 0,void 0,function(){return CR(this,function(e){return[2,new Promise(function(t,i){n.file(function(r){var o=o6(r,n.fullPath);t(o)},function(r){i(r)})})]})})}var Ztn=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 fDe(n){return tnn(n)||enn(n)||mqe(n)||Jtn()}function Jtn(){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 enn(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function tnn(n){if(Array.isArray(n))return hae(n)}function pDe(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 gDe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pDe(Object(t),!0).forEach(function(i){gqe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pDe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function gqe(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c3(n,e){return rnn(n)||inn(n,e)||mqe(n,e)||nnn()}function nnn(){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 mqe(n,e){if(n){if(typeof n=="string")return hae(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 hae(n,e)}}function hae(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 inn(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 rnn(n){if(Array.isArray(n))return n}var onn="file-invalid-type",snn="file-too-large",ann="file-too-small",lnn="too-many-files",cnn=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:onn,message:"File type must be ".concat(t)}},mDe=function(e){return{code:snn,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},_De=function(e){return{code:ann,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},unn={code:lnn,message:"Too many files"};function _qe(n,e){var t=n.type==="application/x-moz-file"||Ztn(n,e);return[t,t?null:cnn(e)]}function vqe(n,e,t){if(gx(n.size))if(gx(e)&&gx(t)){if(n.size>t)return[!1,mDe(t)];if(n.size<e)return[!1,_De(e)]}else{if(gx(e)&&n.size<e)return[!1,_De(e)];if(gx(t)&&n.size>t)return[!1,mDe(t)]}return[!0,null]}function gx(n){return n!=null}function dnn(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=_qe(l,t),u=c3(c,1),d=u[0],h=vqe(l,i,r),f=c3(h,1),g=f[0],m=a?a(l):null;return d&&g&&!m})}function kW(n){return typeof n.isPropagationStopped=="function"?n.isPropagationStopped():typeof n.cancelBubble<"u"?n.cancelBubble:!1}function s9(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 vDe(n){n.preventDefault()}function hnn(n){return n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1}function fnn(n){return n.indexOf("Edge/")!==-1}function pnn(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return hnn(n)||fnn(n)}function Hv(){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!kW(i)&&a&&a.apply(void 0,[i].concat(o)),kW(i)})}}function gnn(){return"showOpenFilePicker"in window}function mnn(n){if(gx(n)){var e=Object.entries(n).filter(function(t){var i=c3(t,2),r=i[0],o=i[1],s=!0;return bqe(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(yqe))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(t,i){var r=c3(i,2),o=r[0],s=r[1];return gDe(gDe({},t),{},gqe({},o,s))},{});return[{description:"Files",accept:e}]}return n}function _nn(n){if(gx(n))return Object.entries(n).reduce(function(e,t){var i=c3(t,2),r=i[0],o=i[1];return[].concat(fDe(e),[r],fDe(o))},[]).filter(function(e){return bqe(e)||yqe(e)}).join(",")}function vnn(n){return n instanceof DOMException&&(n.name==="AbortError"||n.code===n.ABORT_ERR)}function bnn(n){return n instanceof DOMException&&(n.name==="SecurityError"||n.code===n.SECURITY_ERR)}function bqe(n){return n==="audio/*"||n==="video/*"||n==="image/*"||n==="text/*"||/\w+\/[-+.\w]+/g.test(n)}function yqe(n){return/^.*\.[\w]+$/.test(n)}var ynn=["children"],Cnn=["open"],wnn=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Snn=["refKey","onChange","onClick"];function Enn(n){return knn(n)||Tnn(n)||Cqe(n)||xnn()}function xnn(){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 Tnn(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function knn(n){if(Array.isArray(n))return fae(n)}function aee(n,e){return Dnn(n)||Lnn(n,e)||Cqe(n,e)||Inn()}function Inn(){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 Cqe(n,e){if(n){if(typeof n=="string")return fae(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 fae(n,e)}}function fae(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 Lnn(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 Dnn(n){if(Array.isArray(n))return n}function bDe(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 Dl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bDe(Object(t),!0).forEach(function(i){pae(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bDe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function pae(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function IW(n,e){if(n==null)return{};var t=Ann(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 Ann(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 qve=w.forwardRef(function(n,e){var t=n.children,i=IW(n,ynn),r=zR(i),o=r.open,s=IW(r,Cnn);return w.useImperativeHandle(e,function(){return{open:o}},[o]),ce.createElement(w.Fragment,null,t(Dl(Dl({},s),{},{open:o})))});qve.displayName="Dropzone";var wqe={disabled:!1,getFilesFromEvent:ztn,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};qve.defaultProps=wqe;qve.propTypes={children:et.func,accept:et.objectOf(et.arrayOf(et.string)),multiple:et.bool,preventDropOnDocument:et.bool,noClick:et.bool,noKeyboard:et.bool,noDrag:et.bool,noDragEventsBubbling:et.bool,minSize:et.number,maxSize:et.number,maxFiles:et.number,disabled:et.bool,getFilesFromEvent:et.func,onFileDialogCancel:et.func,onFileDialogOpen:et.func,useFsAccessApi:et.bool,autoFocus:et.bool,onDragEnter:et.func,onDragLeave:et.func,onDragOver:et.func,onDrop:et.func,onDropAccepted:et.func,onDropRejected:et.func,onError:et.func,validator:et.func};var gae={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function zR(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Dl(Dl({},wqe),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,f=e.onDropAccepted,g=e.onDropRejected,m=e.onFileDialogCancel,v=e.onFileDialogOpen,_=e.useFsAccessApi,b=e.autoFocus,y=e.preventDropOnDocument,C=e.noClick,E=e.noKeyboard,x=e.noDrag,k=e.noDragEventsBubbling,L=e.onError,D=e.validator,A=w.useMemo(function(){return _nn(t)},[t]),N=w.useMemo(function(){return mnn(t)},[t]),P=w.useMemo(function(){return typeof v=="function"?v:yDe},[v]),M=w.useMemo(function(){return typeof m=="function"?m:yDe},[m]),B=w.useRef(null),F=w.useRef(null),U=w.useReducer(Rnn,gae),H=aee(U,2),W=H[0],q=H[1],V=W.isFocused,re=W.isFileDialogActive,oe=w.useRef(typeof window<"u"&&window.isSecureContext&&_&&gnn()),Q=function(){!oe.current&&re&&setTimeout(function(){if(F.current){var le=F.current.files;le.length||(q({type:"closeDialog"}),M())}},300)};w.useEffect(function(){return window.addEventListener("focus",Q,!1),function(){window.removeEventListener("focus",Q,!1)}},[F,re,M,oe]);var Ne=w.useRef([]),Ve=function(le){B.current&&B.current.contains(le.target)||(le.preventDefault(),Ne.current=[])};w.useEffect(function(){return y&&(document.addEventListener("dragover",vDe,!1),document.addEventListener("drop",Ve,!1)),function(){y&&(document.removeEventListener("dragover",vDe),document.removeEventListener("drop",Ve))}},[B,y]),w.useEffect(function(){return!i&&b&&B.current&&B.current.focus(),function(){}},[B,b,i]);var Ye=w.useCallback(function(X){L?L(X):console.error(X)},[L]),ye=w.useCallback(function(X){X.preventDefault(),X.persist(),be(X),Ne.current=[].concat(Enn(Ne.current),[X.target]),s9(X)&&Promise.resolve(r(X)).then(function(le){if(!(kW(X)&&!k)){var te=le.length,me=te>0&&dnn({files:le,accept:A,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:D}),Me=te>0&&!me;q({isDragAccept:me,isDragReject:Me,isDragActive:!0,type:"setDraggedFiles"}),c&&c(X)}}).catch(function(le){return Ye(le)})},[r,c,Ye,k,A,s,o,a,l,D]),He=w.useCallback(function(X){X.preventDefault(),X.persist(),be(X);var le=s9(X);if(le&&X.dataTransfer)try{X.dataTransfer.dropEffect="copy"}catch{}return le&&d&&d(X),!1},[d,k]),Pe=w.useCallback(function(X){X.preventDefault(),X.persist(),be(X);var le=Ne.current.filter(function(me){return B.current&&B.current.contains(me)}),te=le.indexOf(X.target);te!==-1&&le.splice(te,1),Ne.current=le,!(le.length>0)&&(q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),s9(X)&&u&&u(X))},[B,u,k]),Ge=w.useCallback(function(X,le){var te=[],me=[];X.forEach(function(Me){var rt=_qe(Me,A),It=aee(rt,2),Qt=It[0],pe=It[1],We=vqe(Me,s,o),ne=aee(We,2),Se=ne[0],Ie=ne[1],Ke=D?D(Me):null;if(Qt&&Se&&!Ke)te.push(Me);else{var Je=[pe,Ie];Ke&&(Je=Je.concat(Ke)),me.push({file:Me,errors:Je.filter(function(ot){return ot})})}}),(!a&&te.length>1||a&&l>=1&&te.length>l)&&(te.forEach(function(Me){me.push({file:Me,errors:[unn]})}),te.splice(0)),q({acceptedFiles:te,fileRejections:me,type:"setFiles"}),h&&h(te,me,le),me.length>0&&g&&g(me,le),te.length>0&&f&&f(te,le)},[q,a,A,s,o,l,h,f,g,D]),Fe=w.useCallback(function(X){X.preventDefault(),X.persist(),be(X),Ne.current=[],s9(X)&&Promise.resolve(r(X)).then(function(le){kW(X)&&!k||Ge(le,X)}).catch(function(le){return Ye(le)}),q({type:"reset"})},[r,Ge,Ye,k]),bt=w.useCallback(function(){if(oe.current){q({type:"openDialog"}),P();var X={multiple:a,types:N};window.showOpenFilePicker(X).then(function(le){return r(le)}).then(function(le){Ge(le,null),q({type:"closeDialog"})}).catch(function(le){vnn(le)?(M(le),q({type:"closeDialog"})):bnn(le)?(oe.current=!1,F.current?(F.current.value=null,F.current.click()):Ye(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."))):Ye(le)});return}F.current&&(q({type:"openDialog"}),P(),F.current.value=null,F.current.click())},[q,P,M,_,Ge,Ye,N,a]),Mt=w.useCallback(function(X){!B.current||!B.current.isEqualNode(X.target)||(X.key===" "||X.key==="Enter"||X.keyCode===32||X.keyCode===13)&&(X.preventDefault(),bt())},[B,bt]),Ft=w.useCallback(function(){q({type:"focus"})},[]),Yt=w.useCallback(function(){q({type:"blur"})},[]),ln=w.useCallback(function(){C||(pnn()?setTimeout(bt,0):bt())},[C,bt]),Et=function(le){return i?null:le},mt=function(le){return E?null:Et(le)},Lt=function(le){return x?null:Et(le)},be=function(le){k&&le.stopPropagation()},Te=w.useMemo(function(){return function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=X.refKey,te=le===void 0?"ref":le,me=X.role,Me=X.onKeyDown,rt=X.onFocus,It=X.onBlur,Qt=X.onClick,pe=X.onDragEnter,We=X.onDragOver,ne=X.onDragLeave,Se=X.onDrop,Ie=IW(X,wnn);return Dl(Dl(pae({onKeyDown:mt(Hv(Me,Mt)),onFocus:mt(Hv(rt,Ft)),onBlur:mt(Hv(It,Yt)),onClick:Et(Hv(Qt,ln)),onDragEnter:Lt(Hv(pe,ye)),onDragOver:Lt(Hv(We,He)),onDragLeave:Lt(Hv(ne,Pe)),onDrop:Lt(Hv(Se,Fe)),role:typeof me=="string"&&me!==""?me:"presentation"},te,B),!i&&!E?{tabIndex:0}:{}),Ie)}},[B,Mt,Ft,Yt,ln,ye,He,Pe,Fe,E,x,i]),se=w.useCallback(function(X){X.stopPropagation()},[]),Y=w.useMemo(function(){return function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},le=X.refKey,te=le===void 0?"ref":le,me=X.onChange,Me=X.onClick,rt=IW(X,Snn),It=pae({accept:A,multiple:a,type:"file",style:{display:"none"},onChange:Et(Hv(me,Fe)),onClick:Et(Hv(Me,se)),tabIndex:-1},te,F);return Dl(Dl({},It),rt)}},[F,t,a,Fe,i]);return Dl(Dl({},W),{},{isFocused:V&&!i,getRootProps:Te,getInputProps:Y,rootRef:B,inputRef:F,open:Et(bt)})}function Rnn(n,e){switch(e.type){case"focus":return Dl(Dl({},n),{},{isFocused:!0});case"blur":return Dl(Dl({},n),{},{isFocused:!1});case"openDialog":return Dl(Dl({},gae),{},{isFileDialogActive:!0});case"closeDialog":return Dl(Dl({},n),{},{isFileDialogActive:!1});case"setDraggedFiles":return Dl(Dl({},n),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Dl(Dl({},n),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return Dl({},gae);default:return n}}function yDe(){}function Nnn(n){const[e]=ve(),t=si(),{group:i,files:r,setFiles:o}=n,[s,a]=w.useState([]),l=g=>{o(m=>m.filter(({file:v})=>v!==g))},c=g=>new Promise(m=>{try{const v=new FileReader;v.onload=_=>{var C;const y=(((C=_.target)==null?void 0:C.result)||"").split(`
`);!y.length||y.length===1||y.length===2&&!y[1]?m(!1):m(!0)},v.readAsText(g)}catch{m(!1)}}),u=async g=>{for(let m=0;m<g.length;m++)if(!await c(g[m]))return!1;return!0},{getRootProps:d,getInputProps:h,isDragActive:f}=zR({accept:{"text/*":[".csv"]},onDrop:async g=>{await u(g)?g.forEach(v=>{o(_=>[..._,{group:i,file:v}])}):he.error("csv_rows_length")}});return w.useEffect(()=>{a(r.filter(({group:g})=>g===i).map(({file:g})=>g))},[r]),p(G,{leftSide:e(i),children:s.length?p("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:s.map((g,m)=>O("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[g.name," - ",(g.size/1024).toPrecision(2)," KB"," ",p(p1,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>l(g)})]},m))}):p("div",{...d(),className:"flex flex-col md:flex-row md:items-center",children:O("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:[p("input",{...h()}),p(RT,{className:"mx-auto h-12 w-12",style:{color:t.$3,colorScheme:t.$0}}),p("span",{className:"mt-2 block text-sm font-medium",style:{color:t.$3,colorScheme:t.$0},children:e(f?"drop_file_here":"dropzone_default_message")})]})})})}const Onn={clients:"client",invoices:"invoice",accounting:"invoice",contacts:"client"},CDe={freshbooks:["clients","invoices"],invoice2go:["invoices"],invoicely:["clients","invoices"],waveaccounting:["clients","accounting"],zoho:["contacts","invoices"]};function Pnn(){const[n]=ve(),[e,t]=w.useState("freshbooks"),[i,r]=w.useState([]),[o,s]=w.useState(),[a,l]=w.useState(!1),c=()=>{if(!a){he.processing(),l(!0);const d=new FormData;d.append("import_type",e),i.forEach(({file:h,group:f})=>{d.append(`files[${Onn[f]}]`,h)}),$e("POST",Ae("/api/v1/import"),d).then(h=>he.success(h.data.message)).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===422&&(he.dismiss(),s(h.response.data))}).finally(()=>{l(!1),r([])})}},u=()=>CDe[e].some(d=>!i.filter(({group:h})=>h===d).length);return w.useEffect(()=>{s(void 0),r([])},[e]),O(tn,{title:n("import"),saveButtonLabel:n("import"),onSaveClick:d=>{d.preventDefault(),c()},disableSubmitButton:u()||a,withSaveButton:!0,disableWithoutIcon:!0,children:[p(G,{leftSide:n("import_type"),children:O(En,{value:e,onValueChange:d=>t(d),errorMessage:o==null?void 0:o.errors.import_type,children:[p("option",{value:"freshbooks",children:n("freshbooks")}),p("option",{value:"invoice2go",children:n("invoice2go")}),p("option",{value:"invoicely",children:n("invoicely")}),p("option",{value:"waveaccounting",children:n("waveaccounting")}),p("option",{value:"zoho",children:n("zoho")})]})}),CDe[e].map(d=>p(Nnn,{group:d,files:i,setFiles:r},d)),p(G,{children:o&&Object.keys(o.errors).map((d,h)=>d!=="import_type"&&p(Fs,{type:"danger",children:o.errors[d]},h))})]})}function Mnn(){Mi("import_export");const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("import_export"),href:"/settings/import_export"}];return O(sr,{title:n("import_export"),breadcrumbs:e,docsLink:"en/basic-settings/#import_export",children:[p(Pnn,{}),p($tn,{})]})}/**
* 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 Fnn(){const[n]=ve();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,d1()?e:[...e,{name:n("danger_zone"),href:"/settings/account_management/danger_zone"}]}function Bnn(){const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"}];Mi("account_management"),Pc();const t=xu(),i=lp(),r=Fnn();return O(sr,{onSaveClick:t,onCancelClick:i,title:n("account_management"),breadcrumbs:e,docsLink:"en/basic-settings/#account_management",children:[p(KS,{tabs:r,className:"mt-6"}),p("div",{className:"my-4",children:p(sp,{})})]})}function $nn(){Mi("custom_fields");const[n]=ve(),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=ml(),r=xu(),o=lp();return O(sr,{title:n("custom_fields"),breadcrumbs:e,docsLink:"en/advanced-settings/#custom_fields",onSaveClick:r,onCancelClick:o,children:[i.pathname.endsWith("custom_fields")&&p(DT,{to:"/settings/custom_fields/company"}),p(KS,{tabs:t}),p(gve,{}),p(sp,{})]})}function Vnn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("company")}`,t=Zi(),i=Qm();return t?p(tn,{title:e,children:["company1","company2","company3","company4"].map(r=>p(Zf,{field:r,placeholder:n("company_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function Hnn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("clients")}`,t=Zi(),i=Qm();return t?O(St,{children:[p(tn,{title:e,children:["client1","client2","client3","client4"].map(r=>p(Zf,{field:r,placeholder:n("client_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}),p(tn,{title:`${n("custom_fields")}: ${n("contacts")}`,children:["contact1","contact2","contact3","contact4"].map(r=>p(Zf,{field:r,placeholder:n("contact_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))})]}):null}function Wnn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("products")}`,t=Zi(),i=Qm();return t?p(tn,{title:e,children:["product1","product2","product3","product4"].map(r=>p(Zf,{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 znn(){const n=Pc(),e=zi();return(t,i)=>{if(i===""){const r=An.cloneDeep(n);return r&&delete r.custom_fields[t],e(AT({object:"company",data:r}))}e(go({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 Unn(){const n=zi(),e=Ti();return t=>{switch(t){case 0:n(go({object:"company",property:"custom_surcharge_taxes1",value:!(e!=null&&e.custom_surcharge_taxes1)}));break;case 1:n(go({object:"company",property:"custom_surcharge_taxes2",value:!(e!=null&&e.custom_surcharge_taxes2)}));break;case 2:n(go({object:"company",property:"custom_surcharge_taxes3",value:!(e!=null&&e.custom_surcharge_taxes3)}));break;case 3:n(go({object:"company",property:"custom_surcharge_taxes4",value:!(e!=null&&e.custom_surcharge_taxes4)}));break}}}function jnn(){const[n]=ve(),e=fve(),t=Zi(),i=Qm(),r=znn(),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=Unn();return t?O(tn,{title:`${n("custom_fields")}: ${n("invoices")}`,children:[["invoice1","invoice2","invoice3","invoice4"].map(a=>p(Zf,{field:a,placeholder:n("invoice_field"),onChange:l=>i(a,l),initialValue:t.custom_fields[a]},a)),p(vi,{}),t&&["surcharge1","surcharge2","surcharge3","surcharge4"].map((a,l)=>p(G,{leftSide:p(Ze,{id:a,value:t.custom_fields[a],placeholder:n("surcharge_field"),onValueChange:c=>r(a,c),disabled:e}),children:!!(t!=null&&t.enabled_tax_rates)&&p(kt,{label:n("charge_taxes"),checked:o(l),onChange:()=>s(l)})},l))]}):null}function qnn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("payments")}`,t=Zi(),i=Qm();return t?p(tn,{title:e,children:["payment1","payment2","payment3","payment4"].map(r=>p(Zf,{field:r,placeholder:n("payment_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function Gnn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("projects")}`,t=Zi(),i=Qm();return t?p(tn,{title:e,children:["project1","project2","project3","project4"].map(r=>p(Zf,{field:r,placeholder:n("project_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function Knn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("tasks")}`,t=Zi(),i=Qm();return t?p(tn,{title:e,children:["task1","task2","task3","task4"].map(r=>p(Zf,{field:r,placeholder:n("task_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function Ynn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("vendors")}`,t=Zi(),i=Qm();return t?O(St,{children:[p(tn,{title:e,children:["vendor1","vendor2","vendor3","vendor4"].map(r=>p(Zf,{field:r,placeholder:n("vendor_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}),p(tn,{title:`${n("custom_fields")}: ${n("contacts")}`,children:["vendor_contact1","vendor_contact2","vendor_contact3","vendor_contact4"].map(r=>p(Zf,{field:r,placeholder:n("contact_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))})]}):null}function Qnn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("expenses")}`,t=Zi(),i=Qm();return t?p(tn,{title:e,children:["expense1","expense2","expense3","expense4"].map(r=>p(Zf,{field:r,placeholder:n("expense_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function Xnn(){Mi("custom_fields");const[n]=ve(),e=`${n("custom_fields")}: ${n("users")}`,t=Zi(),i=Qm();return t?p(tn,{title:e,children:["user1","user2","user3","user4"].map(r=>p(Zf,{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 x0(){return!Bm()&&!xc()&&qo()}function Iv(n){const[e]=ve(),t=Va();return p(St,{children:p("div",{className:n.className,children:p(Fs,{className:"mb-4",type:"warning",disableClosing:!0,children:O("div",{className:"flex items-center",children:[p(qD,{className:"mr-2",fontSize:20}),n.message?n.message:e("start_free_trial_message"),(t==null?void 0:t.company_user)&&p(qi,{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 Znn(){const{t:n}=ve();return[{name:n("settings"),href:At("/settings/generated_numbers")},{name:n("clients"),href:At("/settings/generated_numbers/clients")},{name:n("invoices"),href:At("/settings/generated_numbers/invoices")},{name:n("recurring_invoices"),href:At("/settings/generated_numbers/recurring_invoices")},{name:n("payments"),href:At("/settings/generated_numbers/payments")},{name:n("quotes"),href:At("/settings/generated_numbers/quotes")},{name:n("credits"),href:At("/settings/generated_numbers/credits")},{name:n("projects"),href:At("/settings/generated_numbers/projects")},{name:n("tasks"),href:At("/settings/generated_numbers/tasks")},{name:n("vendors"),href:At("/settings/generated_numbers/vendors")},{name:n("purchase_orders"),href:At("/settings/generated_numbers/purchase_orders")},{name:n("expenses"),href:At("/settings/generated_numbers/expenses")},{name:n("recurring_expenses"),href:At("/settings/generated_numbers/recurring_expenses")}]}function Jnn(){Mi("generated_numbers");const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("generated_numbers"),href:"/settings/generated_numbers"}];Pc();const t=Znn(),i=xu(),r=lp(),o=x0();return O(sr,{title:n("generated_numbers"),docsLink:"en/advanced-settings/#generated_numbers",breadcrumbs:e,onSaveClick:i,onCancelClick:r,disableSaveButton:o,children:[p(KS,{tabs:t,className:"mt-6"}),o&&p(Iv,{}),p("div",{className:"my-4",children:p(sp,{})})]})}function Xm(){const[n]=ve();return p(qi,{className:"pl-6",to:"https://invoiceninja.github.io/en/custom-fields/#custom-fields",external:!0,children:n("click_to_variables")})}function ein(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("clients"),children:[p(G,{leftSide:p(Ht,{propertyKey:"client_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"client_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function tin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("invoices"),children:[p(G,{leftSide:p(Ht,{propertyKey:"invoice_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"invoice_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function nin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("recurring_invoices"),children:[p(G,{leftSide:p(Ht,{propertyKey:"recurring_invoice_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"recurring_invoice_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function iin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("payments"),children:[p(G,{leftSide:p(Ht,{propertyKey:"payment_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"payment_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function rin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("quotes"),children:[p(G,{leftSide:p(Ht,{propertyKey:"quote_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"quote_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function oin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("credits"),children:[p(G,{leftSide:p(Ht,{propertyKey:"credit_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"credit_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function sin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("projects"),children:[p(G,{leftSide:p(Ht,{propertyKey:"project_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"project_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function ain(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("tasks"),children:[p(G,{leftSide:p(Ht,{propertyKey:"task_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"task_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function lin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("vendors"),children:[p(G,{leftSide:p(Ht,{propertyKey:"vendor_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"vendor_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function cin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("purchase_orders"),children:[p(G,{leftSide:p(Ht,{propertyKey:"purchase_order_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"purchase_order_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function uin(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("expenses"),children:[p(G,{leftSide:p(Ht,{propertyKey:"expense_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"expense_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}function din(){var l,c;const[n]=ve(),[e,t]=w.useState(""),i=Zi(),r=pa(),o=Gi(Bs),s=Bo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return O(tn,{title:n("recurring_expenses"),children:[p(G,{leftSide:p(Ht,{propertyKey:"recurring_expense_number_pattern",labelElement:p(Wt,{label:n("number_pattern")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"recurring_expense_number_counter",labelElement:p(Wt,{label:n("number_counter")})}),children:p(mo,{precision:0,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"]})}),p(vi,{}),a.map((u,d)=>p(Nl,{onClick:()=>t(e+u),children:p(Oc,{text:u})},d)),p(vi,{}),p(Xm,{})]})}const hin=["1","01","001","0001","00001","000001","0000001","00000001","000000001","0000000001"],fin=["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 pin(){var o,s,a,l,c,u,d,h;const[n]=ve(),e=pa(),t=Pc(),i=Bo(),r=Gi(Bs);return O(tn,{title:n("settings"),children:[p(G,{leftSide:p(Ht,{propertyKey:"counter_padding",labelElement:p(Wt,{label:n("number_padding")}),defaultValue:"1"}),children:p(En,{id:"settings.counter_padding",value:((o=t==null?void 0:t.settings)==null?void 0:o.counter_padding)||"1",onValueChange:f=>i("settings.counter_padding",f),disabled:e("counter_padding"),errorMessage:r==null?void 0:r.errors["settings.counter_padding"],children:hin.map((f,g)=>p("option",{value:g+1,children:f},g))})}),p(G,{leftSide:p(Ht,{propertyKey:"counter_number_applied",labelElement:p(Wt,{label:n("generate_number")}),defaultValue:"when_saved"}),children:O(En,{id:"settings.counter_number_applied",value:((s=t==null?void 0:t.settings)==null?void 0:s.counter_number_applied)||"when_saved",onValueChange:f=>i("settings.counter_number_applied",f),disabled:e("counter_number_applied"),errorMessage:r==null?void 0:r.errors["settings.counter_number_applied"],children:[p("option",{value:"when_saved",children:n("when_saved")}),p("option",{value:"when_sent",children:n("when_sent")})]})}),p(G,{leftSide:p(Ht,{propertyKey:"recurring_number_prefix",labelElement:p(Wt,{label:n("recurring_prefix")})}),children:p(Ze,{value:((a=t==null?void 0:t.settings)==null?void 0:a.recurring_number_prefix)||"",onValueChange:f=>i("settings.recurring_number_prefix",f),disabled:e("recurring_number_prefix"),errorMessage:r==null?void 0:r.errors["settings.recurring_number_prefix"]})}),p(G,{leftSide:p(Ht,{propertyKey:"shared_invoice_quote_counter",labelElement:p(Wt,{label:n("shared_invoice_quote_counter")}),defaultValue:!1}),children:p(kt,{onChange:f=>i("settings.shared_invoice_quote_counter",f),checked:!!((l=t==null?void 0:t.settings)!=null&&l.shared_invoice_quote_counter),disabled:e("shared_invoice_quote_counter")})}),p(G,{leftSide:p(Ht,{propertyKey:"shared_invoice_credit_counter",labelElement:p(Wt,{label:n("shared_invoice_credit_counter")}),defaultValue:!1}),children:p(kt,{onChange:f=>i("settings.shared_invoice_credit_counter",f),checked:!!((c=t==null?void 0:t.settings)!=null&&c.shared_invoice_credit_counter),disabled:e("shared_invoice_credit_counter")})}),p(G,{leftSide:p(Ht,{propertyKey:"reset_counter_frequency_id",labelElement:p(Wt,{label:n("reset_counter")}),defaultValue:"0"}),children:p(En,{value:((u=t==null?void 0:t.settings)==null?void 0:u.reset_counter_frequency_id)||"0",onValueChange:f=>{i("settings.reset_counter_frequency_id",parseInt(f)),f==="0"&&i("settings.reset_counter_date","")},disabled:e("reset_counter_frequency_id"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_frequency_id"],children:fin.map((f,g)=>p("option",{value:g,children:n(f)},g))})}),(t==null?void 0:t.settings)&&((d=t==null?void 0:t.settings)==null?void 0:d.reset_counter_frequency_id)>0&&p(G,{leftSide:p(Ht,{propertyKey:"reset_counter_date",labelElement:p(Wt,{label:n("next_reset")})}),children:p(Ze,{type:"date",value:((h=t==null?void 0:t.settings)==null?void 0:h.reset_counter_date)||"",onValueChange:f=>i("settings.reset_counter_date",f),disabled:e("reset_counter_date"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_date"]})})]})}const gin="/peppol-4400ca01.json";var Gve={exports:{}},Sqe={},wG={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7},N1={};const Gs=wG,Kve=()=>[{type:Gs.RANGE,from:48,to:57}],Eqe=()=>[{type:Gs.CHAR,value:95},{type:Gs.RANGE,from:97,to:122},{type:Gs.RANGE,from:65,to:90}].concat(Kve()),xqe=()=>[{type:Gs.CHAR,value:9},{type:Gs.CHAR,value:10},{type:Gs.CHAR,value:11},{type:Gs.CHAR,value:12},{type:Gs.CHAR,value:13},{type:Gs.CHAR,value:32},{type:Gs.CHAR,value:160},{type:Gs.CHAR,value:5760},{type:Gs.RANGE,from:8192,to:8202},{type:Gs.CHAR,value:8232},{type:Gs.CHAR,value:8233},{type:Gs.CHAR,value:8239},{type:Gs.CHAR,value:8287},{type:Gs.CHAR,value:12288},{type:Gs.CHAR,value:65279}],min=()=>[{type:Gs.CHAR,value:10},{type:Gs.CHAR,value:13},{type:Gs.CHAR,value:8232},{type:Gs.CHAR,value:8233}];N1.words=()=>({type:Gs.SET,set:Eqe(),not:!1});N1.notWords=()=>({type:Gs.SET,set:Eqe(),not:!0});N1.ints=()=>({type:Gs.SET,set:Kve(),not:!1});N1.notInts=()=>({type:Gs.SET,set:Kve(),not:!0});N1.whitespace=()=>({type:Gs.SET,set:xqe(),not:!1});N1.notWhitespace=()=>({type:Gs.SET,set:xqe(),not:!0});N1.anyChar=()=>({type:Gs.SET,set:min(),not:!0});(function(n){const e=wG,t=N1,i="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",r={0:0,t:9,n:10,v:11,f:12,r:13};n.strToChars=function(o){var s=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return o=o.replace(s,function(a,l,c,u,d,h,f,g){if(c)return a;var m=l?8:u?parseInt(u,16):d?parseInt(d,16):h?parseInt(h,8):f?i.indexOf(f):r[g],v=String.fromCharCode(m);return/[[\]{}^$.|?*+()]/.test(v)&&(v="\\"+v),v}),o},n.tokenizeClass=(o,s)=>{for(var a=[],l=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,c,u;(c=l.exec(o))!=null;)if(c[1])a.push(t.words());else if(c[2])a.push(t.ints());else if(c[3])a.push(t.whitespace());else if(c[4])a.push(t.notWords());else if(c[5])a.push(t.notInts());else if(c[6])a.push(t.notWhitespace());else if(c[7])a.push({type:e.RANGE,from:(c[8]||c[9]).charCodeAt(0),to:c[10].charCodeAt(0)});else if(u=c[12])a.push({type:e.CHAR,value:u.charCodeAt(0)});else return[a,l.lastIndex];n.error(s,"Unterminated character class")},n.error=(o,s)=>{throw new SyntaxError("Invalid regular expression: /"+o+"/: "+s)}})(Sqe);var s6={};const SG=wG;s6.wordBoundary=()=>({type:SG.POSITION,value:"b"});s6.nonWordBoundary=()=>({type:SG.POSITION,value:"B"});s6.begin=()=>({type:SG.POSITION,value:"^"});s6.end=()=>({type:SG.POSITION,value:"$"});const jI=Sqe,nm=wG,OE=N1,a9=s6;Gve.exports=n=>{var e=0,t,i,r={type:nm.ROOT,stack:[]},o=r,s=r.stack,a=[],l=_=>{jI.error(n,`Nothing to repeat at column ${_-1}`)},c=jI.strToChars(n);for(t=c.length;e<t;)switch(i=c[e++],i){case"\\":switch(i=c[e++],i){case"b":s.push(a9.wordBoundary());break;case"B":s.push(a9.nonWordBoundary());break;case"w":s.push(OE.words());break;case"W":s.push(OE.notWords());break;case"d":s.push(OE.ints());break;case"D":s.push(OE.notInts());break;case"s":s.push(OE.whitespace());break;case"S":s.push(OE.notWhitespace());break;default:/\d/.test(i)?s.push({type:nm.REFERENCE,value:parseInt(i,10)}):s.push({type:nm.CHAR,value:i.charCodeAt(0)})}break;case"^":s.push(a9.begin());break;case"$":s.push(a9.end());break;case"[":var u;c[e]==="^"?(u=!0,e++):u=!1;var d=jI.tokenizeClass(c.slice(e),n);e+=d[1],s.push({type:nm.SET,set:d[0],not:u});break;case".":s.push(OE.anyChar());break;case"(":var h={type:nm.GROUP,stack:[],remember:!0};i=c[e],i==="?"&&(i=c[e+1],e+=2,i==="="?h.followedBy=!0:i==="!"?h.notFollowedBy=!0:i!==":"&&jI.error(n,`Invalid group, character '${i}' after '?' at column ${e-1}`),h.remember=!1),s.push(h),a.push(o),o=h,s=h.stack;break;case")":a.length===0&&jI.error(n,`Unmatched ) at column ${e-1}`),o=a.pop(),s=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var f=[];o.options.push(f),s=f;break;case"{":var g=/^(\d+)(,(\d+)?)?\}/.exec(c.slice(e)),m,v;g!==null?(s.length===0&&l(e),m=parseInt(g[1],10),v=g[2]?g[3]?parseInt(g[3],10):1/0:m,e+=g[0].length,s.push({type:nm.REPETITION,min:m,max:v,value:s.pop()})):s.push({type:nm.CHAR,value:123});break;case"?":s.length===0&&l(e),s.push({type:nm.REPETITION,min:0,max:1,value:s.pop()});break;case"+":s.length===0&&l(e),s.push({type:nm.REPETITION,min:1,max:1/0,value:s.pop()});break;case"*":s.length===0&&l(e),s.push({type:nm.REPETITION,min:0,max:1/0,value:s.pop()});break;default:s.push({type:nm.CHAR,value:i.charCodeAt(0)})}return a.length!==0&&jI.error(n,"Unterminated group"),r};Gve.exports.types=nm;var _in=Gve.exports;class gb{constructor(e,t){this.low=e,this.high=t,this.length=1+t-e}overlaps(e){return!(this.high<e.low||this.low>e.high)}touches(e){return!(this.high+1<e.low||this.low-1>e.high)}add(e){return new gb(Math.min(this.low,e.low),Math.max(this.high,e.high))}subtract(e){return e.low<=this.low&&e.high>=this.high?[]:e.low>this.low&&e.high<this.high?[new gb(this.low,e.low-1),new gb(e.high+1,this.high)]:e.low<=this.low?[new gb(e.high+1,this.high)]:[new gb(this.low,e.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}}let vin=class dP{constructor(e,t){this.ranges=[],this.length=0,e!=null&&this.add(e,t)}_update_length(){this.length=this.ranges.reduce((e,t)=>e+t.length,0)}add(e,t){var i=r=>{for(var o=0;o<this.ranges.length&&!r.touches(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&r.touches(this.ranges[o]);)r=r.add(this.ranges[o]),o++;s.push(r),this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return e instanceof dP?e.ranges.forEach(i):(t==null&&(t=e),i(new gb(e,t))),this}subtract(e,t){var i=r=>{for(var o=0;o<this.ranges.length&&!r.overlaps(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&r.overlaps(this.ranges[o]);)s=s.concat(this.ranges[o].subtract(r)),o++;this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return e instanceof dP?e.ranges.forEach(i):(t==null&&(t=e),i(new gb(e,t))),this}intersect(e,t){var i=[],r=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(;s<this.ranges.length&&o.overlaps(this.ranges[s]);){var a=Math.max(this.ranges[s].low,o.low),l=Math.min(this.ranges[s].high,o.high);i.push(new gb(a,l)),s++}};return e instanceof dP?e.ranges.forEach(r):(t==null&&(t=e),r(new gb(e,t))),this.ranges=i,this._update_length(),this}index(e){for(var t=0;t<this.ranges.length&&this.ranges[t].length<=e;)e-=this.ranges[t].length,t++;return this.ranges[t].low+e}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new dP(this)}numbers(){return this.ranges.reduce((e,t)=>{for(var i=t.low;i<=t.high;)e.push(i),i++;return e},[])}subranges(){return this.ranges.map(e=>({low:e.low,high:e.high,length:1+e.high-e.low}))}};var bin=vin;const N$=_in,fO=bin,PE=N$.types;var yin=class hP{constructor(e,t){if(this._setDefaults(e),e instanceof RegExp)this.ignoreCase=e.ignoreCase,this.multiline=e.multiline,e=e.source;else if(typeof e=="string")this.ignoreCase=t&&t.indexOf("i")!==-1,this.multiline=t&&t.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=N$(e)}_setDefaults(e){this.max=e.max!=null?e.max:hP.prototype.max!=null?hP.prototype.max:100,this.defaultRange=e.defaultRange?e.defaultRange:this.defaultRange.clone(),e.randInt&&(this.randInt=e.randInt)}gen(){return this._gen(this.tokens,[])}_gen(e,t){var i,r,o,s,a;switch(e.type){case PE.ROOT:case PE.GROUP:if(e.followedBy||e.notFollowedBy)return"";for(e.remember&&e.groupNumber===void 0&&(e.groupNumber=t.push(null)-1),i=e.options?this._randSelect(e.options):e.stack,r="",s=0,a=i.length;s<a;s++)r+=this._gen(i[s],t);return e.remember&&(t[e.groupNumber]=r),r;case PE.POSITION:return"";case PE.SET:var l=this._expand(e);return l.length?String.fromCharCode(this._randSelect(l)):"";case PE.REPETITION:for(o=this.randInt(e.min,e.max===1/0?e.min+this.max:e.max),r="",s=0;s<o;s++)r+=this._gen(e.value,t);return r;case PE.REFERENCE:return t[e.value-1]||"";case PE.CHAR:var c=this.ignoreCase&&this._randBool()?this._toOtherCase(e.value):e.value;return String.fromCharCode(c)}}_toOtherCase(e){return e+(97<=e&&e<=122?-32:65<=e&&e<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(e){return e instanceof fO?e.index(this.randInt(0,e.length-1)):e[this.randInt(0,e.length-1)]}_expand(e){if(e.type===N$.types.CHAR)return new fO(e.value);if(e.type===N$.types.RANGE)return new fO(e.from,e.to);{let t=new fO;for(let i=0;i<e.set.length;i++){let r=this._expand(e.set[i]);if(t.add(r),this.ignoreCase)for(let o=0;o<r.length;o++){let s=r.index(o),a=this._toOtherCase(s);s!==a&&t.add(a)}}return e.not?this.defaultRange.clone().subtract(t):this.defaultRange.clone().intersect(t)}}randInt(e,t){return e+Math.floor(Math.random()*(1+t-e))}get defaultRange(){return this._range=this._range||new fO(32,126)}set defaultRange(e){this._range=e}static randexp(e,t){var i;return typeof e=="string"&&(e=new RegExp(e,t)),e._randexp===void 0?(i=new hP(e,t),e._randexp=i):(i=e._randexp,i._setDefaults(e)),i.gen()}static sugar(){RegExp.prototype.gen=function(){return hP.randexp(this)}}};const Cin=nl(yin);function win(n){const{resolvedTypes:e,resolvedUIComponents:t,onBreadCrumbIndexChange:i}=n;return O("div",{className:"flex flex-col mt-4 px-6 space-y-8",children:[p("div",{className:"flex items-center",children:e.map((r,o)=>O("div",{className:"flex items-center",children:[p("div",{className:"cursor-pointer hover:underline",onClick:()=>i(o),children:r}),o!==e.length-1&&p(nt,{element:Xj,style:{marginLeft:6,marginRight:6}})]},r))}),Array.isArray(t)&&p("div",{children:t.find((r,o)=>t.length-1===o)})]})}function qI(n){const{fieldKey:e,payload:t,setPayload:i,fieldType:r,label:o,helpLabel:s,isOptionalField:a,requiredField:l,invoice:c,setInvoice:u}=n,d=zi(),h=si(),f=Zi(),[g,m]=w.useState((t==null?void 0:t[e])!==void 0),[v,_]=w.useState(!1);return w.useEffect(()=>{if(g&&(t==null?void 0:t[e])===void 0){const b=r==="boolean"?!1:r==="decimal"||r==="number"?0:"";i(y=>({...y,[e]:b}))}if(!g&&(t==null?void 0:t[e])!==void 0){delete t[e];const b=e.split("|").length,y=e.split("|").filter((C,E)=>E!==b-2).join("|");if(f&&!c){const C=An.cloneDeep(f);delete C[y.replaceAll("|",".")],d(go({object:"company",property:"e_invoice",value:C}))}else if(c&&u){const C=An.cloneDeep(c);delete C[`e_invoice.${y.replaceAll("|",".")}`],u(C)}i({...t})}},[g]),w.useEffect(()=>{(t==null?void 0:t[e])!==void 0&&!v&&(m(!0),_(!0))},[t==null?void 0:t[e]]),O("div",{className:"flex items-center",children:[a&&p(Oh,{checked:g,onValueChange:(b,y)=>m(!!y)}),p("div",{className:zt({"opacity-75":!g&&a,"cursor-pointer":a}),onClick:()=>a&&m(b=>!b),children:O("div",{className:"flex flex-col text-sm",children:[O("span",{className:"font-medium",style:{color:h.$3},children:[o,l&&p("span",{className:"ml-1 text-red-600",children:"*"})]}),s&&p("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:s},style:{color:h.$3,opacity:.8}})]})})]})}function Sin(n){const{errors:e}=n,t=i=>{const r=i.split("|").length,o=i.split("|").filter((c,u)=>u<r-2).join("|"),s=o.split("|").length;let a="",l="";return l=o.split("|")[s-1],s>1?(a=o.split("|")[s-2],`(${a}, ${l})`):s>0?`(${l})`:null};return p(Fs,{className:"mb-6",type:"danger",children:p("ul",{children:Object.keys(n.errors.errors).map((i,r)=>p("li",{children:`${e.errors[i]} ${t(i)}`},r))})})}function wDe(n){const{renderFragment:e,children:t,className:i}=n;return e?p(ce.Fragment,{children:t}):p("div",{className:i,children:t})}const Ein=w.forwardRef((n,e)=>{const[t]=ve(),i=ml(),r=si(),{standard:o="peppol",entityLevel:s,currentEInvoice:a,invoice:l,setInvoice:c}=n,{isCompanySettingsActive:u,isClientSettingsActive:d}=$s(),[h,f]=w.useState([]),[g,m]=w.useState(),[v,_]=w.useState(!0),[b,y]=w.useState({}),[C,E]=w.useState(),[x,k]=w.useState(),[L,D]=w.useState({});let A=[];const[N,P]=w.useState({}),[M,B]=w.useState([]),[F,U]=w.useState([]),[H,W]=w.useState([]),[q,V]=w.useState([]),[re,oe]=w.useState([]),[Q,Ne]=w.useState(!1),[Ve,Ye]=w.useState([]),ye=pe=>pe==null?void 0:pe.split("Type")[0],He=(pe,We)=>{P(ne=>({...ne,[pe]:We}))},Pe=pe=>{var ne;const We=pe.split("|").length;if(We>1){const Se=X(pe),Ie=pe.split("|")[We-(Se?4:2)],Ke=pe.split("|")[We-1],Je=b[Ie];if(Je&&Ke)return(ne=Je==null?void 0:Je.choices)==null?void 0:ne.some(ot=>ot.some(wt=>wt===Ke))}return!1},Ge=pe=>!!re.find(We=>We===pe),Fe=(pe,We,ne)=>{if(!mt(We))return!1;if(Pe(pe))return Ge(pe);if(ne)return!0;const Ie=Yt(pe),Ke=!Mt(pe),Je=Ft(pe);return Ie||Ke||Je},bt=(pe,We)=>{const ne=q.find(({key:Se})=>Se===pe);if(ne||We){oe(Je=>Je.filter(ot=>!ot.startsWith(pe)));const Se=X(pe),Ie=pe.split("|").filter((Je,ot)=>ot!==pe.split("|").length-(Se?2:1)).join("|"),Ke=An.cloneDeep(N);if(Object.keys(Ke).forEach(Je=>{Je.startsWith(Ie)&&delete Ke[Je]}),P(Ke),We){const Je=F.find(ot=>ot.key===pe);Je&&W(ot=>[...ot,Je])}else ne&&B(Je=>[...Je,ne])}},Mt=(pe,We)=>(We??(v?A:q)).some(Se=>{const Ie=Se.key.split("|").length;return Se.key.split("|").filter((Je,ot)=>ot!==Ie-1).join("|").split("|").every((Je,ot)=>Je===pe.split("|")[ot])}),Ft=pe=>F.some(We=>{const ne=We.key.split("|").length;return We.key.split("|").filter((Ie,Ke)=>Ke!==ne-1&&Ke!==ne-2).join("|").split("|").every((Ie,Ke)=>Ie===pe.split("|")[Ke])}),Yt=pe=>Ve.some(We=>{const ne=We.split("|").length;return We.split("|").filter((Ie,Ke)=>Ke!==ne-1).join("|").split("|").every((Ie,Ke)=>Ie===pe.split("|")[Ke])}),ln=pe=>pe.replace(/([a-z])([A-Z])/g,"$1 $2").trim(),Et=(pe,We,ne)=>{let Se="";const Ie=`${We}|${pe.name}`,Ke=h.find(ot=>ot.key===pe.name);Ke?Se=Ke.label:Se=ln(pe.name);const Je=Mt(Ie);if(!Fe(Ie,pe.visibility,ne))return null;if(N[Ie]===void 0){const ot=Ie.split("|").length,wt=Ie.split("|").filter((Cn,hn)=>hn!==ot-2).join("|").replaceAll("|","."),pn=An.get(a,wt),Kn=pe.base_type==="boolean"?!1:pe.base_type==="decimal"||pe.base_type==="number"?0:"";(pn||L[Ie.split("|")[ot-1]]||!Je)&&!Pe(Ie)&&P(Cn=>({...Cn,[Ie]:pn||L[Ie.split("|")[ot-1]]||Kn})),Pe(Ie)}return typeof pe.resource=="object"&&pe.resource!==null&&Object.keys(pe.resource).length?p(G,{leftSide:p(qI,{fieldKey:Ie,fieldType:"string",payload:N,setPayload:P,label:Se,helpLabel:pe.help,isOptionalField:Je,requiredField:!!(Ke!=null&&Ke.required),invoice:l,setInvoice:c}),noExternalPadding:!0,children:p(En,{value:N[Ie]||"",onValueChange:ot=>He(Ie,ot),disabled:N[Ie]===void 0,withBlank:!0,children:Object.entries(pe.resource).map(([ot,wt])=>p("option",{value:ot,children:wt||ot},ot))})},Ie):pe.base_type==="decimal"||pe.base_type==="number"?p(G,{leftSide:p(qI,{fieldKey:Ie,fieldType:"number",payload:N,setPayload:P,label:Se,helpLabel:pe.help,isOptionalField:Je,requiredField:!!(Ke!=null&&Ke.required),invoice:l,setInvoice:c}),noExternalPadding:!0,children:p(mo,{value:N[Ie]||0,onValueChange:ot=>{var wt,pn;return He(Ie,parseFloat(ot).toFixed((pn=(wt=ot.split("."))==null?void 0:wt[1])==null?void 0:pn.length))},disabled:N[Ie]===void 0})},Ie):pe.base_type==="date"?p(G,{leftSide:p(qI,{fieldKey:Ie,fieldType:"date",payload:N,setPayload:P,label:Se,helpLabel:pe.help,isOptionalField:Je,requiredField:!!(Ke!=null&&Ke.required),invoice:l,setInvoice:c}),noExternalPadding:!0,children:p(Ze,{type:"date",value:N[Ie]||"",onValueChange:ot=>He(Ie,ot),disabled:N[Ie]===void 0})},Ie):pe.base_type==="boolean"?p(G,{leftSide:p(qI,{fieldKey:Ie,fieldType:"boolean",payload:N,setPayload:P,label:Se,helpLabel:pe.help,isOptionalField:Je,requiredField:!!(Ke!=null&&Ke.required),invoice:l,setInvoice:c}),noExternalPadding:!0,children:p(kt,{checked:!!N[Ie]||!1,onValueChange:ot=>He(Ie,ot),disabled:N[Ie]===void 0})},Ie):pe.base_type==="time"?p(G,{leftSide:p(qI,{fieldKey:Ie,fieldType:"time",payload:N,setPayload:P,label:Se,helpLabel:pe.help,isOptionalField:Je,requiredField:!!(Ke!=null&&Ke.required),invoice:l,setInvoice:c}),noExternalPadding:!0,children:p(Ze,{type:"time",value:N[Ie]||"",onValueChange:ot=>He(Ie,ot),disabled:N[Ie]===void 0})},Ie):pe.base_type!==null?p(G,{leftSide:p(qI,{fieldKey:Ie,fieldType:pe.base_type,payload:N,setPayload:P,label:Se,helpLabel:pe.help,isOptionalField:Je,requiredField:!!(Ke!=null&&Ke.required),invoice:l,setInvoice:c}),noExternalPadding:!0,children:p(Ze,{value:N[Ie]||"",onValueChange:ot=>He(Ie,ot),disabled:N[Ie]===void 0})},Ie):null},mt=pe=>{const We=u&&i.pathname.startsWith("/settings");return!(pe===0||pe===1&&!We||pe===2&&!d||pe===4&&!s||pe===3&&!d&&!We||pe===5&&!s&&!We||pe===6&&!s&&!d)},Lt=pe=>{const We=pe.split("|").length;let ne="",Se="";return We>2&&(ne=pe.split("|")[We-3],Se=pe.split("|")[We-2]),We>3&&(ne=pe.split("|")[We-4]),We>2||We>3?`${t("Choices")} (${ye(ne)}, ${Se})`:We>1?(Se=pe.split("|")[We-2],`${t("Choices")} (${Se})`):t("Choices")},be=pe=>Object.values(pe.elements).some(We=>mt(We.visibility)),Te=pe=>{const We=re.find(ne=>ne.startsWith(pe));if(We){const ne=We.split("|").length;return We.split("|")[ne-1]}return""},se=(pe,We,ne,Se,Ie,Ke)=>{var Cn,hn;const Je=`${ne}|${pe.type}`,ot=v?A:M,wt=q.some(bn=>Je===bn.key),pn=F.some(bn=>Je===bn.key),Kn=!ot.some(bn=>Je===bn.key)&&wt||pn;return p(wDe,{className:"flex items-center space-x-4",renderFragment:!Kn,children:O(wDe,{className:"flex flex-1 flex-col",renderFragment:!Kn,children:[(Kn||Se)&&!!((Cn=pe.choices)!=null&&Cn.length)&&p(G,{leftSide:Lt(Je),noExternalPadding:!0,children:p(En,{value:Te(Je),onValueChange:bn=>{oe(Wn=>{const Ei=Wn.filter(er=>!er.startsWith(Je));if(!bn){const er=Wn.find(ur=>ur.startsWith(Je));er&&P(ur=>({...ur,[er]:typeof ur[er]=="number"?0:typeof ur[er]=="boolean"?!1:""}))}return[...Ei,...bn?[`${Je}|${bn}`]:[]]})},withBlank:!0,children:(hn=pe.choices)==null?void 0:hn.map(bn=>bn.map(Wn=>p("option",{value:Wn,children:Wn},Wn)))})},`${Je}ChoiceSelector`),!!Object.keys(pe.elements).length&&Object.values(pe.elements).map(bn=>{var Wn;if((Wn=bn.base_type)!=null&&Wn.endsWith("Type")){const Ei=Object.values(b).filter((Jr,$i)=>We!==$i),er=Ei.findIndex(Jr=>(Jr==null?void 0:Jr.type)===bn.base_type),ur=Ei[er];if(ur){const Jr=mt(bn.visibility),$i=`${ne}|${bn.name}|${ur.type}`,xs=be(ur),wr=v?A:q;if(bn.min_occurs===0&&xs&&Jr&&!Mt($i,wr)){const ut=$i.split("|").length,Le=$i.split("|")[ut-3],st=Le?`${ln(bn.name)} (${ln(Le)})`:ln(bn.name);A.push({key:$i,label:st,multiSelection:bn.max_occurs===-1})}const Ji=Yt($i),rn=!Mt($i,M),di=Ft($i),Wr=wr.find(Jt=>Jt.key===$i),Qe=Jr&&(Se&&!Wr||rn||di||Ji),Ct=bn.max_occurs===-1&&!Ke,Gt=Ct?F.filter(Jt=>{const ut=Jt.key.split("|").length;return Jt.key.split("|").filter((st,ze)=>ze!==ut-1).join("|")===$i}).map(()=>bn):[bn];return p(St,{children:Qe&&xs&&p(St,{children:Gt.map((Jt,ut)=>(!H.some(Le=>Le.key===`${$i}|${ut}`)||!Ct)&&O("div",{className:"flex items-center space-x-4 mt-1",children:[O("div",{className:"flex flex-1 items-center py-2 border-b border-t justify-between",style:{borderColor:r.$5},children:[O("div",{className:"flex flex-col space-y-1",children:[p("span",{className:"text-sm",children:Gt.length===1?ln(Jt.name):`${ln(Jt.name)} (${ut+1})`}),Jt.help&&p("span",{className:"text-xs",children:Jt.help})]}),p("div",{className:"cursor-pointer",onClick:()=>Ye(Le=>[...Le,Ct?`${$i}|${ut}`:$i]),children:p(nt,{element:F9e,size:27})})]}),Wr&&p("div",{className:"cursor-pointer",onClick:()=>bt(Ct?`${$i}|${ut}`:$i,Ct),children:p(nt,{element:el,size:28})})]},`${$i}${ut}`))})})}}else return Et(bn,Je,Se)})]})},Je)},Y=(pe,We,ne)=>{var Se;return{...pe,errors:{...pe.errors,[We]:[...pe.errors[We]?pe.errors[We]:[],(Se=pe.errors[We])!=null&&Se.length?`
${ne}`:ne]}}},X=pe=>/\d/.test(pe),le=(pe,We="")=>An.flatMapDeep(An.keys(pe),ne=>{const Se=pe[ne],Ie=We?`${We}.${ne}`:ne;return An.isObject(Se)?le(Se,Ie):Ie}),te=(pe,We="")=>le(pe,We),me=()=>{let pe={errors:{},message:""};if(Object.entries(N).forEach(([We,ne])=>{var wt;const Se=X(We),Ie=We.split("|").length,Ke=We.split("|")[Ie-1],Je=We.split("|")[Ie-(Se?4:2)];let ot;if(Object.values(b).forEach(pn=>{pn&&!ot&&Je===pn.type&&(ot=Object.values((pn==null?void 0:pn.elements)||{}).find(({name:Kn})=>Kn===Ke))}),ot){let pn;Object.values(b).forEach(Cn=>{pn||(pn=Object.values((Cn==null?void 0:Cn.elements)||{}).find(({name:hn})=>hn===Ke))});const Kn=(wt=h.find(Cn=>Cn.key===Ke))==null?void 0:wt.required;if(pn){const{pattern:Cn,length:hn,min_length:bn,max_length:Wn}=pn;if(Kn&&!ne&&(pe=Y(pe,We,`${We} is required field!`)),hn&&((ne==null?void 0:ne.toString().length)<hn||(ne==null?void 0:ne.toString().length)>hn)&&(pe=Y(pe,We,`Value length for the ${Ke} field must be ${hn}!`)),Cn)try{new RegExp(Cn).test(ne.toString())===!1&&(pe=Y(pe,We,`${Ke} has wrong pattern, the correct pattern is ${new Cin(Cn).gen()} (example)!`))}catch(Ei){console.error(Ei)}bn&&!Wn&&(ne==null?void 0:ne.toString().length)<bn&&(pe=Y(pe,We,`Min length for ${Ke} field is ${bn}!`)),Wn&&!bn&&(ne==null?void 0:ne.toString().length)>Wn&&(pe=Y(pe,We,`Max length for ${Ke} field is ${Wn}!`)),Wn&&bn&&(((ne==null?void 0:ne.toString().length)>Wn||(ne==null?void 0:ne.toString().length)<bn)&&Wn!==bn?pe=Y(pe,We,`Length for ${Ke} field should be between ${bn} and ${Wn}!`):((ne==null?void 0:ne.toString().length)>Wn||(ne==null?void 0:ne.toString().length)<bn)&&(pe=Y(pe,We,`Length for ${Ke} field should be ${bn}!`)))}}}),Object.keys(pe.errors).length)return m(pe),pe;m(void 0)},Me=()=>{const pe={};return Object.entries(N).forEach(([We,ne])=>{const Se=We.split("|").length,Ie=We.split("|")[Se-1],Ke=We.split("|")[Se-2];let Je;if(Object.values(b).forEach(ot=>{ot&&!Je&&Ke===ot.type&&(Je=Object.values((ot==null?void 0:ot.elements)||{}).find(({name:wt})=>wt===Ie))}),N[We]!==void 0){const ot=We.split("|").filter(wt=>!wt.endsWith("Type")).join("|");An.set(pe,ot.replaceAll("|","."),ne)}}),pe},rt=()=>Ve.map(pe=>{const We=pe.split("|").length,ne=pe.slice(-1),Se=/\d/.test(ne),Ie=pe.split("|")[We-(Se?3:2)];return Se?`${Ie} (${Number(ne)+1})`:Ie}),It=()=>{if(m(void 0),me()===void 0)return Me()},Qt=async(pe,We,ne,Se)=>Object.keys(pe).length?Object.entries(pe).map(([Ke,Je],ot)=>{const wt=Object.values(pe).filter((pn,Kn)=>Kn<ot).some(pn=>Object.values((pn==null?void 0:pn.elements)||{}).some(Kn=>Kn.base_type===(Je==null?void 0:Je.type)));if(ot===0||!wt)return Je&&se(Je,ot,ne||ye(Ke)||"",We??!0,!!ne,!!Se)}).filter(Ke=>Ke):p(St,{});return w.useEffect(()=>{o?fetch(new URL(Object.assign({"/src/resources/e-invoice/peppol/peppol.json":gin})[`/src/resources/e-invoice/${o}/${o}.json`],self.location).href).then(pe=>pe.json()).then(pe=>{_(!0),E(void 0),f(pe.rules),B([]),V([]),y(pe.components),D(pe.defaultFields),m(void 0),oe([]),A=[]}):(f([]),y({}),m(void 0),E(void 0),_(!0),D({}),B([]),V([]),oe([]),A=[])},[o]),w.useEffect(()=>{Object.keys(b).length&&(async()=>{Ne(!0);const pe=await Qt(b);v&&_(!1),E(pe),v&&(V([...A]),B([...A])),Ne(!1)})()},[b,M,g,N,re,Ve,F,H]),w.useEffect(()=>{Object.keys(b).length&&Ve.length&&(async()=>{const pe=await Promise.all(Ve.map(async We=>{const ne=We.slice(-1),Se=/\d/.test(ne),Ie=X(We),Ke=We.split("|").length,Je=We.split("|")[Ke-(Se?2:1)],ot=b[Je];let wt=We.split("|").filter((pn,Kn)=>Kn<Ke-(Ie?0:1)).join("|");return Ie&&(wt=wt.split("|").filter(pn=>!pn.endsWith("Type")).join("|")),await Qt({[Je]:ot},!1,wt,Ie)}));k(pe)})()},[g,N,re,Ve]),w.useEffect(()=>{v||m(void 0)},[N,M,Ve,re,F]),w.useEffect(()=>{a&&M.length&&q.forEach(pe=>{const We=pe.key.split("|").filter(Se=>!Se.endsWith("Type")).join("|"),ne=An.get(a,We.replaceAll("|","."));ne&&te(a).forEach(Ie=>{let Ke=Ie.split(".").join("|");const Je=Ke.split("|").length,ot=Ke.split("|")[Je-2],wt=Ke.split("|")[Je-(/\d/.test(ot)?3:2)];let pn="";if(Object.values(b).forEach(Kn=>{if(Kn&&!pn){const Cn=Object.values(Kn.elements).find(hn=>hn.name===wt);Cn&&(pn=Cn.base_type)}}),pn){const Kn=Ke.split("|");Ke=[...Kn.slice(0,Je-1),pn,...Kn.slice(Je-1)].join("|");const Cn=An.get(a,Ie);P(hn=>({...hn,[Ke]:Cn}))}}),ne&&(pe.multiSelection?Array.isArray(ne)&&ne.forEach((Se,Ie)=>{const Ke=F.some(ot=>ot.key===`${pe.key}|${Ie}`),Je=H.some(ot=>ot.key===`${pe.key}|${Ie}`);Ke||U(ot=>[...ot,{...pe,key:`${pe.key}|${Ie}`}]),!Je&&!Se&&W(ot=>[...ot,{...pe,key:`${pe.key}|${Ie}`}])}):B(Se=>Se.filter(Ie=>Ie.key!==pe.key)))})},[a,q]),w.useImperativeHandle(e,()=>({saveEInvoice(){return It()}}),[N]),O("div",{className:"flex flex-col mt-5",children:[p("div",{className:"flex px-6",children:g&&p(Sin,{errors:g})}),p("div",{children:Ve.length?p(St,{children:C&&x&&p(win,{resolvedTypes:[t("general"),...rt()],resolvedUIComponents:[C,...x],onBreadCrumbIndexChange:pe=>Ye(pe?We=>We.filter((ne,Se)=>Se<pe):[])})}):O(St,{children:[!!C&&p(G,{leftSide:t("fields"),children:p(A1,{value:"",onValueChange:pe=>{const We=q.find(ne=>ne.key===pe);if(We&&We.multiSelection){const ne=F.filter(Ie=>{const Ke=Ie.key.split("|").length;return Ie.key.split("|").filter((ot,wt)=>wt!==Ke-1).join("|")===pe}).length,Se=H.find(Ie=>Ie.key.startsWith(pe));Se?W(Ie=>Ie.filter(Ke=>Ke.key!==Se.key)):U(Ie=>[...Ie,{...We,key:`${We.key}|${ne}`}])}else B(ne=>ne.filter(Se=>Se.key!==pe))},clearAfterSelection:!0,children:M.sort((pe,We)=>pe.label.localeCompare(We.label)).map(({key:pe,label:We},ne)=>p("option",{value:pe,children:We},ne))})}),Q?p(ds,{}):p("div",{className:"mt-4 px-6",children:C??null})]})})]})});function xin(){const[n]=ve(),e=!0,t=w.useRef(null),i=[{name:n("settings"),href:"/settings"},{name:n("e_invoice"),href:"/settings/e_invoice"}],r=zi(),o=xu(),s=pa(),a=Bo(),{isCompanySettingsActive:l}=$s(),c=Pc(),u=x0(),[d,h]=us(Bs),[f,g]=w.useState(new FormData),[m,v]=w.useState(!1),_=Gm({enableReinitialize:!0,initialValues:f,onSubmit:()=>{he.processing(),h(void 0),$e("POST",Ae("/api/v1/companies/:id",{id:c==null?void 0:c.id}),f,{headers:{"Content-Type":"multipart/form-data"}}).then(x=>{r(US({object:"company",data:x.data.data})),he.success("uploaded_document")}).catch(x=>{var k;((k=x.response)==null?void 0:k.status)===422&&(h(x.response.data),he.dismiss())}).finally(()=>g(new FormData))}}),b=w.useCallback(x=>{if(x.length===0){he.error("invalid_file");return}f.append("e_invoice_certificate",x[0]),f.append("_method","PUT"),g(f),_.submitForm()},[f]),{getRootProps:y,getInputProps:C,isDragActive:E}=zR({onDrop:b,multiple:!1,maxFiles:1,accept:{"application/*":[".p12",".pfx",".pem",".cer",".crt",".der",".txt",".p7b",".spc",".bin"]}});return w.useEffect(()=>{m&&(o(),v(!1))},[m]),O(sr,{title:n("e_invoice"),docsLink:"en/advanced-settings/#e_invoice",breadcrumbs:i,onSaveClick:()=>{var x,k;(x=t==null?void 0:t.current)!=null&&x.saveEInvoice()&&a("e_invoice",(k=t==null?void 0:t.current)==null?void 0:k.saveEInvoice()),v(!0)},disableSaveButton:u,children:[u&&p(Iv,{}),O(tn,{title:n("e_invoice"),children:[p(G,{leftSide:p(Ht,{propertyKey:"e_invoice_type",labelElement:p(Wt,{label:n("e_invoice_type")}),defaultValue:"EN16931"}),children:O(En,{value:(c==null?void 0:c.settings.e_invoice_type)||"EN16931",onValueChange:x=>a("settings.e_invoice_type",x),disabled:s("e_invoice_type"),children:[p("option",{value:"PEPPOL",children:"PEPPOL"}),p("option",{value:"FACT1",children:"FACT1"}),p("option",{value:"EN16931",children:"EN16931"}),p("option",{value:"XInvoice_3_0",children:"XInvoice_3.0"}),p("option",{value:"XInvoice_2_3",children:"XInvoice_2.3"}),p("option",{value:"XInvoice_2_2",children:"XInvoice_2.2"}),p("option",{value:"XInvoice_2_1",children:"XInvoice_2.1"}),p("option",{value:"XInvoice_2_0",children:"XInvoice_2.0"}),p("option",{value:"XInvoice_1_0",children:"XInvoice_1.0"}),p("option",{value:"XInvoice-Extended",children:"XInvoice-Extended"}),p("option",{value:"XInvoice-BasicWL",children:"XInvoice-BasicWL"}),p("option",{value:"XInvoice-Basic",children:"XInvoice-Basic"}),p("option",{value:"Facturae_3.2.2",children:"Facturae_3.2.2"}),p("option",{value:"Facturae_3.2.1",children:"Facturae_3.2.1"}),p("option",{value:"Facturae_3.2",children:"Facturae_3.2"}),p("option",{value:"FatturaPA",children:"FatturaPA"})]})}),(c==null?void 0:c.settings.e_invoice_type)==="PEPPOL"&&e?p(Ein,{ref:t,currentEInvoice:(c==null?void 0:c.e_invoice)||{}}):O(St,{children:[p(G,{leftSide:p(Ht,{propertyKey:"enable_e_invoice",labelElement:p(Wt,{label:n("enable_e_invoice")})}),children:p(kt,{checked:!!(c!=null&&c.settings.enable_e_invoice),onValueChange:x=>a("settings.enable_e_invoice",x),disabled:s("enable_e_invoice")})}),c!=null&&c.settings.enable_e_invoice?O(St,{children:[p(G,{leftSide:p(Ht,{propertyKey:"merge_e_invoice_to_pdf",labelElement:p(Wt,{label:n("merge_e_invoice_to_pdf")})}),children:p(kt,{checked:!!(c!=null&&c.settings.merge_e_invoice_to_pdf),onValueChange:x=>a("settings.merge_e_invoice_to_pdf",x),disabled:s("merge_e_invoice_to_pdf")})}),l&&p(G,{leftSide:n("upload_certificate"),leftSideHelp:c!=null&&c.has_e_invoice_certificate?n("certificate_set"):n("certificate_not_set"),children:p("div",{...y(),className:"flex flex-col md:flex-row md:items-center",children:O("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:[p("input",{...C()}),p(RT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium text-gray-900",children:E?"drop_your_logo_here":n("dropzone_default_message")})]})})}),l&&p(G,{leftSide:n("certificate_passphrase"),leftSideHelp:c!=null&&c.has_e_invoice_certificate_passphrase?n("passphrase_set"):n("passphrase_not_set"),children:p(Ze,{value:"",id:"password",type:"password",onValueChange:x=>a("has_e_invoice_certificate_passphrase",x),errorMessage:d==null?void 0:d.errors.has_e_invoice_certificate_passphrase})}),p(G,{leftSide:p(Ht,{propertyKey:"e_quote_type",labelElement:p(Wt,{label:n("e_quote_type")}),defaultValue:"OrderX_Comfort"}),children:O(En,{value:(c==null?void 0:c.settings.e_quote_type)||"OrderX_Comfort",onValueChange:x=>a("settings.e_quote_type",x),disabled:s("e_quote_type"),children:[p("option",{value:"OrderX_Comfort",children:"OrderX_Comfort"}),p("option",{value:"OrderX_Basic",children:"OrderX_Basic"}),p("option",{value:"OrderX_Extended",children:"OrderX_Extended"})]})})]}):null]})]})]})}const Tin=rl(F_.Option)`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,Tqe=rl.button`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,kin=rl.li`
background-color: ${n=>n.theme.backgroundColor};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function Iin({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:f,onEmptyValues:g,onFocus:m,onInputValueChange:v}){const[_,b]=w.useState(String(n.value??"")),[y,C]=w.useState(r),[E,x]=w.useState(null),[k,L]=w.useState(-1),D=w.useRef(null),A=w.useRef(null),N=w.useRef(null);let P=_===""?e:e.filter(H=>{var W,q,V,re,oe;return((q=(W=H.label)==null?void 0:W.toLowerCase())==null?void 0:q.includes(_==null?void 0:_.toLowerCase()))||((oe=(re=(V=H.value)==null?void 0:V.toString())==null?void 0:re.toLowerCase())==null?void 0:oe.includes(_==null?void 0:_.toLowerCase()))||H.searchable.toLowerCase().includes(_==null?void 0:_.toLowerCase())});P=P.filter(H=>o.length>0?!o.includes(H.value):!0),P=P.filter(H=>s.length>0?s.includes(H[a?"label":"value"]):!0),w.useEffect(()=>{const H=e.findIndex(W=>W.value===n.value||W.label===n.value);if(H>=0){x(e[H]),L(H);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 M=H=>{b(H),x(null),C(!0),L(-1)},B=H=>{E&&E.value===H.value||(x(H),b(H.label),c(H),f&&(b(""),x(null)),setTimeout(()=>C(!1),100))},F=H=>{if(H.key==="ArrowDown"&&k<P.length-1){H.preventDefault(),L(k+1);return}if(H.key==="ArrowUp"&&k>0){H.preventDefault(),L(k-1);return}if(H.key==="Enter"){if(C(!1),k>=0){B(P[k]);return}k===-1&&i&&B({id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()});return}if(H.key==="Escape"){C(!1);return}if(H.key==="Tab"&&i){C(!1),B({id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()});return}};m1(D,()=>{if(C(!1),E&&E.value&&_===E.value||_==="")return;const H={id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()};B(H),c(H)}),m1(A,()=>{v==null||v(_)}),YD(()=>{if(g&&(_===""&&P.length>0||P.length<=3))return g(_)},600,[_,P]),w.useEffect(()=>{const H=document.querySelector(`[data-combobox-element-id="${k+1}"]`);H&&H.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})},[k]);const U=si();return O("div",{ref:D,className:"w-full",tabIndex:-1,children:[n.label?p("p",{className:"text-sm font-medium block",children:n.label}):null,p("div",{className:"relative mt-1",children:O("div",{className:"relative w-full cursor-default overflow-hidden rounded border text-left sm:text-sm",style:{borderColor:U.$5},children:[p("input",{type:"text",onChange:H=>M(H.target.value),onKeyDown:F,onFocus:()=>{C(!0),m&&m()},placeholder:n.placeholder,disabled:t,defaultValue:E?E.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:N,style:{backgroundColor:U.$1,borderColor:U.$5,color:U.$3},"data-cy":"comboboxInput",tabIndex:-1}),!t&&p("button",{tabIndex:-1,type:"button",onClick:H=>{if(u)return H.preventDefault(),C(!1),u()},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",children:u&&E?p(qm,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-clear-icon",style:{color:U.$3}}):p(bR,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-chevrondown-icon",style:{color:U.$3}})})]})}),y&&O("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:U.$1,borderColor:U.$4},tabIndex:-1,children:[l&&l.visible&&p(Tqe,{theme:{hoverColor:U.$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:U.$3},children:l.label}),P.map((H,W)=>p(kin,{theme:{backgroundColor:k===W?U.$2:U.$1},className:zt("min-w-[19rem] relative cursor-pointer select-none py-2 pl-3 pr-9 hover:font-semibold",{"font-medium":k===W}),onClick:()=>B(H),"data-combobox-element-id":W,tabIndex:-1,children:H.resource&&typeof d.dropdownLabelFn<"u"?d.dropdownLabelFn(H.resource):H.label},H.id))]}),h&&p(Fs,{className:"mt-2",type:"danger",children:h})]})}function kqe({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:f,clearInputAfterSelection:g,isDataLoading:m}){const[v]=ve(),[_,b]=w.useState(null),[y,C]=w.useState(""),[E,x]=w.useState(r);let k=y===""?e:e.filter(P=>{var M,B,F,U,H;return((B=(M=P.label)==null?void 0:M.toLowerCase())==null?void 0:B.includes(y==null?void 0:y.toLowerCase()))||((H=(U=(F=P.value)==null?void 0:F.toString())==null?void 0:U.toLowerCase())==null?void 0:H.includes(y==null?void 0:y.toLowerCase()))||P.searchable.toLowerCase().includes(y==null?void 0:y.toLowerCase())});k=k.filter(P=>o.length>0?!o.includes(P.value):!0),k=k.filter(P=>s.length>0?s.includes(P[a?"label":"value"]):!0);const L=w.useRef(null),D=w.useRef(null);m1(L,()=>{x(!1)}),YD(()=>{if(c&&(y===""&&k.length>0||k.length<=3))return c(y)},600,[k]);const A=P=>{P&&(_&&P.value===_.value?d&&d():b(()=>({...P,eventType:"internal"})))};w.useEffect(()=>{_&&_.eventType==="internal"&&u(_),g&&(b(null),C("")),x(!1),D!=null&&D.current&&D.current.blur()},[_]),w.useEffect(()=>{const P=e.find(M=>M.value===n.value||M.label===n.value);b(P||(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&&x(!0),()=>{x(!1)}),[r]);const N=si();return O("div",{className:"w-full",children:[O(F_,{as:"div",value:_,onChange:P=>A(P),disabled:t,ref:L,children:[n.label&&p(F_.Label,{className:"text-sm font-medium block",style:{color:N.$3},children:n.label}),p("div",{className:"relative mt-1",children:O("div",{className:"relative w-full cursor-default overflow-hidden rounded border text-left sm:text-sm",style:{borderColor:N.$5},children:[p(F_.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:P=>C(P.target.value),displayValue:P=>{var M;return((M=h.inputLabelFn)==null?void 0:M.call(h,P==null?void 0:P.resource))??((P==null?void 0:P.label)||y)},onClick:()=>x(!0),placeholder:n.placeholder,style:{backgroundColor:N.$1,borderColor:N.$5,color:N.$3}}),!t&&p(F_.Button,{onClick:P=>{if(d)return P.preventDefault(),C(""),_&&x(!1),!_&&x(M=>!M),d();x(M=>!M)},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",children:d&&_?p(qm,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-clear-icon",style:{color:N.$3}}):p(bR,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-chevrondown-icon",style:{color:N.$3}})})]})}),E&&O(F_.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:N.$1,borderColor:N.$4},children:[l&&l.visible&&p(Tqe,{theme:{hoverColor:N.$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:N.$3},children:l.label}),!!m&&p("div",{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",children:p(ds,{})}),!m&&!k.length&&p("div",{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",children:v("no_records_found")}),i&&y.length>0&&!m&&p(F_.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:P})=>O("span",{className:zt("block truncate space-x-1",P&&"font-semibold"),children:[p("span",{children:v("Select")}),p("q",{className:"font-semibold",children:y})]})},"combobox-not-found"),k.length>0&&!m&&k.map(P=>p(Tin,{theme:{hoverColor:N.$2},value:P,className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",style:{color:N.$3},children:({selected:M,active:B})=>O(St,{children:[p("span",{className:zt("block truncate",M&&"font-semibold",B&&"font-semibold"),children:P.resource&&typeof h.dropdownLabelFn<"u"?h.dropdownLabelFn(P.resource):P.label}),M&&p("span",{className:"absolute inset-y-0 right-0 flex items-center pr-4",style:{color:N.$3},children:p(Qj,{className:"h-5 w-5","aria-hidden":"true"})})]})},P.id))]})]}),f&&p(Fs,{className:"mt-2",type:"danger",children:f})]})}function Mh({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:f,disableWithQueryParameter:g,errorMessage:m,clearInputAfterSelection:v,onInputValueChange:_}){const[b,y]=w.useState([]),[C,E]=w.useState(n),[x,k]=w.useState(!1);w.useEffect(()=>{E(n)},[n]);const L=w.useRef(void 0),D=()=>b.length?!!b.find(B=>B.value===e.value||B.label===e.value):!0,{data:A,isLoading:N}=Ii([new URL(C).pathname,new URL(C).pathname+new URL(C).search],()=>$e("GET",new URL(C).href).then(M=>{const B=[];return M.data.data.map(F=>{var U;return B.push({id:F[t.id],label:F[t.label],value:F[t.value],resource:F,eventType:"external",searchable:((U=t.customSearchableValue)==null?void 0:U.call(t,F))||F[t.searchable||t.id]})}),B}),{staleTime:r??1/0,enabled:x});w.useEffect(()=>{if(!C.includes("/api/v1/products")&&!x){clearTimeout(L.current);const M=setTimeout(()=>k(!0),100);L.current=M}},[e.value]),w.useEffect(()=>{x&&e.value&&!g&&!D()&&E(M=>{const B=new URL(M);return e.value&&e.value.toString().length>0&&(B.searchParams.set("with",e.value.toString()),B.searchParams.get("sort")&&B.searchParams.delete("sort")),B.href}),x&&!e.value&&E(M=>{const B=new URL(M);return B.searchParams.get("with")&&B.searchParams.delete("with"),s&&B.searchParams.set("sort",s),B.href})},[b,x,e.value]),w.useEffect(()=>{A&&y([...A])},[A]),w.useEffect(()=>(E(M=>{const B=new URL(M);return s&&B.searchParams.set("sort",s),B.searchParams.set("status","active"),B.searchParams.set("filter",""),B.href}),()=>{y([]),k(!1),L.current=void 0}),[]);const P=M=>{E(B=>{const F=new URL(B);return F.searchParams.set("filter",M),F.href})};return C.includes("/api/v1/products")?p(Iin,{entries:b,inputOptions:e,readonly:i,onChange:h,onDismiss:f,initiallyVisible:o,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:v,isDataLoading:N,onFocus:()=>k(!0),onInputValueChange:_,onEmptyValues:P}):p(kqe,{entries:b,inputOptions:e,readonly:i,onChange:h,onEmptyValues:P,onDismiss:f,initiallyVisible:o,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:v,isDataLoading:N,onInputValueChange:_})}function Yve(n){var s;const[e]=ve(),t=ki(),i=TR(),{isAdmin:r,isOwner:o}=Fo();return p(Mh,{inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value??null},endpoint:Ae(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 Lin(){const[n]=ve(),{isCompanySettingsActive:e}=$s(),t=!0;return`${n("default")}`,(Bm()||xc())&&t&&e&&d1(),[{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&&!d1()}]}function Din(){const[n]=ve(),e=Zi(),t=Bo(),[i,r]=w.useState(!1),o=()=>{i||(he.processing(),r(!0),$e("POST",Ae("/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=>he.success(s.data.message)).finally(()=>r(!1)))};return O(St,{children:[p(G,{leftSide:n("host"),leftSideHelp:n("host_help"),children:p(Ze,{value:(e==null?void 0:e.smtp_host)||"",onValueChange:s=>t("smtp_host",s),disabled:i})}),p(G,{leftSide:n("port"),leftSideHelp:n("port_help"),children:p(Ze,{value:(e==null?void 0:e.smtp_port)||"",onValueChange:s=>t("smtp_port",s),disabled:i})}),p(G,{leftSide:n("encryption"),children:O(En,{value:(e==null?void 0:e.smtp_encryption)||"",onValueChange:s=>t("smtp_encryption",s),withBlank:!0,disabled:i,children:[p("option",{value:"tls",children:"STARTTLS"}),p("option",{value:"ssl",children:"SSL/TLS"})]})}),p(G,{leftSide:n("username"),children:p(Ze,{value:(e==null?void 0:e.smtp_username)||"",onValueChange:s=>t("smtp_username",s),disabled:i})}),p(G,{leftSide:n("password"),children:p(Ze,{value:(e==null?void 0:e.smtp_password)||"",onValueChange:s=>t("smtp_password",s),disabled:i})}),p(G,{leftSide:n("local_domain"),leftSideHelp:n("local_domain_help"),children:p(Ze,{value:(e==null?void 0:e.smtp_local_domain)||"",onValueChange:s=>t("smtp_local_domain",s),disabled:i})}),p(G,{leftSide:n("bcc_email"),leftSideHelp:n("comma_sparated_list"),children:p(Ze,{value:(e==null?void 0:e.settings.bcc_email)||"",onValueChange:s=>t("settings.bcc_email",s)})}),p(G,{leftSide:n("send_time"),children:p(En,{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)=>p("option",{value:s+1,children:Un().startOf("day").add(s+1,"hour").format("h:ss A")},a))})}),p(G,{leftSide:n("verify_peer"),children:p(kt,{checked:(e==null?void 0:e.smtp_verify_peer)??!0,onValueChange:s=>t("smtp_verify_peer",s),disabled:i})}),p(G,{pushContentToRight:!0,children:p(un,{behavior:"button",onClick:o,disableWithoutIcon:!0,disabled:i,children:n("send_test_email")})})]})}var Ain=function(n){return n instanceof RegExp},Rin=function(e){var t=/[\\^$.*+?()[\]{}|]/g,i=RegExp(t.source);return e&&i.test(e)?e.replace(t,"\\$&"):e},Iqe=function(n){return typeof n=="string"},Nin=function(n){var e=[];return n.forEach(function(t){Array.isArray(t)?e=e.concat(t):e.push(t)}),e};function Oin(n,e,t){var i=0,r=0;if(n==="")return n;if(!n||!Iqe(n))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var o=e;Ain(o)||(o=new RegExp("("+Rin(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 Pin=function(e,t,i){return Array.isArray(e)||(e=[e]),Nin(e.map(function(r){return Iqe(r)?Oin(r,t,i):r}))};const EG=nl(Pin);function Min(){var u;Mi("email_settings");const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("email_settings"),href:"/settings/email_settings"}],t=Lin(),i=Pc(),r=pa(),o=Gi(Bs),s=Bo(),a=xu(),l=lp(),c=x0();return O(sr,{title:n("email_settings"),docsLink:"en/advanced-settings/#email_settings",breadcrumbs:e,onSaveClick:a,onCancelClick:l,disableSaveButton:c,children:[c&&p(Iv,{}),O(tn,{title:n("settings"),children:[p(G,{leftSide:p(Ht,{propertyKey:"show_email_footer",labelElement:p(Wt,{label:n("show_email_footer")})}),children:p(kt,{checked:!!(i!=null&&i.settings.show_email_footer),onValueChange:d=>s("settings.show_email_footer",d),disabled:r("show_email_footer")})}),p(G,{leftSide:p(Ht,{propertyKey:"pdf_email_attachment",labelElement:p(Wt,{label:n("attach_pdf")})}),children:p(kt,{checked:!!(i!=null&&i.settings.pdf_email_attachment),onValueChange:d=>s("settings.pdf_email_attachment",d),disabled:r("pdf_email_attachment")})}),p(G,{leftSide:p(Ht,{propertyKey:"document_email_attachment",labelElement:p(Wt,{label:n("attach_documents")})}),children:p(kt,{checked:!!(i!=null&&i.settings.document_email_attachment),onValueChange:d=>s("settings.document_email_attachment",d),disabled:r("document_email_attachment")})}),p(G,{leftSide:p(Ht,{propertyKey:"ubl_email_attachment",labelElement:p(Wt,{label:n("attach_ubl"),helpLabel:EG(`${n("ubl_email_attachment_help")}.`,":here",()=>p(qi,{className:"text-xs",to:"/settings/e_invoice",children:n("here")}))})}),children:p(kt,{checked:!!(i!=null&&i.settings.ubl_email_attachment),onValueChange:d=>s("settings.ubl_email_attachment",d),disabled:r("ubl_email_attachment")})}),p(vi,{}),p(G,{leftSide:p(Ht,{propertyKey:"email_sending_method",labelElement:p(Wt,{label:n("email_provider")}),defaultValue:"default"}),children:p(En,{value:(i==null?void 0:i.settings.email_sending_method)||"default",onValueChange:d=>s("settings.email_sending_method",d),disabled:r("email_sending_method")||!Bm()&&!xc(),errorMessage:o==null?void 0:o.errors["settings.email_sending_method"],children:t.map(({value:d,label:h,enabled:f})=>f&&p("option",{value:d,children:h},d))})}),((i==null?void 0:i.settings.email_sending_method)==="office365"||(i==null?void 0:i.settings.email_sending_method)==="microsoft"||(i==null?void 0:i.settings.email_sending_method)==="gmail")&&qo()&&p(G,{leftSide:p(Ht,{propertyKey:"gmail_sending_user_id",labelElement:p(Wt,{label:`Gmail / Microsoft ${n("user")}`})}),children:p(Yve,{endpoint:"/api/v1/users?sending_users=true",value:(u=i==null?void 0:i.settings)==null?void 0:u.gmail_sending_user_id,onChange:d=>s("settings.gmail_sending_user_id",d.id),onClearButtonClick:()=>s("settings.gmail_sending_user_id","0"),readonly:r("gmail_sending_user_id"),withoutAction:!0,errorMessage:o==null?void 0:o.errors["settings.gmail_sending_user_id"]})}),(i==null?void 0:i.settings.email_sending_method)==="client_postmark"&&p(G,{leftSide:p(Ht,{propertyKey:"postmark_secret",labelElement:p(Wt,{label:n("secret")})}),children:p(Ze,{value:(i==null?void 0:i.settings.postmark_secret)||"",onValueChange:d=>s("settings.postmark_secret",d),disabled:r("postmark_secret"),errorMessage:o==null?void 0:o.errors["settings.postmark_secret"]})}),(i==null?void 0:i.settings.email_sending_method)==="client_mailgun"&&O(St,{children:[p(G,{leftSide:p(Ht,{propertyKey:"mailgun_secret",labelElement:p(Wt,{label:n("secret")})}),children:p(Ze,{value:(i==null?void 0:i.settings.mailgun_secret)||"",onValueChange:d=>s("settings.mailgun_secret",d),disabled:r("mailgun_secret"),errorMessage:o==null?void 0:o.errors["settings.mailgun_secret"]})}),p(G,{leftSide:p(Ht,{propertyKey:"mailgun_domain",labelElement:p(Wt,{label:n("domain")})}),children:p(Ze,{value:(i==null?void 0:i.settings.mailgun_domain)||"",onValueChange:d=>s("settings.mailgun_domain",d),disabled:r("mailgun_domain"),errorMessage:o==null?void 0:o.errors["settings.mailgun_domain"]})}),p(G,{leftSide:p(Ht,{propertyKey:"mailgun_endpoint",labelElement:p(Wt,{label:n("endpoint")}),defaultValue:"api.mailgun.net"}),children:O(En,{value:(i==null?void 0:i.settings.mailgun_endpoint)||"api.mailgun.net",onValueChange:d=>s("settings.mailgun_endpoint",d),disabled:r("mailgun_endpoint"),errorMessage:o==null?void 0:o.errors["settings.mailgun_endpoint"],children:[p("option",{value:"api.mailgun.net",defaultChecked:!0,children:"api.mailgun.net"}),p("option",{value:"api.eu.mailgun.net",children:"api.eu.mailgun.net"})]})})]}),(i==null?void 0:i.settings.email_sending_method)==="client_brevo"&&p(G,{leftSide:p(Ht,{propertyKey:"brevo_secret",labelElement:p(Wt,{label:n("secret")})}),children:p(Ze,{value:(i==null?void 0:i.settings.brevo_secret)||"",onValueChange:d=>s("settings.brevo_secret",d),disabled:r("brevo_secret"),errorMessage:o==null?void 0:o.errors["settings.brevo_secret"]})}),((i==null?void 0:i.settings.email_sending_method)==="client_mailgun"||(i==null?void 0:i.settings.email_sending_method)==="client_postmark"||(i==null?void 0:i.settings.email_sending_method)==="smtp"||(i==null?void 0:i.settings.email_sending_method)==="client_brevo")&&p(G,{leftSide:p(Ht,{propertyKey:"custom_sending_email",labelElement:p(Wt,{label:n("from_email")})}),children:p(Ze,{value:(i==null?void 0:i.settings.custom_sending_email)||"",onValueChange:d=>s("settings.custom_sending_email",d),disabled:r("custom_sending_email"),errorMessage:o==null?void 0:o.errors["settings.custom_sending_email"]})}),p(G,{leftSide:p(Ht,{propertyKey:"email_from_name",labelElement:p(Wt,{label:n("from_name")})}),children:p(Ze,{value:(i==null?void 0:i.settings.email_from_name)||"",onValueChange:d=>s("settings.email_from_name",d),disabled:r("email_from_name"),errorMessage:o==null?void 0:o.errors["settings.email_from_name"]})}),p(G,{leftSide:p(Ht,{propertyKey:"reply_to_name",labelElement:p(Wt,{label:n("reply_to_name")})}),children:p(Ze,{value:(i==null?void 0:i.settings.reply_to_name)||"",onValueChange:d=>s("settings.reply_to_name",d),disabled:r("reply_to_name"),errorMessage:o==null?void 0:o.errors["settings.reply_to_name"]})}),p(G,{leftSide:p(Ht,{propertyKey:"reply_to_email",labelElement:p(Wt,{label:n("reply_to_email")})}),children:p(Ze,{value:(i==null?void 0:i.settings.reply_to_email)||"",onValueChange:d=>s("settings.reply_to_email",d),disabled:r("reply_to_email"),errorMessage:o==null?void 0:o.errors["settings.reply_to_email"]})}),(i==null?void 0:i.settings.email_sending_method)!=="smtp"&&p(G,{leftSide:p(Ht,{propertyKey:"bcc_email",labelElement:p(Wt,{label:n("bcc_email"),helpLabel:n("comma_sparated_list")})}),children:p(Ze,{value:(i==null?void 0:i.settings.bcc_email)||"",onValueChange:d=>s("settings.bcc_email",d),disabled:r("bcc_email"),errorMessage:o==null?void 0:o.errors["settings.bcc_email"]})}),(i==null?void 0:i.settings.email_sending_method)!=="smtp"&&p(G,{leftSide:p(Ht,{propertyKey:"entity_send_time",labelElement:p(Wt,{label:n("send_time")})}),children:p(En,{value:(i==null?void 0:i.settings.entity_send_time)||"",onValueChange:d=>s("settings.entity_send_time",d.length>0?d:6),withBlank:!0,disabled:r("entity_send_time"),errorMessage:o==null?void 0:o.errors["settings.entity_send_time"],children:[...Array(24).keys()].map((d,h)=>p("option",{value:d+1,children:Un().startOf("day").add(d+1,"hour").format("h:ss A")},h))})}),(i==null?void 0:i.settings.email_sending_method)==="smtp"&&p(Din,{}),p(vi,{}),p(G,{leftSide:p(Ht,{propertyKey:"email_style",labelElement:p(Wt,{label:n("email_design")}),defaultValue:"plain"}),children:O(En,{value:(i==null?void 0:i.settings.email_style)||"plain",onValueChange:d=>s("settings.email_style",d),disabled:r("email_style"),errorMessage:o==null?void 0:o.errors["settings.email_style"],children:[p("option",{value:"plain",children:n("plain")}),p("option",{value:"light",children:n("light")}),p("option",{value:"dark",children:n("dark")}),p("option",{value:"custom",children:n("custom")})]})}),(i==null?void 0:i.settings.email_style)==="custom"&&p(G,{leftSide:p(Ht,{propertyKey:"email_style_custom",labelElement:p(Wt,{label:n("custom")})}),children:p(Ze,{element:"textarea",value:(i==null?void 0:i.settings.email_style_custom)||"",onValueChange:d=>d.includes("$body")?s("settings.email_style_custom",d):he.error(Ca("body_variable_missing",{body:"$body"})),disabled:r("email_style_custom"),errorMessage:o==null?void 0:o.errors["settings.email_style_custom"]})}),p(G,{leftSide:p(Ht,{propertyKey:"email_signature",labelElement:p(Wt,{label:n("signature")})}),children:p(dd,{value:(i==null?void 0:i.settings.email_signature)||"",onChange:d=>s("settings.email_signature",d),disabled:r("email_signature")})})]})]})}function Fin(){var a,l;const[n]=ve();Pc();const{isCompanySettingsActive:e}=$s(),t=Zi(),i=pa(),r=Bo(),[o,s]=us(Bs);return w.useState(""),O(tn,{title:n("settings"),children:[qo(),e&&p(G,{leftSide:n("domain_url"),children:p(Ze,{value:(t==null?void 0:t.portal_domain)||"",onValueChange:c=>r("portal_domain",c),errorMessage:o==null?void 0:o.errors.portal_domain})}),e&&p(G,{leftSide:O("span",{children:[n("login")," ",n("url")]}),children:O("div",{className:"flex flex-col space-y-1",children:[p(Oc,{text:`${t==null?void 0:t.portal_domain}/client/login?company_key=${t==null?void 0:t.company_key}`}),qo(),qo(),qo()]})}),e&&p(vi,{}),p(G,{className:zt({"mt-4":e}),leftSide:p(Ht,{propertyKey:"enable_client_portal",labelElement:p(Wt,{label:n("client_portal")}),defaultValue:!1}),children:p(kt,{checked:!!(t!=null&&t.settings.enable_client_portal),onValueChange:c=>r("settings.enable_client_portal",c),disabled:i("enable_client_portal")})}),p(G,{leftSide:p(Ht,{propertyKey:"client_portal_enable_uploads",labelElement:p(Wt,{label:n("client_document_upload"),helpLabel:n("document_upload_help")}),defaultValue:!1}),children:p(kt,{checked:!!(t!=null&&t.settings.client_portal_enable_uploads),onValueChange:c=>r("settings.client_portal_enable_uploads",c),disabled:i("client_portal_enable_uploads")})}),p(G,{leftSide:p(Ht,{propertyKey:"vendor_portal_enable_uploads",labelElement:p(Wt,{label:n("vendor_document_upload"),helpLabel:n("vendor_document_upload_help")}),defaultValue:!1}),children:p(kt,{checked:!!(t!=null&&t.settings.vendor_portal_enable_uploads),onValueChange:c=>r("settings.vendor_portal_enable_uploads",c),disabled:i("vendor_portal_enable_uploads")})}),p(G,{leftSide:p(Ht,{propertyKey:"accept_client_input_quote_approval",labelElement:p(Wt,{label:n("accept_purchase_order_number"),helpLabel:n("accept_purchase_order_number_help")}),defaultValue:!1}),children:p(kt,{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")})}),p(G,{leftSide:p(Ht,{propertyKey:"show_pdfhtml_on_mobile",labelElement:p(Wt,{label:n("show_pdfhtml_on_mobile"),helpLabel:n("show_pdfhtml_on_mobile_help")}),defaultValue:!1}),children:p(kt,{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")})}),p(G,{leftSide:n("enable_client_portal_dashboard"),leftSideHelp:n("enable_client_portal_dashboard_help"),children:p(kt,{checked:!!((l=t==null?void 0:t.settings)!=null&&l.enable_client_portal_dashboard),onValueChange:c=>r("settings.enable_client_portal_dashboard",c)})}),p(vi,{}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"client_portal_terms",labelElement:p(Wt,{label:n("terms_of_service")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"client_portal_privacy_policy",labelElement:p(Wt,{label:n("privacy_policy")})}),children:p(Ze,{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 Bin(){const[n]=ve(),e=Zi(),t=Bo(),i=pa();return O(tn,{title:n("authorization"),children:[p(G,{leftSide:p(Ht,{propertyKey:"enable_client_portal_password",labelElement:p(Wt,{label:n("enable_portal_password"),helpLabel:n("enable_portal_password_help")}),defaultValue:!1}),children:p(kt,{checked:!!(e!=null&&e.settings.enable_client_portal_password),onValueChange:r=>t("settings.enable_client_portal_password",r),disabled:i("enable_client_portal_password")})}),p(G,{leftSide:p(Ht,{propertyKey:"show_accept_invoice_terms",labelElement:p(Wt,{label:n("show_accept_invoice_terms"),helpLabel:n("show_accept_invoice_terms_help")}),defaultValue:!1}),children:p(kt,{checked:!!(e!=null&&e.settings.show_accept_invoice_terms),onValueChange:r=>t("settings.show_accept_invoice_terms",r),disabled:i("show_accept_invoice_terms")})}),p(G,{leftSide:p(Ht,{propertyKey:"show_accept_quote_terms",labelElement:p(Wt,{label:n("show_accept_quote_terms"),helpLabel:n("show_accept_quote_terms_help")}),defaultValue:!1}),children:p(kt,{checked:!!(e!=null&&e.settings.show_accept_quote_terms),onValueChange:r=>t("settings.show_accept_quote_terms",r),disabled:i("show_accept_quote_terms")})}),p(vi,{}),p(G,{leftSide:p(Ht,{propertyKey:"require_invoice_signature",labelElement:p(Wt,{label:n("require_invoice_signature"),helpLabel:n("require_invoice_signature_help")}),defaultValue:!1}),children:p(kt,{checked:!!(e!=null&&e.settings.require_invoice_signature),onValueChange:r=>t("settings.require_invoice_signature",r),disabled:i("require_invoice_signature")})}),p(G,{leftSide:p(Ht,{propertyKey:"require_quote_signature",labelElement:p(Wt,{label:n("require_quote_signature"),helpLabel:n("require_quote_signature_help")}),defaultValue:!1}),children:p(kt,{checked:!!(e!=null&&e.settings.require_quote_signature),onValueChange:r=>t("settings.require_quote_signature",r),disabled:i("require_quote_signature")})}),p(G,{leftSide:p(Ht,{propertyKey:"require_purchase_order_signature",labelElement:p(Wt,{label:n("require_purchase_order_signature"),helpLabel:n("require_purchase_order_signature_help")}),defaultValue:!1}),children:p(kt,{checked:!!(e!=null&&e.settings.require_purchase_order_signature),onValueChange:r=>t("settings.require_purchase_order_signature",r),disabled:i("require_purchase_order_signature")})}),p(G,{leftSide:p(Ht,{propertyKey:"signature_on_pdf",labelElement:p(Wt,{label:n("signature_on_pdf"),helpLabel:n("signature_on_pdf_help")}),defaultValue:!1}),children:p(kt,{checked:!!(e!=null&&e.settings.signature_on_pdf),onValueChange:r=>t("settings.signature_on_pdf",r),disabled:i("signature_on_pdf")})})]})}function $in(){const[n]=ve(),e=Zi(),t=Bo(),i=pa(),r=Gi(Bs);return O(tn,{title:n("customize"),children:[p(G,{leftSide:p(Ht,{propertyKey:"portal_custom_head",labelElement:p(Wt,{label:n("header")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"portal_custom_footer",labelElement:p(Wt,{label:n("footer")})}),children:p(Ze,{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"]})}),O(St,{children:[p(G,{leftSide:p(Ht,{propertyKey:"portal_custom_css",labelElement:p(Wt,{label:n("custom_css")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"portal_custom_js",labelElement:p(Wt,{label:n("custom_javascript")})}),children:p(Ze,{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 Vin(){const[n]=ve(),e=Zi(),t=Bo(),i=pa(),{isCompanySettingsActive:r}=$s(),o=Gi(Bs);return O(tn,{title:n("messages"),children:[r&&p(G,{leftSide:n("dashboard"),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"custom_message_unpaid_invoice",labelElement:p(Wt,{label:n("unpaid_invoice")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"custom_message_paid_invoice",labelElement:p(Wt,{label:n("paid_invoice")})}),children:p(Ze,{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"]})}),p(G,{leftSide:p(Ht,{propertyKey:"custom_message_unapproved_quote",labelElement:p(Wt,{label:n("unapproved_quote")})}),children:p(Ze,{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 Hin(){const[n]=ve(),e=Zi(),t=Bo(),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=An.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=An.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(f=>({...f,required:f.key===s?d.required:f.required,visible:f.key===s?d.visible:f.visible}));t("client_registration_fields",h)}else{const h=i[u];l=[...l,{key:h.field,...d}],t("client_registration_fields",l)}}};return O(tn,{title:n("registration"),children:[p(G,{leftSide:n("client_registration"),leftSideHelp:n("client_registration_help"),children:p(kt,{checked:!!(e!=null&&e.client_can_register),onValueChange:s=>t("client_can_register",s)})}),(e==null?void 0:e.client_can_register)&&p(G,{leftSide:n("registration_url"),children:p(Oc,{text:`${e==null?void 0:e.portal_domain}/client/register?company_key=${e==null?void 0:e.company_key}`})}),p("div",{className:"pt-4 border-b"}),i.map(s=>p(G,{leftSide:s.label,children:O(En,{value:r(s.field),onValueChange:a=>o(s.field,a),children:[p("option",{value:"hidden",defaultChecked:!0,children:n("hidden")}),p("option",{value:"optional",children:n("optional")}),p("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 Win(){const[n]=ve(),{isGroupSettingsActive:e,isClientSettingsActive:t}=$s();let i=[{name:n("settings"),href:At("/settings/client_portal")},{name:n("authorization"),href:At("/settings/client_portal/authorization")},{name:n("registration"),href:At("/settings/client_portal/registration")},{name:n("messages"),href:At("/settings/client_portal/messages")},{name:n("customize"),href:At("/settings/client_portal/customize")}];return(e||t)&&(i=i.filter(r=>r.name!==n("registration"))),i}function zin(){Mi("client_portal"),Pc();const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("client_portal"),href:"/settings/client_portal"}],t=xu(),i=lp(),r=x0(),o=Win();return O(sr,{title:n("client_portal"),docsLink:"en/advanced-settings/#client_portal",breadcrumbs:e,onSaveClick:t,onCancelClick:i,disableSaveButton:r,children:[r&&p(Iv,{}),p(KS,{tabs:o,className:"mt-6"}),p("div",{className:"my-4",children:p(sp,{})})]})}/**
* 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 Uin(n,e){return e.replace("$body",n)}function l9(n){const e=si();return p("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),Uvt.success(Ca("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 jin={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 qin={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 Qd=(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))(Qd||{});/**
* 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 WT={[Qd.Daily]:"freq_daily",[Qd.Weekly]:"freq_weekly",[Qd.TwoWeeks]:"freq_two_weeks",[Qd.FourWeeks]:"freq_four_weeks",[Qd.Monthly]:"freq_monthly",[Qd.TwoMonths]:"freq_two_months",[Qd.ThreeMonths]:"freq_three_months",[Qd.FourMonths]:"freq_four_months",[Qd.SixMonths]:"freq_six_months",[Qd.Annually]:"freq_annually",[Qd.TwoYears]:"freq_two_years",[Qd.ThreeYears]:"freq_three_years"},rC=["reminder1","reminder2","reminder3"];function Gin(){Mi("templates_and_reminders");const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("templates_and_reminders"),href:"/settings/templates_and_reminders"}],t=Pc(),i=Bo(),r=xu(),o=lp();Va();const s=pa(),{isCompanySettingsActive:a}=$s(),{data:l}=ph(),[c,u]=w.useState(a||t!=null&&t.settings.email_template_invoice?"invoice":""),[d,h]=w.useState(),[f,g]=w.useState(),[m,v]=w.useState(-1),[_,b]=w.useState(!0),[y,C]=w.useState(!1),E=x0(),x=c==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${c||"invoice"}`,k=c==="quote_reminder1"?"email_quote_template_reminder1":`email_template_${c||"invoice"}`,L=W=>c==="quote_reminder1"?"quote_num_days_reminder1":`num_days_reminder${W}`,D=W=>c==="quote_reminder1"?"quote_schedule_reminder1":`schedule_reminder${W}`,A=W=>c==="quote_reminder1"?"enable_quote_reminder1":`enable_reminder${W}`,N=W=>c==="quote_reminder1"?"quote_late_fee_amount1":`late_fee_amount${W}`,P=W=>c==="quote_reminder1"?"quote_late_fee_percent1":`late_fee_percent${W}`,M=()=>{var W,q;if(l!=null&&l.templates&&t&&c){const V={subject:t.settings[x],body:t.settings[k]};if(((W=V.subject)==null?void 0:W.length)>0||((q=V.body)==null?void 0:q.length)>0)h({...V});else{const re=l.templates[c]||{subject:t.settings[x]||"",body:t.settings[k]||""};h({...re})}}},B=W=>{const q=An.cloneDeep(t==null?void 0:t.settings);q&&(W?(q[L(W)]=0,q[D(W)]="disabled",q[A(W)]=!1,q[N(W)]=0,q[P(W)]=0):(q.enable_reminder_endless=!1,q.endless_reminder_frequency_id=""),i("settings",q))},F=(W,q)=>{const V=An.cloneDeep(q||(t==null?void 0:t.settings));V&&(W?(delete V[L(W)],delete V[D(W)],delete V[A(W)],delete V[N(W)],delete V[P(W)]):(delete V.enable_reminder_endless,delete V.endless_reminder_frequency_id),i("settings",V))},U=W=>{if(!W){const q=An.cloneDeep(t==null?void 0:t.settings);if(q){const V=m>-1?`reminder${m}`:"";delete q[c==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${V||c}`],rC.includes(c)||c==="reminder_endless"?F(rC.indexOf(c)+1,q):i("settings",q),h(void 0)}}W&&!c&&u("invoice"),W&&c&&(M(),s(k)&&rC.includes(c)&&B(rC.indexOf(c)+1),c==="reminder_endless"&&s("email_template_reminder_endless")&&B())};w.useEffect(()=>{if(l!=null&&l.templates&&t&&c){rC.includes(c)?v(rC.indexOf(c)+1):v(-1);const W=t==null?void 0:t.settings[k];(a||W&&!a||c==="invoice"&&!W&&!a&&_)&&M(),_&&b(!1)}},[l,c]),w.useEffect(()=>{c&&d&&(i(`settings.${x}`,d==null?void 0:d.subject),i(`settings.${k}`,d==null?void 0:d.body),C(!0),$e("POST",Ae("/api/v1/templates"),{body:d==null?void 0:d.body,subject:d==null?void 0:d.subject,entity:"",entity_id:"",template:k}).then(W=>g(W.data)).finally(()=>C(!1)))},[d]);const H=c==="payment"?qin:jin;return O(sr,{title:n("templates_and_reminders"),docsLink:"en/advanced-settings/#templates_and_reminders",breadcrumbs:e,onSaveClick:r,onCancelClick:o,disableSaveButton:E,children:[E&&p(Iv,{}),O(tn,{title:n("edit"),children:[p(G,{leftSide:p(Ht,{checked:typeof(t==null?void 0:t.settings[k])<"u",propertyKey:k,labelElement:p(Wt,{label:n("template")}),defaultValue:c||"invoice",onCheckboxChange:W=>U(W)}),children:O(En,{value:c,onValueChange:W=>{u(W),!a&&h(void 0)},cypressRef:"templateSelector",children:[l&&Object.keys(l.templates).map((W,q)=>p("option",{value:W,children:n(W)},q)),p("option",{value:"payment_failed",children:n("payment_failed")}),p("option",{value:"custom1",children:n("first_custom")}),p("option",{value:"custom2",children:n("second_custom")}),p("option",{value:"custom3",children:n("third_custom")})]})}),p(G,{leftSide:n("subject"),disabledLabels:s(k),children:p(Ze,{id:"subject",value:(d==null?void 0:d.subject)||"",onValueChange:W=>h(q=>q&&{...q,subject:W}),disabled:s(k)})}),p(G,{leftSide:n("body"),disabledLabels:s(k),children:p(dd,{value:(d==null?void 0:d.body)||"",onChange:W=>h(q=>q&&{...q,body:W}),disabled:s(k)})})]}),(rC.includes(c)||c==="reminder_endless"||c==="quote_reminder1")&&!s(k)&&p(tn,{children:rC.includes(c)||c==="quote_reminder1"?O(St,{children:[p(G,{leftSide:n("days"),children:p(mo,{precision:0,value:(t==null?void 0:t.settings[L(m)])||0,onValueChange:W=>i(`settings.${L(m)}`,parseFloat(W)||0),disablePrecision:!0})}),p(G,{leftSide:n("schedule"),children:O(En,{value:(t==null?void 0:t.settings[D(m)])||"disabled",onValueChange:W=>i(`settings.${D(m)}`,W),children:[p("option",{value:"disabled",defaultChecked:!0,children:n("disabled")}),p("option",{value:c==="quote_reminder1"?"after_quote_date":"after_invoice_date",children:n(c==="quote_reminder1"?"after_quote_date":"after_invoice_date")}),p("option",{value:c==="quote_reminder1"?"before_valid_until_date":"before_due_date",children:n(c==="quote_reminder1"?"before_valid_until_date":"before_due_date")}),p("option",{value:c==="quote_reminder1"?"after_valid_until_date":"after_due_date",children:n(c==="quote_reminder1"?"after_valid_until_date":"after_due_date")})]})}),p(G,{leftSide:n("send_email"),children:p(kt,{checked:!!(t!=null&&t.settings[A(m)])||!1,onValueChange:W=>i(`settings.${A(m)}`,W)})}),p(G,{leftSide:n("late_fee_amount"),children:p(mo,{value:(t==null?void 0:t.settings[N(m)])||0,onValueChange:W=>i(`settings.${N(m)}`,parseFloat(W)||0)})}),p(G,{leftSide:n("late_fee_percent"),children:p(mo,{value:(t==null?void 0:t.settings[P(m)])||0,onValueChange:W=>i(`settings.${P(m)}`,parseFloat(W)||0)})})]}):O(St,{children:[p(G,{leftSide:n("send_email"),children:p(kt,{checked:!!(t!=null&&t.settings.enable_reminder_endless),onValueChange:W=>i("settings.enable_reminder_endless",W)})}),p(G,{leftSide:n("frequency"),children:p(En,{value:(t==null?void 0:t.settings.endless_reminder_frequency_id)||"",onValueChange:W=>i("settings.endless_reminder_frequency_id",W),withBlank:!0,children:Object.keys(WT).map((W,q)=>p("option",{value:W,children:n(WT[W])},q))})})]})}),f&&p(tn,{className:"scale-y-100",title:f.subject,children:y?p("div",{className:"flex justify-center items-center",style:{height:800},children:p(ds,{})}):p("iframe",{srcDoc:Uin(f.body,f.wrapper),frameBorder:"0",width:"100%",height:800})}),O(tn,{title:n("variables"),children:[p(G,{leftSide:n("invoice"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:H.invoice.map((W,q)=>p(l9,{children:W},q))})}),p(G,{leftSide:n("client"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:H.client.map((W,q)=>p(l9,{children:W},q))})}),p(G,{leftSide:n("contact"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:H.contact.map((W,q)=>p(l9,{children:W},q))})}),p(G,{leftSide:n("company"),className:"flex-wrap",children:p("div",{className:"flex flex-wrap",children:H.company.map((W,q)=>p(l9,{children:W},q))})})]})]})}const Kin=()=>{const{t:n}=ve(),e=Ti(),t=ef(),i=XS({resolveBy:"code"}),r=a=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"nordigen",platform:"react",institution_id:a}).then(l=>{var c;window.open(Ae("/nordigen/connect/:hash",{hash:(c=l==null?void 0:l.data)==null?void 0:c.hash}))})},o=()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"yodlee",platform:"react"}).then(a=>{var l;window.open(At("https://invoicing.co/yodlee/onboard/:hash",{hash:(l=a==null?void 0:a.data)==null?void 0:l.hash}))})};return[{id:"bank_account_name",label:n("name"),format:(a,l)=>O("div",{className:"flex items-center space-x-3",children:[p(qi,{to:At("/settings/bank_accounts/:id/details",{id:l==null?void 0:l.id}),children:l==null?void 0:l.bank_account_name}),(l.integration_type==="NORDIGEN"||l.integration_type==="YODLEE")&&l.disabled_upstream&&p(Yu,{message:n("reconnect"),width:"auto",placement:"top",children:p("div",{className:"cursor-pointer",onClick:c=>{c.stopPropagation(),l.integration_type==="NORDIGEN"&&r(l.nordigen_institution_id),l.integration_type==="YODLEE"&&o()},children:p(Ly,{color:"red",size:22})})})]})},{id:"bank_account_type",label:n("type")},{id:"balance",label:n("balance"),format:(a,l)=>{var c,u;return t(a,(c=e==null?void 0:e.settings)==null?void 0:c.country_id,(u=i(l.currency))==null?void 0:u.id)}}]},Yin="/dap-logos/yodlee.svg",Qin="/dap-logos/goCardless.png";function Xin(){const[n]=ve(),e=Ss(),t=si(),i=w.useRef(null),[r,o]=w.useState(),[s,a]=w.useState(!1);m1(i,()=>{o(void 0)});const l=()=>{a(!1),o(void 0)},c=()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"yodlee",platform:"react"}).then(h=>{var f;l(),window.open(At("https://invoicing.co/yodlee/onboard/:hash",{hash:(f=h==null?void 0:h.data)==null?void 0:f.hash}))})},u=()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"nordigen",platform:"react"}).then(h=>{var f;l(),window.open(Ae("/nordigen/connect/:hash",{hash:(f=h==null?void 0:h.data)==null?void 0:f.hash}))})},d=()=>{r==="yodlee"&&c(),r==="nordigen"&&u()};return O(St,{children:[O(un,{type:"secondary",onClick:()=>u(),children:[p("span",{className:"mr-2",children:p(nt,{element:UEt,size:20})}),n("connect_accounts")]}),p(Or,{title:n("connect_accounts"),visible:s,onClose:l,children:O("div",{ref:i,className:"flex flex-col space-y-6",children:[xc()&&p("div",{className:"flex cursor-pointer h-44 border-4",style:{borderColor:r==="yodlee"?e:t.$5},onClick:()=>o("yodlee"),children:p("img",{className:"flex-1",src:Yin})}),xc()&&p("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:p("img",{className:"flex-1",src:Qin})}),p(un,{onClick:d,disableWithoutIcon:!0,disabled:!r,children:n("connect")})]})})]})}function Zin(){Mi("bank_accounts");const[n]=ve(),e=Kin(),t=ki(),i=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"}];return O(sr,{title:n("bank_accounts"),breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_accounts",children:[!xc()&&qo()&&p(Iv,{message:n("upgrade_to_connect_bank_account")}),p(Lg,{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:O("div",{className:"flex space-x-2",children:[p(Xin,{}),qo(),O(un,{type:"secondary",onClick:()=>t("/settings/bank_accounts/transaction_rules"),children:[p("span",{className:"mr-2",children:p(nt,{element:KEt,size:20})}),n("rules")]})]})})]})}function Jin(){Mi("edit_bank_account");const[n]=ve(),e=ki(),{id:t}=il(),{data:i}=TWe({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:At("/bank_accounts/:id/edit",{id:t})}],d=(f,g)=>{c(m=>m&&{...m,[f]:g})},h=async f=>{r||(f.preventDefault(),he.processing(),a(void 0),o(!0),$e("PUT",Ae("/api/v1/bank_integrations/:id",{id:t}),l).then(()=>{he.success("updated_bank_account"),In(["bank_integrations"]),e("/settings/bank_accounts")}).catch(g=>{var m;((m=g.response)==null?void 0:m.status)===422&&(a(g.response.data),he.dismiss())}).finally(()=>o(!1)))};return w.useEffect(()=>{i&&c(i)},[i]),p(sr,{title:n("edit_bank_account"),breadcrumbs:u,docsLink:"en/basic-settings/#edit_bank_account",onSaveClick:h,children:O(tn,{onFormSubmit:h,title:n("edit_bank_account"),children:[p(G,{leftSide:n("account_name"),children:p(Ze,{value:l==null?void 0:l.bank_account_name,onValueChange:f=>d("bank_account_name",f),errorMessage:s==null?void 0:s.errors.bank_account_name})}),p(G,{leftSide:n("sync_from"),children:p(Ze,{type:"date",value:l==null?void 0:l.from_date,onValueChange:f=>d("from_date",f),errorMessage:s==null?void 0:s.errors.from_date})}),p(G,{leftSide:n("auto_sync"),children:p(kt,{checked:(l==null?void 0:l.auto_sync)||!1,onValueChange:f=>d("auto_sync",f)})})]})})}/**
* 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 Lqe(n,e,t,i,r,o){const s=ki();return a=>{a.preventDefault(),!i&&n&&(he.processing(),e(void 0),t(!0),$e("POST",Ae("/api/v1/bank_integrations"),n).then(l=>{he.success("created_bank_account"),In(["bank_integrations"]),r?(In(["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&&(he.dismiss(),e(l.response.data))}).finally(()=>t(!1)))}}function ern(){const[n]=ve();Mi("new_bank_account");const{data:e}=kWe(),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=Lqe(a,s,r,i),u=(d,h)=>{l(f=>f&&{...f,[d]:h})};return w.useEffect(()=>{e&&l(e)},[e]),p(sr,{title:n("new_bank_account"),breadcrumbs:t,docsLink:"en/basic-settings/#create_bank_account",disableSaveButton:!xc()&&!Bm()&&qo(),onSaveClick:c,children:p(tn,{onFormSubmit:c,title:n("new_bank_account"),children:p(G,{leftSide:n("account_name"),children:p(Ze,{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 trn(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]=ve(),a=Ti(),l=ef(),c=XS({resolveBy:"code"});return O(tn,{title:s("details"),children:[p(G,{leftSide:s("balance"),children:l(e||0,a.settings.country_id,(u=c(o))==null?void 0:u.id)}),p(G,{leftSide:s("type"),children:t}),p(G,{leftSide:s("provider"),children:i}),p(G,{leftSide:s("status"),children:r})]})}function nrn(){Mi("bank_account");const{id:n}=il(),[e]=ve(),t=[{name:e("settings"),href:"/settings"},{name:e("bank_accounts"),href:"/settings/bank_accounts"},{name:e("bank_account"),href:At("/settings/bank_accounts/:id/details",{id:n})}],{data:i}=TWe({id:n}),[r,o]=w.useState();return w.useEffect(()=>{o(i)},[i]),p(sr,{title:e("bank_account"),breadcrumbs:t,docsLink:"en/basic-settings/#bank_account_details",children:p(trn,{accountDetails:r})})}function irn(){const[n]=ve();return[{id:"name",label:n("name"),format:(t,i)=>p(qi,{to:At("/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 p(qi,{to:At("/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 p(qi,{to:At("/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 rrn(){const{documentTitle:n}=Mi("transaction_rules"),[e]=ve(),t=irn(),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 p(sr,{title:n,breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_transaction_rules",children:p(Lg,{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 orn(){const{isAdmin:n}=Fo();return Ii(["/api/v1/bank_transaction_rules","create"],()=>$e("GET",Ae("/api/v1/bank_transaction_rules/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function srn(n){return Ii(["/api/v1/bank_transaction_rules",n.id],()=>$e("GET",Ae("/api/v1/bank_transaction_rules/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function Dqe(n){const[e]=ve(),t=Ss(),{data:i}=dqe(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState(),u=()=>{s||(he.processing(),a(!0),$e("POST",Ae("/api/v1/expense_categories"),l).then(d=>{he.success("created_expense_category"),In(["expense_categories"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:Ae("/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),he.dismiss())}).finally(()=>a(!1)))};return w.useEffect(()=>{i&&c({...i,color:t})},[i]),p(Or,{title:e("create_expense_category"),visible:n.visible,onClose:()=>n.setVisible(!1),stopPropagationInHeader:!0,children:O("div",{onClick:d=>d.stopPropagation(),children:[p(hqe,{expenseCategory:l,setExpenseCategory:c,errors:r,setErrors:o}),p("div",{className:"flex justify-end space-x-4 mt-5",children:p(un,{behavior:"button",onClick:u,children:e("save")})})]})})}function arn(n){var s;const[e]=ve(),[t,i]=w.useState(!1),r=hs(),o="&per_page=1";return O(St,{children:[p(Dqe,{visible:n.initiallyVisible||t,setVisible:n.setVisible||i,setSelectedIds:n.setSelectedIds,onCreatedCategory:a=>n.onChange(a)}),!n.setSelectedIds&&p(Mh,{endpoint:Ae(`/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 tkr(n){return Ii(["/api/v1/vendors",n.id],()=>$e("GET",Ae("/api/v1/vendors/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function lrn(){const n=hs();return Ii(["/api/v1/vendors","create"],()=>$e("GET",Ae("/api/v1/vendors/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n("create_vendor")})}function crn(n){return Ii(["/api/v1/vendors",n],()=>$e("GET",Ae("/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 nkr(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/vendors/bulk"),{action:e,ids:[n]}).then(()=>{he.success(`${e}d_vendor`),In(["vendors"])})}}function a6(n){const e=yve();return p(A1,{onValueChange:n.onChange,value:n.value,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,disabled:n.disabled,children:e.map((t,i)=>O("option",{value:t.id,children:[t.name," (",t.iso_3166_3,")"]},i))})}function urn(n){var _,b,y,C,E;const[e]=ve(),{vendor:t,setVendor:i,errors:r,page:o,setContacts:s,contacts:a,fundamentalConceptVisible:l}=n,c=Ti(),{isAdmin:u,isOwner:d}=Fo(),h=(x,k)=>{i(L=>L&&{...L,[x]:k})},f=(x,k,L)=>{An.set(a[L],x,k),s([...a])},g=x=>{let k=[...a];k=k.filter((L,D)=>x!==D),s(k)},m=()=>{const x=[...a];x.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(x)},v=Bj();return p(St,{children:l?O("div",{className:"flex flex-col space-y-3",children:[p(Ze,{label:e("name"),value:(t==null?void 0:t.name)||"",onValueChange:x=>h("name",x),errorMessage:r==null?void 0:r.errors.name}),p(Ze,{label:`${e("contact")} ${e("first_name")}`,value:a[0].first_name,onValueChange:x=>f("first_name",x,0),errorMessage:r==null?void 0:r.errors["contacts.0.first_name"]}),p(Ze,{label:`${e("contact")} ${e("last_name")}`,value:a[0].last_name,onValueChange:x=>f("last_name",x,0),errorMessage:r==null?void 0:r.errors["contacts.0.last_name"]}),p(Ze,{label:`${e("contact")} ${e("email")}`,value:a[0].email,onValueChange:x=>f("email",x,0),errorMessage:r==null?void 0:r.errors["contacts.0.email"]}),p(Ze,{label:`${e("contact")} ${e("phone")}`,value:a[0].phone,onValueChange:x=>f("phone",x,0),errorMessage:r==null?void 0:r.errors["contacts.0.phone"]}),p(sA,{label:e("currency"),value:(t==null?void 0:t.currency_id)||"",onChange:x=>h("currency_id",x),errorMessage:r==null?void 0:r.errors.currency_id,dismissable:!0})]}):O("div",{className:"grid grid-cols-12 gap-4",children:[O("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[O(tn,{title:e("details"),children:[o==="edit"&&p(G,{leftSide:e("status"),children:p($m,{entity:t})}),p(G,{leftSide:e("name"),children:p(Ze,{id:"name",value:t.name||"",onValueChange:x=>h("name",x),errorMessage:r==null?void 0:r.errors.name})}),p(G,{leftSide:e("number"),children:p(Ze,{value:t.number||"",onValueChange:x=>h("number",x),errorMessage:r==null?void 0:r.errors.number})}),p(G,{leftSide:e("user"),children:p(Yve,{value:t.assigned_user_id,onChange:x=>h("assigned_user_id",x.id),onClearButtonClick:()=>h("assigned_user_id",""),clearButton:!0,errorMessage:r==null?void 0:r.errors.assigned_user_id})}),p(G,{leftSide:e("id_number"),children:p(Ze,{value:t.id_number||"",onValueChange:x=>h("id_number",x),errorMessage:r==null?void 0:r.errors.id_number})}),p(G,{leftSide:e("vat_number"),children:p(Ze,{value:t.vat_number||"",onValueChange:x=>h("vat_number",x),errorMessage:r==null?void 0:r.errors.vat_number})}),p(G,{leftSide:e("website"),children:p(Ze,{value:t.website||"",onValueChange:x=>h("website",x),errorMessage:r==null?void 0:r.errors.website})}),p(G,{leftSide:e("phone"),children:p(Ze,{value:t.phone||"",onValueChange:x=>h("phone",x),errorMessage:r==null?void 0:r.errors.phone})}),p(G,{leftSide:e("routing_id"),children:p(Ze,{value:t.routing_id||"",onValueChange:x=>h("routing_id",x),errorMessage:(_=n.errors)==null?void 0:_.errors.routing_id})}),p(G,{leftSide:e("tax_exempt"),children:p(kt,{checked:!!t.is_tax_exempt,onValueChange:x=>h("is_tax_exempt",x)})}),p(G,{leftSide:e("classification"),children:O(En,{id:"classification",defaultValue:t.classification??"",onValueChange:x=>h("classification",x),errorMessage:r==null?void 0:r.errors.classification,withBlank:!0,children:[p("option",{value:"individual",children:e("individual")}),p("option",{value:"business",children:e("business")}),p("option",{value:"company",children:e("company")}),p("option",{value:"partnership",children:e("partnership")}),p("option",{value:"trust",children:e("trust")}),p("option",{value:"charity",children:e("charity")}),p("option",{value:"government",children:e("government")}),p("option",{value:"other",children:e("other")})]})}),((b=c==null?void 0:c.custom_fields)==null?void 0:b.vendor1)&&p(rs,{field:"contact1",defaultValue:t.custom_value1,value:c.custom_fields.vendor1,onValueChange:x=>h("custom_value1",x)}),((y=c==null?void 0:c.custom_fields)==null?void 0:y.vendor2)&&p(rs,{field:"vendor2",defaultValue:t.custom_value2,value:c.custom_fields.vendor2,onValueChange:x=>h("custom_value2",x)}),((C=c==null?void 0:c.custom_fields)==null?void 0:C.vendor3)&&p(rs,{field:"vendor3",defaultValue:t.custom_value3,value:c.custom_fields.vendor3,onValueChange:x=>h("custom_value3",x)}),((E=c==null?void 0:c.custom_fields)==null?void 0:E.vendor4)&&p(rs,{field:"vendor4",defaultValue:t.custom_value4,value:c.custom_fields.vendor4,onValueChange:x=>h("custom_value4",x)})]}),O(tn,{title:e("address"),children:[p(G,{leftSide:e("address1"),children:p(Ze,{value:t.address1,onValueChange:x=>h("address1",x),errorMessage:r==null?void 0:r.errors.address1})}),p(G,{leftSide:e("address2"),children:p(Ze,{value:t.address2,onValueChange:x=>h("address2",x),errorMessage:r==null?void 0:r.errors.address2})}),p(G,{leftSide:e("city"),children:p(Ze,{value:t.city,onValueChange:x=>h("city",x),errorMessage:r==null?void 0:r.errors.city})}),p(G,{leftSide:e("state"),children:p(Ze,{value:t.state,onValueChange:x=>h("state",x),errorMessage:r==null?void 0:r.errors.state})}),p(G,{leftSide:e("postal_code"),children:p(Ze,{value:t.postal_code,onValueChange:x=>h("postal_code",x),errorMessage:r==null?void 0:r.errors.postal_code})}),p(G,{leftSide:e("country"),children:p(a6,{value:t.country_id,onChange:x=>h("country_id",x),errorMessage:r==null?void 0:r.errors.country_id})})]})]}),O("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[p(tn,{title:e("contacts"),children:a.map((x,k,{length:L})=>{var D,A,N,P,M,B,F,U;return O("div",{children:[p(G,{leftSide:e("first_name"),children:p(Ze,{id:`first_name_${k}`,value:x.first_name,onValueChange:H=>f("first_name",H,k),errorMessage:(D=n.errors)==null?void 0:D.errors[`contacts.${k}.first_name`]})}),p(G,{leftSide:e("last_name"),children:p(Ze,{id:`last_name_${k}`,value:x.last_name,onValueChange:H=>f("last_name",H,k),errorMessage:(A=n.errors)==null?void 0:A.errors[`contacts.${k}.last_name`]})}),p(G,{leftSide:e("email"),children:p(Ze,{id:`email_${k}`,value:x.email,onValueChange:H=>f("email",H,k),errorMessage:(N=n.errors)==null?void 0:N.errors[`contacts.${k}.email`]})}),p(G,{leftSide:e("phone"),children:p(Ze,{value:x.phone,onValueChange:H=>f("phone",H,k),errorMessage:(P=n.errors)==null?void 0:P.errors[`contacts.${k}.phone`]})}),p(G,{leftSide:e("send_email"),children:p(kt,{checked:x.send_email,onChange:H=>f("send_email",H,k)})}),((M=c==null?void 0:c.custom_fields)==null?void 0:M.vendor_contact1)&&p(rs,{field:"vendor_contact1",defaultValue:x.custom_value1||"",value:c.custom_fields.vendor_contact1,onValueChange:H=>f("custom_value1",H,k)}),((B=c==null?void 0:c.custom_fields)==null?void 0:B.vendor_contact2)&&p(rs,{field:"vendor_contact2",defaultValue:x.custom_value2||"",value:c.custom_fields.vendor_contact2,onValueChange:H=>f("custom_value2",H,k)}),((F=c==null?void 0:c.custom_fields)==null?void 0:F.vendor_contact3)&&p(rs,{field:"vendor_contact3",defaultValue:x.custom_value3||"",value:c.custom_fields.vendor_contact3,onValueChange:H=>f("custom_value3",H,k)}),((U=c==null?void 0:c.custom_fields)==null?void 0:U.vendor_contact4)&&p(rs,{field:"vendor_contact4",defaultValue:x.custom_value4||"",value:c.custom_fields.vendor_contact4,onValueChange:H=>f("custom_value4",H,k)}),p(G,{children:O("div",{className:"flex justify-between items-center",children:[t.contacts.length>=2&&p("button",{type:"button",className:"text-red-600",onClick:()=>g(k),children:e("remove_contact")}),k+1==L&&p(un,{type:"minimal",behavior:"button",onClick:m,children:e("add_contact")})]})}),p(vi,{})]},k)})}),p(tn,{title:e("additional_info"),children:O(kv,{className:"px-5",tabs:[e("settings"),...u||d?[e("custom_fields")]:[]],children:[O("div",{className:"flex flex-col space-y-4",children:[p(G,{leftSide:e("currency"),noExternalPadding:!0,children:p(sA,{value:t.currency_id,onChange:x=>h("currency_id",parseInt(x)),errorMessage:r==null?void 0:r.errors.currency_id})}),v.length>1&&p(G,{leftSide:e("language"),noExternalPadding:!0,children:p(e6,{value:t.language_id,onChange:x=>h("language_id",x),errorMessage:r==null?void 0:r.errors.language_id,dismissable:!0})}),p(dd,{label:e("public_notes").toString(),onChange:x=>h("public_notes",x),value:t.public_notes}),p(dd,{label:e("private_notes").toString(),onChange:x=>h("private_notes",x),value:t.private_notes})]}),O("div",{children:[O("span",{className:"text-sm",children:[e("custom_fields"),"  "]}),p(qi,{to:"/settings/custom_fields/vendors",className:"capitalize",children:e("click_here")})]})]})})]})]})})}function drn(n){const[e]=ve(),{fundamentalConceptVisible:t,setFundamentalConceptVisible:i}=n,{data:r}=lrn(),[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=xu(),h=async()=>{An.set(o,"contacts",c),he.processing(),await d(!0),$e("POST",Ae("/api/v1/vendors"),o).then(f=>{he.success("created_vendor"),In(["vendors"]),n.setSelectedIds&&n.setSelectedIds([f.data.data.id]),n.onVendorCreated&&n.onVendorCreated(f.data.data),s(r),n.setVisible(!1)}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(he.dismiss(),l(f.response.data))})};return O(St,{children:[o&&p(urn,{vendor:o,setVendor:s,errors:a,setContacts:u,contacts:c,fundamentalConceptVisible:t}),O("div",{className:zt("flex",{"justify-between":t,"justify-end space-x-5":!t}),children:[p(un,{behavior:"button",type:"secondary",onClick:()=>i(f=>!f),children:e(t?"more_fields":"less_fields")}),p(un,{behavior:"button",onClick:h,children:e("save")})]})]})}function hrn(n){const[e]=ve(),[t,i]=w.useState(!0);return p(Or,{title:e("create_vendor"),visible:n.visible,onClose:()=>n.setVisible(!1),size:t?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:p(drn,{setSelectedIds:n.setSelectedIds,setVisible:n.setVisible,onVendorCreated:n.onVendorCreated,fundamentalConceptVisible:t,setFundamentalConceptVisible:i})})}function frn(n){var o;const[e]=ve(),t=hs(),[i,r]=w.useState(!1);return O(St,{children:[p(hrn,{visible:n.initiallyVisibleModal||i,setVisible:n.setVisible||r,setSelectedIds:n.setSelectedIds,onVendorCreated:s=>n.onChange(s)}),!n.setSelectedIds&&p(Mh,{endpoint:Ae("/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")&&!n.withoutAction},readonly:n.readonly,onDismiss:n.onClearButtonClick,initiallyVisible:n.initiallyVisible,sortBy:"name|asc",staleTime:n.staleTime||1/0,errorMessage:n.errorMessage,exclude:n.exclude})]})}/**
* 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 Aqe(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 prn={search_key:"description",operator:"contains",value:""},grn={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 mrn(n){const[e]=ve(),{visible:t,setVisible:i,transactionRule:r,ruleIndex:o,setTransactionRule:s,setErrors:a}=n,[l,c]=w.useState(),u=Aqe({setTransactionRule:s,setErrors:a}),d=(g,m)=>{c(v=>v&&{...v,[g]:m})},h=g=>{d("search_key",g),g==="description"&&d("operator","contains"),g==="amount"&&d("operator","<")},f=()=>{if(l){const g=r.rules||[];o>-1?(g[o]=l,u("rules",g),i(!1)):(u("rules",[...g,l]),i(!1))}};return w.useEffect(()=>{r&&(o>-1?c(r.rules[o]):c(prn))},[r,o]),O(Or,{title:o>-1?e("edit_rule"):e("add_rule"),visible:t,onClose:()=>i(!1),children:[O(En,{required:!0,label:e("field"),value:l==null?void 0:l.search_key,onValueChange:g=>h(g),children:[p("option",{defaultChecked:!0,value:"description",children:e("description")}),p("option",{value:"amount",children:e("amount")})]}),p(En,{required:!0,label:e("operator"),value:l==null?void 0:l.operator,onValueChange:g=>d("operator",g),children:(l==null?void 0:l.search_key)&&grn[l.search_key].map((g,m)=>p("option",{value:g.value,children:e(g.label)},m))}),p(Ze,{changeOverride:!0,required:!0,label:e("value"),value:l==null?void 0:l.value,onValueChange:g=>d("value",g)}),p(un,{className:"self-end",onClick:f,disableWithoutIcon:!0,disabled:!(l!=null&&l.value),children:e("save")})]})}function Rqe(n){var g;const[e]=ve(),t=Ss(),[i,r]=w.useState(!1),[o,s]=w.useState(-1),{transactionRule:a,setTransactionRule:l,errors:c,setErrors:u}=n,d=Aqe({setErrors:u,setTransactionRule:l}),h=m=>{const v=a.rules.filter((_,b)=>b!==m);d("rules",v)},f=si();return O(St,{children:[O(tn,{title:n.page==="create"?e("new_transaction_rule"):e("edit_transaction_rule"),children:[p(G,{leftSide:e("name"),required:!0,children:p(Ze,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},required:!0,value:a.name,onValueChange:m=>d("name",m),errorMessage:c==null?void 0:c.errors.name})}),p(G,{leftSide:e("match_all_rules"),leftSideHelp:e("match_all_rules_help"),children:p(kt,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},checked:a.matches_on_all||!1,onValueChange:m=>d("matches_on_all",m)})}),p(G,{leftSide:e("auto_convert"),leftSideHelp:e("auto_convert_help"),children:p(kt,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},checked:a.auto_convert||!1,onValueChange:m=>d("auto_convert",m)})}),p(G,{leftSide:e("vendor"),children:p(frn,{value:a.vendor_id,onChange:m=>d("vendor_id",m.id),onClearButtonClick:()=>d("vendor_id",""),errorMessage:c==null?void 0:c.errors.vendor_id})}),p(G,{leftSide:e("expense_category"),children:p(arn,{value:a.category_id,onChange:m=>d("category_id",m.id),onClearButtonClick:()=>d("category_id",""),errorMessage:c==null?void 0:c.errors.category_id})})]}),O(ZS,{children:[O(eE,{children:[p(Ma,{children:e("field")},"field"),p(Ma,{children:e("operator")},"operator"),p(Ma,{children:e("value")},"value")]}),O(JS,{children:[(g=a.rules)==null?void 0:g.map((m,v)=>O(wc,{className:"py-2",children:[p(To,{width:"30%",style:{backgroundColor:f.$2,color:f.$3,colorScheme:f.$0},children:e(m.search_key)}),p(To,{width:"30%",style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:e(m.operator)}),p(To,{width:"40%",style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:O("div",{className:"flex justify-between",children:[p("span",{children:m.value}),O("div",{className:"flex space-x-8",style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:[p(wF,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>{s(v),r(!0)}}),p(el,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>h(v)})]})]})})]},v)),p(wc,{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:p(To,{colSpan:100,style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},children:O("button",{style:{color:f.$3,colorScheme:f.$0,backgroundColor:f.$1,borderColor:f.$4},onClick:()=>{s(-1),r(!0)},className:"w-full py-1 inline-flex justify-center items-center space-x-2",children:[p(F9e,{className:"cursor-pointer",color:t,fontSize:18}),p("span",{children:e("add_rule")})]})})})]})]}),p(mrn,{visible:i,setVisible:r,ruleIndex:o,setTransactionRule:l,setErrors:u,transactionRule:a})]})}function _rn(){const[n]=ve();Mi("new_transaction_rule");const e=ki(),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}=orn(),[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||(he.processing(),c(void 0),a(!0),$e("POST",Ae("/api/v1/bank_transaction_rules"),r).then(h=>{he.success("created_transaction_rule"),In(["bank_transaction_rules"]),e(At("/settings/bank_accounts/transaction_rules/:id/edit",{id:h.data.data.id}))}).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===422&&(he.dismiss(),c(h.response.data))}).finally(()=>a(!1)))};return p(sr,{title:n("new_transaction_rule"),breadcrumbs:t,docsLink:"en/basic-settings/#create_transaction_rule",disableSaveButton:!r||s,onSaveClick:u,children:r?p(Rqe,{page:"create",transactionRule:r,setTransactionRule:o,errors:l,setErrors:c}):p(ds,{})})}function vrn(){const[n]=ve();Mi("edit_transaction_rule");const{id:e}=il(),t=ki(),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:At("/settings/bank_accounts/transaction_rules/:id/edit",{id:e})}],{data:r}=srn({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||(he.processing(),u(void 0),l(!0),$e("PUT",Ae("/api/v1/bank_transaction_rules/:id",{id:e}),o).then(()=>{he.success("updated_transaction_rule"),In(["bank_transaction_rules"]),t("/settings/bank_accounts/transaction_rules")}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(he.dismiss(),u(f.response.data))}).finally(()=>l(!1)))};return p(sr,{title:n("edit_transaction_rule"),breadcrumbs:i,docsLink:"en/basic-settings/#edit_transaction_rule",disableSaveButton:!o||a,onSaveClick:d,children:o?p(Rqe,{transactionRule:o,setTransactionRule:s,errors:c,setErrors:u}):p(ds,{})})}function Qve({text:n,className:e,secure:t,limit:i=0,iconColor:r}){const o=n||"",s=a=>{a.stopPropagation(),navigator.clipboard.writeText(o),he.success("copied_to_clipboard",{value:""})};return O("div",{className:`inline-flex space-x-2 ${e}`,children:[p("span",{children:t?n.split("").map(()=>"*"):o.length>i?o.substring(0,i).concat(" "):o}),o.length>0&&p("button",{type:"button",onClick:s,children:p(V9e,{size:18,color:r})})]})}const brn=()=>{const[n]=ve(),e=ef(),t=Ti();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=>O("div",{className:"flex space-x-2",onClick:o=>o.stopPropagation(),children:[p(qi,{to:r,external:!0,children:n("purchase_page")}),p(Qve,{text:r})]})}]};function yrn(){const{documentTitle:n}=Mi("payment_links"),[e]=ve(),t=brn(),i=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"}];return p(sr,{title:n,docsLink:"en/advanced-settings/#subscriptions",breadcrumbs:i,children:p(Lg,{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 Nqe(n){return Ii(["/api/v1/products"],()=>$e("GET",Ae("/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 ikr(n){return Ii(["/api/v1/products",n.id],()=>$e("GET",Ae("/api/v1/products/:id",{id:n.id})),{staleTime:1/0})}function Crn(n){const e=hs();return Ii(["/api/v1/products/create"],()=>$e("GET",Ae("/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 wrn(n,e){return $e("POST",Ae("/api/v1/products/bulk"),{action:e,ids:Array.from(n)})}function c9(n){const e=Ss(),t=ki(),i=ef(),[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((g,m)=>m!==d);o(h);const f=h.map(({id:g})=>g);n.handleChange(n.type,f.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:f})=>f===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]),O(St,{children:[n.products&&p(En,{onValueChange:u=>a(u),value:s,withBlank:!0,children:n.products.map((u,d)=>p("option",{value:u.id,children:c(u)},d))}),p("div",{className:"flex justify-center",children:p("ul",{role:"list",className:"-mb-8 mt-3",children:r.map((u,d)=>{var h,f;return p("li",{children:O("div",{className:"relative pb-8",children:[d!==r.length-1&&p("span",{className:"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}),O("div",{className:"relative flex space-x-3",children:[p("span",{className:"h-8 w-8 rounded-full flex items-center justify-center ring-8 ring-white",style:{backgroundColor:e},children:p(Jen,{className:"h-4 w-4 text-white cursor-pointer","aria-hidden":"true",onClick:()=>t(At("/products/:id/edit",{id:u.id}))})}),O("div",{className:"flex min-w-0 flex-1 justify-between space-x-4 pt-1.5",children:[O("div",{className:"flex flex-1 justify-between space-x-5",children:[p(qi,{to:At("/products/:id/edit",{id:u.id}),children:u.product_key}),p("span",{children:i(u.price,(h=u.company)==null?void 0:h.settings.country_id,(f=u.company)==null?void 0:f.settings.currency_id)})]}),p("div",{className:"whitespace-nowrap text-right text-sm text-gray-500",children:p(p1,{className:"cursor-pointer ml-10 xl:ml-20",color:e,fontSize:19,onClick:()=>l(u.id)})})]})]})]})},d)})})})]})}function Oqe(n){const[e]=ve(),{subscription:t,handleChange:i,errors:r,products:o,page:s}=n;return O(tn,{title:e("overview"),children:[p(G,{leftSide:e("name"),required:!0,children:p(Ze,{value:t.name,onValueChange:a=>i("name",a),errorMessage:r==null?void 0:r.errors.name})}),p(G,{leftSide:e("group"),children:p(Mh,{endpoint:Ae("/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})}),p(G,{leftSide:e("user"),children:p(Yve,{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})}),p(G,{leftSide:e("products"),children:p(c9,{type:"product_ids",handleChange:i,subscription:t,products:o})}),p(G,{leftSide:e("recurring_products"),children:p(c9,{type:"recurring_product_ids",handleChange:i,subscription:t,products:o})}),p(G,{leftSide:e("optional_products"),children:p(c9,{type:"optional_product_ids",handleChange:i,subscription:t,products:o})}),p(G,{leftSide:e("optional_recurring_products"),children:p(c9,{type:"optional_recurring_product_ids",handleChange:i,subscription:t,products:o})}),s!=="create"&&p(G,{leftSide:e("purchase_page"),children:p(Oc,{className:"break-all",text:t.purchase_page})})]})}function Pqe(n){const[e]=ve(),{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]),O(tn,{title:e("settings"),children:[p(G,{leftSide:e("frequency"),children:O(En,{value:t.frequency_id,errorMessage:r==null?void 0:r.errors.frequency_id,onValueChange:o=>i("frequency_id",o),children:[p("option",{value:"",children:e("once")}),Object.keys(WT).map((o,s)=>p("option",{value:o,children:e(WT[o])},s))]})}),p(G,{leftSide:e("remaining_cycles"),children:O(En,{value:t==null?void 0:t.remaining_cycles,onValueChange:o=>i("remaining_cycles",o),errorMessage:r==null?void 0:r.errors.remaining_cycles,children:[p("option",{value:"-1",children:e("endless")}),[...Array(37).keys()].map((o,s)=>p("option",{value:o,children:o},s))]})}),p(G,{leftSide:e("auto_bill"),children:O(En,{value:t.auto_bill,onValueChange:o=>i("auto_bill",o),errorMessage:r==null?void 0:r.errors.auto_bill,children:[p("option",{defaultChecked:!0}),p("option",{value:"always",children:e("enabled")}),p("option",{value:"optout",children:e("optout")}),p("option",{value:"optin",children:e("optin")}),p("option",{value:"off",children:e("disabled")})]})}),p(G,{leftSide:e("promo_code"),children:p(Ze,{value:t.promo_code,onValueChange:o=>i("promo_code",o),errorMessage:r==null?void 0:r.errors.promo_code})}),p(G,{leftSide:e("promo_discount"),children:O(Q4,{children:[p("div",{className:"w-full lg:w-1/2",children:p(mo,{value:t.promo_discount||"",onValueChange:o=>i("promo_discount",parseFloat(o)),errorMessage:r==null?void 0:r.errors.promo_discount})}),p("div",{className:"w-full lg:w-1/2",children:O(En,{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:[p("option",{value:"true",children:e("amount")}),p("option",{value:"false",children:e("percent")})]})})]})}),p(G,{leftSide:e("registration_required"),leftSideHelp:e("registration_required_help"),children:p(kt,{checked:t.registration_required,onValueChange:o=>i("registration_required",o)})}),p(G,{leftSide:e("use_inventory_management"),leftSideHelp:e("use_inventory_management_help"),children:p(kt,{checked:t.use_inventory_management,onValueChange:o=>i("use_inventory_management",o)})}),p(G,{leftSide:e("return_url"),children:p(Ze,{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"]})}),p(G,{leftSide:e("allow_query_overrides"),children:p(kt,{checked:t.allow_query_overrides,onValueChange:o=>i("allow_query_overrides",o)})}),p(G,{leftSide:e("allow_plan_changes"),children:p(kt,{checked:t.allow_plan_changes,onValueChange:o=>i("allow_plan_changes",o)})}),p(G,{leftSide:e("allow_cancellation"),children:p(kt,{checked:t.allow_cancellation,onValueChange:o=>i("allow_cancellation",o)})}),t.allow_cancellation&&p(G,{children:O(En,{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:[p("option",{value:86400,children:e("count_day")}),p("option",{value:172800,children:Ca("count_days",{count:2})}),p("option",{value:259200,children:Ca("count_days",{count:3})}),p("option",{value:604800,children:Ca("count_days",{count:7})}),p("option",{value:1209600,children:Ca("count_days",{count:14})}),p("option",{value:2592e3,children:Ca("count_days",{count:30})}),p("option",{value:5184e3,children:Ca("count_days",{count:60})})]})}),p(G,{leftSide:e("trial_enabled"),children:p(kt,{checked:t.trial_enabled,onValueChange:o=>i("trial_enabled",o)})}),t.trial_enabled&&p(G,{children:O(En,{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:[p("option",{value:86400,children:e("count_day")}),p("option",{value:172800,children:Ca("count_days",{count:2})}),p("option",{value:259200,children:Ca("count_days",{count:3})}),p("option",{value:604800,children:Ca("count_days",{count:7})}),p("option",{value:1209600,children:Ca("count_days",{count:14})}),p("option",{value:2592e3,children:Ca("count_days",{count:30})}),p("option",{value:5184e3,children:Ca("count_days",{count:60})})]})}),p(G,{leftSide:e("per_seat_enabled"),children:p(kt,{checked:t.per_seat_enabled,onValueChange:o=>i("per_seat_enabled",o)})}),t.per_seat_enabled&&p(G,{children:p(Ze,{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 Mqe(n){const[e]=ve(),t=Ss(),{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=f=>{Object.hasOwn(i.webhook_configuration.post_purchase_headers,f)&&(delete i.webhook_configuration.post_purchase_headers[f],r("webhook_configuration",i.webhook_configuration))};return O(tn,{title:e("webhook"),children:[p(G,{leftSide:e("webhook_url"),children:p(Ze,{value:i.webhook_configuration.post_purchase_url,onValueChange:f=>r("webhook_configuration.post_purchase_url",f),errorMessage:o==null?void 0:o.errors["webhook_configuration.post_purchase_url"]})}),p(G,{leftSide:e("rest_method"),children:O(En,{value:i.webhook_configuration.post_purchase_rest_method,onValueChange:f=>r("webhook_configuration.post_purchase_rest_method",f),errorMessage:o==null?void 0:o.errors["webhook_configuration.post_purchase_rest_method"],children:[p("option",{defaultChecked:!0}),p("option",{value:"post",children:e("post")}),p("option",{value:"put",children:e("put")})]})}),p(G,{leftSide:e("add_header"),children:O("div",{className:"flex flex-col",children:[O("div",{className:"flex flex-1 justify-between items-center",children:[p(Ze,{label:e("header_key"),value:s,onValueChange:f=>a(f)}),p(Ze,{label:e("header_value"),value:l,onValueChange:f=>c(f)}),p(qp,{className:"mt-7 text-gray-800 cursor-pointer",fontSize:25,onClick:()=>s&&l&&d()})]}),u==null?void 0:u.map(([f,g],m)=>O("div",{className:"flex flex-1 justify-between items-center space-x-2 mt-4",children:[p("span",{className:"flex-1 text-start",children:f}),p("span",{className:"flex-1 text-start",children:g}),p(p1,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>h(f)})]},m)),!u.length&&p("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 Fqe(n){return(e,t)=>{n.setErrors(void 0);const i=An.cloneDeep(n.subscription);n.setSubscription(An.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 Srn(){const{isAdmin:n,isOwner:e}=Fo();return Ii(["/api/v1/subscriptions","create"],()=>$e("GET",Ae("/api/v1/subscriptions/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function Ern(n){const{isAdmin:e,isOwner:t}=Fo();return Ii(["/api/v1/subscriptions",n.id],()=>$e("GET",Ae("/api/v1/subscriptions/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function xrn(){const n=Co(),e=Gi(Eu);return async(t,i)=>(he.processing(),$e("POST",Ae("/api/v1/subscriptions/bulk"),{action:i,ids:t}).then(()=>{he.success(`${i}d_subscription`),In(["subscriptions"]),e&&n.invalidateQueries([e])}))}function Bqe({subscription:n,handleChange:e,errors:t}){const{t:i}=ve(),r=n.steps?n.steps.split(","):[],[o,s]=w.useState([]),{data:a}=Ii({initialData:{},queryKey:["subscriptions","dependencies"],queryFn:()=>$e("GET",Ae("/api/v1/subscriptions/steps")).then(f=>f.data)}),l=a?Object.values(a).filter(f=>!r.includes(f.id)):[];function c(f){e("steps",r.filter(g=>g!==f).join(","))}function u(f){if(!f.destination||!a)return;const g=Array.from(r),[m]=g.splice(f.source.index,1);g.splice(f.destination.index,0,m),e("steps",g.join(",")),d(g.join(","))}function d(f){$e("POST",Ae("/api/v1/subscriptions/steps/check"),{steps:f??r.join(",")}).then(()=>s([])).catch(g=>{var m;(m=g.response)!=null&&m.data.errors.steps&&s(g.response.data.errors.steps)})}w.useEffect(()=>{a&&d()},[r.length]);const h=l.filter(f=>f.id.startsWith("auth.")).filter(f=>r.some(g=>g.startsWith("auth."))?!f.id.startsWith("auth."):!0);return O(tn,{title:i("steps"),children:[p(G,{leftSide:i("authentication"),children:p(En,{value:"",onValueChange:f=>{e("steps",[...r,f].join(","))},withBlank:!0,children:h.map((f,g)=>p("option",{value:f.id,children:i(f.id)},g))})}),p(G,{leftSide:i("other_steps"),children:p(En,{value:"",onValueChange:f=>{e("steps",[...r,f].join(","))},withBlank:!0,children:l.filter(f=>!f.id.startsWith("auth.")).map((f,g)=>p("option",{value:f.id,children:i(f.id)},g))})}),O(G,{leftSide:i("order"),leftSideHelp:i("steps_order_help"),children:[p(bG,{onDragEnd:u,children:p(CG,{droppableId:"columns",children:f=>O("div",{...f.droppableProps,ref:f.innerRef,children:[r.map((g,m)=>p(yG,{draggableId:`item-${m}`,index:m,children:v=>O("div",{ref:v.innerRef,...v.draggableProps,className:"flex items-center justify-between py-2",children:[O("div",{className:"flex space-x-2 items-center",children:[p(nt,{className:"cursor-pointer",element:p1,size:20,onClick:()=>c(g)}),p("p",{children:i(g)})]}),p("div",{...v.dragHandleProps,children:p(nt,{element:B9e,size:23})})]})},m)),f.placeholder]})})}),t!=null&&t.errors.steps?p("div",{className:"text-red-500 mt-2",children:t.errors.steps}):o.length?p("div",{className:"text-red-500 mt-2",children:o.map((f,g)=>p("p",{children:f},g))}):null]})]})}function Trn(){const{documentTitle:n}=Mi("new_payment_link"),[e]=ve(),t=ki(),{data:i}=Srn(),{data:r}=Nqe({include:"company",status:["active"]}),o=x0(),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,f]=w.useState(),g=Fqe({setErrors:f,setSubscription:c,subscription:l});return w.useEffect(()=>{i&&c({...i,frequency_id:Qd.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]),O(sr,{title:n,breadcrumbs:s,onSaveClick:v=>{v.preventDefault(),f(void 0),he.processing(),$e("POST",Ae("/api/v1/subscriptions"),l).then(_=>{he.success("created_subscription"),In(["subscriptions"]),t(At("/settings/subscriptions/:id/edit",{id:_.data.data.id}))}).catch(_=>{var b;((b=_.response)==null?void 0:b.status)===422&&(f(_.response.data),he.dismiss())})},disableSaveButton:!l||o,children:[o&&p(Iv,{}),O(kv,{tabs:a,children:[p("div",{children:l&&p(Oqe,{subscription:l,handleChange:g,errors:h,products:u,page:"create"})}),p("div",{children:l&&p(Pqe,{subscription:l,handleChange:g,errors:h})}),p("div",{children:l&&p(Mqe,{subscription:l,handleChange:g,errors:h})}),p("div",{children:l&&p(Bqe,{subscription:l,handleChange:g,errors:h})})]})]})}function krn(){const[n]=ve(),e=xrn();return[i=>Tr(i)===nr.Active&&p(gt,{onClick:()=>e([i.id],"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),i=>(Tr(i)===nr.Archived||Tr(i)===nr.Deleted)&&p(gt,{onClick:()=>e([i.id],"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),i=>(Tr(i)===nr.Active||Tr(i)===nr.Archived)&&p(gt,{onClick:()=>e([i.id],"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function Irn(){const{documentTitle:n}=Mi("edit_payment_link"),[e]=ve(),t=krn(),{id:i}=il(),{data:r}=Ern({id:i}),{data:o}=Nqe({status:["active"]}),s=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"},{name:e("edit_payment_link"),href:At("/settings/subscriptions/:id/edit",{id:i})}],a=x0(),l=[e("overview"),e("settings"),e("webhook"),e("steps")],[c,u]=w.useState(),[d,h]=w.useState(),[f,g]=w.useState(),[m,v]=w.useState(!1),_=Fqe({setErrors:g,setSubscription:h,subscription:d});return w.useEffect(()=>{if(r){const{post_purchase_headers:y,post_purchase_body:C,post_purchase_rest_method:E,post_purchase_url:x,return_url:k}=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:E||"",post_purchase_url:x||"",return_url:k||""}})}},[r]),w.useEffect(()=>{o&&u(o)},[o]),p(sr,{title:n,breadcrumbs:s,navigationTopRight:d&&p(R1,{resource:d,onSaveClick:()=>{m||(g(void 0),v(!0),he.processing(),$e("PUT",Ae("/api/v1/subscriptions/:id",{id:i}),d).then(()=>{he.success("updated_subscription"),In(["subscriptions"])}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(g(y.response.data),he.dismiss())}).finally(()=>v(!1)))},actions:t,disableSaveButton:!d||a||m}),children:O(kv,{tabs:l,children:[p("div",{children:d&&p(Oqe,{subscription:d,handleChange:_,errors:f,products:c})}),p("div",{children:d&&p(Pqe,{subscription:d,handleChange:_,errors:f})}),p("div",{children:d&&p(Mqe,{subscription:d,handleChange:_,errors:f})}),p("div",{children:d&&p(Bqe,{subscription:d,handleChange:_,errors:f})})]})})}/**
* 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 Lrn(n){const e=hs();return Ii("/api/v1/clients/create",()=>$e("GET",Ae("/api/v1/clients/create")).then(t=>t.data.data),{refetchOnWindowFocus:!!n.refetchOnWindowFocus,staleTime:1/0,enabled:e("create_client")})}function $qe(n){return Ii(["/api/v1/clients","per_page=500",n],()=>{var e;return $e("GET",Ae("/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 rkr({id:n,enabled:e}){return Ii(["/api/v1/clients",n],()=>$e("GET",Ae("/api/v1/clients/:id?include=group_settings,activities.history",{id:n})).then(t=>t.data.data),{enabled:e,staleTime:1/0})}const Drn={assign_group:"updated_group",bulk_update:"updated_records"};function Xve(){const n=Co(),e=Gi(Eu);return async(t,i,r)=>{const{groupSettingsId:o,column:s,newValue:a}=r||{};return he.processing(),$e("POST",Ae("/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=Drn[i]||`${i}d_client`;he.success(l),e&&n.invalidateQueries([e]),In(["clients"]),i==="delete"&&In(["projects"])})}}const Arn=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Rrn=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Nrn=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Orn=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],SDe=(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 Vqe(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?Orn:Nrn:e.binary?Rrn:Arn,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=SDe(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=SDe(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 Prn(n){return O("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:[p("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"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("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"}),p("circle",{cx:"18.5",cy:"47",r:"3",fill:"#FFF"}),p("circle",{cx:"28.5",cy:"47",r:"3",fill:"#FFF"}),p("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 Mrn(n){return O("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:[p("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"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),p("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"}),p("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"}),p("g",{fill:"#FFF",children:p("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 Frn(n){return O("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:[p("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"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("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"}),p("g",{fill:"#FFF",children:p("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 Brn(n){return O("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:[p("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"}),p("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"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("g",{fill:"#FFF",children:p("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"})}),p("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),p("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 $rn(n){return O("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:[p("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"}),p("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),p("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"}),p("g",{fill:"#FFF",children:p("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"})}),p("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 Hqe(n){const e=["jpg","svg","png","pdf"],{size:t=26,type:i}=n;return O(St,{children:[i==="jpg"&&p(Mrn,{height:t}),i==="svg"&&p($rn,{height:t}),i==="png"&&p(Brn,{height:t}),i==="pdf"&&p(Frn,{height:t}),!e.includes(i)&&p(Prn,{height:t})]})}function Wqe(n){const[e]=ve(),t=_l(),{disableEditableOptions:i=!1}=n,r=QWe(),[o,s]=w.useState(!1),a=Wi(ap),[l,c]=w.useState(),[u,d]=w.useState([]),{dateFormat:h}=sc(),f=Co(),g=_=>{var b;return(b=u.find(({documentId:y})=>y===_))==null?void 0:b.url},m=(_,b)=>{he.processing(),f.fetchQuery(["/api/v1/documents",_.hash],()=>$e("GET",Ae("/documents/:hash",{hash:_.hash}),{headers:LT()},{responseType:"arraybuffer"}),{staleTime:1/0}).then(y=>{const C=new Blob([y.data],{type:y.headers["content-type"]}),E=URL.createObjectURL(C);if(b){window.open(E);return}const x=document.createElement("a");x.download=_.name,x.href=E,x.target="_blank",document.body.appendChild(x),x.click(),document.body.removeChild(x),he.dismiss()})},v=_=>{he.processing(),$e("delete",Ae("/api/v1/documents/:id",{id:l}),{},{headers:{"X-Api-Password":_}}).then(()=>{var b;he.success("deleted_document"),(b=n.onDocumentDelete)==null||b.call(n)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===412&&(he.error("password_error_incorrect"),a(0))})};return w.useEffect(()=>{t.show_document_preview&&n.documents.forEach(async({id:_,hash:b,type:y})=>{if(!u.find(({documentId:E})=>E===_)&&(y==="png"||y==="jpg")){const E=await f.fetchQuery(["documents",b],()=>$e("GET",Ae("/documents/:hash",{hash:b}),{headers:LT()},{responseType:"arraybuffer"}),{staleTime:1/0}),x=new Blob([E.data],{type:E.headers["content-type"]}),k=URL.createObjectURL(x);d(L=>[...L,{documentId:_,url:k}])}})},[t,n.documents]),O(St,{children:[O(ZS,{children:[O(eE,{children:[p(Ma,{children:e("name")}),p(Ma,{children:e("date")}),p(Ma,{children:e("type")}),p(Ma,{children:e("size")}),!i&&p(Ma,{})]}),O(JS,{children:[!n.documents.length&&p(wc,{children:p(To,{colSpan:5,children:e("no_records_found")})}),n.documents.map((_,b)=>O(wc,{children:[p(To,{children:O("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[O("div",{className:"flex items-center space-x-2",children:[p(Hqe,{type:_.type}),p("span",{children:_.name}),_.is_public?p(nt,{element:IH,size:27}):p(nt,{element:kH,size:27})]}),t.show_document_preview&&(_.type==="png"||_.type==="jpg")&&p(St,{children:g(_.id)?p("img",{src:g(_.id),style:{width:150,height:75}}):p(ds,{})})]})}),p(To,{children:xo(_.updated_at,h)}),p(To,{children:_.type}),p(To,{children:Vqe(_.size)}),!i&&p(To,{children:O(Fm,{label:e("actions"),children:[p(gt,{onClick:()=>{m(_,!0)},icon:p(nt,{element:lme}),children:e("view")}),p(gt,{onClick:()=>{m(_,!1)},icon:p(nt,{element:sS}),children:e("download")}),_.is_public?p(gt,{onClick:()=>{r(_.id,!1).then(()=>{var y;return(y=n.onDocumentDelete)==null?void 0:y.call(n)})},icon:p(nt,{element:kH}),children:e("set_private")}):p(gt,{onClick:()=>{r(_.id,!0).then(()=>{var y;return(y=n.onDocumentDelete)==null?void 0:y.call(n)})},icon:p(nt,{element:IH}),children:e("set_public")}),p(gt,{onClick:()=>{c(_.id),s(!0)},icon:p(nt,{element:el}),children:e("delete")})]})})]},b))]})]}),p(Tg,{show:o,onClose:s,onSave:v})]})}function Vrn(){const{t:n}=ve(),{dateFormat:e}=sc(),t=_l(),i=QWe(),r=Wi(ap),[o,s]=w.useState(1),[a,l]=w.useState("10"),[c,u]=w.useState(""),[d,h]=w.useState(!1),[f,g]=w.useState([]),{data:m,isLoading:v}=KWe({perPage:a,currentPage:o,companyDocuments:"true"}),_=Co(),b=x=>{var k;return(k=f.find(({documentId:L})=>L===x))==null?void 0:k.url},y=()=>{In(["documents"])},C=async(x,k)=>{he.processing();const L=await _.fetchQuery(["/api/v1/documents",x.hash],()=>$e("GET",Ae("/documents/:hash",{hash:x.hash}),{headers:LT()},{responseType:"arraybuffer"}),{staleTime:1/0});he.dismiss();const D=new Blob([L.data],{type:L.headers["content-type"]}),A=URL.createObjectURL(D);if(k){window.open(A);return}const N=document.createElement("a");N.download=x.name,N.href=A,N.target="_blank",document.body.appendChild(N),N.click(),document.body.removeChild(N)},E=(x,k=!0)=>{he.processing(),$e("delete",Ae("/api/v1/documents/:id",{id:c}),{},{headers:{"X-Api-Password":x}}).then(()=>he.success("deleted_document")).catch(L=>{var D;((D=L.response)==null?void 0:D.status)===412&&(he.error("password_error_incorrect"),r(0))}).finally(()=>y())};return w.useEffect(()=>{t.show_document_preview&&m&&m.data.data.forEach(async({id:x,hash:k,type:L})=>{if(!f.find(({documentId:A})=>A===x)&&(L==="png"||L==="jpg")){const A=await _.fetchQuery(["/api/v1/documents",k],()=>$e("GET",Ae("/documents/:hash",{hash:k}),{headers:LT()},{responseType:"arraybuffer"}),{staleTime:1/0}),N=new Blob([A.data],{type:A.headers["content-type"]}),P=URL.createObjectURL(N);g(M=>[...M,{documentId:x,url:P}])}})},[t,m==null?void 0:m.data.data]),O(St,{children:[O(ZS,{children:[O(eE,{children:[p(Ma,{children:n("name")}),p(Ma,{children:n("date")}),p(Ma,{children:n("type")}),p(Ma,{children:n("size")}),p(Ma,{})]}),O(JS,{children:[v&&p(wc,{children:p(To,{colSpan:5,children:p(ds,{})})}),m&&m.data.data.map(x=>O(wc,{children:[p(To,{children:O("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[O("div",{className:"flex items-center space-x-2",children:[p(Hqe,{type:x.type}),p("span",{children:x.name}),x.is_public?p(nt,{element:IH,size:27}):p(nt,{element:kH,size:27})]}),t.show_document_preview&&(x.type==="png"||x.type==="jpg")&&p(St,{children:b(x.id)?p("img",{src:b(x.id),style:{width:150,height:75}}):p(ds,{})})]})}),p(To,{children:xo(x.updated_at,e)}),p(To,{children:x.type}),p(To,{children:Vqe(x.size)}),p(To,{children:O(Fm,{label:n("actions"),children:[p(gt,{onClick:()=>{C(x,!0)},icon:p(nt,{element:lme}),children:n("view")}),p(gt,{onClick:()=>{C(x,!1)},icon:p(nt,{element:sS}),children:n("download")}),x.is_public?p(gt,{onClick:()=>{i(x.id,!1).then(()=>y())},icon:p(nt,{element:kH}),children:n("set_private")}):p(gt,{onClick:()=>{i(x.id,!0).then(()=>y())},icon:p(nt,{element:IH}),children:n("set_public")}),p(gt,{onClick:()=>{u(x.id),h(!0)},icon:p(nt,{element:el}),children:n("delete")})]})})]},x.id))]})]}),m&&p(nje,{currentPage:o,onPageChange:s,onRowsChange:l,totalPages:m.data.meta.pagination.total_pages}),p(Tg,{show:d,onClose:h,onSave:E})]})}function Zve(n){const[e]=ve(),{disableUpload:t=!1}=n,i=Va(),[r,o]=w.useState(new FormData),[s,a]=w.useState(),l=Gm({enableReinitialize:!0,initialValues:{},onSubmit:()=>{he.processing(),a(void 0),$e("POST",n.endpoint,r,{headers:{"Content-Type":"multipart/form-data"}}).then(()=>{var f;he.success("uploaded_document"),o(new FormData),(f=n.onSuccess)==null||f.call(n)}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(he.dismiss(),a(f.response.data)),o(new FormData)})}}),{getRootProps:c,getInputProps:u,isDragActive:d}=zR({disabled:!xc()&&qo()||t,onDrop:f=>{r.append("_method","PUT"),f.forEach(g=>r.append("documents[]",g)),o(r),l.submitForm()}}),h=si();return n.widgetOnly?O(St,{children:[!xc()&&qo()&&p(Fs,{className:"mb-4",type:"warning",disableClosing:!0,children:O("div",{className:"flex items-center",children:[p(qD,{className:"mr-2",fontSize:20}),e("upgrade_to_upload_images"),(i==null?void 0:i.company_user)&&p(qi,{className:"ml-10",external:!0,to:i.company_user.ninja_portal_url,children:e("plan_change")})]})}),p("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:O("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:[p("input",{...u()}),p(RT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("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((f,g)=>p(Fs,{className:"mt-2",type:"danger",children:s.errors[f]},g))]}):O(St,{children:[!xc()&&qo()&&p(Fs,{className:"mb-4",type:"warning",disableClosing:!0,children:O("div",{className:"flex items-center",children:[p(qD,{className:"mr-2",fontSize:20}),e("upgrade_to_upload_images"),(i==null?void 0:i.company_user)&&p(qi,{className:"ml-10",external:!0,to:i.company_user.ninja_portal_url,children:e("plan_change")})]})}),p(tn,{title:e("upload"),children:p(G,{leftSide:e("upload"),children:p("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:O("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:[p("input",{...u()}),p(RT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("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 xG(){const n=Va(),{isAdmin:e,isOwner:t}=Fo();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 Hrn({client:n,errors:e,setClient:t}){var v,_,b,y,C,E,x;const[i]=ve(),r=vve(),o=Bj(),s=hs(),a=xG(),{data:l}=sqe({}),{data:c}=ph(),{id:u}=il(),d=(k,L)=>{t(D=>D&&{...D,[k]:L})},h=(k,L)=>{var A;const D=An.cloneDeep(n);k!=="currency_id"&&L===""?(A=D.settings)==null||delete A[k]:An.set(D,`settings.${k}`,L),t(D)},[f,g]=w.useState([i("settings"),i("notes"),i("classify"),i("documents")]);w.useEffect(()=>{u||g(k=>k.filter(L=>L!==i("documents")))},[]);const m=()=>{In(["clients"])};return p(tn,{title:i("additional_info"),children:O(kv,{className:"px-5",tabs:f,formatTabLabel:k=>{if(k===3)return p(O_e,{numberOfDocuments:n==null?void 0:n.documents.length})},children:[O("div",{className:"-mx-5",children:[r.length>1&&p(G,{leftSide:i("currency"),children:p(sA,{value:((v=n==null?void 0:n.settings)==null?void 0:v.currency_id)||"",onChange:k=>h("currency_id",k),errorMessage:e==null?void 0:e.errors["settings.currency_id"],dismissable:!0})}),o.length>1&&p(G,{leftSide:i("language"),children:p(e6,{value:((_=n==null?void 0:n.settings)==null?void 0:_.language_id)||"",onChange:k=>h("language_id",k),errorMessage:e==null?void 0:e.errors["settings.language_id"],dismissable:!0})}),l&&p(G,{leftSide:i("payment_terms"),children:p(En,{id:"settings.payment_terms",defaultValue:((b=n==null?void 0:n.settings)==null?void 0:b.payment_terms)||"",errorMessage:e==null?void 0:e.errors["settings.payment_terms"],onValueChange:k=>h("payment_terms",k),withBlank:!0,customSelector:!0,children:l.data.data.map((k,L)=>p("option",{value:k.num_days,children:k.name},L))})}),l&&p(G,{leftSide:i("quote_valid_until"),children:p(En,{id:"settings.valid_until",defaultValue:((y=n==null?void 0:n.settings)==null?void 0:y.valid_until)||"",onValueChange:k=>h("valid_until",k),errorMessage:e==null?void 0:e.errors["settings.valid_until"],withBlank:!0,customSelector:!0,children:l.data.data.map((k,L)=>p("option",{value:k.num_days,children:k.name},L))})}),p(G,{leftSide:i("task_rate"),children:p(mo,{value:((C=n==null?void 0:n.settings)==null?void 0:C.default_task_rate)||"",onValueChange:k=>h("default_task_rate",parseFloat(k)),errorMessage:e==null?void 0:e.errors["settings.default_task_rate"]})}),p(G,{leftSide:i("send_reminders"),children:O(En,{id:"settings.send_reminders",defaultValue:((E=n==null?void 0:n.settings)==null?void 0:E.send_reminders)===!0?"enabled":((x=n==null?void 0:n.settings)==null?void 0:x.send_reminders)===!1?"disabled":"",onValueChange:k=>h("send_reminders",k==="enabled"?!0:k===""?"":!1),withBlank:!0,errorMessage:e==null?void 0:e.errors["settings.send_reminders"],customSelector:!0,children:[p("option",{value:"enabled",children:i("enabled")}),p("option",{value:"disabled",children:i("disabled")})]})})]}),O("div",{className:"-mx-5",children:[p(G,{leftSide:i("public_notes"),children:p(dd,{value:n==null?void 0:n.public_notes,onChange:k=>d("public_notes",k)})}),p(G,{leftSide:i("private_notes"),children:p(dd,{value:n==null?void 0:n.private_notes,onChange:k=>d("private_notes",k)})})]}),O("div",{className:"-mx-5",children:[c&&p(G,{leftSide:i("size_id"),children:p(En,{id:"size_id",defaultValue:(n==null?void 0:n.size_id)||"",onValueChange:k=>d("size_id",k),errorMessage:e==null?void 0:e.errors.size_id,withBlank:!0,customSelector:!0,children:c==null?void 0:c.sizes.map((k,L)=>p("option",{value:k.id,children:k.name},L))})}),c&&p(G,{leftSide:i("industry"),children:p(En,{id:"industry_id",defaultValue:(n==null?void 0:n.industry_id)||"",errorMessage:e==null?void 0:e.errors.industry_id,onValueChange:k=>d("industry_id",k),withBlank:!0,customSelector:!0,children:c==null?void 0:c.industries.map((k,L)=>p("option",{value:k.id,children:k.name},L))})})]}),u?p("div",{children:O("div",{className:"px-6",children:[p(Zve,{widgetOnly:!0,endpoint:Ae("/api/v1/clients/:id/upload",{id:u}),onSuccess:m}),p(Wqe,{documents:(n==null?void 0:n.documents)||[],onDocumentDelete:m,disableEditableOptions:!a(n,!0)&&!s("edit_client")})]})}):p(St,{})]})})}function Wrn(n){var s,a,l,c,u,d;const[e]=ve(),{errors:t,setClient:i,setErrors:r}=n,o=h=>{r(void 0),i(f=>f&&An.set(f,h.target.id,h.target.value))};return O(St,{children:[p(G,{leftSide:e("billing_address1"),children:p(Ze,{id:"address1",value:((s=n.client)==null?void 0:s.address1)||"",onChange:o,errorMessage:t==null?void 0:t.errors.address1})}),p(G,{leftSide:e("address2"),children:p(Ze,{id:"address2",value:((a=n.client)==null?void 0:a.address2)||"",onChange:o,errorMessage:t==null?void 0:t.errors.address2})}),p(G,{leftSide:e("city"),children:p(Ze,{id:"city",value:((l=n.client)==null?void 0:l.city)||"",onChange:o,errorMessage:t==null?void 0:t.errors.city})}),p(G,{leftSide:e("state"),children:p(Ze,{id:"state",value:((c=n.client)==null?void 0:c.state)||"",onChange:o,errorMessage:t==null?void 0:t.errors.state})}),p(G,{leftSide:e("postal_code"),children:p(Ze,{id:"postal_code",value:((u=n.client)==null?void 0:u.postal_code)||"",onChange:o,errorMessage:t==null?void 0:t.errors.postal_code})}),p(G,{leftSide:e("country"),children:p(a6,{value:((d=n.client)==null?void 0:d.country_id)||"",errorMessage:t==null?void 0:t.errors.country_id,onChange:h=>i(f=>f&&{...f,country_id:h}),dismissable:!0})})]})}function zrn(n){var a,l,c,u,d,h;const[e]=ve(),{errors:t,setErrors:i,setClient:r}=n,o=f=>{i(void 0),r(g=>g&&An.set(g,f.target.id,f.target.value))};return O(St,{children:[p(un,{onClick:()=>{n.setClient(f=>f&&{...f,shipping_address1:f==null?void 0:f.address1,shipping_address2:f==null?void 0:f.address2,shipping_city:f==null?void 0:f.city,shipping_state:f==null?void 0:f.state,shipping_postal_code:f==null?void 0:f.postal_code,shipping_country_id:f==null?void 0:f.country_id})},type:"secondary",behavior:"button",className:"mx-4 rounded-md bg-grey h-6",children:e("copy_billing")}),p(G,{leftSide:e("shipping_address1"),children:p(Ze,{id:"shipping_address1",value:((a=n.client)==null?void 0:a.shipping_address1)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_address1})}),p(G,{leftSide:e("address2"),children:p(Ze,{id:"shipping_address2",value:((l=n.client)==null?void 0:l.shipping_address2)||"",onChange:o})}),p(G,{leftSide:e("city"),children:p(Ze,{id:"shipping_city",value:((c=n.client)==null?void 0:c.shipping_city)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_city})}),p(G,{leftSide:e("state"),children:p(Ze,{id:"shipping_state",value:((u=n.client)==null?void 0:u.shipping_state)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_state})}),p(G,{leftSide:e("postal_code"),children:p(Ze,{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})}),p(G,{leftSide:e("country"),children:p(a6,{onChange:f=>r(g=>g&&{...g,shipping_country_id:f}),value:((h=n.client)==null?void 0:h.shipping_country_id)||"",errorMessage:t==null?void 0:t.errors.shipping_country_id,dismissable:!0})})]})}function Urn(n){const[e]=ve();return p(tn,{title:e("address"),children:O(kv,{className:"px-5",tabs:[e("billing_address"),e("shipping_address")],children:[p("div",{className:"-mx-5",children:p(Wrn,{...n})}),p("div",{className:"-mx-5",children:p(zrn,{...n})})]})})}function jrn(n){const[e]=ve(),{size:t=22}=n||{};return p(Yu,{tooltipElement:EG(e("user_unsubscribed"),":link",()=>O(qi,{className:"lowercase text-xs",to:"https://invoiceninja.github.io/en/hosted-mail/",external:!0,children:[e("link"),"."]})),width:"auto",placement:"top",children:p(Ly,{color:"red",size:t})})}function qrn(n){const[e]=ve(),t=Ss(),i=Ti(),r=(l,c,u)=>{n.setErrors(void 0);const d=n.contacts.findIndex(h=>h.contact_key===u);An.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:Qq().replaceAll("-",""),first_name:"",last_name:"",email:"",password:"",phone:"",send_email:!1}),n.setContacts(l)},a=si();return p(tn,{className:"mt-4 xl:mt-0",title:e("contacts"),children:n.contacts.map((l,c,u)=>{var d,h,f,g,m,v,_,b,y;return O("div",{className:"pb-4 mb-4 border-b",style:{borderColor:a.$5},children:[p(G,{leftSide:e("first_name"),children:p(Ze,{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})}),p(G,{leftSide:e("last_name"),children:p(Ze,{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})}),p(G,{leftSide:e("email"),children:p(Ze,{id:`email_${c}`,value:l.email,onChange:C=>r(C.target.value,"email",l.contact_key),errorMessage:(f=n.errors)==null?void 0:f.errors[`contacts.${c}.email`]})}),(i==null?void 0:i.settings.enable_client_portal_password)&&p(G,{leftSide:e("password"),children:p(Ze,{id:`password_${c}`,type:"password",value:l.password,onChange:C=>r(C.target.value,"password",l.contact_key),errorMessage:(g=n.errors)==null?void 0:g.errors[`contacts.${c}.password`]})}),p(G,{leftSide:e("phone"),children:p(Ze,{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`]})}),p(G,{leftSide:e("add_to_invoices"),children:p(kt,{checked:!!(l!=null&&l.send_email),onChange:C=>r(C,"send_email",l.contact_key)})}),((v=i==null?void 0:i.custom_fields)==null?void 0:v.contact1)&&p(rs,{field:"contact1",defaultValue:l.custom_value1,value:i.custom_fields.contact1,onValueChange:C=>r(C,"custom_value1",l.contact_key)}),((_=i==null?void 0:i.custom_fields)==null?void 0:_.contact2)&&p(rs,{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)&&p(rs,{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)&&p(rs,{field:"contact4",defaultValue:l.custom_value4,value:i.custom_fields.contact4,onValueChange:C=>r(C,"custom_value4",l.contact_key)}),p(G,{...l.is_locked&&{leftSide:p("div",{className:"flex",children:p(jrn,{size:25})})},children:O("div",{className:"flex items-center",children:[p("div",{className:"flex items-center justify-between w-1/2",children:n.contacts.length>=2&&p("button",{type:"button",onClick:()=>o(c),className:"text-red-600",children:e("remove_contact")})}),p("div",{className:"w-1/2 flex justify-end",children:c+1===u.length&&p("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 Grn(n){return Ii(["/api/v1/group_settings",n],()=>$e("GET",Ae("/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 Krn(n){const{id:e}=n;return Ii(["/api/v1/group_settings",e],()=>$e("GET",Ae("/api/v1/group_settings/:id",{id:e})).then(t=>t.data.data),{staleTime:1/0})}function Yrn(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/group_settings/bulk"),{action:e,ids:n}).then(()=>{he.success(`${e}d_group`),In(["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 Qrn(){return Ii(["/api/v1/users"],()=>$e("GET",Ae("/api/v1/users")),{staleTime:1/0})}function Xrn(n){return Ii(["/api/v1/users",n.id],()=>$e("GET",Ae("/api/v1/users/:id?include=company_user",{id:n.id})),{enabled:n.enabled,staleTime:1/0})}function Zrn(){const{isAdmin:n}=Fo();return Ii(["/api/v1/users/create"],()=>$e("GET",Ae("/api/v1/users/create")),{staleTime:1/0,enabled:n})}function Jrn(){const n=Wi(ap),e=RBe();return(t,i,r)=>{he.processing(),$e("POST",Ae("/api/v1/users/bulk"),{action:i,ids:t},{headers:{"X-Api-Password":r}}).then(()=>{he.success(`${i}d_user`),e(["users"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===412&&(he.error("password_error_incorrect"),n(0))})}}function eon(n){var a,l,c,u,d,h,f,g,m,v,_,b,y,C,E,x,k,L,D,A,N,P,M,B,F,U,H,W,q;const[e]=ve(),{data:t}=Qrn(),{data:i}=Grn(),r=(V,re)=>{n.setErrors(void 0),n.setClient(oe=>oe&&An.set({...oe},V,re))},o=(V,re)=>{n.setClient(oe=>oe&&An.set({...oe},V,re))},s=Ti();return O(tn,{title:e("company_details"),children:[n.client&&n.page==="edit"&&p(G,{leftSide:e("status"),children:p($m,{entity:n.client})}),p(G,{leftSide:e("name"),children:p(Ze,{value:((a=n.client)==null?void 0:a.name)||"",onValueChange:V=>r("name",V),errorMessage:(l=n.errors)==null?void 0:l.errors.name})}),p(G,{leftSide:e("number"),children:p(Ze,{value:((c=n.client)==null?void 0:c.number)||"",onValueChange:V=>r("number",V),errorMessage:(u=n.errors)==null?void 0:u.errors.number})}),i&&p(G,{leftSide:e("group"),children:p(En,{value:(d=n.client)==null?void 0:d.group_settings_id,onValueChange:V=>r("group_settings_id",V),errorMessage:(h=n.errors)==null?void 0:h.errors.group_settings_id,withBlank:!0,customSelector:!0,children:i.map((V,re)=>p("option",{value:V.id,children:V.name},re))})}),t&&p(G,{leftSide:e("user"),children:p(En,{value:(f=n.client)==null?void 0:f.assigned_user_id,onValueChange:V=>r("assigned_user_id",V),errorMessage:(g=n.errors)==null?void 0:g.errors.assigned_user_id,withBlank:!0,customSelector:!0,children:t.data.data.map((V,re)=>O("option",{value:V.id,children:[V.first_name," ",V.last_name]},re))})}),p(G,{leftSide:e("id_number"),children:p(Ze,{value:((m=n.client)==null?void 0:m.id_number)||"",onValueChange:V=>r("id_number",V),errorMessage:(v=n.errors)==null?void 0:v.errors.id_number})}),p(G,{leftSide:e("vat_number"),children:p(Ze,{value:((_=n.client)==null?void 0:_.vat_number)||"",onValueChange:V=>r("vat_number",V),errorMessage:(b=n.errors)==null?void 0:b.errors.vat_number})}),p(G,{leftSide:e("website"),children:p(Ze,{value:((y=n.client)==null?void 0:y.website)||"",onValueChange:V=>r("website",V),errorMessage:(C=n.errors)==null?void 0:C.errors.website})}),p(G,{leftSide:e("phone"),children:p(Ze,{value:((E=n.client)==null?void 0:E.phone)||"",onValueChange:V=>r("phone",V),errorMessage:(x=n.errors)==null?void 0:x.errors.phone})}),p(G,{leftSide:e("routing_id"),children:p(Ze,{value:((k=n.client)==null?void 0:k.routing_id)||"",onValueChange:V=>r("routing_id",V),errorMessage:(L=n.errors)==null?void 0:L.errors.routing_id})}),p(G,{leftSide:e("valid_vat_number"),children:p(kt,{checked:!!((D=n.client)!=null&&D.has_valid_vat_number),onValueChange:V=>o("has_valid_vat_number",V)})}),p(G,{leftSide:e("tax_exempt"),children:p(kt,{checked:!!((A=n.client)!=null&&A.is_tax_exempt),onValueChange:V=>o("is_tax_exempt",V)})}),p(G,{leftSide:e("classification"),children:O(En,{value:((N=n.client)==null?void 0:N.classification)??"",onValueChange:V=>r("classification",V),withBlank:!0,customSelector:!0,children:[p("option",{value:"individual",children:e("individual")}),p("option",{value:"business",children:e("business")}),p("option",{value:"company",children:e("company")}),p("option",{value:"partnership",children:e("partnership")}),p("option",{value:"trust",children:e("trust")}),p("option",{value:"charity",children:e("charity")}),p("option",{value:"government",children:e("government")}),p("option",{value:"other",children:e("other")})]})}),((P=s==null?void 0:s.custom_fields)==null?void 0:P.client1)&&p(rs,{field:"client1",defaultValue:(M=n.client)==null?void 0:M.custom_value1,value:s.custom_fields.client1,onValueChange:V=>o("custom_value1",V)}),((B=s==null?void 0:s.custom_fields)==null?void 0:B.client2)&&p(rs,{field:"client2",defaultValue:(F=n.client)==null?void 0:F.custom_value2,value:s.custom_fields.client2,onValueChange:V=>o("custom_value2",V)}),((U=s==null?void 0:s.custom_fields)==null?void 0:U.client3)&&p(rs,{field:"client3",defaultValue:(H=n.client)==null?void 0:H.custom_value3,value:s.custom_fields.client3,onValueChange:V=>o("custom_value3",V)}),((W=s==null?void 0:s.custom_fields)==null?void 0:W.client4)&&p(rs,{field:"client4",defaultValue:(q=n.client)==null?void 0:q.custom_value4,value:s.custom_fields.client4,onValueChange:V=>o("custom_value4",V)})]})}function zqe({isModalOpen:n,setIsModalOpen:e,onClientCreated:t}){var _;const[i]=ve(),[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}=Lrn({refetchOnWindowFocus:!1}),f=(b,y)=>{a(void 0),o(C=>C&&An.set({...C},b,y))},g=(b,y)=>{a(void 0);const C=l.findIndex(E=>E.contact_key===l[0].contact_key);An.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}])},v=()=>{if(An.set(r,"contacts",l),he.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")]}}),he.error(),v;$e("POST",Ae("/api/v1/clients"),r).then(b=>{he.success("created_client"),t&&t(b.data.data),In(["clients"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:Ae("/api/v1/clients")}})),m(!1)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(a(b.response.data),he.dismiss())})};return w.useEffect(()=>{h&&n&&o({...h})},[n]),p(Or,{title:i("new_client"),visible:n,onClose:()=>m(!1),size:u?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:O("div",{className:"flex flex-col space-y-7",children:[r?p(St,{children:u?O("div",{className:"flex flex-col space-y-3",children:[p(Ze,{label:i("name"),value:(r==null?void 0:r.name)||"",onValueChange:b=>f("name",b),errorMessage:s==null?void 0:s.errors.name}),p(Ze,{label:`${i("contact")} ${i("first_name")}`,value:l[0].first_name,onValueChange:b=>g(b,"first_name"),errorMessage:s==null?void 0:s.errors.name}),p(Ze,{label:`${i("contact")} ${i("last_name")}`,value:l[0].last_name,onValueChange:b=>g(b,"last_name"),errorMessage:s==null?void 0:s.errors.name}),p(Ze,{label:`${i("contact")} ${i("email")}`,value:l[0].email,onValueChange:b=>g(b,"email"),errorMessage:s==null?void 0:s.errors["contacts.0.email"]}),p(Ze,{label:`${i("contact")} ${i("phone")}`,value:l[0].phone,onValueChange:b=>g(b,"phone"),errorMessage:s==null?void 0:s.errors["contacts.0.phone"]}),p(sA,{label:i("currency"),value:((_=r==null?void 0:r.settings)==null?void 0:_.currency_id)||"",onChange:b=>{const y=An.cloneDeep(r);An.set(y,"settings.currency_id",b),o(y)},errorMessage:s==null?void 0:s.errors["settings.currency_id"],dismissable:!0})]}):O("div",{className:"flex flex-col xl:flex-row xl:gap-4",children:[O("div",{className:"w-full xl:w-1/2",children:[p(eon,{client:r,setClient:o,setErrors:a,errors:s}),p("div",{className:"mt-5",children:p(Urn,{client:r,setClient:o,setErrors:a,errors:s})})]}),O("div",{className:"w-full xl:w-1/2",children:[p(qrn,{contacts:l,setContacts:c,setErrors:a,errors:s}),p("div",{className:"mt-5",children:p(Hrn,{client:r,setClient:o,setErrors:a,errors:s})})]})]})}):p(ds,{}),O("div",{className:zt("flex",{"justify-between":u,"justify-end space-x-5":!u}),children:[p(un,{behavior:"button",type:"secondary",onClick:()=>d(b=>!b),children:i(u?"more_fields":"less_fields")}),p(un,{behavior:"button",onClick:v,children:i("save")})]})]})})}function TG(n){var s;const[e]=ve(),[t,i]=w.useState(!1),r=hs(),{dropdownLabelFn:o}=n;return O(St,{children:[p(zqe,{isModalOpen:t,setIsModalOpen:i,onClientCreated:a=>n.onChange(a)}),p(Mh,{inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value||null},endpoint:Ae("/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&&p(Fs,{className:"mt-2",type:"danger",children:n.errorMessage})]})}const kG=Ro(void 0);function ton(n){const[e]=ve(),t=Ss(),i=Gi(kG),{schedule:r,handleChange:o,errors:s,page:a}=n,{data:l}=$qe({enabled:a==="edit"||!!i}),[c,u]=w.useState([]),d=f=>{const g={...r.parameters};g.clients=f.map(({id:m})=>m),o("parameters",g)},h=f=>{const g=c.filter((m,v)=>v!==f);d(g),u(g)};return w.useEffect(()=>{if((a==="edit"||i)&&l){const f=l==null?void 0:l.filter(g=>{var m;return(m=r.parameters.clients)==null?void 0:m.includes(g.id)});u(f)}},[l]),O(St,{children:[p(G,{leftSide:e("date_range"),children:O(En,{value:r.parameters.date_range,onValueChange:f=>o("parameters.date_range",f),errorMessage:s==null?void 0:s.errors["parameters.date_range"],children:[p("option",{value:"last7_days",children:e("last7_days")}),p("option",{value:"last30_days",children:e("last30_days")}),p("option",{value:"last365_days",children:e("last365_days")}),p("option",{value:"this_month",children:e("this_month")}),p("option",{value:"last_month",children:e("last_month")}),p("option",{value:"this_quarter",children:e("this_quarter")}),p("option",{value:"last_quarter",children:e("last_quarter")}),p("option",{value:"this_year",children:e("this_year")}),p("option",{value:"last_year",children:e("last_year")}),p("option",{value:"all_time",children:e("all_time")})]})}),p(G,{leftSide:e("status"),children:O(En,{value:r.parameters.status,onValueChange:f=>o("parameters.status",f),errorMessage:s==null?void 0:s.errors["parameters.status"],children:[p("option",{value:"all",children:e("all")}),p("option",{value:"paid",children:e("paid")}),p("option",{value:"unpaid",children:e("unpaid")})]})}),p(G,{leftSide:e("show_aging_table"),children:p(kt,{checked:r.parameters.show_aging_table,onValueChange:f=>o("parameters.show_aging_table",f)})}),p(G,{leftSide:e("show_payments_table"),children:p(kt,{checked:r.parameters.show_payments_table,onValueChange:f=>o("parameters.show_payments_table",f)})}),p(G,{leftSide:e("show_credits_table"),children:p(kt,{checked:r.parameters.show_credits_table,onValueChange:f=>o("parameters.show_credits_table",f)})}),p(G,{leftSide:e("only_clients_with_invoices"),children:p(kt,{checked:r.parameters.only_clients_with_invoices,onValueChange:f=>o("parameters.only_clients_with_invoices",f)})}),O(G,{leftSide:e("client"),children:[p(TG,{onChange:f=>{u(g=>{const m=[...g,f];return d(m),m})},withoutAction:!0,clearInputAfterSelection:!0,exclude:r.parameters.clients}),O("div",{className:"flex justify-center",children:[p("div",{className:"flex flex-col space-y-2 pt-3",children:c==null?void 0:c.map((f,g)=>O("div",{className:"flex items-center justify-between",children:[p("span",{children:f.display_name}),p(p1,{className:"cursor-pointer ml-16",fontSize:20,color:t,onClick:()=>h(g)})]},f.id))}),!(c!=null&&c.length)&&p("span",{className:"text-gray-500 self-center text-xl mt-4",children:e("all_clients")})]})]})]})}function non(n){const[e]=ve(),t=ef(),{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 O(St,{children:[p(G,{leftSide:e("type"),children:O(En,{value:i.parameters.entity,onValueChange:a=>r("parameters.entity",a),errorMessage:o==null?void 0:o.errors["parameters.entity"],children:[p("option",{value:"invoice",defaultChecked:!0,children:e("invoice")}),p("option",{value:"quote",children:e("quote")}),p("option",{value:"credit",children:e("credit")}),p("option",{value:"purchase_order",children:e("purchase_order")})]})}),i.parameters.entity==="invoice"&&p(G,{leftSide:e("invoice"),children:p(Mh,{endpoint:Ae("/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"&&p(G,{leftSide:e("quote"),children:p(Mh,{endpoint:Ae("/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"&&p(G,{leftSide:e("credit"),children:p(Mh,{endpoint:Ae("/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"&&p(G,{leftSide:e("purchase_order"),children:p(Mh,{endpoint:Ae("/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 ion={email_statement:["template","next_run","frequency","remaining_cycles"],email_record:["template","next_run"],email_report:["template","next_run","frequency","remaining_cycles"]};function ron(n){const{template:e}=n;return t=>ion[e].includes(t)}function Uqe(n){const[e]=ve(),t=si(),i=Co(),r=qk(),{value:o,onValueChange:s,errorMessage:a}=n,l=w.useRef(void 0),[c,u]=w.useState(""),[d,h]=w.useState(!!o),[f,g]=w.useState(),{data:m,isLoading:v}=Ii({queryKey:["/api/v1/products","perPage=500","status=active",c],queryFn:()=>$e("GET",Ae("/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&&g(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],()=>$e("GET",Ae("/api/v1/products?per_page=:perPage&include=&status=active&filter=:filter",{filter:y,perPage:4})).then(E=>E.data.data),{staleTime:1/0});g(E=>{const x=E||[],k=x.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 k[0]?[...x,k[0]]:[...x]})}h(!1)})()},[o]);const _=b=>b.map(y=>y.value).join(",");return O(St,{children:[f&&!d?p(G,{leftSide:e("products"),children:O("div",{className:"flex space-x-3",children:[p("div",{className:"flex-1",children:p(_v,{id:"productItemSelector",placeholder:e("products"),...o&&{defaultValue:f==null?void 0:f.filter(b=>o.split(",").find(y=>y===b.value))},onChange:b=>s(_(b)),options:f,onInputChange:b=>{clearTimeout(l.current);const y=setTimeout(()=>u(b),600);l.current=y},isMulti:!0,styles:r,isSearchable:!0})}),v&&p("div",{className:"flex justify-center items-center",children:p(ds,{})})]})}):p("div",{className:"flex justify-center items-center",children:p(ds,{})}),a&&p(Fs,{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 oon(){const[n]=ve(),e=kg();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 son(){const[n]=ve(),e=kg();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 Ur=(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))(Ur||{});/**
* 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 aon={[Ur.ACH]:"payment_type_ACH",[Ur.ACSS]:"payment_type_ACSS",[Ur.ALIPAY]:"payment_type_Alipay",[Ur.AMERICAN_EXPRESS]:"payment_type_American Express",[Ur.BANCONTACT]:"bancontact",[Ur.BACS]:"payment_type_BACS",[Ur.BECS]:"becs",[Ur.BANK_TRANSFER]:"payment_type_Bank Transfer",[Ur.CARTE_BLANCHE]:"payment_type_Carte Blanche",[Ur.CASH]:"payment_type_Cash",[Ur.CASH_APP]:"payment_type_Cash App",[Ur.CHECK]:"payment_type_Check",[Ur.CREDIT]:"payment_type_Credit",[Ur.CREDIT_CARD_OTHER]:"payment_type_Credit Card Other",[Ur.CRYPTO]:"payment_type_Crypto",[Ur.DINERS]:"payment_type_Diners Card",[Ur.DIRECT_DEBIT]:"payment_type_direct_debit",[Ur.DISCOVER]:"payment_type_Discover Card",[Ur.EPS]:"eps",[Ur.EUROCARD]:"payment_type_EuroCard",[Ur.FPX]:"fpx",[Ur.GIROPAY]:"giropay",[Ur.GOCARDLESS]:"payment_type_GoCardless",[Ur.HOSTED_PAGE]:"payment_type_Hosted Page",[Ur.IDEAL]:"ideal",[Ur.IZETTLE]:"payment_type_iZettle",[Ur.INSTANT_BANK_PAY]:"instant_bank_pay",[Ur.INTERAC]:"payment_type_Interac E-Transfer",[Ur.JCB]:"payment_type_JCB",[Ur.KBC]:"kbc_cbc",[Ur.KLARNA]:"payment_type_Klarna",[Ur.LASER]:"payment_type_Laser",[Ur.MAESTRO]:"payment_type_Maestro",[Ur.MASTERCARD]:"payment_type_MasterCard",[Ur.MOLLIE_BANK_TRANSFER]:"payment_type_Bank Transfer",[Ur.NOVA]:"payment_type_Nova",[Ur.PAYPAL]:"payment_type_PayPal",[Ur.PRZELEWY24]:"przelewy24",[Ur.SEPA]:"payment_type_SEPA",[Ur.SOFORT]:"payment_type_Sofort",[Ur.SOLO]:"payment_type_Solo",[Ur.SWITCH]:"payment_type_Switch",[Ur.UNIONPAY]:"payment_type_UnionPay",[Ur.VENMO]:"payment_type_Venmo",[Ur.VISA]:"payment_type_Visa Card",[Ur.ZELLE]:"payment_type_Zelle"};function u3(n){const[e]=ve();return p("span",{className:zt({"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 lon=Ro(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 con=Ro(void 0);function uon(n){const[e]=ve(),{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=kg(),u=!!t,d=r||o||s;return l?p(_r,{variant:"red",children:e("deleted")}):a?p(_r,{variant:"orange",children:e("archived")}):u?p(_r,{variant:"dark-blue",style:{backgroundColor:c.$3},children:e("invoiced")}):i?p(_r,{variant:"light-blue",children:e("pending")}):d?p(_r,{variant:"green",style:{backgroundColor:c.$1},children:e("paid")}):p(_r,{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 cp(n){const[e]=ve(),t=Ti(),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()]?vW(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 okr(n){const e=hs();return Ii(At("/api/v1/expenses/create"),()=>$e("GET",Ae("/api/v1/expenses/create")).then(t=>t.data.data),{enabled:e("create_expense")?n.enabled??!0:!1,staleTime:1/0})}function skr(n){return Ii(["/api/v1/expenses",n.id],()=>$e("GET",Ae("/api/v1/expenses/:id?include=category",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function akr(n){return Ii(["/api/v1/expenses",n],()=>$e("GET",Ae("/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 don(){const n=Co(),e=Gi(Eu);return(t,i,r)=>{he.processing(),$e("POST",Ae("/api/v1/expenses/bulk"),{action:i,ids:t,...r}).then(()=>{he.success(`${i}d_expense`),e&&n.invalidateQueries([e]),In(["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 lkr(n){const{includeIsLocked:e}=n,t=e?"&is_locked=true":"";return Ii(["/api/v1/invoices",n.id],()=>$e("GET",Ae(`/api/v1/invoices/:id?include=client.group_settings${t}`,{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:!!n.id})}function IG(n){const e=hs();return Ii(["/api/v1/invoices/create"],()=>$e("GET",Ae("/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 hon={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 ckr(n){const e=Co(),t=Gi(Eu);return(i,r,o)=>{he.processing(),$e("POST",Ae("/api/v1/invoices/bulk"),{action:r,ids:i,...o&&{email_type:o}}).then(()=>{var a;const s=hon[r]||`${r}d_invoice`;he.success(s),(a=n==null?void 0:n.onSuccess)==null||a.call(n),In(["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 O1=Ro(void 0),ukr=Ro(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 vv=(n=>(n.Product="1",n.Task="2",n.UnpaidFee="3",n.PaidFee="4",n.LateFee="5",n.Expense="6",n))(vv||{});/**
* 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 P1=()=>({_id:Qq(),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:vv.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 jqe(n){const e=ki(),{data:t}=IG(),i=Wi(O1),{onlyAddToInvoice:r}=n||{},o=(a,l,c)=>a.calculate_tax_by_amount?a.uses_inclusive_taxes?Math.round(l/a.amount*100*1e3/10)/100:Math.round(l/a.amount*1e3/10)/1:c;return{create:a=>{var l,c,u,d,h;if(t){const f={...t};r||(f.date=(l=a[0])==null?void 0:l.date,f.client_id=(c=a[0])==null?void 0:c.client_id),f.uses_inclusive_taxes=(u=a[0])==null?void 0:u.uses_inclusive_taxes,f.project_id=(d=a[0])==null?void 0:d.project_id,f.vendor_id=(h=a[0])==null?void 0:h.vendor_id;const g=a.map(m=>{var v;return{...P1(),type_id:vv.Product,cost:(m==null?void 0:m.foreign_amount)>0?m.foreign_amount:m.amount,quantity:1,product_key:((v=m==null?void 0:m.category)==null?void 0:v.name)??"",notes:m.public_notes,line_total:Number(((m==null?void 0:m.foreign_amount)>0?m.foreign_amount:m.amount*1).toPrecision(2)),expense_id:m.id,tax_name1:m.tax_name1,tax_rate1:o(m,m.tax_amount1,m.tax_rate1),tax_name2:m.tax_name2,tax_rate2:o(m,m.tax_amount2,m.tax_rate2),tax_name3:m.tax_name3,tax_rate3:o(m,m.tax_amount3,m.tax_rate3)}});r?i(m=>m&&{...m,line_items:[...m.line_items,...g]}):(i({...f,line_items:g}),e(At("/invoices/create?table=products&action=invoice_expense",{})))}},calculatedTaxRate: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 tE(n){const{entity:e,editPageTabs:t}=n,i=ml(),o=il().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(f=>i.pathname.endsWith(`/${f}`)),u=s&&a&&(c||l),d=s&&a&&!l&&!c;return{isEditPage:u,isShowPage:d,isEditOrShowPage:u||d}}const fon=rl.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function pon(n){const[e]=ve(),{expenses:t,bulkAction:i}=n,r=ki(),o=ef(),s=hs(),a=xG(),{calculatedTaxRate:l}=jqe(),c=si(),u=Co(),d=Wi(O1),[h,f]=w.useState([]),[g,m]=w.useState(!1),[v,_]=w.useState(!1),b=()=>{if(i&&Ja(t).pluck("client_id").unique().toArray().length>1)return he.error("multiple_client_error");_(!0)},y=C=>{d(()=>C&&{...C,line_items:[...C.line_items,...t.map(E=>{var x;return{...P1(),type_id:vv.Product,cost:E.amount,quantity:1,product_key:((x=E==null?void 0:E.category)==null?void 0:x.name)??"",notes:E.public_notes,line_total:Number((E.amount*1).toPrecision(2)),expense_id:E.id,tax_name1:E.tax_name1,tax_rate1:l(E,E.tax_amount1,E.tax_rate1),tax_name2:E.tax_name2,tax_rate2:l(E,E.tax_amount2,E.tax_rate2),tax_name3:E.tax_name3,tax_rate3:l(E,E.tax_amount3,E.tax_rate3)}})]}),r(At("/invoices/:id/edit?action=invoice_expense",{id:C.id}))};return w.useEffect(()=>{var C;v&&(m(!0),u.fetchQuery(["/api/v1/invoices",`include=client&status_id=1,2,3&is_deleted=true&filter_deleted_clients=true&client_id=${(C=t[0])==null?void 0:C.client_id}`],()=>{var E;return $e("GET",Ae("/api/v1/invoices?include=client.group_settings&status_id=1,2,3&is_deleted=true&filter_deleted_clients=true&client_id=:clientId",{clientId:((E=t[0])==null?void 0:E.client_id)||""}))},{staleTime:1/0}).then(E=>{s("edit_invoice")?f(E.data.data):f(E.data.data.filter(x=>a(x)))}).finally(()=>m(!1))),v||f([])},[v]),O(St,{children:[O(Or,{title:e("action_add_to_invoice"),onClose:()=>_(!1),visible:v,children:[p("div",{className:"flex flex-col space-y-1",children:h.map(C=>{var E,x;return O(fon,{theme:{hoverColor:c.$5},onClick:()=>y(C),className:"flex items-center justify-between cursor-pointer rounded py-1 px-2",children:[p("p",{children:C==null?void 0:C.number}),p("p",{children:o(C.amount,(E=C.client)==null?void 0:E.country_id,(x=C.client)==null?void 0:x.settings.currency_id)})]},C.id)})}),g&&p("div",{className:"flex justify-center",children:p(ds,{})}),!g&&!h.length&&p("div",{className:"flex justify-center font-medium text-lg",children:e("no_invoices_found")})]}),p(gt,{onClick:b,icon:p(nt,{element:Nk}),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 gon(n){const{setErrors:e,isFormBusy:t,setIsFormBusy:i}=n;return r=>{t||(he.processing(),e==null||e(void 0),i==null||i(!0),$e("PUT",Ae("/api/v1/expenses/:id",{id:r.id}),r).then(()=>{he.success("updated_expense"),In(["expenses"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(e==null||e(o.response.data),he.dismiss())}).finally(()=>i==null?void 0:i(!1)))}}function mon(n){var y,C,E;const[e]=ve(),t=si(),i=hs(),r=FF(),{visible:o,isFormBusy:s,setIsFormBusy:a,expense:l,setVisible:c}=n,[u,d]=w.useState(!1),{data:h}=jve({status:["active"]}),f=gon({isFormBusy:s,setIsFormBusy:a}),{red:g,green:m,blue:v,hex:_}=DR(((y=l.category)==null?void 0:y.color)||""),b=MF(g,m,v)?-220:220;return O("div",{onClick:x=>x.stopPropagation(),children:[p(PF,{placement:"bottom",interactive:!0,render:()=>O("div",{className:"border box rounded-md shadow-lg focus:outline-none",style:{backgroundColor:t.$1,borderColor:t.$4,minWidth:"15rem",maxWidth:"20rem"},onClick:x=>x.stopPropagation(),children:[i("create_expense")&&p(gt,{className:"font-medium text-center py-3",onClick:()=>{d(!0),c(!1)},cypressRef:"newExpenseCategoryAction",children:e("new_expense_category")}),p("div",{className:"flex flex-col max-h-80 overflow-y-auto",children:h==null?void 0:h.map((x,k)=>x.id!==l.category_id&&p(gt,{onClick:()=>{c(!1),f({...l,category_id:x.id})},children:x.name},k))})]}),visible:o,children:p("div",{className:"cursor-pointer","data-cy":"expenseCategoryBadge",children:p(u3,{for:{},code:((C=l.category)==null?void 0:C.name)||e("uncategorized"),style:{color:r(_,b),backgroundColor:((E=l.category)==null?void 0:E.color)||""},onClick:()=>!s&&c(x=>!x)})})}),p(Dqe,{visible:u,setVisible:d,onCreatedCategory:x=>f({...l,category_id:x.id})})]})}function _on(n){const e=w.useRef(null),{expense:t}=n,[i,r]=w.useState(!1),[o,s]=w.useState(!1);return m1(e,()=>{i&&r(!1)}),p("div",{ref:e,children:p(mon,{visible:i,isFormBusy:o,setIsFormBusy:s,expense:t,setVisible:r})})}function Jve({apiEndpoint:n,entityId:e,cacheEndpoint:t,component:i,preCheck:r,componentCallbackFn:o}){const s=Va(),a=Co(),[l,c]=w.useState(r??!1),[u,d]=w.useState();return w.useEffect(()=>{s&&e&&!l&&(async()=>{const h=await a.fetchQuery([t,e],()=>$e("GET",Ae(n,{id:e})).then(f=>f.data.data),{staleTime:1/0});h&&(h.user_id===s.id||h.assigned_user_id===s.id)&&(o&&d(h),c(!0))})()},[]),o&&l&&u?p(St,{children:o(u)}):l?p(St,{children:i}):p(St,{})}/**
* 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 nE(){const n=hs(),e=xG();return(t,i)=>!n(`view_${t}`)&&!n(`edit_${t}`)&&!e(i)}function Rf(n){const e=Ss(),{renderSpan:t}=n;return t?p("span",{className:n.className,children:n.children}):p(k1,{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 Gk(){const[n]=ve(),e=Ti(),{dateFormat:t}=sc(),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])===BC.Date&&o)return xo(o,t);if((s==null?void 0:s.split("|")[1])===BC.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 von(){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:qqe,setPrototypeOf:EDe,isFrozen:bon,getPrototypeOf:yon,getOwnPropertyDescriptor:Con}=Object;let{freeze:Yh,seal:Vm,create:Gqe}=Object,{apply:mae,construct:_ae}=typeof Reflect<"u"&&Reflect;Yh||(Yh=function(e){return e});Vm||(Vm=function(e){return e});mae||(mae=function(e,t,i){return e.apply(t,i)});_ae||(_ae=function(e,t){return new e(...t)});const u9=Jf(Array.prototype.forEach),xDe=Jf(Array.prototype.pop),pO=Jf(Array.prototype.push),O$=Jf(String.prototype.toLowerCase),lee=Jf(String.prototype.toString),TDe=Jf(String.prototype.match),gO=Jf(String.prototype.replace),won=Jf(String.prototype.indexOf),Son=Jf(String.prototype.trim),S_=Jf(Object.prototype.hasOwnProperty),Th=Jf(RegExp.prototype.test),mO=Eon(TypeError),kDe=Jf(Number.isNaN);function Jf(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 mae(n,e,i)}}function Eon(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return _ae(n,t)}}function Wo(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:O$;EDe&&EDe(n,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const o=t(r);o!==r&&(bon(e)||(e[i]=o),r=o)}n[r]=!0}return n}function xon(n){for(let e=0;e<n.length;e++)S_(n,e)||(n[e]=null);return n}function nx(n){const e=Gqe(null);for(const[t,i]of qqe(n))S_(n,t)&&(Array.isArray(i)?e[t]=xon(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=nx(i):e[t]=i);return e}function d9(n,e){for(;n!==null;){const i=Con(n,e);if(i){if(i.get)return Jf(i.get);if(typeof i.value=="function")return Jf(i.value)}n=yon(n)}function t(){return null}return t}const IDe=Yh(["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"]),cee=Yh(["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"]),uee=Yh(["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"]),Ton=Yh(["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"]),dee=Yh(["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"]),kon=Yh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),LDe=Yh(["#text"]),DDe=Yh(["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"]),hee=Yh(["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"]),ADe=Yh(["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"]),h9=Yh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ion=Vm(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Lon=Vm(/<%[\w\W]*|[\w\W]*%>/gm),Don=Vm(/\${[\w\W]*}/gm),Aon=Vm(/^data-[\-\w.\u00B7-\uFFFF]/),Ron=Vm(/^aria-[\-\w]+$/),Kqe=Vm(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Non=Vm(/^(?:\w+script|data):/i),Oon=Vm(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yqe=Vm(/^html$/i),Pon=Vm(/^[a-z][.\w]*(-[.\w]+)+$/i);var RDe=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ion,ERB_EXPR:Lon,TMPLIT_EXPR:Don,DATA_ATTR:Aon,ARIA_ATTR:Ron,IS_ALLOWED_URI:Kqe,IS_SCRIPT_OR_DATA:Non,ATTR_WHITESPACE:Oon,DOCTYPE_NAME:Yqe,CUSTOM_ELEMENT:Pon});const ME={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Mon=function(){return typeof window>"u"?null:window},Fon=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 Qqe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Mon();const e=ze=>Qqe(ze);if(e.version="3.1.3",e.removed=[],!n||!n.document||n.document.nodeType!==ME.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:f}=n,g=l.prototype,m=d9(g,"cloneNode"),v=d9(g,"nextSibling"),_=d9(g,"childNodes"),b=d9(g,"parentNode");if(typeof s=="function"){const ze=t.createElement("template");ze.content&&ze.content.ownerDocument&&(t=ze.content.ownerDocument)}let y,C="";const{implementation:E,createNodeIterator:x,createDocumentFragment:k,getElementsByTagName:L}=t,{importNode:D}=i;let A={};e.isSupported=typeof qqe=="function"&&typeof b=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:N,ERB_EXPR:P,TMPLIT_EXPR:M,DATA_ATTR:B,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:H,CUSTOM_ELEMENT:W}=RDe;let{IS_ALLOWED_URI:q}=RDe,V=null;const re=Wo({},[...IDe,...cee,...uee,...dee,...LDe]);let oe=null;const Q=Wo({},[...DDe,...hee,...ADe,...h9]);let Ne=Object.seal(Gqe(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}})),Ve=null,Ye=null,ye=!0,He=!0,Pe=!1,Ge=!0,Fe=!1,bt=!0,Mt=!1,Ft=!1,Yt=!1,ln=!1,Et=!1,mt=!1,Lt=!0,be=!1;const Te="user-content-";let se=!0,Y=!1,X={},le=null;const te=Wo({},["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 me=null;const Me=Wo({},["audio","video","img","source","image","track"]);let rt=null;const It=Wo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Qt="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml";let ne=We,Se=!1,Ie=null;const Ke=Wo({},[Qt,pe,We],lee);let Je=null;const ot=["application/xhtml+xml","text/html"],wt="text/html";let pn=null,Kn=null;const Cn=255,hn=t.createElement("form"),bn=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},Wn=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Kn&&Kn===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=nx(Ee),Je=ot.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?wt:Ee.PARSER_MEDIA_TYPE,pn=Je==="application/xhtml+xml"?lee:O$,V=S_(Ee,"ALLOWED_TAGS")?Wo({},Ee.ALLOWED_TAGS,pn):re,oe=S_(Ee,"ALLOWED_ATTR")?Wo({},Ee.ALLOWED_ATTR,pn):Q,Ie=S_(Ee,"ALLOWED_NAMESPACES")?Wo({},Ee.ALLOWED_NAMESPACES,lee):Ke,rt=S_(Ee,"ADD_URI_SAFE_ATTR")?Wo(nx(It),Ee.ADD_URI_SAFE_ATTR,pn):It,me=S_(Ee,"ADD_DATA_URI_TAGS")?Wo(nx(Me),Ee.ADD_DATA_URI_TAGS,pn):Me,le=S_(Ee,"FORBID_CONTENTS")?Wo({},Ee.FORBID_CONTENTS,pn):te,Ve=S_(Ee,"FORBID_TAGS")?Wo({},Ee.FORBID_TAGS,pn):{},Ye=S_(Ee,"FORBID_ATTR")?Wo({},Ee.FORBID_ATTR,pn):{},X=S_(Ee,"USE_PROFILES")?Ee.USE_PROFILES:!1,ye=Ee.ALLOW_ARIA_ATTR!==!1,He=Ee.ALLOW_DATA_ATTR!==!1,Pe=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,Ge=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fe=Ee.SAFE_FOR_TEMPLATES||!1,bt=Ee.SAFE_FOR_XML!==!1,Mt=Ee.WHOLE_DOCUMENT||!1,ln=Ee.RETURN_DOM||!1,Et=Ee.RETURN_DOM_FRAGMENT||!1,mt=Ee.RETURN_TRUSTED_TYPE||!1,Yt=Ee.FORCE_BODY||!1,Lt=Ee.SANITIZE_DOM!==!1,be=Ee.SANITIZE_NAMED_PROPS||!1,se=Ee.KEEP_CONTENT!==!1,Y=Ee.IN_PLACE||!1,q=Ee.ALLOWED_URI_REGEXP||Kqe,ne=Ee.NAMESPACE||We,Ne=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&bn(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&bn(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ne.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ne.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fe&&(He=!1),Et&&(ln=!0),X&&(V=Wo({},LDe),oe=[],X.html===!0&&(Wo(V,IDe),Wo(oe,DDe)),X.svg===!0&&(Wo(V,cee),Wo(oe,hee),Wo(oe,h9)),X.svgFilters===!0&&(Wo(V,uee),Wo(oe,hee),Wo(oe,h9)),X.mathMl===!0&&(Wo(V,dee),Wo(oe,ADe),Wo(oe,h9))),Ee.ADD_TAGS&&(V===re&&(V=nx(V)),Wo(V,Ee.ADD_TAGS,pn)),Ee.ADD_ATTR&&(oe===Q&&(oe=nx(oe)),Wo(oe,Ee.ADD_ATTR,pn)),Ee.ADD_URI_SAFE_ATTR&&Wo(rt,Ee.ADD_URI_SAFE_ATTR,pn),Ee.FORBID_CONTENTS&&(le===te&&(le=nx(le)),Wo(le,Ee.FORBID_CONTENTS,pn)),se&&(V["#text"]=!0),Mt&&Wo(V,["html","head","body"]),V.table&&(Wo(V,["tbody"]),delete Ve.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw mO('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mO('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=Ee.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=Fon(f,r)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));Yh&&Yh(Ee),Kn=Ee}},Ei=Wo({},["mi","mo","mn","ms","mtext"]),er=Wo({},["foreignobject","annotation-xml"]),ur=Wo({},["title","style","font","a","script"]),Jr=Wo({},[...cee,...uee,...Ton]),$i=Wo({},[...dee,...kon]),xs=function(Ee){let tt=b(Ee);(!tt||!tt.tagName)&&(tt={namespaceURI:ne,tagName:"template"});const xt=O$(Ee.tagName),lt=O$(tt.tagName);return Ie[Ee.namespaceURI]?Ee.namespaceURI===pe?tt.namespaceURI===We?xt==="svg":tt.namespaceURI===Qt?xt==="svg"&&(lt==="annotation-xml"||Ei[lt]):!!Jr[xt]:Ee.namespaceURI===Qt?tt.namespaceURI===We?xt==="math":tt.namespaceURI===pe?xt==="math"&&er[lt]:!!$i[xt]:Ee.namespaceURI===We?tt.namespaceURI===pe&&!er[lt]||tt.namespaceURI===Qt&&!Ei[lt]?!1:!$i[xt]&&(ur[xt]||!Jr[xt]):!!(Je==="application/xhtml+xml"&&Ie[Ee.namespaceURI]):!1},wr=function(Ee){pO(e.removed,{element:Ee});try{Ee.parentNode.removeChild(Ee)}catch{Ee.remove()}},Ji=function(Ee,tt){try{pO(e.removed,{attribute:tt.getAttributeNode(Ee),from:tt})}catch{pO(e.removed,{attribute:null,from:tt})}if(tt.removeAttribute(Ee),Ee==="is"&&!oe[Ee])if(ln||Et)try{wr(tt)}catch{}else try{tt.setAttribute(Ee,"")}catch{}},rn=function(Ee){let tt=null,xt=null;if(Yt)Ee="<remove></remove>"+Ee;else{const Ln=TDe(Ee,/^[\r\n\t ]+/);xt=Ln&&Ln[0]}Je==="application/xhtml+xml"&&ne===We&&(Ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ee+"</body></html>");const lt=y?y.createHTML(Ee):Ee;if(ne===We)try{tt=new h().parseFromString(lt,Je)}catch{}if(!tt||!tt.documentElement){tt=E.createDocument(ne,"template",null);try{tt.documentElement.innerHTML=Se?C:lt}catch{}}const gn=tt.body||tt.documentElement;return Ee&&xt&&gn.insertBefore(t.createTextNode(xt),gn.childNodes[0]||null),ne===We?L.call(tt,Mt?"html":"body")[0]:Mt?tt.documentElement:gn},di=function(Ee){return x.call(Ee.ownerDocument||Ee,Ee,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Wr=function(Ee){return Ee instanceof d&&(typeof Ee.__depth<"u"&&typeof Ee.__depth!="number"||typeof Ee.__removalCount<"u"&&typeof Ee.__removalCount!="number"||typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof u)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},Qe=function(Ee){return typeof a=="function"&&Ee instanceof a},Ct=function(Ee,tt,xt){A[Ee]&&u9(A[Ee],lt=>{lt.call(e,tt,xt,Kn)})},Gt=function(Ee){let tt=null;if(Ct("beforeSanitizeElements",Ee,null),Wr(Ee))return wr(Ee),!0;const xt=pn(Ee.nodeName);if(Ct("uponSanitizeElement",Ee,{tagName:xt,allowedTags:V}),Ee.hasChildNodes()&&!Qe(Ee.firstElementChild)&&Th(/<[/\w]/g,Ee.innerHTML)&&Th(/<[/\w]/g,Ee.textContent)||Ee.nodeType===ME.progressingInstruction||bt&&Ee.nodeType===ME.comment&&Th(/<[/\w]/g,Ee.data))return wr(Ee),!0;if(!V[xt]||Ve[xt]){if(!Ve[xt]&&ut(xt)&&(Ne.tagNameCheck instanceof RegExp&&Th(Ne.tagNameCheck,xt)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(xt)))return!1;if(se&&!le[xt]){const lt=b(Ee)||Ee.parentNode,gn=_(Ee)||Ee.childNodes;if(gn&&lt){const Ln=gn.length;for(let ri=Ln-1;ri>=0;--ri){const mi=m(gn[ri],!0);mi.__removalCount=(Ee.__removalCount||0)+1,lt.insertBefore(mi,v(Ee))}}}return wr(Ee),!0}return Ee instanceof l&&!xs(Ee)||(xt==="noscript"||xt==="noembed"||xt==="noframes")&&Th(/<\/no(script|embed|frames)/i,Ee.innerHTML)?(wr(Ee),!0):(Fe&&Ee.nodeType===ME.text&&(tt=Ee.textContent,u9([N,P,M],lt=>{tt=gO(tt,lt," ")}),Ee.textContent!==tt&&(pO(e.removed,{element:Ee.cloneNode()}),Ee.textContent=tt)),Ct("afterSanitizeElements",Ee,null),!1)},Jt=function(Ee,tt,xt){if(Lt&&(tt==="id"||tt==="name")&&(xt in t||xt in hn||xt==="__depth"||xt==="__removalCount"))return!1;if(!(He&&!Ye[tt]&&Th(B,tt))){if(!(ye&&Th(F,tt))){if(!oe[tt]||Ye[tt]){if(!(ut(Ee)&&(Ne.tagNameCheck instanceof RegExp&&Th(Ne.tagNameCheck,Ee)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(Ee))&&(Ne.attributeNameCheck instanceof RegExp&&Th(Ne.attributeNameCheck,tt)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(tt))||tt==="is"&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&Th(Ne.tagNameCheck,xt)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(xt))))return!1}else if(!rt[tt]){if(!Th(q,gO(xt,H,""))){if(!((tt==="src"||tt==="xlink:href"||tt==="href")&&Ee!=="script"&&won(xt,"data:")===0&&me[Ee])){if(!(Pe&&!Th(U,gO(xt,H,"")))){if(xt)return!1}}}}}}return!0},ut=function(Ee){return Ee!=="annotation-xml"&&TDe(Ee,W)},Le=function(Ee){Ct("beforeSanitizeAttributes",Ee,null);const{attributes:tt}=Ee;if(!tt)return;const xt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe};let lt=tt.length;for(;lt--;){const gn=tt[lt],{name:Ln,namespaceURI:ri,value:mi}=gn,Vi=pn(Ln);let qn=Ln==="value"?mi:Son(mi);if(xt.attrName=Vi,xt.attrValue=qn,xt.keepAttr=!0,xt.forceKeepAttr=void 0,Ct("uponSanitizeAttribute",Ee,xt),qn=xt.attrValue,xt.forceKeepAttr||(Ji(Ln,Ee),!xt.keepAttr))continue;if(!Ge&&Th(/\/>/i,qn)){Ji(Ln,Ee);continue}if(bt&&Th(/((--!?|])>)|<\/(style|title)/i,qn)){Ji(Ln,Ee);continue}Fe&&u9([N,P,M],oi=>{qn=gO(qn,oi," ")});const mn=pn(Ee.nodeName);if(Jt(mn,Vi,qn)){if(be&&(Vi==="id"||Vi==="name")&&(Ji(Ln,Ee),qn=Te+qn),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ri)switch(f.getAttributeType(mn,Vi)){case"TrustedHTML":{qn=y.createHTML(qn);break}case"TrustedScriptURL":{qn=y.createScriptURL(qn);break}}try{ri?Ee.setAttributeNS(ri,Ln,qn):Ee.setAttribute(Ln,qn),Wr(Ee)?wr(Ee):xDe(e.removed)}catch{}}}Ct("afterSanitizeAttributes",Ee,null)},st=function ze(Ee){let tt=null;const xt=di(Ee);for(Ct("beforeSanitizeShadowDOM",Ee,null);tt=xt.nextNode();){if(Ct("uponSanitizeShadowNode",tt,null),Gt(tt))continue;const lt=b(tt);tt.nodeType===ME.element&&(lt&&lt.__depth?tt.__depth=(tt.__removalCount||0)+lt.__depth+1:tt.__depth=1),(tt.__depth>=Cn||tt.__depth<0||kDe(tt.__depth))&&wr(tt),tt.content instanceof o&&(tt.content.__depth=tt.__depth,ze(tt.content)),Le(tt)}Ct("afterSanitizeShadowDOM",Ee,null)};return e.sanitize=function(ze){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=null,xt=null,lt=null,gn=null;if(Se=!ze,Se&&(ze="<!-->"),typeof ze!="string"&&!Qe(ze))if(typeof ze.toString=="function"){if(ze=ze.toString(),typeof ze!="string")throw mO("dirty is not a string, aborting")}else throw mO("toString is not a function");if(!e.isSupported)return ze;if(Ft||Wn(Ee),e.removed=[],typeof ze=="string"&&(Y=!1),Y){if(ze.nodeName){const mi=pn(ze.nodeName);if(!V[mi]||Ve[mi])throw mO("root node is forbidden and cannot be sanitized in-place")}}else if(ze instanceof a)tt=rn("<!---->"),xt=tt.ownerDocument.importNode(ze,!0),xt.nodeType===ME.element&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?tt=xt:tt.appendChild(xt);else{if(!ln&&!Fe&&!Mt&&ze.indexOf("<")===-1)return y&&mt?y.createHTML(ze):ze;if(tt=rn(ze),!tt)return ln?null:mt?C:""}tt&&Yt&&wr(tt.firstChild);const Ln=di(Y?ze:tt);for(;lt=Ln.nextNode();){if(Gt(lt))continue;const mi=b(lt);lt.nodeType===ME.element&&(mi&&mi.__depth?lt.__depth=(lt.__removalCount||0)+mi.__depth+1:lt.__depth=1),(lt.__depth>=Cn||lt.__depth<0||kDe(lt.__depth))&&wr(lt),lt.content instanceof o&&(lt.content.__depth=lt.__depth,st(lt.content)),Le(lt)}if(Y)return ze;if(ln){if(Et)for(gn=k.call(tt.ownerDocument);tt.firstChild;)gn.appendChild(tt.firstChild);else gn=tt;return(oe.shadowroot||oe.shadowrootmode)&&(gn=D.call(i,gn,!0)),gn}let ri=Mt?tt.outerHTML:tt.innerHTML;return Mt&&V["!doctype"]&&tt.ownerDocument&&tt.ownerDocument.doctype&&tt.ownerDocument.doctype.name&&Th(Yqe,tt.ownerDocument.doctype.name)&&(ri="<!DOCTYPE "+tt.ownerDocument.doctype.name+`>
`+ri),Fe&&u9([N,P,M],mi=>{ri=gO(ri,mi," ")}),y&&mt?y.createHTML(ri):ri},e.setConfig=function(){let ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wn(ze),Ft=!0},e.clearConfig=function(){Kn=null,Ft=!1},e.isValidAttribute=function(ze,Ee,tt){Kn||Wn({});const xt=pn(ze),lt=pn(Ee);return Jt(xt,lt,tt)},e.addHook=function(ze,Ee){typeof Ee=="function"&&(A[ze]=A[ze]||[],pO(A[ze],Ee))},e.removeHook=function(ze){if(A[ze])return xDe(A[ze])},e.removeHooks=function(ze){A[ze]&&(A[ze]=[])},e.removeAllHooks=function(){A={}},e}var Bon=Qqe();/**
* 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 i0(n){return new DOMParser().parseFromString(n,"text/html").documentElement.textContent||""}function Xc(n){return Bon.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 UR(){const n=XS(),e=Ti();return t=>{const i=n(e==null?void 0:e.settings.currency_id);return i?bve.formatValue(isNaN(Number(t))?0:t,i):t}}function dkr(){const[n]=ve(),e=hs(),t=ki(),i=don(),r=Wi(con),o=Wi(lon),{isEditPage:s}=tE({entity:"expense",editPageTabs:["documents"]}),{create:a}=jqe(),l=d=>{r({...d,id:"",documents:[],number:"",date:Un().format("YYYY-MM-DD")}),t("/expenses/create?action=clone")},c=d=>{o({...d,id:"",documents:[],number:"",date:Un().format("YYYY-MM-DD")}),t("/recurring_expenses/create?action=clone")};return[d=>d.should_be_invoiced===!0&&d.invoice_id.length===0&&e("create_invoice")&&p(gt,{onClick:()=>a([d]),icon:p(nt,{element:Nk}),children:n("invoice_expense")}),d=>d.should_be_invoiced===!0&&d.invoice_id.length===0&&p(pon,{expenses:[d]}),d=>e("create_expense")&&p(gt,{onClick:()=>l(d),icon:p(nt,{element:t0}),children:n("clone")}),d=>e("create_recurring_expense")&&p(gt,{onClick:()=>c(d),icon:p(nt,{element:t0}),children:n("clone_to_recurring")}),()=>s&&p(vi,{withoutPadding:!0}),d=>Tr(d)===nr.Active&&s&&p(gt,{onClick:()=>i([d.id],"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),d=>(Tr(d)===nr.Archived||Tr(d)===nr.Deleted)&&s&&p(gt,{onClick:()=>i([d.id],"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),d=>(Tr(d)===nr.Active||Tr(d)===nr.Archived)&&s&&p(gt,{onClick:()=>i([d.id],"delete"),icon:p(nt,{element:el}),children:n("delete")})]}const $on=["status","number","client","vendor","date","amount","public_notes"];function Von(){const[n,e,t,i]=cp({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 hkr(){var v;const{t:n}=ve(),{dateFormat:e}=sc(),t=UR(),i=hs(),r=nE(),o=ki(),s=ef(),a=_l(),l=Gk(),c=von();Von();const[u,d,h,f]=cp({entity:"expense"}),g=[{column:"category",id:"category_id",label:n("category"),format:(_,b)=>b&&p(_on,{expense:b})},{column:"status",id:"id",label:n("status"),format:(_,b)=>O("div",{className:"flex items-center space-x-2",children:[p(Rf,{to:At("/expenses/:id/edit",{id:b.id}),renderSpan:r("expense",b),children:p("span",{className:"inline-flex items-center space-x-4",children:p(uon,{entity:b})})}),b.invoice_id&&p(Jve,{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:p(nt,{element:Nk,size:19,onClick:()=>o(At("/invoices/:id/edit",{id:b.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(_,b)=>p(Rf,{to:At("/expenses/:id/edit",{id:b.id}),renderSpan:r("expense",b),children:_})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(_,b)=>b.vendor&&p(Rf,{to:At("/vendors/:id",{id:_.toString()}),renderSpan:r("vendor",b.vendor),children:b.vendor.name})},{column:"client",id:"client_id",label:n("client"),format:(_,b)=>b.client&&p(Rf,{to:At("/clients/:id",{id:_.toString()}),renderSpan:r("client",b.client),children:b.client.display_name})},{column:"date",id:"date",label:n("date"),format:_=>xo(_,e)},{column:"amount",id:"amount",label:n("amount"),format:(_,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:_=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(_)}})}),children:p("span",{children:i0(Xc(_)).slice(0,50)})})},{column:"entity_state",id:"id",label:n("entity_state"),format:(_,b)=>p($m,{entity:b})},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:_=>xo(_,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:_=>xo(_,e)},{column:u,id:"custom_value1",label:u,format:_=>l("expense1",_==null?void 0:_.toString())},{column:d,id:"custom_value2",label:d,format:_=>l("expense2",_==null?void 0:_.toString())},{column:h,id:"custom_value3",label:h,format:_=>l("expense3",_==null?void 0:_.toString())},{column:f,id:"custom_value4",label:f,format:_=>l("expense4",_==null?void 0:_.toString())},{column:"documents",id:"documents",label:n("documents"),format:(_,b)=>b.documents.length},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:_=>t(_)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(_,b)=>b.is_deleted?n("yes"):n("no")},{column:"net_amount",id:"amount",label:n("net_amount"),format:(_,b)=>{var y,C;return s(_,(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:_=>xo(_,e)},{column:"payment_type",id:"payment_type_id",label:n("payment_type"),format:_=>p(u3,{for:aon,code:_,headless:!0})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:_=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(_)}})}),children:p("span",{children:i0(Xc(_)).slice(0,50)})})},{column:"should_be_invoiced",id:"should_be_invoiced",label:n("should_be_invoiced"),format:(_,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:_=>t(_)},{column:"tax_rate2",id:"tax_rate2",label:n("tax_rate2"),format:_=>t(_)},{column:"tax_rate3",id:"tax_rate3",label:n("tax_rate3"),format:_=>t(_)},{column:"transaction_reference",id:"transaction_reference",label:n("transaction_reference")},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:_=>xo(_,e)}],m=((v=a==null?void 0:a.react_table_columns)==null?void 0:v.expense)||$on;return g.filter(_=>m.includes(_.column)).sort((_,b)=>m.indexOf(_.column)-m.indexOf(b.column))}function fkr(n){const{setExpense:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function Hon(){const[n]=ve(),e=kg(),t=FF(),{data:i}=jve({status:["active"],perPage:500}),r=[{label:n("logged"),value:"logged",color:"white",backgroundColor:"#6B7280",dropdownKey:"0"},{label:n("pending"),value:"pending",color:"white",backgroundColor:"#93C5FD",dropdownKey:"0"},{label:n("invoiced"),value:"invoiced",color:"white",backgroundColor:e.$3||"#1D4ED8",dropdownKey:"0"},{label:n("paid"),value:"paid",color:"white",backgroundColor:e.$1||"#22C55E",dropdownKey:"0"},{label:n("unpaid"),value:"unpaid",color:"white",backgroundColor:e.$4||"#e6b05c",dropdownKey:"0"},{label:n("uncategorized"),value:"uncategorized",color:"white",backgroundColor:"#b5812c",dropdownKey:"0"}];return i==null||i.forEach(o=>{const{red:s,green:a,blue:l,hex:c}=DR(o.color||""),u=MF(s,a,l)?-220:220;r.push({value:o.id,label:o.name,color:t(c,u),backgroundColor:o.color||"",queryKey:"categories",dropdownKey:"1",placeHolder:"expense_categories"})}),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
*/var ew=(n=>(n.Viewed="-1",n.Draft="1",n.Sent="2",n.Accepted="3",n.Received="4",n.Cancelled="5",n))(ew||{});/**
* 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 Won(n){return e=>{if(e.invitations.length!==0){if(e.invitations.length>0&&n.resourceType==="purchase_order")return Ae("/vendor/purchase_order/:invitation/download",{resource:n.resourceType,invitation:e.invitations[0].key});if(e.invitations.length>0)return Ae("/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 Xqe(n){const e=Co(),t=Won({resourceType:n.resource});return i=>{const r=t(i);r&&(he.processing(),e.fetchQuery(r,()=>$e("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),he.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 LG=Ro(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 zon(n){return n.invitations.length>0?`${n.invitations[0].link}?silent=true`:null}function Zqe(n){var t;const e=zon(n);e&&((t=window.open(e,"_blank"))==null||t.focus())}function Uon(n){const[e]=ve(),{status_id:t,archived_at:i,is_deleted:r,invitations:o}=n.entity,s=kg(),a=()=>o.some(f=>f.viewed_date),l=t===ew.Draft,c=!l,u=a(),d=t===ew.Cancelled,h=t===ew.Accepted;return r?p(_r,{variant:"red",children:e("deleted")}):i?p(_r,{variant:"orange",children:e("archived")}):d?p(_r,{variant:"black",style:{backgroundColor:s.$5},children:e("cancelled")}):t===ew.Received?p(_r,{variant:"green",style:{backgroundColor:s.$3},children:e("received")}):h?p(_r,{variant:"dark-blue",style:{backgroundColor:s.$2},children:e("accepted")}):c?p(_r,{variant:"light-blue",style:{backgroundColor:s.$1},children:e("sent")}):l?p(_r,{variant:"generic",children:e("draft")}):u&&!d&&!h?p(_r,{variant:"yellow",style:{backgroundColor:s.$4},children:e("viewed")}):p(St,{})}/**
* 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 Jqe(){const{isAdmin:n,isOwner:e}=Fo();return Ii(["/api/v1/task_schedulers","create"],()=>$e("GET",Ae("/api/v1/task_schedulers/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function jon(n){const{isAdmin:e,isOwner:t}=Fo();return Ii(["/api/v1/task_schedulers",n.id],()=>$e("GET",Ae("/api/v1/task_schedulers/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function qon(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/task_schedulers/bulk"),{action:e,ids:n}).then(()=>{he.success(`${e}d_schedule`),In(["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 d3={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 eGe(n){const{data:e}=Jqe();return(t,i)=>{const{setErrors:r,setSchedule:o}=n;r(void 0);const s=An.cloneDeep(n.schedule);t==="template"&&e?o(()=>({...e,template:i,frequency_id:Qd.Monthly,remaining_cycles:-1,parameters:{...d3}})):t==="parameters.report_name"&&e?o(a=>a&&{...a,parameters:{...d3,report_name:i}}):(t==="parameters.entity"&&o(An.set(s,"parameters.entity_id","")),o(An.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 tGe({entity:n}){const e=ki(),t=Wi(kG);return i=>{t({...d3,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 nGe=({entity:n})=>{const e=Co(),t=i=>new Promise(r=>{const o=()=>{i.removeEventListener("load",o),r()};document.body.appendChild(i),i.addEventListener("load",o)});return i=>{i.length&&(he.processing(),e.fetchQuery([`/api/v1/${n}s/bulk`],()=>$e("POST",Ae(`/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()),he.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 Gon={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 iGe(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 rGe(n){const{property:e}=iGe(n);return Gon[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 DG(){const n=Co();return{find:t=>n.fetchQuery({queryKey:["/api/v1/clients",t],queryFn:()=>$e("GET",Ae("/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 Kon(n){const e=Ti(),t=XS(),i=DG(),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),f=t(e.settings.currency_id);h&&f&&(l.cost=c*(h.exchange_rate/f.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 oGe(){const n=Co();return{find:t=>n.fetchQuery(["/api/v1/vendors",t],()=>$e("GET",Ae("/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 sGe(){const n=ph();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 Yon(){const n=ph();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 Qon(n){const e=Ti(),t=sGe(),i=Yon(),r=oGe(),o=DG(),[s,a]=w.useState(""),[l,c]=w.useState(""),{resource:u,relationType:d}=n,[h,f]=w.useState(),[g,m]=w.useState(),[v,_]=w.useState();return w.useEffect(()=>{s&&d==="client_id"&&o.find(s).then(b=>_(b)),l&&d==="vendor_id"&&r.find(l).then(b=>_(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=v;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=>f(y))}if(d==="vendor_id"){const b=v;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=>f(y))}},[v]),b=>g&&h?bve.formatMoney(isNaN(Number(b))?0:b,g,h):b}/**
* 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 AG(n){const e=Ti(),t=DG(),i=oGe(),r=sGe(),o=$R();return async(s,a)=>{var c;let l;return s.length>=1&&a==="client_id"?await t.find(s).then(async u=>{var d;await r.find(u.settings.currency_id||((d=e.settings)==null?void 0:d.currency_id)).then(h=>{const f=o(e.settings.country_id),g={thousandSeparator:(f==null?void 0:f.thousand_separator)||(h==null?void 0:h.thousand_separator)||",",decimalSeparator:(f==null?void 0:f.decimal_separator)||(h==null?void 0:h.decimal_separator)||".",precision:(h==null?void 0:h.precision)||2};n?n(g):l=g})}):s.length>=1&&a==="vendor_id"?await i.find(s).then(async u=>{var d;await r.find(u.currency_id||((d=e.settings)==null?void 0:d.currency_id)).then(h=>{const f=o(e.settings.country_id),g={thousandSeparator:(f==null?void 0:f.thousand_separator)||(h==null?void 0:h.thousand_separator)||",",decimalSeparator:(f==null?void 0:f.decimal_separator)||(h==null?void 0:h.decimal_separator)||".",precision:(h==null?void 0:h.precision)||2};n?n(g):l=g})}):await r.find((c=e.settings)==null?void 0:c.currency_id).then(u=>{const d=o(e.settings.country_id),h={thousandSeparator:(d==null?void 0:d.thousand_separator)||(u==null?void 0:u.thousand_separator)||",",decimalSeparator:(d==null?void 0:d.decimal_separator)||(u==null?void 0:u.decimal_separator)||".",precision:(u==null?void 0:u.precision)||2};n?n(h):l=h}),l}}function Xon(n){var o,s;const[e,t]=w.useState(),[i]=ve(),r=Gm({initialValues:{name:"",rate:""},onSubmit:a=>{t(void 0),$e("POST",Ae("/api/v1/tax_rates"),a).then(l=>{he.success("created_tax_rate"),n.onClose(!1),In(["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),he.dismiss())}).finally(()=>r.setSubmitting(!1))}});return O(Or,{title:i("create_tax_rate"),visible:n.isVisible,onClose:n.onClose,children:[p(Ze,{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}),p(Ze,{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}),p(un,{behavior:"button",type:"primary",onClick:()=>{r.submitForm()},children:i("save")})]})}function Aw(n){const[e]=ve(),[t,i]=w.useState(!1),{isAdmin:r,isOwner:o}=Fo(),{resourceTaxName:s,resourceTaxRate:a}=n;return O(St,{children:[p(Mh,{inputOptions:{value:n.defaultValue??null},endpoint:Ae("/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}),p(Xon,{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 Zon=Ro(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 jR(){const n=_l();return n!=null&&n.number_precision&&(n==null?void 0:n.number_precision)>0&&(n==null?void 0:n.number_precision)<=100?n.number_precision:2}/**
* 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 Jon=n=>{const{onlyAddToInvoice:e}=n||{},t=ki(),i=Ti(),r=jR(),{data:o}=IG(),s=Wi(O1);return a=>{if(o){const l=a.map(c=>({...P1(),type_id:vv.Product,product_key:c.product_key,quantity:i!=null&&i.fill_products?c.quantity:1,...(i==null?void 0:i.fill_products)&&{line_total:Number((c.price*c.quantity).toFixed(r)),cost:c.price,notes:c.notes,tax_name1:c.tax_name1,tax_rate1:c.tax_rate1,tax_name2:c.tax_name2,tax_rate2:c.tax_rate2,tax_name3:c.tax_name3,tax_rate3:c.tax_rate3,tax_id:"",custom_value1:c.custom_value1,custom_value2:c.custom_value2,custom_value3:c.custom_value3,custom_value4:c.custom_value4}}));e?s(c=>c&&{...c,line_items:[...c.line_items,...l]}):(s({...o,line_items:l}),t("/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 esn(n){const e=hs();return Ii(["/api/v1/purchase_orders","create"],()=>$e("GET",Ae("/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 pkr(n){return Ii(["/api/v1/purchase_orders",n.id],()=>$e("GET",Ae("/api/v1/purchase_orders/:id",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}const tsn={expense:"converted_to_expense",email:"emailed_purchase_orders",mark_sent:"marked_purchase_orders_as_sent",add_to_inventory:"added_purchase_orders_to_inventory"};function nsn(){const n=Co(),e=Gi(Eu);return(t,i)=>{he.processing(),$e("POST",Ae("/api/v1/purchase_orders/bulk"),{action:i,ids:t}).then(()=>{const r=tsn[i]||`${i}d_purchase_order`;he.success(r),In(["purchase_orders"]),i==="expense"&&In(["expenses"]),e&&n.invalidateQueries([e])})}}function isn(){const n=Co(),e=Gi(Eu);return t=>{he.processing(),$e("PUT",Ae("/api/v1/purchase_orders/:id?mark_sent=true",{id:t.id}),t).then(()=>{he.success("marked_purchase_order_as_sent"),In(["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 rsn=()=>{const n=ki(),e=Ti(),t=jR(),{data:i}=esn(),r=Wi(LG);return o=>{if(i){const s=o.map(a=>({...P1(),type_id:vv.Product,product_key:a.product_key,quantity:e!=null&&e.fill_products?a.quantity:1,...(e==null?void 0:e.fill_products)&&{line_total:Number((a.price*a.quantity).toFixed(t)),cost:a.price,notes:a.notes,tax_name1:a.tax_name1,tax_rate1:a.tax_rate1,tax_name2:a.tax_name2,tax_rate2:a.tax_rate2,tax_name3:a.tax_name3,tax_rate3:a.tax_rate3,tax_id:"",custom_value1:a.custom_value1,custom_value2:a.custom_value2,custom_value3:a.custom_value3,custom_value4:a.custom_value4}}));r({...i,line_items:s}),n("/purchase_orders/create?action=purchase_order_product")}}},osn=["product_key","description","price","quantity"];function ssn(){const[n,e,t,i]=cp({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 gkr(){var f;const{t:n}=ve();ssn();const{dateFormat:e}=sc(),t=ef(),i=UR(),r=_l(),o=nE(),s=Gk(),[a,l,c,u]=cp({entity:"product"}),d=[{column:"product_key",id:"product_key",label:n("product"),format:(g,m)=>O("span",{className:"inline-flex items-center space-x-4",children:[p($m,{entity:m}),p(Rf,{to:At("/products/:id/edit",{id:m.id}),renderSpan:o("product",m),children:g})]})},{column:"description",id:"notes",label:n("notes"),format:g=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(g)}})}),children:p("span",{children:i0(Xc(g)).slice(0,50)})})},{column:"price",id:"price",label:n("price"),format:(g,m)=>{var v,_;return t(g,(v=m.company)==null?void 0:v.settings.country_id,(_=m.company)==null?void 0:_.settings.currency_id)}},{column:"quantity",id:"quantity",label:n("default_quantity"),format:g=>i(g)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:g=>xo(g,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:g=>xo(g,e)},{column:a,id:"custom_value1",label:a,format:g=>s("product1",g==null?void 0:g.toString())},{column:l,id:"custom_value2",label:l,format:g=>s("product2",g==null?void 0:g.toString())},{column:c,id:"custom_value3",label:c,format:g=>s("product3",g==null?void 0:g.toString())},{column:u,id:"custom_value4",label:u,format:g=>s("product4",g==null?void 0:g.toString())},{column:"documents",id:"documents",label:n("documents"),format:(g,m)=>m.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(g,m)=>p($m,{entity:m})},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(g,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:g=>i(g)},{column:"tax_rate2",id:"tax_rate2",label:n("tax_rate2"),format:g=>i(g)},{column:"tax_rate3",id:"tax_rate3",label:n("tax_rate3"),format:g=>i(g)},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:g=>xo(g,e)}],h=((f=r==null?void 0:r.react_table_columns)==null?void 0:f.product)||osn;return d.filter(g=>h.includes(g.column)).sort((g,m)=>h.indexOf(g.column)-h.indexOf(m.column))}function mkr(){const[n]=ve(),e=ki(),t=hs(),i=Wi(Zon),r=Jon(),o=rsn(),{isEditPage:s}=tE({entity:"product",editPageTabs:["documents","product_fields"]}),a=u=>{i({...u,id:"",documents:[]}),e("/products/create?action=clone")},l=(u,d)=>{he.processing(),wrn([d],u).then(()=>{he.success(`${u}d_product`),In(["products"])})};return[u=>!u.is_deleted&&t("create_invoice")&&p(gt,{onClick:()=>r([u]),icon:p(nt,{element:qp}),children:n("new_invoice")}),u=>!u.is_deleted&&t("create_purchase_order")&&p(gt,{onClick:()=>o([u]),icon:p(nt,{element:qp}),children:n("new_purchase_order")}),u=>!u.is_deleted&&t("create_product")&&p(gt,{onClick:()=>a(u),icon:p(nt,{element:t0}),children:n("clone")}),()=>s&&p(vi,{withoutPadding:!0}),u=>Tr(u)===nr.Active&&s&&p(gt,{onClick:()=>l("archive",u.id),icon:p(nt,{element:Dc}),children:n("archive")}),u=>(Tr(u)===nr.Archived||Tr(u)===nr.Deleted)&&s&&p(gt,{onClick:()=>l("restore",u.id),icon:p(nt,{element:Lc}),children:n("restore")}),u=>(Tr(u)===nr.Active||Tr(u)===nr.Archived)&&s&&p(gt,{onClick:()=>l("delete",u.id),icon:p(nt,{element:el}),children:n("delete")})]}function asn(n){const{setErrors:e,setProduct:t}=n;return(i,r)=>{e(void 0),t(o=>o&&{...o,[i]:r})}}function ebe(){const[n]=ve();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 lsn({value:n,label:e,onChange:t}){const i=ebe();return p(kqe,{inputOptions:{value:n,label:e},entries:i,entryOptions:{id:"id",value:"id",label:"label"},onChange:t,onEmptyValues:()=>null})}function csn(n){var c,u,d,h;const[e]=ve(),[,t]=lF(),i=Ti(),r=ebe(),{errors:o,handleChange:s,type:a,product:l}=n;return O(St,{children:[a==="edit"&&p(G,{leftSide:e("status"),children:p($m,{entity:l})}),p(G,{leftSide:e("item"),required:!0,children:p(Ze,{required:!0,value:l.product_key,onValueChange:f=>s("product_key",f),errorMessage:o==null?void 0:o.errors.product_key})}),p(G,{leftSide:e("description"),children:p(Ze,{element:"textarea",value:l.notes,onValueChange:f=>s("notes",f),errorMessage:o==null?void 0:o.errors.notes})}),p(G,{leftSide:e("price"),children:p(mo,{value:l.price||"",onValueChange:f=>s("price",parseFloat(f)),errorMessage:o==null?void 0:o.errors.price})}),(i==null?void 0:i.enable_product_cost)&&p(G,{leftSide:e("cost"),children:p(Ze,{value:l.cost,onValueChange:f=>s("cost",f),errorMessage:o==null?void 0:o.errors.cost})}),(i==null?void 0:i.enable_product_quantity)&&p(G,{leftSide:e("default_quantity"),children:p(mo,{value:l.quantity||"",onValueChange:f=>s("quantity",parseFloat(f)),errorMessage:o==null?void 0:o.errors.quantity})}),p(G,{leftSide:e("max_quantity"),children:p(mo,{value:l.max_quantity||"",onValueChange:f=>s("max_quantity",parseFloat(f)),errorMessage:o==null?void 0:o.errors.max_quantity})}),O(G,{leftSide:e("tax_category"),children:[p(En,{value:l.tax_id,onValueChange:f=>s("tax_id",f),customSelector:!0,dismissable:!1,children:r.map((f,g)=>p("option",{value:f.value,children:f.label},g))}),o!=null&&o.errors.tax_id?p(Fs,{className:"mt-2",type:"danger",children:o.errors.tax_id}):null]}),p(G,{leftSide:e("image_url"),children:p(Ze,{value:l.product_image,onValueChange:f=>s("product_image",f),errorMessage:o==null?void 0:o.errors.product_image})}),(i==null?void 0:i.track_inventory)&&O(St,{children:[p(G,{leftSide:e("stock_quantity"),children:p(mo,{value:l.in_stock_quantity||"",onValueChange:f=>{s("in_stock_quantity",Number(f)),a==="edit"&&t(g=>({...g,update_in_stock_quantity:"true"}))},errorMessage:o==null?void 0:o.errors.in_stock_quantity})}),p(G,{leftSide:e("stock_notifications"),children:p(kt,{checked:l.stock_notification,onValueChange:f=>s("stock_notification",f)})}),p(G,{leftSide:e("notification_threshold"),children:p(mo,{value:l.stock_notification_threshold||"",onValueChange:f=>s("stock_notification_threshold",parseFloat(f)),errorMessage:o==null?void 0:o.errors.stock_notification_threshold})})]}),i&&i.enabled_item_tax_rates>0&&p(G,{leftSide:e("tax"),children:p(Aw,{onChange:f=>{var g,m;s("tax_rate1",(g=f.resource)==null?void 0:g.rate),s("tax_name1",(m=f.resource)==null?void 0:m.name)},defaultValue:l.tax_name1,onClearButtonClick:()=>{s("tax_rate1",0),s("tax_name1","")},onTaxCreated:f=>{s("tax_rate1",f.rate),s("tax_name1",f.name)}})}),i&&i.enabled_item_tax_rates>1&&p(G,{leftSide:e("tax"),children:p(Aw,{onChange:f=>{var g,m;s("tax_rate2",(g=f.resource)==null?void 0:g.rate),s("tax_name2",(m=f.resource)==null?void 0:m.name)},defaultValue:l.tax_name2,onClearButtonClick:()=>{s("tax_rate2",0),s("tax_name2","")},onTaxCreated:f=>{s("tax_rate2",f.rate),s("tax_name2",f.name)}})}),i&&i.enabled_item_tax_rates>2&&p(G,{leftSide:e("tax"),children:p(Aw,{onChange:f=>{var g,m;s("tax_rate3",(g=f.resource)==null?void 0:g.rate),s("tax_name3",(m=f.resource)==null?void 0:m.name)},defaultValue:l.tax_name3,onClearButtonClick:()=>{s("tax_rate3",0),s("tax_name3","")},onTaxCreated:f=>{s("tax_rate3",f.rate),s("tax_name3",f.name)}})}),((c=i==null?void 0:i.custom_fields)==null?void 0:c.product1)&&p(rs,{field:"custom_value1",defaultValue:l.custom_value1,value:i.custom_fields.product1,onValueChange:f=>s("custom_value1",f)}),((u=i==null?void 0:i.custom_fields)==null?void 0:u.product2)&&p(rs,{field:"custom_value2",defaultValue:l.custom_value2,value:i.custom_fields.product2,onValueChange:f=>s("custom_value2",f)}),((d=i==null?void 0:i.custom_fields)==null?void 0:d.product3)&&p(rs,{field:"custom_value3",defaultValue:l.custom_value3,value:i.custom_fields.product3,onValueChange:f=>s("custom_value3",f)}),((h=i==null?void 0:i.custom_fields)==null?void 0:h.product4)&&p(rs,{field:"custom_value4",defaultValue:l.custom_value4,value:i.custom_fields.product4,onValueChange:f=>s("custom_value4",f)})]})}function usn(n){const[e]=ve(),{data:t}=Crn(),[i,r]=w.useState(),[o,s]=w.useState(!1),[a,l]=w.useState(),c=asn({setErrors:r,setProduct:l}),u=()=>{o||(s(!0),$e("POST",Ae("/api/v1/products"),a).then(d=>{he.success("created_product"),In(["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),he.dismiss())}).finally(()=>s(!1)))};return w.useEffect(()=>{t&&l(t)},[t]),O(Or,{title:e("new_product"),visible:n.isModalOpen,onClose:n.setIsModalOpen,backgroundColor:"gray",size:"small",children:[a&&p(csn,{product:a,errors:i,handleChange:c}),p(un,{type:"primary",behavior:"button",onClick:u,children:e("save")})]})}function dsn(n){const[e]=ve(),[t,i]=w.useState(!1),r=Ti(),o=hs();return O(St,{children:[p(usn,{setIsModalOpen:i,isModalOpen:t,onProductCreated:n.onProductCreated}),p(Mh,{endpoint:Ae("/api/v1/products?per_page=800"),inputOptions:{value:n.defaultValue??null,label:n.label},entryOptions:{id:"id",label:"product_key",value:"id",searchable:"notes",dropdownLabelFn:s=>O("div",{children:[O("div",{className:"flex space-x-1",children:[p("p",{className:"font-semibold",children:s.product_key}),(r==null?void 0:r.track_inventory)&&n.displayStockQuantity&&O("p",{className:zt({"text-red-700":s.in_stock_quantity<=0}),children:["(",Ca("stock_quantity_number",{quantity:s.in_stock_quantity}),")"]})]}),p("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),onInputValueChange:n.onInputValueChange,action:{label:e("new_product"),onClick:()=>i(!0),visible:o("create_product")&&!n.withoutAction},onDismiss:n.onClearButtonClick,sortBy:"product_key|asc",nullable:!0,clearInputAfterSelection:n.clearInputAfterSelection},"product_selector"),n.errorMessage&&p(Fs,{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 hsn(n){const e=n.resource,t=Wi(iE);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 fsn=["discount","cost","unit_cost","quantity","rate","hours"],psn=["tax_rate1","tax_rate2","tax_rate3"],gsn={decimalSeparator:".",precision:2,thousandSeparator:","},P$=n=>!Object.keys(n).some(t=>t!=="_id"&&t!=="type_id"&&t!=="is_amount_discount"&&n[t]);function msn(n){const e=ml(),[t,i]=w.useState(),[r,o]=us(iE),s=y=>y.filter((E,x)=>x!==y.length-1).some(E=>P$(E));w.useCallback(y=>{let C=vv.Product;n.type==="task"&&(C=vv.Task);const E=y.filter(({type_id:L})=>L===C),x=E.length,k=E[x-1];if(x>0&&(!s(E)&&!P$(k)&&n.createItem(),s(E)&&P$(k))){const L=y.indexOf(E[x-1]);L>-1&&n.deleteLineItem(L)}},[n.resource.line_items]);const a=Kon({relationType:n.relationType,resource:n.resource,type:n.type,onChange:n.onLineItemChange}),l=hsn({resource:n.resource,type:n.type,onChange:n.onLineItemChange}),c=async(y,C,E)=>{o(!1),await n.onLineItemPropertyChange(y,C,E)},u=Ti(),d=_l(),h=n.resource,f=async(y,C,E)=>{o(!1);const x=An.cloneDeep(E);E&&u&&u.enabled_item_tax_rates===0&&(x.tax_name1="",x.tax_rate1=0,x.tax_name2="",x.tax_rate2=0,x.tax_name3="",x.tax_rate3=0),E&&u&&u.enabled_item_tax_rates===1&&(x.tax_name2="",x.tax_rate2=0,x.tax_name3="",x.tax_rate3=0),E&&u&&u.enabled_item_tax_rates===2&&(x.tax_name3="",x.tax_rate3=0),await a(y,C,x)},g=Qon({resource:n.resource,relationType:n.relationType}),m=AG(i);w.useEffect(()=>{h[n.relationType]?m(h[n.relationType],n.relationType):i(gsn)},[h==null?void 0:h[n.relationType]]),w.useEffect(()=>{},[h==null?void 0:h.line_items,r]);const v=ebe(),{preferences:_}=QS(),b=(y,C)=>{if(u.calculate_taxes){const E=h==null?void 0:h.line_items[C];return E.tax_id==="7"||E.tax_id===""?O(Q4,{children:[p(Aw,{onChange:k=>k.resource&&l(y,C,k.resource),onTaxCreated:k=>l(y,C,k),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"?p("button",{type:"button",onClick:()=>c("tax_id","1",C),children:p(IYt,{})}):null]}):Ja(v).pluck("value").filter(k=>k!=="7").toArray().includes(E.tax_id)&&y==="tax_rate1"?p(Q4,{children:p(lsn,{value:E.tax_id,onChange:k=>c("tax_id",k.value,C)})}):null}return p(Aw,{onChange:E=>E.resource&&l(y,C,E.resource),onTaxCreated:E=>l(y,C,E),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 x,k,L,D;const E=rGe(y);if(E==="product_key")return p(dsn,{onChange:A=>f(C,A.label,A.resource),className:"w-auto",defaultValue:h==null?void 0:h.line_items[C][E],onProductCreated:A=>A&&f(C,A.product_key,A),clearButton:!0,onInputValueChange:A=>c("product_key",A,C),onClearButtonClick:()=>a(C,"",null),displayStockQuantity:e.pathname.startsWith("/invoices")},`${E}${h==null?void 0:h.line_items[C][E]}`);if(E==="notes")return p(Ze,{id:E,element:"textarea",value:h==null?void 0:h.line_items[C][E],onChange:A=>c(E,A.target.value,C),style:{marginTop:"4px"},textareaRows:_.auto_expand_product_table_notes?1:3},`${E}${C}`);if(fsn.includes(E))return t&&p(mo,{precision:E==="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:E,value:(h==null?void 0:h.line_items[C][E])||"",className:"auto",onValueChange:A=>{c(E,isNaN(parseFloat(A))?0:parseFloat(A),C)}});if(E==="gross_line_total"||E==="tax_amount")return g((h==null?void 0:h.line_items[C][E])??0);if(psn.includes(E))return b(E,C);if(["line_total"].includes(E))return g(h==null?void 0:h.line_items[C][E]);if(["product1","product2","product3","product4"].includes(E)){const A=E.replace("product","custom_value");return(x=u.custom_fields)!=null&&x[E]?p(rs,{field:E,defaultValue:h==null?void 0:h.line_items[C][A],value:(k=u.custom_fields)==null?void 0:k[E],onValueChange:N=>c(A,N,C),fieldOnly:!0}):p(Ze,{id:E,value:h==null?void 0:h.line_items[C][E],onChange:N=>c(E,N.target.value,C)})}if(["task1","task2","task3","task4"].includes(E)){const A=E.replace("task","custom_value");return(L=u.custom_fields)!=null&&L[E]?p(rs,{field:E,defaultValue:h==null?void 0:h.line_items[C][A],value:(D=u.custom_fields)==null?void 0:D[E],onValueChange:N=>c(A,N,C),fieldOnly:!0}):p(Ze,{id:E,value:h==null?void 0:h.line_items[C][E],onChange:N=>c(E,N.target.value,C)})}return p(Ze,{id:E,value:h==null?void 0:h.line_items[C][E],onChange:A=>c(E,A.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 _sn(n){const[e]=ve(),t=Ti(),{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}=iGe(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 vsn(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?Hve(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 bsn(n){const e=rGe(n);return{product_key:"15%",notes:"30%",cost:"10%",quantity:"10%",line_total:"5%",discount:"10%",tax_rate1:"12%"}[e]||""}const iE=Ro(void 0);function _kr(n){const[e]=ve(),t=si(),i=Zme(),{resource:r,items:o,columns:s,relationType:a}=n,l=Wi(iE),c=_sn({type:n.type}),u=msn({type:n.type,resource:n.resource,onLineItemChange:n.onLineItemChange,onLineItemPropertyChange:n.onLineItemPropertyChange,relationType:a,createItem:n.onCreateItemClick,deleteLineItem:n.onDeleteRowClick}),d=vsn({resource:n.resource,onSort:n.onSort}),h=()=>o.some(g=>P$(g)),f=g=>r.line_items.indexOf(g);return O(ZS,{children:[p(eE,{backgroundColor:i.$5,children:s.map((g,m)=>p(Ma,{textColor:i.$6,children:c(g)},m))}),p(bG,{onDragEnd:d,children:p(CG,{droppableId:"product-table",children:g=>O(JS,{...g.droppableProps,innerRef:g.innerRef,children:[o.map((m,v)=>p(yG,{draggableId:f(m).toString(),index:f(m),children:_=>p(wc,{innerRef:_.innerRef,tabIndex:v+1,..._.draggableProps,children:s.map((b,y,{length:C})=>O(To,{width:bsn(b),children:[C-1!==y&&O("div",{className:zt({"flex justify-between items-center space-x-3":y===0}),children:[y===0?p("button",{..._.dragHandleProps,children:p(T1t,{size:18})}):null,u(b,f(m))]}),C-1===y&&O("div",{className:"flex justify-between items-center",children:[u(b,f(m)),r&&p("button",{style:{color:t.$3},className:"ml-2 text-gray-600 hover:text-red-600",onClick:()=>{l(!0),n.onDeleteRowClick(f(m))},children:p(cwt,{size:18})})]})]},y))},f(m))},f(m))),g.placeholder,p(wc,{className:"bg-slate-100 hover:bg-slate-200",children:p(To,{colSpan:100,children:O("button",{onClick:()=>!h()&&n.onCreateItemClick(),className:"w-full py-2 inline-flex justify-center items-center space-x-2",children:[p(QCt,{size:18}),p("span",{children:n.type==="product"?e("add_item"):e("add_line")})]})})})]})})})]})}function pm(n){const{onClick:e,icon:t,label:i}=n;return O(un,{behavior:"button",type:"secondary",className:"w-3/4",onClick:e,children:[p(nt,{element:t,style:{width:"1.1rem",height:"1.1rem"}}),p("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 tbe=Ro(void 0),vkr=Ro(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 RG=Ro(void 0),ysn=Ro(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 NG=Ro(void 0),Csn=Ro(void 0);function wsn(n){const[e]=ve(),t=ki(),{purchaseOrder:i}=n,r=hs(),o=Wi(RG),s=Wi(tbe),a=Wi(O1),l=Wi(NG),c=Zi(),[u,d]=w.useState(!1),h=()=>{a({...i,id:"",number:"",documents:[],due_date:"",partial_due_date:"",date:Un().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")},f=()=>{o({...i,id:"",number:"",documents:[],date:Un().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")},g=()=>{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:Un().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 O(St,{children:[(r("create_invoice")||r("create_quote")||r("create_recurring_invoice")||r("create_credit"))&&p(gt,{onClick:()=>d(!0),icon:p(nt,{element:t0}),children:e("clone_to_other")}),p(Or,{title:e("clone_to"),visible:u,onClose:()=>d(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:p("div",{className:"flex justify-center",children:O("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[r("create_invoice")&&p(pm,{label:e("invoice"),icon:oS,onClick:h}),r("create_quote")&&p(pm,{label:e("quote"),icon:Sge,onClick:f}),r("create_recurring_invoice")&&p(pm,{label:e("recurring_invoice"),icon:SH,onClick:g}),r("create_credit")&&p(pm,{label:e("credit"),icon:oS,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 nbe(){const n=zi();return async()=>$e("POST",Ae("/api/v1/refresh")).then(e=>{n(y0(e.data.data))})}Ro(!1);const Ssn=Ro(null),Esn=Ro(!1),xsn=Ro([]),Tsn=Ro(null);function bkr({entity:n,entities:e,visible:t,bulkUrl:i,setVisible:r,labelFn:o}){const[s]=ve(),[a,l]=w.useState(null),[c,u]=w.useState(!1),[d,h]=us(Ssn),f=Co(),g=w.useRef(null),m=()=>{const _=Ja(e).pluck("id").toArray();h(null),he.processing(),$e("POST",Ae(i),{ids:_,entity:n,template_id:a,send_email:c,action:"template"}).then(b=>{const y=b.data.message;if(_fe.emit("bulk.completed"),c){r(!1),he.success();return}g.current&&(g.current.disabled=!0),f.fetchQuery({queryKey:["reports",y],queryFn:()=>$e("POST",Ae(`/api/v1/templates/preview/${y}`),{},{responseType:"arraybuffer"}).then(C=>C.data),retry:10,retryDelay:5e3}).then(C=>{const E=new Blob([C],{type:"application/pdf"}),x=URL.createObjectURL(E);h(x),he.success(),_fe.emit("bulk.completed")}).finally(()=>{g.current&&(g.current.disabled=!1)})})},v=_=>{const b=document.createElement("a");b.download="template.pdf",b.href=_,b.target="_blank",document.body.appendChild(b),b.click(),document.body.removeChild(b)};return O(Or,{title:s("load_template"),visible:t,onClose:r,size:"small",children:[p(G,{leftSide:s("design"),noExternalPadding:!0,children:p(Mh,{endpoint:Ae(`/api/v1/designs?template=true&entities=${n}`),inputOptions:{value:a??"",label:""},entryOptions:{id:"id",label:"name",value:"id"},onChange:_=>_.resource?l(_.resource.id):null})}),O("p",{className:"capitalize",children:[s("entities"),":"]}),p("ul",{children:e.map((_,b)=>p("li",{children:o(_)},b))}),p(kt,{label:s("send_email"),checked:c,onChange:u}),p(un,{innerRef:g,behavior:"button",onClick:m,disabled:!a,disableWithoutIcon:!0,children:s("run_template")}),d?p(un,{type:"secondary",behavior:"button",onClick:()=>v(d),children:s("download_pdf")}):null]})}function qR(){const[n,e]=us(Esn),[t,i]=us(xsn),[r,o]=us(Tsn);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 ksn(n){return e=>{if(e.invitations.length!==0&&e.invitations.length>0)return Ae("/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 aGe(n){const e=Co(),t=ksn({resourceType:n.resource,downloadType:n.downloadType});return i=>{const r=t(i);r&&(he.processing(),e.fetchQuery(r,()=>$e("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),he.dismiss()})))}}const Isn=rl.div`
border-color: ${n=>n.theme.borderColor};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function ykr(){const[n]=ve(),{dateFormat:e}=sc(),t=r=>{var u,d,h,f,g,m,v,_,b,y,C,E,x,k,L,D,A,N,P,M,B,F,U,H,W,q,V,re,oe,Q;let o=Ca(`activity_${r.activity_type_id}`,{});r.activity_type_id===10&&r.contact&&(o=Ca("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 Ne=Object.keys(r||{}).find(Ve=>s.includes(Ve));return!Ne&&(r!=null&&r.client)?"client":Ne||""})(),c={client:p(qi,{to:At("/clients/:id",{id:(u=r.client)==null?void 0:u.hashed_id}),children:(d=r.client)==null?void 0:d.label}),contact:p(qi,{to:At(`/${(h=r==null?void 0:r.contact)==null?void 0:h.contact_entity}/:id`,{id:(f=r.contact)==null?void 0:f.hashed_id}),children:(g=r.contact)==null?void 0:g.label}),quote:p(qi,{to:At("/quotes/:id/edit",{id:(m=r.quote)==null?void 0:m.hashed_id}),children:(v=r.quote)==null?void 0:v.label}),user:((_=r.user)==null?void 0:_.label)??n("system"),expense:p(qi,{to:At("/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:p(qi,{to:At("/recurring_invoices/:id/edit",{id:(C=r.recurring_invoice)==null?void 0:C.hashed_id}),children:(E=r==null?void 0:r.recurring_invoice)==null?void 0:E.label}),recurring_expense:p(qi,{to:At("/recurring_expenses/:id/edit",{id:(x=r.recurring_expense)==null?void 0:x.hashed_id}),children:(k=r==null?void 0:r.recurring_expense)==null?void 0:k.label}),purchase_order:p(qi,{to:At("/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:p(qi,{to:At("/invoices/:id/edit",{id:(A=r.invoice)==null?void 0:A.hashed_id}),children:(N=r==null?void 0:r.invoice)==null?void 0:N.label}),payment_amount:(P=r==null?void 0:r.payment_amount)==null?void 0:P.label,payment:p(qi,{to:At("/payments/:id/edit",{id:(M=r.payment)==null?void 0:M.hashed_id}),children:(B=r==null?void 0:r.payment)==null?void 0:B.label}),credit:p(qi,{to:At("/credits/:id/edit",{id:(F=r.credit)==null?void 0:F.hashed_id}),children:(U=r==null?void 0:r.credit)==null?void 0:U.label}),task:p(qi,{to:At("/tasks/:id/edit",{id:(H=r.task)==null?void 0:H.hashed_id}),children:(W=r==null?void 0:r.task)==null?void 0:W.label}),vendor:p(qi,{to:At("/vendors/:id/edit",{id:(q=r.vendor)==null?void 0:q.hashed_id}),children:(V=r==null?void 0:r.vendor)==null?void 0:V.label}),subscription:p(qi,{to:At("/settings/subscriptions/:id/edit",{id:(re=r.subscription)==null?void 0:re.hashed_id}),children:(oe=r==null?void 0:r.subscription)==null?void 0:oe.label}),adjustment:(Q=r==null?void 0:r.adjustment)==null?void 0:Q.label,notes:!!(l&&r[l])&&O(St,{children:[p("br",{}),p(qi,{to:At(`/${l}s/${r[l].hashed_id}/edit`),children:r==null?void 0:r.notes})]})};for(const[Ne,Ve]of Object.entries(c))o=EG(o,`:${Ne}`,()=>Ve);return o},i=si();return r=>p(Isn,{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:O("div",{className:"flex flex-col space-y-2",children:[p("span",{className:"text-sm",children:t(r)}),O("div",{className:"flex space-x-3",children:[p("span",{className:"dark:text-white text-sm",children:xo(r.created_at,e+" HH:mm")}),p("span",{className:"text-gray-500 text-sm",children:r.ip})]})]})})}function OG(n){const[e]=ve(),{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("")},f=()=>{s||(a(!0),he.processing(),$e("POST",Ae("/api/v1/activities/notes"),{entity:`${t}s`,entity_id:i,notes:u}).then(()=>{he.success("saved_comment"),In(["activities"])}).finally(()=>{a(!1),h()}))};return O(St,{children:[i&&p("div",{className:"cursor-pointer",onClick:()=>c(!0),children:o||p(un,{behavior:"button",type:"secondary",onClick:()=>{},children:e("add_comment")})}),O(Or,{size:"regular",title:`${e("comment")} | ${e(t)} | ${r}`,visible:l,onClose:h,children:[p(Ze,{element:"textarea",value:u,onValueChange:g=>d(g),changeOverride:!0}),p("div",{className:"flex self-end",children:p(un,{behavior:"button",onClick:f,disabled:s||!u,disableWithoutIcon:!0,children:e("add")})})]})]})}function Ckr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=ki(),o=nbe(),s=Wi(iE);return a=>{he.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"),$e("POST",Ae(l),a).then(async c=>{(t||i)&&await o(),he.success("created_purchase_order"),In(["purchase_orders"]),r(At("/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?he.error(d.errors.amount[0]):he.dismiss(),e(d)}}).finally(()=>s(void 0))}}const Lsn=["status","number","vendor","expense","amount","date","due_date"];function Dsn(){const[n,e,t,i]=cp({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 wkr(){var f;const{t:n}=ve(),{dateFormat:e}=sc(),t=ef(),i=UR(),r=_l(),o=nE(),s=Gk();Dsn();const[a,l,c,u]=cp({entity:"invoice"}),d=[{column:"status",id:"status_id",label:n("status"),format:(g,m)=>p(qi,{to:At("/purchase_orders/:id/edit",{id:m.id}),children:p(Uon,{entity:m})})},{column:"number",id:"number",label:n("number"),format:(g,m)=>O("div",{className:"flex space-x-2",children:[p(Rf,{to:At("/purchase_orders/:id/edit",{id:m.id}),renderSpan:o("purchase_order",m),children:g}),p(Qve,{text:m.number})]})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(g,m)=>m.vendor&&p(qi,{to:At("/vendors/:id",{id:m.vendor.id}),children:m.vendor.name})},{column:"expense",id:"expense_id",label:n("expense"),format:(g,m)=>m.expense&&p(qi,{to:At("/expenses/:id/edit",{id:m.expense.id}),children:m.expense.number})},{column:"amount",id:"amount",label:n("amount"),format:(g,m)=>{var v,_;return t(g,(v=m.vendor)==null?void 0:v.country_id,(_=m.vendor)==null?void 0:_.currency_id)}},{column:"date",id:"date",label:n("date"),format:g=>xo(g,e)},{column:"due_date",id:"due_date",label:n("due_date"),format:g=>xo(g,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:g=>xo(g,e)},{column:"contact_name",id:"id",label:n("contact_name"),format:(g,m)=>{var v,_;return m.vendor&&((_=(v=m.vendor)==null?void 0:v.contacts)==null?void 0:_.length)>0&&O(qi,{to:At("/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:(g,m)=>m.vendor&&p(Oc,{text:m.vendor.contacts[0].email})},{column:"created_at",id:"created_at",label:n("created_at"),format:g=>xo(g,e)},{column:a,id:"custom_value1",label:a,format:g=>s("invoice1",g==null?void 0:g.toString())},{column:l,id:"custom_value2",label:l,format:g=>s("invoice2",g==null?void 0:g.toString())},{column:c,id:"custom_value3",label:c,format:g=>s("invoice3",g==null?void 0:g.toString())},{column:u,id:"custom_value4",label:u,format:g=>s("invoice4",g==null?void 0:g.toString())},{column:"discount",id:"discount",label:n("discount"),format:(g,m)=>{var v,_;return m.is_amount_discount?t(g,(v=m.vendor)==null?void 0:v.country_id,(_=m.vendor)==null?void 0:_.currency_id):`${i(g)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(g,m)=>m.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(g,m)=>p($m,{entity:m})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:g=>i(g)}],h=((f=r==null?void 0:r.react_table_columns)==null?void 0:f.purchaseOrder)||Lsn;return d.filter(g=>h.includes(g.column)).sort((g,m)=>h.indexOf(g.column)-h.indexOf(m.column))}function Asn(){const[n]=ve(),e=kg();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 Skr(){const[n]=ve(),e=Ti(),{isAdmin:t,isOwner:i}=Fo(),{isEditPage:r}=tE({entity:"purchase_order"}),[,o]=us(LG),s=nsn(),a=ki(),l=isn(),c=hs(),u=nE(),d=nGe({entity:"purchase_order"}),h=Xqe({resource:"purchase_order"}),f=tGe({entity:"purchase_order"}),g=aGe({resource:"purchase_order",downloadType:"download_e_purchase_order"}),{setChangeTemplateResources:m,setChangeTemplateVisible:v,setChangeTemplateEntityContext:_}=qR(),b=C=>{o({...C,id:"",number:"",documents:[],date:Un().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=>p(gt,{onClick:()=>a(At("/purchase_orders/:id/email",{id:C.id})),icon:p(nt,{element:dme}),children:n("send_email")}),C=>p(gt,{onClick:()=>a(At("/purchase_orders/:id/pdf",{id:C.id})),icon:p(nt,{element:oq}),children:n("view_pdf")}),C=>Tr(C)!==nr.Deleted&&p(gt,{onClick:()=>d([C.id]),icon:p(nt,{element:P9e}),children:n("print_pdf")}),C=>C.status_id!==ew.Accepted&&(t||i)&&p(gt,{onClick:()=>f(C.id),icon:p(nt,{element:cme}),children:n("schedule")}),C=>p(OG,{entity:"purchase_order",entityId:C.id,label:`#${C.number}`,labelElement:p(gt,{icon:p(nt,{element:rq}),children:n("add_comment")})}),C=>p(gt,{onClick:()=>h(C),icon:p(nt,{element:sS}),children:n("download")}),C=>!!(e!=null&&e.settings.enable_e_invoice)&&p(gt,{onClick:()=>g(C),icon:p(nt,{element:sS}),children:n("download_e_purchase_order")}),C=>C.status_id!==ew.Accepted&&p(gt,{onClick:()=>l(C),icon:p(nt,{element:M9e}),children:n("mark_sent")}),C=>!C.expense_id.length&&p(gt,{onClick:()=>s([C.id],"expense"),icon:p(nt,{element:fme}),children:n("convert_to_expense")}),C=>C.status_id===ew.Accepted&&p(gt,{onClick:()=>s([C.id],"add_to_inventory"),icon:p(nt,{element:zEt}),children:n("add_to_inventory")}),C=>!!C.expense_id.length&&!u("expense",C.expense)&&p(gt,{onClick:()=>a(At("/expenses/:id/edit",{id:C.expense_id})),icon:p(nt,{element:lme}),children:`${n("view")} ${n("expense")}`}),C=>p(gt,{onClick:()=>Zqe(C),icon:p(nt,{element:hme}),children:n("vendor_portal")}),()=>p(vi,{withoutPadding:!0}),C=>c("create_purchase_order")&&p(gt,{onClick:()=>b(C),icon:p(nt,{element:t0}),children:n("clone_to_purchase_order")}),C=>p(wsn,{purchaseOrder:C}),C=>p(gt,{onClick:()=>{v(!0),m([C]),_({endpoint:"/api/v1/purchase_orders/bulk",entity:"purchase_order"})},icon:p(nt,{element:SR}),children:n("run_template")}),()=>r&&p(vi,{withoutPadding:!0}),C=>!C.archived_at&&r&&p(gt,{onClick:()=>s([C.id],"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),C=>!!C.archived_at&&r&&p(gt,{onClick:()=>s([C.id],"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),C=>!C.is_deleted&&r&&p(gt,{onClick:()=>s([C.id],"delete"),icon:p(nt,{element:el}),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 wf=(n=>(n.Viewed="-2",n.Expired="-1",n.Draft="1",n.Sent="2",n.Approved="3",n.Converted="4",n))(wf||{});/**
* 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 Rsn{constructor(e,t){this.invoice=e,this.currency=t,this.taxCollection=Ja(),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(Ja(r))}calculateAmountLineTax(e,t){return Math.round(t*e/100*1e3/10)/100}push(){var e,t;return this.subTotal+=parseFloat((this.item.line_total+4e-15).toFixed(((e=this.currency)==null?void 0:e.precision)||2)),this.subTotal=parseFloat(this.subTotal.toFixed(((t=this.currency)==null?void 0:t.precision)||2)),this.grossSubTotal+=this.item.gross_line_total,this.lineItems.push(this.item),this}calculateTaxesWithAmountDiscount(){this.taxCollection=Ja(),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 LW{static formatValue(e,t){return rae(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 lGe{constructor(e,t){this.invoice=e,this.currency=t,this.taxMap=Ja(),this.totalTaxMap=[],this.totalDiscount=0,this.total=0,this.totalTaxes=0,this.totalCustomValues=0,this.subTotal=0,this.invoiceItems=new Rsn(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(){var e,t,i;if(this.invoice.tax_name1.length>=1){let r=this.taxer(this.total,this.invoice.tax_rate1);r+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name1,this.invoice.tax_rate1),this.totalTaxes+=r,this.totalTaxMap.push({name:`${this.invoice.tax_name1} ${parseFloat(this.invoice.tax_rate1.toFixed(((e=this.currency)==null?void 0:e.precision)||2))} %`})}if(this.invoice.tax_name2.length>=1){let r=this.taxer(this.total,this.invoice.tax_rate2);r+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name2,this.invoice.tax_rate2),this.totalTaxes+=r,this.totalTaxMap.push({name:`${this.invoice.tax_name2} ${parseFloat(this.invoice.tax_rate2.toFixed(((t=this.currency)==null?void 0:t.precision)||2))} %`})}if(this.invoice.tax_name3.length>=1){let r=this.taxer(this.total,this.invoice.tax_rate3);r+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name3,this.invoice.tax_rate3),this.totalTaxes+=r,this.totalTaxMap.push({name:`${this.invoice.tax_name3} ${parseFloat(this.invoice.tax_rate3.toFixed(((i=this.currency)==null?void 0:i.precision)||2))} %`})}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){var r,o,s,a;let i=0;return this.invoice.custom_surcharge_tax1&&(i+=parseFloat((this.invoice.custom_surcharge1*(t/100)).toFixed(((r=this.currency)==null?void 0:r.precision)||2))),this.invoice.custom_surcharge_tax2&&(i+=parseFloat((this.invoice.custom_surcharge2*(t/100)).toFixed(((o=this.currency)==null?void 0:o.precision)||2))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(((s=this.currency)==null?void 0:s.precision)||2))),this.invoice.custom_surcharge_tax4&&(i+=parseFloat((this.invoice.custom_surcharge4*(t/100)).toFixed(((a=this.currency)==null?void 0:a.precision)||2))),i}setTaxMap(){this.invoice.is_amount_discount&&(this.invoiceItems.calculateTaxesWithAmountDiscount(),this.invoice.line_items=this.invoiceItems.lineItems),this.taxMap=Ja();let e=Ja();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(){var e;return this.total+=this.totalTaxes,this.total.toFixed(((e=this.currency)==null?void 0:e.precision)||2),this}calculateBalance(){return this.setCalculatedAttributes(),this}setCalculatedAttributes(){var e,t;return this.invoice.amount=parseFloat(LW.formatValue(this.total,((e=this.currency)==null?void 0:e.precision)||2)),this.invoice.balance=parseFloat(LW.formatValue(this.total,((t=this.currency)==null?void 0:t.precision)||2))-(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){var t;return this.invoice.is_amount_discount?this.invoice.discount:parseFloat((e*(this.invoice.discount/100)).toFixed(((t=this.currency)==null?void 0:t.precision)||2))}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 Nsn(){const n=Co(),e=Gi(Eu);return t=>{he.processing(),$e("PUT",Ae("/api/v1/quotes/:id?approve=true",{id:t.id}),t).then(()=>{he.success("approved_quote"),In(["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 Osn={convert_to_invoice:"converted_quote",convert_to_project:"converted_quote",email:"emailed_quotes",mark_sent:"marked_quote_as_sent"},cGe=()=>{const n=ki(),e=Co(),t=Gi(Eu);return(i,r)=>{he.processing(),$e("POST",Ae("/api/v1/quotes/bulk"),{action:r,ids:i}).then(o=>{const s=Osn[r]||`${r}d_quote`;r==="approve"?he.success(Ca("approved_quotes",{value:i.length})):he.success(s),In(["quotes"]),t&&e.invalidateQueries([t]),r==="convert_to_invoice"&&In(["invoices"]),r==="convert_to_project"&&(In(["projects"]),n(At("/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 Psn(){const n=Co(),e=Gi(Eu);return t=>{he.processing(),$e("PUT",Ae("/api/v1/quotes/:id?mark_sent=true",{id:t.id}),t).then(()=>{he.success("quote_sent"),In(["quotes"]),e&&n.invalidateQueries([e])})}}function Msn(n){const[e]=ve(),{status_id:t,is_deleted:i,archived_at:r,invoice_id:o,invitations:s}=n.entity,a=kg(),l=()=>s==null?void 0:s.some(f=>f.viewed_date),c=t===wf.Approved||t===wf.Converted,u=!c,d=l(),h=t===wf.Expired;return i?p(_r,{variant:"red",children:e("deleted")}):r?p(_r,{variant:"orange",children:e("archived")}):o?p(_r,{variant:"green",style:{backgroundColor:a.$3},children:e("converted")}):h?p(_r,{variant:"red",style:{backgroundColor:a.$5},children:e("expired")}):d&&u&&!c?p(_r,{variant:"yellow",children:e("viewed")}):t===wf.Draft?p(_r,{variant:"generic",children:e("draft")}):t===wf.Sent?p(_r,{variant:"light-blue",style:{backgroundColor:a.$1},children:e("sent")}):t===wf.Approved?p(_r,{variant:"dark-blue",style:{backgroundColor:a.$2},children:e("approved")}):p(St,{})}/**
* 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 Fsn{constructor(e){this.invoice=e,this.taxCollection=Ja(),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(Ja(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=Ja(),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 uGe{constructor(e,t){this.invoice=e,this.currency=t,this.taxMap=Ja(),this.totalTaxMap=[],this.totalDiscount=0,this.total=0,this.totalTaxes=0,this.totalCustomValues=0,this.subTotal=0,this.invoiceItems=new Fsn(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(){var t,i,r;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 o=this.calcInclusiveLineTax(e,this.invoice.tax_rate1);this.totalTaxes+=o,this.totalTaxMap.push({name:`${this.invoice.tax_name1} ${parseFloat(this.invoice.tax_rate1.toFixed(((t=this.currency)==null?void 0:t.precision)||2))} %`})}if(this.invoice.tax_rate2>0){const o=this.calcInclusiveLineTax(e,this.invoice.tax_rate2);this.totalTaxes+=o,this.totalTaxMap.push({name:`${this.invoice.tax_name2} ${parseFloat(this.invoice.tax_rate2.toFixed(((i=this.currency)==null?void 0:i.precision)||2))} %`})}if(this.invoice.tax_rate3>0){const o=this.calcInclusiveLineTax(e,this.invoice.tax_rate3);this.totalTaxes+=o,this.totalTaxMap.push({name:`${this.invoice.tax_name3} ${parseFloat(this.invoice.tax_rate3.toFixed(((r=this.currency)==null?void 0:r.precision)||2))} %`})}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){var r,o,s,a;let i=0;return this.invoice.custom_surcharge_tax1&&(i+=parseFloat((this.invoice.custom_surcharge1*(t/100)).toFixed(((r=this.currency)==null?void 0:r.precision)||2))),this.invoice.custom_surcharge_tax2&&(i+=parseFloat((this.invoice.custom_surcharge2*(t/100)).toFixed(((o=this.currency)==null?void 0:o.precision)||2))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(((s=this.currency)==null?void 0:s.precision)||2))),this.invoice.custom_surcharge_tax4&&(i+=parseFloat((this.invoice.custom_surcharge4*(t/100)).toFixed(((a=this.currency)==null?void 0:a.precision)||2))),i}setTaxMap(){this.invoice.is_amount_discount&&(this.invoiceItems.calculateTaxesWithAmountDiscount(),this.invoice.line_items=this.invoiceItems.lineItems),this.taxMap=Ja();let e=Ja();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(){var e;return this.totalTaxes=Number(this.totalTaxes.toFixed(((e=this.currency)==null?void 0:e.precision)||2)),this}calculateBalance(){return this.setCalculatedAttributes(),this}setCalculatedAttributes(){var e,t;return this.invoice.amount=parseFloat(LW.formatValue(this.total,((e=this.currency)==null?void 0:e.precision)||2)),this.invoice.balance=parseFloat(LW.formatValue(this.total,((t=this.currency)==null?void 0:t.precision)||2))-(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){var t;return this.invoice.is_amount_discount?this.invoice.discount:parseFloat((e*(this.invoice.discount/100)).toFixed(((t=this.currency)==null?void 0:t.precision)||2))}taxer(e,t){var i;return parseFloat((e*((t??0)/100)).toFixed(((i=this.currency)==null?void 0:i.precision)||2))}valuer(e){return typeof e=="number"?e:0}calcInclusiveLineTax(e,t){return e-e/(1+t/100)}}const Bsn=n=>{const[e]=ve(),[t,i]=w.useState(!1),{selectedIds:r,setSelected:o}=n,s=si(),a=cGe();return O(St,{children:[p(gt,{onClick:()=>i(!0),icon:p(nt,{element:fme}),disablePreventNavigation:n.disablePreventNavigation,children:e("convert_to_project")}),O(Or,{title:e("convert_to_project"),visible:t,onClose:()=>i(!1),children:[p("span",{className:"text-lg",style:{backgroundColor:s.$2,color:s.$3,colorScheme:s.$0},children:e("are_you_sure")}),p("div",{className:"flex justify-end space-x-4 mt-5",children:p(un,{behavior:"button",onClick:()=>{a(r,"convert_to_project"),o==null||o([]),i(!1)},children:p("span",{className:"text-base mx-3",children:e("yes")})})})]})]})};function $sn(n){const[e]=ve(),t=ki(),{quote:i}=n,r=hs(),o=Wi(O1),s=Wi(tbe),a=Wi(NG),l=Wi(LG),c=Zi(),[u,d]=w.useState(!1),h=()=>{s({...i,id:"",number:"",documents:[],date:Un().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")},f=()=>{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")},g=()=>{l({...i,id:"",number:"",documents:[],date:Un().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:Un().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 O(St,{children:[(r("create_invoice")||r("create_credit")||r("create_recurring_invoice")||r("create_purchase_order"))&&p(gt,{onClick:()=>d(!0),icon:p(nt,{element:t0}),children:e("clone_to_other")}),p(Or,{title:e("clone_to"),visible:u,onClose:()=>d(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:p("div",{className:"flex justify-center",children:O("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[r("create_invoice")&&p(pm,{label:e("invoice"),icon:oS,onClick:m}),r("create_credit")&&p(pm,{label:e("credit"),icon:oS,onClick:h}),r("create_recurring_invoice")&&p(pm,{label:e("recurring_invoice"),icon:SH,onClick:f}),r("create_purchase_order")&&p(pm,{label:e("purchase_order"),icon:$me,onClick:g})]})})})]})}function Ekr(n){const e=XS(),t=Ti(),[i,r]=us(RG),[,o]=us(ysn),s=(f,g)=>{r(m=>m&&{...m,[f]:g})};return{handleChange:s,handleInvitationChange:(f,g)=>{let m=[...i.invitations];const v=(m==null?void 0:m.find(_=>_.client_contact_id===f))||-1;if(v!==-1&&g===!1&&(m=m.filter(_=>_.client_contact_id!==f)),v===-1){const _={client_contact_id:f};m.push(_)}s("invitations",m)},handleLineItemChange:(f,g)=>{const m=(i==null?void 0:i.line_items)||[];m[f]=g,r(v=>v&&{...v,line_items:m})},handleLineItemPropertyChange:(f,g,m)=>{const v=(i==null?void 0:i.line_items)||[];v[m][f]=g,r(_=>_&&{..._,line_items:v})},handleCreateLineItem:f=>{r(g=>g&&{...g,line_items:[...g.line_items,{...P1(),type_id:f,quantity:1}]})},handleDeleteLineItem:f=>{const g=(i==null?void 0:i.line_items)||[];g.splice(f,1),r(m=>m&&{...m,line_items:g})},calculateInvoiceSum:f=>{var m;const g=e(((m=n.client)==null?void 0:m.settings.currency_id)||(t==null?void 0:t.settings.currency_id));if(g&&f){const v=f.uses_inclusive_taxes?new uGe(f,g).build():new lGe(f,g).build();o(v)}}}}function xkr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=nbe(),o=ki(),s=xu(),a=Wi(iE);return async l=>{he.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"),$e("POST",Ae(c),l).then(async u=>{(t||i)&&await r(),he.success("created_quote"),In(["quotes"]),o(At("/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?he.error(h.errors.amount[0]):he.dismiss(),e(h)}}).finally(()=>a(void 0))}}function Tkr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=nbe(),o=Wi(iE),s=xu();return async a=>{he.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"),$e("PUT",Ae(l,{id:a.id}),a).then(async()=>{(t||i)&&await r(),he.success("updated_quote"),In(["quotes"])}).catch(c=>{var u;if(((u=c.response)==null?void 0:u.status)===422){const d=c.response.data;d.errors.amount?he.error(d.errors.amount[0]):he.dismiss(),e(d)}}).finally(()=>o(void 0))}}function kkr(n){const[e]=ve(),{showCommonBulkAction:t,showEditAction:i}=n||{},r=Wi(RG),o=Ti(),{isAdmin:s,isOwner:a}=Fo(),{isEditPage:l}=tE({entity:"quote",editPageTabs:["documents","settings","activity","history","email_history"]}),c=Nsn(),u=cGe(),d=ki(),h=Psn(),f=hs(),g=nGe({entity:"quote"}),m=Xqe({resource:"quote"}),v=aGe({resource:"quote",downloadType:"download_e_quote"}),_=tGe({entity:"quote"}),{setChangeTemplateResources:b,setChangeTemplateVisible:y,setChangeTemplateEntityContext:C}=qR(),E=k=>{r({...k,id:"",number:"",documents:[],date:Un().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[k=>!!i&&p(gt,{to:At("/quotes/:id/edit",{id:k.id}),icon:p(nt,{element:wF}),children:e("edit")}),()=>!!i&&p(vi,{withoutPadding:!0}),k=>p(gt,{to:At("/quotes/:id/pdf",{id:k.id}),icon:p(nt,{element:oq}),children:e("view_pdf")}),k=>Tr(k)!==nr.Deleted&&p(gt,{onClick:()=>g([k.id]),icon:p(nt,{element:P9e}),disablePreventNavigation:!0,children:e("print_pdf")}),k=>p(gt,{onClick:()=>m(k),icon:p(nt,{element:sS}),disablePreventNavigation:!0,children:e("download_pdf")}),k=>!!(o!=null&&o.settings.enable_e_invoice)&&p(gt,{onClick:()=>v(k),icon:p(nt,{element:sS}),disablePreventNavigation:!0,children:e("download_e_quote")}),k=>k.status_id!==wf.Converted&&k.status_id!==wf.Approved&&(s||a)&&p(gt,{onClick:()=>_(k.id),icon:p(nt,{element:cme}),children:e("schedule")}),k=>p(OG,{entity:"quote",entityId:k.id,label:`#${k.number}`,labelElement:p(gt,{icon:p(nt,{element:rq}),children:e("add_comment")})}),k=>p(gt,{to:At("/quotes/:id/email",{id:k.id}),icon:p(nt,{element:dme}),children:e("email_quote")}),k=>p(gt,{onClick:()=>k&&Zqe(k),icon:p(nt,{element:hme}),disablePreventNavigation:!0,children:e("client_portal")}),k=>k.status_id===wf.Draft&&p(gt,{onClick:()=>h(k),icon:p(nt,{element:M9e}),disablePreventNavigation:!0,children:e("mark_sent")}),k=>(k.status_id===wf.Draft||k.status_id===wf.Sent)&&p(gt,{onClick:()=>c(k),icon:p(nt,{element:sme}),disablePreventNavigation:!0,children:e("approve")}),k=>k.status_id!==wf.Converted&&f("create_invoice")&&p(gt,{onClick:()=>u([k.id],"convert_to_invoice"),icon:p(nt,{element:fme}),disablePreventNavigation:!0,children:e("convert_to_invoice")}),k=>!k.project_id&&f("create_project")&&p(Bsn,{selectedIds:[k.id],disablePreventNavigation:!0}),k=>p(gt,{onClick:()=>{y(!0),b([k]),C({endpoint:"/api/v1/quotes/bulk",entity:"quote"})},icon:p(nt,{element:SR}),children:e("run_template")}),()=>p(vi,{withoutPadding:!0}),k=>f("create_quote")&&p(gt,{onClick:()=>E(k),icon:p(nt,{element:t0}),children:e("clone_to_quote")}),k=>p($sn,{quote:k}),()=>(l||!!t)&&p(vi,{withoutPadding:!0}),k=>(l||!!t)&&k.archived_at===0&&p(gt,{onClick:()=>u([k.id],"archive"),icon:p(nt,{element:Dc}),disablePreventNavigation:!0,children:e("archive")}),k=>(l||!!t)&&k.archived_at>0&&p(gt,{onClick:()=>u([k.id],"restore"),icon:p(nt,{element:Lc}),disablePreventNavigation:!0,children:e("restore")}),k=>(l||!!t)&&!(k!=null&&k.is_deleted)&&p(gt,{onClick:()=>u([k.id],"delete"),icon:p(nt,{element:el}),disablePreventNavigation:!0,children:e("delete")})]}const Vsn=["status","number","client","amount","date","valid_until"];function Hsn(){const[n,e,t,i]=cp({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 Ikr(){var b;const{t:n}=ve(),{dateFormat:e}=sc();Hsn();const t=Ss(),i=ki(),r=UR(),o=hs(),s=nE(),a=ef(),l=_l(),c=$R(),u=Gk(),d=w.useCallback(y=>{let C="";return y.invitations.map(E=>{E.viewed_date&&(C=E.viewed_date)}),C},[]),[h,f,g,m]=cp({entity:"invoice"}),v=[{column:"status",id:"status_id",label:n("status"),format:(y,C)=>O("div",{className:"flex items-center space-x-2",children:[p(Msn,{entity:C}),C.status_id===wf.Converted&&C.invoice_id&&p(Jve,{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:p(Nk,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>i(At("/invoices/:id/edit",{id:C.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(y,C)=>O("div",{className:"flex space-x-2",children:[p(Rf,{to:At("/quotes/:id/edit",{id:C.id}),renderSpan:s("quote",C),children:y}),p(Qve,{text:C.number})]})},{column:"client",id:"client_id",label:n("client"),format:(y,C)=>{var E;return p(Rf,{to:At("/clients/:id",{id:C.client_id}),renderSpan:s("client",C.client),children:(E=C.client)==null?void 0:E.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(y,C)=>{var E,x;return a(y,(E=C.client)==null?void 0:E.country_id,(x=C.client)==null?void 0:x.settings.currency_id)}},{column:"date",id:"date",label:n("date"),format:y=>xo(y,e)},{column:"valid_until",id:"due_date",label:n("valid_until"),format:(y,C)=>xo(C.due_date,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:y=>xo(y,e)},{column:"client_city",id:"client_id",label:n("client_city"),format:(y,C)=>{var E;return(E=C.client)==null?void 0:E.city}},{column:"client_country",id:"client_id",label:n("client_country"),format:(y,C)=>{var E,x,k;return((E=C.client)==null?void 0:E.country_id)&&((k=c((x=C.client)==null?void 0:x.country_id))==null?void 0:k.name)}},{column:"client_postal_code",id:"client_id",label:n("client_postal_code"),format:(y,C)=>{var E;return(E=C.client)==null?void 0:E.postal_code}},{column:"client_state",id:"client_id",label:n("client_state"),format:(y,C)=>{var E;return(E=C.client)==null?void 0:E.state}},{column:"contact_email",id:"client_id",label:n("contact_email"),format:(y,C)=>{var E;return C.client&&C.client.contacts.length>0&&p(Oc,{text:(E=C.client)==null?void 0:E.contacts[0].email})}},{column:"contact_name",id:"client_id",label:n("contact_name"),format:(y,C)=>{var E,x;return C.client&&C.client.contacts.length>0&&`${(E=C.client)==null?void 0:E.contacts[0].first_name} ${(x=C.client)==null?void 0:x.contacts[0].last_name}`}},{column:"created_at",id:"created_at",label:n("created_at"),format:y=>xo(y,e)},{column:h,id:"custom_value1",label:h,format:y=>u("invoice1",y==null?void 0:y.toString())},{column:f,id:"custom_value2",label:f,format:y=>u("invoice2",y==null?void 0:y.toString())},{column:g,id:"custom_value3",label:g,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 E,x;return C.is_amount_discount?a(y,(E=C.client)==null?void 0:E.country_id,(x=C.client)==null?void 0:x.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)=>p($m,{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?xo(d(C),e):n("no")},{column:"last_sent_date",id:"last_sent_date",label:n("last_sent_date"),format:y=>xo(y,e)},{column:"partial",id:"partial",label:n("partial"),format:(y,C)=>{var E,x;return a(y,(E=C.client)==null?void 0:E.country_id,(x=C.client)==null?void 0:x.settings.currency_id)}},{column:"partial_due_date",id:"partial_due_date",label:n("partial_due_date"),format:y=>xo(y,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:y=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(y)}})}),children:p("span",{children:i0(Xc(y)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:y=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(y)}})}),children:p("span",{children:i0(Xc(y)).slice(0,50)})})},{column:"tax_amount",id:"total_taxes",label:n("total_taxes"),format:(y,C)=>{var E,x;return a(y,(E=C.client)==null?void 0:E.country_id,(x=C.client)==null?void 0:x.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("last_updated"),format:y=>xo(y,e)}],_=((b=l==null?void 0:l.react_table_columns)==null?void 0:b.quote)||Vsn;return v.filter(y=>_.includes(y.column)).sort((y,C)=>_.indexOf(y.column)-_.indexOf(C.column))}function Wsn(){const[n]=ve(),e=kg();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 tw=(n=>(n.DRAFT="1",n.ACTIVE="2",n.PAUSED="3",n.COMPLETED="4",n.PENDING="-1",n))(tw||{});function zsn(n){const[e]=ve(),t=kg(),{status_id:i,is_deleted:r,archived_at:o,last_sent_date:s,remaining_cycles:a}=n.entity,l=i===tw.DRAFT,c=!!r,u=!!o,d=i===tw.ACTIVE&&!s,h=a===-1?"endless":a;return c?p(_r,{variant:"red",children:e("deleted")}):u?p(_r,{variant:"orange",children:e("archived")}):!l&&h===0?p(_r,{variant:"light-blue",style:{backgroundColor:t.$1},children:e("completed")}):d?p(_r,{variant:"dark-blue",style:{backgroundColor:t.$2},children:e("pending")}):l?p(_r,{variant:"generic",children:e("draft")}):i===tw.ACTIVE?p(_r,{variant:"green",style:{backgroundColor:t.$3},children:e("active")}):i===tw.PAUSED?p(_r,{variant:"orange",style:{backgroundColor:t.$4},children:e("paused")}):p(St,{})}/**
* 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 pf=(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))(pf||{});/**
* 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 Usn={[pf.FREQUENCY_ANNUALLY]:"freq_annually",[pf.FREQUENCY_DAILY]:"freq_daily",[pf.FREQUENCY_FOUR_MONTHS]:"freq_four_months",[pf.FREQUENCY_FOUR_WEEKS]:"freq_four_weeks",[pf.FREQUENCY_MONTHLY]:"freq_monthly",[pf.FREQUENCY_SIX_MONTHS]:"freq_six_months",[pf.FREQUENCY_THREE_MONTHS]:"freq_three_months",[pf.FREQUENCY_THREE_YEARS]:"freq_three_years",[pf.FREQUENCY_TWO_MONTHS]:"freq_two_months",[pf.FREQUENCY_TWO_WEEKS]:"freq_two_weeks",[pf.FREQUENCY_TWO_YEARS]:"freq_two_years",[pf.FREQUENCY_WEEKLY]:"freq_weekly",[pf.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 Lkr(n){return Ii(["/api/v1/recurring_invoices",n.id],()=>$e("GET",Ae("/api/v1/recurring_invoices/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:!!n.id})}function Dkr(n){const e=hs();return Ii(["/api/v1/recurring_invoices","create"],()=>$e("GET",Ae("/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 jsn={start:"started_recurring_invoice",stop:"stopped_recurring_invoice",update_prices:"updated_prices",increase_prices:"updated_prices"};function ibe(n){const e=Co(),t=Gi(Eu),{onSuccess:i,setErrors:r}=n||{};return(o,s,a)=>{he.processing(),$e("POST",Ae("/api/v1/recurring_invoices/bulk"),{action:s,ids:o,...typeof a=="number"&&{percentage_increase:a}}).then(()=>{const l=jsn[s]||`${s}d_recurring_invoice`;he.success(l),i==null||i(),t&&e.invalidateQueries([t]),In(["recurring_invoices"])}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(r==null||r(l.response.data),he.dismiss())})}}const qsn=n=>{const[e]=ve(),[t,i]=w.useState(!1),o=ibe({onSuccess:()=>{i(!1)}}),{selectedIds:s,setSelected:a}=n,l=()=>{o(s,"update_prices"),a==null||a([])};return O(St,{children:[p(gt,{onClick:()=>i(!0),icon:p(nt,{element:QEt}),children:e("update_prices")}),O(Or,{title:e("update_prices"),visible:t,onClose:()=>i(!1),children:[p("span",{className:"text-lg text-gray-900",children:e("are_you_sure")}),p(un,{className:"self-end",onClick:l,children:e("yes")})]})]})},Gsn=n=>{const[e]=ve(),[t,i]=w.useState(!1),[r,o]=w.useState(0),[s,a]=w.useState(),l=()=>{i(!1),o(0)},c=ibe({onSuccess:l,setErrors:a}),{selectedIds:u,setSelected:d}=n,h=()=>{c(u,"increase_prices",r),d==null||d([])};return O(St,{children:[p(gt,{onClick:()=>i(!0),icon:p(nt,{element:$At}),children:e("increase_prices")}),O(Or,{title:e("increase_prices"),visible:t,onClose:l,children:[p(mo,{label:e("percent"),value:r||"",onValueChange:f=>{o(parseFloat(f)),s&&a(void 0)},errorMessage:s==null?void 0:s.errors.percentage_increase}),p(un,{className:"self-end",onClick:h,children:e("submit")})]})]})};function Ksn(n){const[e]=ve(),t=ki(),{recurringInvoice:i}=n,r=hs(),o=Wi(RG),s=Wi(tbe),a=Wi(O1),l=Wi(LG),c=Zi(),[u,d]=w.useState(!1),h=()=>{a({...i,id:"",documents:[],number:"",due_date:"",partial_due_date:"",date:Un().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")},f=()=>{o({...i,id:"",number:"",documents:[],date:Un().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")},g=()=>{s({...i,id:"",number:"",documents:[],date:Un().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:Un().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 O(St,{children:[(r("create_invoice")||r("create_quote")||r("create_credit")||r("create_purchase_order"))&&p(gt,{onClick:()=>d(!0),icon:p(nt,{element:t0}),children:e("clone_to_other")}),p(Or,{title:e("clone_to"),visible:u,onClose:()=>d(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:p("div",{className:"flex justify-center",children:O("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[r("create_invoice")&&p(pm,{label:e("invoice"),icon:oS,onClick:h}),r("create_quote")&&p(pm,{label:e("quote"),icon:Sge,onClick:f}),r("create_credit")&&p(pm,{label:e("credit"),icon:oS,onClick:g}),r("create_purchase_order")&&p(pm,{label:e("purchase_order"),icon:$me,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 PG(){const n=Ti();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 Ysn(){const n=Ti(),{data:e}=ph(),[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 dGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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 v={date:m,utc:!0,args:arguments};return new s(v)},l.utc=function(m){var v=a(this.toDate(),{locale:this.$L,utc:!0});return m?v.add(this.utcOffset(),t):v},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,v){var _=this.$utils().u;if(_(m))return this.$u?0:_(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(E){E===void 0&&(E="");var x=E.match(i);if(!x)return null;var k=(""+x[0]).match(r)||["-",0,0],L=k[0],D=60*+k[1]+ +k[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(v)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 v=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},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 f=l.toDate;l.toDate=function(m){return m==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var g=l.diff;l.diff=function(m,v,_){if(m&&this.$u===m.$u)return g.call(this,m,v,_);var b=this.local(),y=a(m).local();return g.call(b,y,v,_)}}})})(dGe);var Qsn=dGe.exports;const Xsn=nl(Qsn);var hGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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,f,g){g===void 0&&(g={});var m=new Date(h),v=function(_,b){b===void 0&&(b={});var y=b.timeZoneName||"short",C=_+"|"+y,E=i[C];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:_,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:y}),i[C]=E),E}(f,g);return v.formatToParts(m)},c=function(h,f){for(var g=l(h,f),m=[],v=0;v<g.length;v+=1){var _=g[v],b=_.type,y=_.value,C=t[b];C>=0&&(m[C]=parseInt(y,10))}var E=m[3],x=E===24?0:E,k=m[0]+"-"+m[1]+"-"+m[2]+" "+x+":"+m[4]+":"+m[5]+":000",L=+h;return(s.utc(k).valueOf()-(L-=L%1e3))/6e4},u=o.prototype;u.tz=function(h,f){h===void 0&&(h=a);var g=this.utcOffset(),m=this.toDate(),v=m.toLocaleString("en-US",{timeZone:h}),_=Math.round((m-new Date(v))/1e3/60),b=s(v,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(m.getTimezoneOffset()/15)-_,!0);if(f){var y=b.utcOffset();b=b.add(g-y,"minute")}return b.$x.$timezone=h,b},u.offsetName=function(h){var f=this.$x.$timezone||s.tz.guess(),g=l(this.valueOf(),f,{timeZoneName:h}).find(function(m){return m.type.toLowerCase()==="timezonename"});return g&&g.value};var d=u.startOf;u.startOf=function(h,f){if(!this.$x||!this.$x.$timezone)return d.call(this,h,f);var g=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(g,h,f).tz(this.$x.$timezone,!0)},s.tz=function(h,f,g){var m=g&&f,v=g||f||a,_=c(+s(),v);if(typeof h!="string")return s(h).tz(v);var b=function(x,k,L){var D=x-60*k*1e3,A=c(D,L);if(k===A)return[D,k];var N=c(D-=60*(A-k)*1e3,L);return A===N?[D,A]:[x-60*Math.min(A,N)*1e3,Math.max(A,N)]}(s.utc(h,m).valueOf(),_,v),y=b[0],C=b[1],E=s(y).utcOffset(C);return E.$x.$timezone=v,E},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){a=h}}})})(hGe);var Zsn=hGe.exports;const Jsn=nl(Zsn);/**
* 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
*/Un.extend(Xsn);Un.extend(Jsn);function ean(){const{timeZone:n}=Ysn(),{timeFormat:e}=PG(),{dateFormat:t}=sc();return(i,r,o,s)=>{if(i===0||i===""||i===void 0)return"";const a=`${r||t} ${o||e}`;return Un.utc(i).tz(s||n).format(a)}}function Akr(n){const e=XS(),t=Ti(),[i,r]=us(NG),[,o]=us(Csn),s=(f,g)=>{r(m=>m&&{...m,[f]:g})};return{handleChange:s,handleInvitationChange:(f,g)=>{let m=[...i.invitations];const v=(m==null?void 0:m.find(_=>_.client_contact_id===f))||-1;if(v!==-1&&g===!1&&(m=m.filter(_=>_.client_contact_id!==f)),v===-1){const _={client_contact_id:f};m.push(_)}s("invitations",m)},handleLineItemChange:(f,g)=>{const m=(i==null?void 0:i.line_items)||[];m[f]=g,r(v=>v&&{...v,line_items:m})},handleLineItemPropertyChange:(f,g,m)=>{const v=(i==null?void 0:i.line_items)||[];v[m][f]=g,r(_=>_&&{..._,line_items:v})},handleCreateLineItem:f=>{r(g=>g&&{...g,line_items:[...g.line_items,{...P1(),type_id:f,quantity:1}]})},handleDeleteLineItem:f=>{const g=(i==null?void 0:i.line_items)||[];g.splice(f,1),r(m=>m&&{...m,line_items:g})},calculateInvoiceSum:f=>{var m;const g=e(((m=n.client)==null?void 0:m.settings.currency_id)||(t==null?void 0:t.settings.currency_id));if(g&&f){const v=f.uses_inclusive_taxes?new uGe(f,g).build():new lGe(f,g).build();o(v)}}}}function Rkr(n){const{setErrors:e}=n,t=Wi(iE);return(i,r)=>{he.processing(),e(void 0);const o=r?`/api/v1/recurring_invoices/:id?${r}=true`:"/api/v1/recurring_invoices/:id";$e("PUT",Ae(o,{id:i.id}),i).then(()=>{In(["recurring_invoices"]),he.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?he.error(l.errors.amount[0]):he.dismiss(),e(l)}}).finally(()=>t(void 0))}}function tan(){const n=Co(),e=Gi(Eu);return(t,i)=>{he.processing(),$e("PUT",Ae(i==="start"?"/api/v1/recurring_invoices/:id?start=true":"/api/v1/recurring_invoices/:id?stop=true",{id:t.id}),t).then(()=>{In(["recurring_invoices"]),e&&n.invalidateQueries([e]),he.success(i==="start"?"started_recurring_invoice":"stopped_recurring_invoice")})}}function Nkr(n){const[e]=ve(),t=ibe(),i=ki(),r=hs(),o=tan(),s=Wi(NG),{showEditAction:a,showCommonBulkActions:l}=n||{},{isEditPage:c}=tE({entity:"recurring_invoice",editPageTabs:["documents","settings","activity","history","schedule"]}),u=h=>{s({...h,id:"",documents:[],number:""}),i("/recurring_invoices/create?action=clone")};return[h=>!!a&&p(gt,{to:At("/recurring_invoices/:id/edit",{id:h.id}),icon:p(nt,{element:wF}),children:e("edit")}),()=>!!a&&p(vi,{withoutPadding:!0}),h=>p(gt,{to:At("/recurring_invoices/:id/pdf",{id:h.id}),icon:p(nt,{element:oq}),children:e("view_pdf")}),h=>(h.status_id===tw.DRAFT||h.status_id===tw.PAUSED)&&p(gt,{onClick:()=>o(h,"start"),icon:p(nt,{element:ame}),children:e("start")}),h=>h.status_id===tw.ACTIVE&&p(gt,{onClick:()=>o(h,"stop"),icon:p(nt,{element:ume}),children:e("stop")}),h=>!h.is_deleted&&p(qsn,{selectedIds:[h.id]}),h=>!h.is_deleted&&p(Gsn,{selectedIds:[h.id]}),h=>p(OG,{entity:"recurring_invoice",entityId:h.id,label:`#${h.number}`,labelElement:p(gt,{icon:p(nt,{element:rq}),children:e("add_comment")})}),()=>p(vi,{withoutPadding:!0}),h=>r("create_recurring_invoice")&&p(gt,{onClick:()=>u(h),icon:p(nt,{element:t0}),children:e("clone_to_recurring")}),h=>p(Ksn,{recurringInvoice:h}),()=>(c||!!l)&&p(vi,{withoutPadding:!0}),h=>(c||!!l)&&Tr(h)===nr.Active&&p(gt,{onClick:()=>t([h.id],"archive"),icon:p(nt,{element:Dc}),children:e("archive")}),h=>(c||!!l)&&(Tr(h)===nr.Archived||Tr(h)===nr.Deleted)&&p(gt,{onClick:()=>t([h.id],"restore"),icon:p(nt,{element:Lc}),children:e("restore")}),h=>(c||!!l)&&(Tr(h)===nr.Active||Tr(h)===nr.Archived)&&p(gt,{onClick:()=>t([h.id],"delete"),icon:p(nt,{element:el}),children:e("delete")})]}function Okr({setErrors:n}){const e=ki(),t=Wi(iE);return(i,r)=>{n(void 0),he.processing();const o=r?`/api/v1/recurring_invoices?${r}=true`:"/api/v1/recurring_invoices";$e("POST",Ae(o),i).then(s=>{he.success("created_recurring_invoice"),In(["recurring_invoices"]),e(At("/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?he.error(l.errors.amount[0]):he.dismiss(),n(l)}}).finally(()=>t(void 0))}}const nan=["status","number","client","amount","remaining_cycles","next_send_date","frequency","due_date_days","auto_bill"];function ian(){const[n,e,t,i]=cp({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 Pkr(){var g;const{t:n}=ve(),{dateFormat:e}=sc(),t=ean(),i=UR(),r=nE();ian();const o=ef(),s=_l(),a=Gk(),[l,c,u,d]=cp({entity:"invoice"}),h=[{column:"status",id:"status_id",label:n("status"),format:(m,v)=>p(zsn,{entity:v})},{column:"number",id:"number",label:n("number"),format:(m,v)=>p(Rf,{to:At("/recurring_invoices/:id/edit",{id:v.id}),renderSpan:r("recurring_invoice",v),children:m})},{column:"client",id:"client_id",label:n("client"),format:(m,v)=>{var _;return p(Rf,{to:At("/clients/:id",{id:v.client_id}),renderSpan:r("client",v.client),children:(_=v.client)==null?void 0:_.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(m,v)=>{var _,b;return o(m,(_=v.client)==null?void 0:_.country_id,(b=v.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=>p(u3,{for:Usn,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=>xo(m,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:m=>xo(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,v)=>{var _,b;return v.is_amount_discount?o(m,(_=v.client)==null?void 0:_.country_id,(b=v.client)==null?void 0:b.settings.currency_id):`${i(m)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(m,v)=>v.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(m,v)=>p($m,{entity:v})},{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=>xo(m,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:m=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":s.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(m)}})}),children:p("span",{children:i0(Xc(m)).slice(0,50)})})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:m=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":s.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(m)}})}),children:p("span",{children:i0(Xc(m)).slice(0,50)})})},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:m=>xo(m,e)}],f=((g=s==null?void 0:s.react_table_columns)==null?void 0:g.recurringInvoice)||nan;return h.filter(m=>f.includes(m.column)).sort((m,v)=>f.indexOf(m.column)-f.indexOf(v.column))}function ran(){const[n]=ve(),e=kg();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 oan(){const[n]=ve(),e=kg();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 san=Ro(void 0);var fGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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},f=function(x){return x instanceof C},g=function(x,k,L){return new C(x,L,k.$l)},m=function(x){return i.p(x)+"s"},v=function(x){return x<0},_=function(x){return v(x)?Math.ceil(x):Math.floor(x)},b=function(x){return Math.abs(x)},y=function(x,k){return x?v(x)?{negative:!0,format:""+b(x)+k}:{negative:!1,format:""+x+k}:{negative:!1,format:""}},C=function(){function x(L,D,A){var N=this;if(this.$d={},this.$l=A,L===void 0&&(this.$ms=0,this.parseFromMilliseconds()),D)return g(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){N.$d[m(B)]=L[B]}),this.calMilliseconds(),this;if(typeof L=="string"){var P=L.match(d);if(P){var M=P.slice(2).map(function(B){return B!=null?Number(B):0});return this.$d.years=M[0],this.$d.months=M[1],this.$d.weeks=M[2],this.$d.days=M[3],this.$d.hours=M[4],this.$d.minutes=M[5],this.$d.seconds=M[6],this.calMilliseconds(),this}}return this}var k=x.prototype;return k.calMilliseconds=function(){var L=this;this.$ms=Object.keys(this.$d).reduce(function(D,A){return D+(L.$d[A]||0)*h[A]},0)},k.parseFromMilliseconds=function(){var L=this.$ms;this.$d.years=_(L/c),L%=c,this.$d.months=_(L/u),L%=u,this.$d.days=_(L/a),L%=a,this.$d.hours=_(L/s),L%=s,this.$d.minutes=_(L/o),L%=o,this.$d.seconds=_(L/r),L%=r,this.$d.milliseconds=L},k.toISOString=function(){var L=y(this.$d.years,"Y"),D=y(this.$d.months,"M"),A=+this.$d.days||0;this.$d.weeks&&(A+=7*this.$d.weeks);var N=y(A,"D"),P=y(this.$d.hours,"H"),M=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"),U=L.negative||D.negative||N.negative||P.negative||M.negative||F.negative,H=P.format||M.format||F.format?"T":"",W=(U?"-":"")+"P"+L.format+D.format+N.format+H+P.format+M.format+F.format;return W==="P"||W==="-P"?"P0D":W},k.toJSON=function(){return this.toISOString()},k.format=function(L){var D=L||"YYYY-MM-DDTHH:mm:ss",A={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(N,P){return P||String(A[N])})},k.as=function(L){return this.$ms/h[m(L)]},k.get=function(L){var D=this.$ms,A=m(L);return A==="milliseconds"?D%=1e3:D=A==="weeks"?_(D/h[A]):this.$d[A],D||0},k.add=function(L,D,A){var N;return N=D?L*h[m(D)]:f(L)?L.$ms:g(L,this).$ms,g(this.$ms+N*(A?-1:1),this)},k.subtract=function(L,D){return this.add(L,D,!0)},k.locale=function(L){var D=this.clone();return D.$l=L,D},k.clone=function(){return g(this.$ms,this)},k.humanize=function(L){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!L)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},x}(),E=function(x,k,L){return x.add(k.years()*L,"y").add(k.months()*L,"M").add(k.days()*L,"d").add(k.hours()*L,"h").add(k.minutes()*L,"m").add(k.seconds()*L,"s").add(k.milliseconds()*L,"ms")};return function(x,k,L){t=L,i=L().$utils(),L.duration=function(N,P){var M=L.locale();return g(N,{$l:M},P)},L.isDuration=f;var D=k.prototype.add,A=k.prototype.subtract;k.prototype.add=function(N,P){return f(N)?E(this,N,1):D.bind(this)(N,P)},k.prototype.subtract=function(N,P){return f(N)?E(this,N,-1):A.bind(this)(N,P)}}})})(fGe);var aan=fGe.exports;const lan=nl(aan);var pGe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Po,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,f){for(var g,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 E=b[C];E.d&&(g=h?r(c).diff(d,E.d,!0):d.diff(c,E.d,!0));var x=(t.rounding||Math.round)(Math.abs(g));if(v=g>0,x<=E.r||!E.r){x<=1&&C>0&&(E=b[C-1]);var k=_[E.l];f&&(x=f(""+x)),m=typeof k=="string"?k.replace("%d",x):k(x,u,E.l,v);break}}if(u)return m;var L=v?_.future:_.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)}}})})(pGe);var can=pGe.exports;const uan=nl(can);/**
* 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 Hm(n){if(n===""||n==="[]")return[];const e=[[0,0,"",!0]],t=JSON.parse(n);return t.length?t:e}function dan(n,e=!1){const t=Hm(n);let i=0;for(const[a,l]of t){if(a>l&&!e)continue;const u=(l!==0?typeof l=="number"?l:0:Math.floor(Date.now()/1e3))-(typeof a=="number"?a:0);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 Mkr(n,e){const t=Hm(n);Un.extend(lan),Un.extend(uan);let i=0;if(e!=null&&e.calculateLastTimeLog){const r=t.length-1,o=t[r][0],s=o?Un.unix(o):Un();i+=Un().diff(s,"seconds")}else t.map(([r,o])=>{const s=r?Un.unix(r):Un(),a=o?Un.unix(o):Un();i+=a.diff(s,"seconds")});return e!=null&&e.inSeconds?i.toString():i>86400?Un.duration(i,"seconds").humanize():Un.duration(i,"seconds").format("HH:mm:ss")}function Fkr(n,e){const i=Hm(n)[e],r=i?Un.unix(i[0]):Un(),s=(i?Un.unix(i[1]):Un()).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 gGe(n){const{isAdmin:e}=Fo();return Ii(["/api/v1/task_statuses","create"],()=>$e("GET",Ae("/api/v1/task_statuses/create")).then(t=>t.data.data),{staleTime:1/0,enabled:e?(n==null?void 0:n.enabled)??!0:!1})}function mGe(n){return Ii(["/api/v1/task_statuses",n],()=>$e("GET",Ae("/api/v1/task_statuses?status=:status",{status:(n==null?void 0:n.status)||"all"})).then(e=>e.data),{staleTime:1/0})}function han(n){return Ii(["/api/v1/task_statuses",n.id],()=>$e("GET",Ae("/api/v1/task_statuses/:id",{id:n.id})),{staleTime:1/0})}function fan(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/task_statuses/bulk"),{action:e,ids:[n]}).then(()=>{he.success(`${e}d_task_status`),In(["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 _Ge(n){let e=!1;const i=Hm(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 pan(n){const{isFormBusy:e,setErrors:t,setIsFormBusy:i}=n;return r=>{if(!e){if(i(!0),he.processing(),_Ge(r))return i(!1),he.error("task_errors");$e("PUT",Ae("/api/v1/tasks/:id",{id:r.id}),r).then(()=>{he.success("updated_task"),In(["tasks"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(he.dismiss(),t==null||t(o.response.data))}).finally(()=>i(!1))}}}function rbe(n){return(e,t)=>{n.setErrors(void 0),n.setTaskStatus(i=>i&&{...i,[e]:t})}}function gan(){const[n]=ve(),e=fan();return[i=>i.archived_at===0&&p(gt,{onClick:()=>e(i.id,"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),i=>i.archived_at>0&&p(gt,{onClick:()=>e(i.id,"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),i=>!i.is_deleted&&p(gt,{onClick:()=>e(i.id,"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function man(n){const[e]=ve(),t=Ss(),{data:i}=gGe(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState(),u=rbe({setErrors:o,setTaskStatus:c}),d=()=>{s||(he.processing(),o(void 0),a(!0),$e("POST",Ae("/api/v1/task_statuses"),l).then(h=>{var f;he.success("created_task_status"),In(["task_statuses"]),c(i),(f=n.onCreatedTaskStatus)==null||f.call(n,h.data.data),n.setVisible(!1)}).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===422&&(o(h.response.data),he.dismiss())}).finally(()=>a(!1)))};return w.useEffect(()=>{i&&c(i)},[i]),O(Or,{title:e("new_task_status"),visible:n.visible,onClose:()=>{n.setVisible(!1),c(i)},children:[p(Ze,{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}),p(pg,{children:e("color")}),p(jk,{value:(l==null?void 0:l.color)||t,onValueChange:h=>u("color",h)}),p(un,{className:"self-end",behavior:"button",disabled:s,onClick:d,children:e("save")})]})}function NDe(n){const[e]=ve(),t=si(),{isAdmin:i,isOwner:r}=Fo(),{visible:o,isFormBusy:s,setIsFormBusy:a,task:l,setVisible:c}=n,[u,d]=w.useState(!1),{data:h}=mGe({status:"active"}),f=pan({isFormBusy:s,setIsFormBusy:a});return O(St,{children:[p(PF,{placement:"bottom",interactive:!0,render:()=>O("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)&&p(gt,{className:"font-medium text-center py-3",onClick:()=>{d(!0),c(!1)},children:e("new_task_status")}),h==null?void 0:h.data.map((g,m)=>g.id!==l.status_id&&p(gt,{onClick:()=>{c(!1),f({...l,status_id:g.id})},children:g.name},m)),!(h!=null&&h.data.length)&&p("div",{className:"font-medium text-center py-2 text-xs",children:e("no_records_found")})]}),visible:o,children:p("div",{})}),p(man,{visible:u,setVisible:d,onCreatedTaskStatus:g=>f({...l,status_id:g.id})})]})}function _an(n){const[e]=ve(),t=w.useRef(null),i=FF(),r=kg(),{invoice_id:o,archived_at:s,is_deleted:a,time_log:l,status:c}=n.entity,[u,d]=w.useState(!1),[h,f]=w.useState(!1);m1(t,()=>{u&&d(!1)});const g=()=>{const m=Hm(l),v=m.length;return v?m[v-1][1]===0:!1};if(a)return p(_r,{variant:"red",children:e("deleted")});if(s)return p(_r,{variant:"orange",children:e("archived")});if(o)return p(_r,{variant:"green",style:{backgroundColor:r.$3},children:e("invoiced")});if(g())return p(_r,{variant:"light-blue",style:{backgroundColor:r.$2},children:e("running")});if(c){const{red:m,green:v,blue:_,hex:b}=DR(c.color),y=MF(m,v,_)?-220:220;return O("div",{ref:t,onClick:C=>C.stopPropagation(),children:[p(Yu,{width:"auto",message:e("change_status"),withoutArrow:!0,placement:"bottom",children:p(u3,{for:{},code:c.name,style:{color:i(b,y),backgroundColor:c.color},onClick:()=>!h&&d(C=>!C)})}),p(NDe,{visible:u,isFormBusy:h,setIsFormBusy:f,task:n.entity,setVisible:d})]})}return O("div",{ref:t,onClick:m=>m.stopPropagation(),children:[p(Yu,{width:"auto",message:e("change_status"),withoutArrow:!0,placement:"bottom",children:p(u3,{for:{},code:"logged",onClick:()=>!h&&d(m=>!m)})}),p(NDe,{visible:u,isFormBusy:h,setIsFormBusy:f,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 Oy(n){let e=!1;return Hm(n.time_log).forEach(([,t])=>{t===0&&(e=!0)}),e}function van(n){return n.invoice_id?"invoiced":Oy(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 obe(){const n=Ti(),e=jR(),t=r=>r||(n!=null&&n.use_comma_as_decimal_place?".":","),i=r=>r||(n!=null&&n.use_comma_as_decimal_place?",":".");return(r,o,s,a)=>iae(r,{thousandSeparator:t(o),decimalSeparator:i(s),decimalScale:a||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 ban(){const n=ph();return e=>{var t;if(n)return(t=n.data)==null?void 0:t.date_formats.find(i=>i.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
*/function sbe(){const n=Ti(),e=DG(),t=ban(),i=r=>r?"HH:mm:ss":"hh:mm:ss A";return async r=>{const s={dateFormat:t(n==null?void 0:n.settings.date_format_id),timeFormat:i(!!(n!=null&&n.settings.military_time))};return r.length>=1&&await e.find(r).then(a=>{a.settings.date_format_id&&(s.dateFormat=t(a.settings.date_format_id)),s.timeFormat=i(!!a.settings.military_time)}),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 vGe(n){const[e]=ve(),{onlyAddToInvoice:t}=n||{},i=ki(),r=obe(),o=AG(),s=Ti(),{data:a}=IG(),{timeFormat:l}=PG(),c=jR(),{dateFormat:u}=sc(),d=Wi(O1),h=UR(),f=sbe(),g=(m,v)=>{const _=Hm(m);let b=0;return _.length&&_.forEach(([y,C,,E])=>{if(E||!(s!=null&&s.settings.allow_billable_task_items)||typeof E>"u"){const x=Un.unix(y),k=Un.unix(C);b+=k.diff(x,"seconds")/3600,b=Number(b.toFixed(v||c))}}),b};return async m=>{var v,_,b,y,C,E,x,k,L,D,A;if(a){const N={...a};if(s&&s.enabled_tax_rates>0&&(N.tax_name1=(v=s.settings)==null?void 0:v.tax_name1,N.tax_rate1=(_=s.settings)==null?void 0:_.tax_rate1),s&&s.enabled_tax_rates>1&&(N.tax_name2=(b=s.settings)==null?void 0:b.tax_name2,N.tax_rate2=(y=s.settings)==null?void 0:y.tax_rate2),s&&s.enabled_tax_rates>2&&(N.tax_name3=(C=s.settings)==null?void 0:C.tax_name3,N.tax_rate3=(E=s.settings)==null?void 0:E.tax_rate3),N.uses_inclusive_taxes=((x=s==null?void 0:s.settings)==null?void 0:x.inclusive_taxes)??!1,Ja(m).pluck("client_id").unique().toArray().length>1)return he.error("multiple_client_error");N.client_id=m[0].client_id,(k=m[0])!=null&&k.project_id&&(N.project_id=(L=m[0])==null?void 0:L.project_id);const M=await o((D=m[0])==null?void 0:D.client_id,"client_id"),{dateFormat:B,timeFormat:F}=await f((A=m[0])==null?void 0:A.client_id);m.forEach(U=>{var oe,Q;const H=Hm(U.time_log),W=[];H.forEach(([Ne,Ve,Ye,ye])=>{if(ye||!(s!=null&&s.settings.allow_billable_task_items)||typeof ye>"u"){let He="";if(s.invoice_task_hours){const Ge=Un.unix(Ne),Fe=Un.unix(Ve),bt=r((Fe.diff(Ge,"seconds")/3600).toString(),M==null?void 0:M.thousandSeparator,M==null?void 0:M.decimalSeparator,M==null?void 0:M.precision);He=`• ${h(bt)} ${e("hours")}`}const Pe=[];(s.invoice_task_datelog||s.invoice_task_timelog)&&Pe.push(`<div class="task-time-details">
`),s.invoice_task_datelog&&Pe.push(Un.unix(Ne).format(B!=null&&B.format_moment?B.format_moment:u)),s.invoice_task_timelog&&Pe.push(Un.unix(Ne).format(F||l)+" - "),s.invoice_task_timelog&&Pe.push(Un.unix(Ve).format(F||l)),s.invoice_task_hours&&Pe.push(He),s.invoice_task_item_description&&Ye&&Pe.push(`
${Ye}`),(s.invoice_task_datelog||s.invoice_task_timelog)&&(Pe.push(`
`),Pe.push(`</div>
`)),W.push(Pe.join(" "))}});const q=g(U.time_log,c),V={...P1(),type_id:vv.Task,cost:U.rate,quantity:q,line_total:Number((U.rate*q).toFixed(c)),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},re=s.invoice_task_project&&((oe=U==null?void 0:U.project)!=null&&oe.name)?"## "+((Q=U.project)==null?void 0:Q.name)+`
`:"";W.length&&(V.notes=re+(U==null?void 0:U.description)+" "+W.join(" ")),typeof N.line_items=="string"&&(N.line_items=[]),N.line_items.push(V)}),t?d(U=>U&&{...U,line_items:[...U.line_items,...N.line_items]}):(d(N),i(At("/invoices/create?table=tasks&project=:projectAssigned&action=invoice_task",{projectAssigned:!!m[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 yan(){const n=Co(),e=Gi(Eu),t=ml();return i=>{he.processing(),$e("PUT",Ae("/api/v1/tasks/:id?start=true",{id:i.id}),i).then(()=>{t.pathname.endsWith("/create")?he.dismiss():he.success("started_task"),In(["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 Can(){const n=Co(),e=Gi(Eu);return t=>{he.processing();const i=Hm(t.time_log),r=i[i.length-1][0],o=Un().unix();if(r&&r>o)i[i.length-1][1]=r+1,t.time_log=JSON.stringify(i);else if(_Ge(t))return he.error("task_errors");$e("PUT",Ae("/api/v1/tasks/:id?stop=true",{id:t.id}),t).then(()=>{he.success("stopped_task"),In(["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 Bkr(n){return Ii(["/api/v1/tasks",n.id],()=>$e("GET",Ae("/api/v1/tasks/:id?include=status",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:n.enabled??!0})}function $kr(n){const e=hs();return Ii(["/api/v1/tasks/create"],()=>$e("GET",Ae("/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 Vkr(n){return Ii(["/api/v1/tasks",n],()=>$e("GET",Ae(":endpoint",{endpoint:n.endpoint||"/api/v1/tasks"})).then(e=>e.data),{staleTime:1/0})}const bGe=()=>{const n=Co(),e=Gi(Eu);return(t,i)=>{he.processing(),$e("POST",Ae("/api/v1/tasks/bulk"),{action:i,ids:t}).then(()=>{i!=="start"&&i!=="stop"&&he.success(`${i}d_task`),i==="start"&&he.success(Ca("started_tasks",{value:t.length})),i==="stop"&&he.success(Ca("stopped_tasks",{value:t.length})),e&&n.invalidateQueries([e]),In(["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 yGe=(n,e)=>{const t=Hm(n);let i=0;return t.length&&t.forEach(([r,o])=>{if(r&&o){const s=Un.unix(r),a=Un.unix(o);i+=Number((a.diff(s,"seconds")/3600).toFixed(e))}}),i};function Hkr(){const[n]=ve(),e=ki(),t=obe(),i=AG(),r=sbe(),o=Ti(),s=jR(),{data:a}=IG(),{timeFormat:l}=PG(),{dateFormat:c}=sc(),u=Wi(O1);return async(d,h,f)=>{var g,m,v,_,b,y;if(a){const C={...a};if(o&&o.enabled_tax_rates>0&&(C.tax_name1=(g=o.settings)==null?void 0:g.tax_name1,C.tax_rate1=(m=o.settings)==null?void 0:m.tax_rate1),o&&o.enabled_tax_rates>1&&(C.tax_name2=(v=o.settings)==null?void 0:v.tax_name2,C.tax_rate2=(_=o.settings)==null?void 0:_.tax_rate2),o&&o.enabled_tax_rates>2&&(C.tax_name3=(b=o.settings)==null?void 0:b.tax_name3,C.tax_rate3=(y=o.settings)==null?void 0:y.tax_rate3),Ja(d).pluck("client_id").unique().toArray().length>1)return he.error("multiple_client_error");C.project_id=f,C.client_id=h,C.line_items=[];const x=await i(h,"client_id"),{dateFormat:k,timeFormat:L}=await r(h);d.forEach(D=>{var F,U;const A=Hm(D.time_log),N=[];A.forEach(([H,W,q,V])=>{if(V||!(o!=null&&o.settings.allow_billable_task_items)||typeof V>"u"){let re="";if(o.invoice_task_hours){const Q=Un.unix(H),Ne=Un.unix(W);re=`• ${t((Ne.diff(Q,"seconds")/3600).toString(),x==null?void 0:x.thousandSeparator,x==null?void 0:x.decimalSeparator,x==null?void 0:x.precision)} ${n("hours")}`}const oe=[];(o.invoice_task_datelog||o.invoice_task_timelog)&&oe.push(`<div class="task-time-details">
`),o.invoice_task_datelog&&oe.push(Un.unix(H).format(k!=null&&k.format_moment?k.format_moment:c)),o.invoice_task_timelog&&oe.push(Un.unix(H).format(L||l)+" - "),o.invoice_task_timelog&&oe.push(Un.unix(W).format(L||l)),o.invoice_task_hours&&oe.push(re),o.invoice_task_item_description&&q&&oe.push(`
${q}`),(o.invoice_task_datelog||o.invoice_task_timelog)&&(oe.push(`
`),oe.push(`</div>
`)),N.push(oe.join(" "))}});const P=yGe(D.time_log,s),M={...P1(),type_id:vv.Task,cost:D.rate,quantity:P,line_total:Number((D.rate*P).toFixed(s)),task_id:D.id,tax_id:""},B=(F=D==null?void 0:D.project)!=null&&F.name?"## "+((U=D.project)==null?void 0:U.name)+`
`:"";N.length&&(M.notes=B+(D==null?void 0:D.description)+" "+N.join(" ")),typeof C.line_items=="string"&&(C.line_items=[]),C.line_items.push(M)}),u(C),e(At("/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 wan(n){const[e]=ve(),{tasks:t}=n,i=ki(),r=obe(),o=AG(),s=sbe(),a=Ti(),{timeFormat:l}=PG(),c=jR(),{dateFormat:u}=sc(),d=Wi(O1);return async h=>{var g,m;const f=An.cloneDeep(h);if(t){const v=await o((g=t[0])==null?void 0:g.client_id,"client_id"),{dateFormat:_,timeFormat:b}=await s((m=t[0])==null?void 0:m.client_id);t.forEach(y=>{var D,A;const C=Hm(y.time_log),E=[];C.forEach(([N,P,M,B])=>{if(B||!(a!=null&&a.settings.allow_billable_task_items)||typeof B>"u"){let F="";if(a.invoice_task_hours){const H=Un.unix(N),W=Un.unix(P);F=`• ${r((W.diff(H,"seconds")/3600).toString(),v==null?void 0:v.thousandSeparator,v==null?void 0:v.decimalSeparator,v==null?void 0:v.precision)} ${e("hours")}`}const U=[];(a.invoice_task_datelog||a.invoice_task_timelog)&&U.push(`<div class="task-time-details">
`),a.invoice_task_datelog&&U.push(Un.unix(N).format(_!=null&&_.format_moment?_.format_moment:u)),a.invoice_task_timelog&&U.push(Un.unix(N).format(b||l)+" - "),a.invoice_task_timelog&&U.push(Un.unix(P).format(b||l)),a.invoice_task_hours&&U.push(F),a.invoice_task_item_description&&M&&U.push(`
${M}`),(a.invoice_task_datelog||a.invoice_task_timelog)&&(U.push(`
`),U.push(`</div>
`)),E.push(U.join(" "))}});const x=yGe(y.time_log,c),k={...P1(),type_id:vv.Task,cost:y.rate,quantity:x,line_total:Number((y.rate*x).toFixed(c)),task_id:y.id,tax_id:"",custom_value1:y.custom_value1,custom_value2:y.custom_value2,custom_value3:y.custom_value3,custom_value4:y.custom_value4},L=a.invoice_task_project&&((D=y==null?void 0:y.project)!=null&&D.name)?"## "+((A=y.project)==null?void 0:A.name)+`
`:"";E.length&&(k.notes=L+(y==null?void 0:y.description)+" "+E.join(" ")),typeof f.line_items=="string"&&(f.line_items=[]),f.line_items.push(k)}),d(f),i(At("/invoices/:id/edit?action=add_tasks&table=tasks",{id:f.id}))}}}function San(n){const{visible:e,setVisible:t,tasks:i,invoices:r}=n,o=ef(),s=wan({tasks:i});return p(Or,{title:Ca("add_to_invoice",{invoice:""}),visible:e,onClose:()=>t(!1),children:p("div",{className:"flex flex-col overflow-y-auto max-h-96",children:r==null?void 0:r.map((a,l)=>{var c,u;return O("div",{className:"flex justify-between py-2 cursor-pointer hover:bg-gray-100 px-3",onClick:()=>s(a),children:[p("span",{children:a.number}),p("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 CGe(n){const{tasks:e,isBulkAction:t,setSelected:i}=n,r=Co(),o=hs(),s=xG(),[a,l]=w.useState(!1),[c,u]=w.useState([]),d=()=>{if(!e.length)return he.error("no_invoices_found");const h=e.map(g=>g.client_id);if(h.some(g=>!g))return he.error("no_invoices_found");if(h.length){const g=h[0];if(h.some(v=>v!==g))return he.error("multiple_client_error")}he.processing(),r.fetchQuery(["/api/v1/invoices","client_id",e[0].client_id],()=>$e("GET",Ae("/api/v1/invoices?client_id=:clientId&include=client&status=active&per_page=100",{clientId:e[0].client_id})),{staleTime:1/0}).then(g=>{if(he.dismiss(),!g.data.data.length)return he.error("no_invoices_found");o("edit_invoice")?u(g.data.data):u(g.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"))?O(St,{children:[p(San,{visible:a,setVisible:l,tasks:e,invoices:c}),p(gt,{onClick:d,icon:p(nt,{element:WEt}),children:Ca("add_to_invoice",{invoice:""})})]}):p(St,{})}const Ean=["status","number","client","description","duration","entity_state"];function xan(){const[n,e,t,i]=cp({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 Wkr(){var _;const{t:n}=ve(),{dateFormat:e}=sc(),t=Ss(),i=hs(),r=nE(),o=Gk(),s=Ti(),a=_l(),l=ki(),c=ef();xan();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,f,g]=cp({entity:"task"}),m=[{column:"project",id:"project_id",label:n("project"),format:(b,y)=>{var C,E;return p(Jve,{entityId:y.project_id,cacheEndpoint:"/api/v1/projects",apiEndpoint:"/api/v1/projects/:id?include=client",preCheck:i("view_project")||i("edit_project"),component:p(qi,{to:At("/projects/:id",{id:(C=y==null?void 0:y.project)==null?void 0:C.id}),children:(E=y==null?void 0:y.project)==null?void 0:E.name})})}},{column:"status",id:"status_id",label:n("status"),format:(b,y)=>O("div",{className:"flex items-center space-x-2",children:[p(_an,{entity:y}),y.invoice_id&&p(Yu,{width:"auto",message:n("view_invoice"),withoutArrow:!0,placement:"bottom",children:p(Nk,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>l(At("/invoices/:id/edit",{id:y.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(b,y)=>p(Rf,{to:At("/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&&p(Rf,{to:At("/clients/:id",{id:b.toString()}),renderSpan:r("client",y.client),children:y.client.display_name})},{column:"description",id:"description",label:n("description"),format:b=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(b)}})}),children:p("span",{children:i0(Xc(b)).slice(0,50)})})},{column:"duration",id:"time_log",label:n("duration"),format:b=>dan(b.toString(),!0)},{column:"entity_state",id:"id",label:n("entity_state"),format:(b,y)=>n(van(y))},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>xo(b,e)},{column:"calculated_rate",id:"rate",label:n("calculated_rate"),format:(b,y)=>{var C,E;return c(y.rate||s.settings.default_task_rate,(C=y.client)==null?void 0:C.country_id,(E=y.client)==null?void 0:E.settings.currency_id)}},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>xo(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:f,id:"custom_value3",label:f,format:b=>o("task3",b==null?void 0:b.toString())},{column:g,id:"custom_value4",label:g,format:b=>o("task4",b==null?void 0:b.toString())},{column:"date",id:"calculated_start_date",label:n("date"),format:(b,y)=>xo(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)=>Oy(y)?n("yes"):n("no")},{column:"rate",id:"rate",label:n("rate"),format:(b,y)=>{var C,E;return c(b,(C=y.client)==null?void 0:C.country_id,(E=y.client)==null?void 0:E.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:b=>xo(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:_.task)||Ean;return m.filter(b=>v.includes(b.column)).sort((b,y)=>v.indexOf(b.column)-v.indexOf(y.column))}function zkr(){return n=>{$e("PUT",Ae("/api/v1/tasks/:id",{id:n.id}),n).then(()=>{he.success("updated_task"),In(["tasks"])})}}function Tan(){const[n]=ve(),e=FF(),t=kg(),{data:i}=mGe({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}=DR(o.color),u=MF(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 Ukr(n){const[e]=ve(),t=ki(),i=hs(),{showCommonBulkAction:r,showEditAction:o}=n||{},{isEditPage:s}=tE({entity:"task",editPageTabs:["documents"]}),a=yan(),l=Can(),c=bGe(),u=vGe(),d=Wi(san),h=_=>{d({..._,id:"",documents:[],number:"",invoice_id:""}),t("/tasks/create?action=clone")},{setChangeTemplateResources:f,setChangeTemplateVisible:g,setChangeTemplateEntityContext:m}=qR();return[_=>!!o&&p(gt,{to:At("/tasks/:id/edit",{id:_.id}),icon:p(nt,{element:wF}),children:e("edit")}),()=>!!o&&p(vi,{withoutPadding:!0}),_=>!Oy(_)&&!_.invoice_id&&p(gt,{onClick:()=>a(_),icon:p(nt,{element:ame}),children:e("start")}),_=>Oy(_)&&!_.invoice_id&&p(gt,{onClick:()=>l(_),icon:p(nt,{element:ume}),children:e("stop")}),_=>!Oy(_)&&!_.invoice_id&&i("create_invoice")&&p(gt,{onClick:()=>u([_]),icon:p(nt,{element:Nk}),children:e("invoice_task")}),_=>p(CGe,{tasks:[_]}),_=>i("create_task")&&p(gt,{onClick:()=>h(_),icon:p(nt,{element:t0}),children:e("clone")}),_=>p(gt,{onClick:()=>{g(!0),f([_]),m({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:p(nt,{element:SR}),children:e("run_template")}),()=>(s||!!r)&&p(vi,{withoutPadding:!0}),_=>(s||!!r)&&Tr(_)===nr.Active&&p(gt,{onClick:()=>c([_.id],"archive"),icon:p(nt,{element:Dc}),children:e("archive")}),_=>(s||!!r)&&(Tr(_)===nr.Archived||Tr(_)===nr.Deleted)&&p(gt,{onClick:()=>c([_.id],"restore"),icon:p(nt,{element:Lc}),children:e("restore")}),_=>(s||!!r)&&(Tr(_)===nr.Active||Tr(_)===nr.Archived)&&p(gt,{onClick:()=>c([_.id],"delete"),icon:p(nt,{element:el}),children:e("delete")})]}const jkr=()=>{const[n]=ve(),e=vGe(),t=bGe(),i=hs(),r=YWe(),o=v=>v.some(({documents:_})=>_.length),s=v=>v.flatMap(({documents:_})=>_.map(({id:b})=>b)),a=v=>v.every(_=>!Oy(_)&&!_.invoice_id),l=v=>v.every(_=>Oy(_)&&!_.invoice_id),c=v=>v.every(_=>!Oy(_)&&!_.invoice_id),u=v=>v.every(_=>!Oy(_)&&!_.invoice_id&&_.client_id),d=(v,_)=>{const b=s(v);r(b,"download"),_==null||_([])},{setChangeTemplateVisible:h,setChangeTemplateResources:f,setChangeTemplateEntityContext:g}=qR();return[({selectedIds:v,selectedResources:_,setSelected:b})=>_&&a(_)&&p(gt,{onClick:()=>{t(v,"start"),b([])},icon:p(nt,{element:ame}),children:n("start")}),({selectedIds:v,selectedResources:_,setSelected:b})=>_&&l(_)&&p(gt,{onClick:()=>{t(v,"stop"),b([])},icon:p(nt,{element:ume}),children:n("stop")}),({selectedResources:v,setSelected:_})=>v&&u(v)&&p(CGe,{tasks:v,isBulkAction:!0,setSelected:_}),({selectedResources:v,setSelected:_})=>v&&c(v)&&i("create_invoice")?p(gt,{onClick:()=>{e(v),_([])},icon:p(nt,{element:Nk}),children:n("invoice_task")}):null,({selectedResources:v,setSelected:_})=>p(gt,{onClick:()=>v&&o(v)?d(v,_):he.error("no_documents_to_download"),icon:p(nt,{element:sS}),children:n("documents")}),({selectedResources:v})=>p(gt,{onClick:()=>{h(!0),f(v),g({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:p(nt,{element:SR}),children:n("run_template")})]};function wGe(n){const[e]=ve(),{value:t,onValueChange:i,errorMessage:r,report:o}=n,s=qk(),a=Tan(),l=Wsn(),c=son(),u=oan(),d=oon(),h=Hon(),f=Asn(),g=ran(),[m,v]=w.useState([]),_=b=>b.map(y=>y.value).join(",");return w.useEffect(()=>{(o==="invoice"||o==="invoice_item")&&v(d),o==="credit"&&v(c),o==="expense"&&v(h),(o==="purchase_order"||o==="purchase_order_item")&&v(f),(o==="quote"||o==="quote_item")&&v(l),o==="recurring_invoice"&&v(g),o==="payment"&&v(u),o==="task"&&v(a)},[o]),O(St,{children:[p(_v,{id:"statusSelector",styles:s,...t&&{value:m.filter(b=>t.split(",").find(y=>b.value===y))},onChange:b=>i(_(b)),placeholder:e("status"),options:m,isMulti:!0}),r&&p(Fs,{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 SGe(){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 kan=[{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 Ian=[{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 ODe=[{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 PDe=[{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 _O=[{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 Lan=[{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 MDe=[{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 Dan=[{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:"log_duration",value:"task.time_log",map:"task"},{trans:"log_duration_words",value:"task.time_log_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"},{trans:"assigned_user",value:"task.assigned_user_id",map:"task"},{trans:"user",value:"task.user_id",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 Aan=[{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 FDe=[{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 Ran=[{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 BDe=[{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"}],sb=11;function Nan(){const[n]=ve(),e=Ti(),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]?vW(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 Jg({title:n,droppableId:e,isDropDisabled:t,data:i,onRemove:r}){const[o]=ve(),s=si(),a=Nan(),l=c=>{const u=c.value.split(".");return`${o(`${u[0]}`)} - ${a(c.trans,u[0])}`};return O("div",{children:[p("h2",{className:"text-gray-500 font-medium",children:typeof n=="string"?p("p",{children:n}):n()}),p(CG,{droppableId:e,isDropDisabled:t,children:c=>O("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:[p("div",{className:"overflow-y-scroll h-96 mt-2 border rounded-md divide-y",children:i&&i.map((u,d)=>p(yG,{index:d,draggableId:`left-word-${u.value}`,children:h=>p("div",{ref:h.innerRef,...h.draggableProps,...h.dragHandleProps,children:O("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===sb.toString()&&p("button",{style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},type:"button",onClick:()=>r?r(u):null,children:p(qm,{size:15})})]},d)})},u.value))}),c.placeholder]})})]})}const Oan=["client","invoice","credit","quote","payment","vendor","purchase_order","task","expense","recurring_invoice","contact"];function Pan({report:n,columns:e}){const{preferences:t}=QS(),i=[e.includes("client")?kan:[],e.includes("invoice")?e.includes("item")?BDe.concat(_O.map(o=>({...o,origin:"invoice"}))):BDe:[],e.includes("credit")?e.includes("item")?PDe.concat(_O.map(o=>({...o,origin:"credit"}))):PDe:[],e.includes("quote")?e.includes("item")?ODe.concat(_O.map(o=>({...o,origin:"quote"}))):ODe:[],e.includes("payment")?Ian:[],e.includes("vendor")?Lan:[],e.includes("purchase_order")?e.includes("item")?MDe.concat(_O.map(o=>({...o,origin:"purchase_order"}))):MDe:[],e.includes("task")?Dan:[],e.includes("expense")?Aan:[],e.includes("recurring_invoice")?e.includes("item")?FDe.concat(_O.map(o=>({...o,origin:"recurring_invoice"}))):FDe:[],e.includes("contact")?Ran:[],[]];return{data:n in t.reports.columns&&t.reports.columns[n].length!==0?t.reports.columns[n]:i,defaultColumns:i}}function Man({report:n,columns:e}){const[t]=ve(),{update:i}=QS(),{data:r,defaultColumns:o}=Pan({report:n,columns:e}),s=d=>{if(d.destination)try{const h=An.cloneDeep(r),f=parseInt(d.source.droppableId),g=h[f][d.source.index];h[f].splice(d.source.index,1);const m=parseInt(d.destination.droppableId);h[m].splice(d.destination.index,0,g),i(`preferences.reports.columns.${n}`,[...h])}catch{i(`preferences.reports.columns.${n}`,o)}},a=d=>{const h=Oan.indexOf(d.map),f=An.cloneDeep(r);f[sb]=f[sb].filter(g=>g.value!==d.value),f[h].push(d),i(`preferences.reports.columns.${n}`,[...f])},l=()=>{i(`preferences.reports.columns.${n}`,o)},c=d=>{const h=An.cloneDeep(r);h[sb]=[...h[sb],...h[d]],h[d]=[],i(`preferences.reports.columns.${n}`,[...h])},u=si();return p("div",{className:"min-w-min",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tn,{className:"my-6",children:p(bG,{onDragEnd:s,children:O("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")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("client")}),p("button",{type:"button",onClick:()=>c(0),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[0],droppableId:"0",isDropDisabled:!0}),e.includes("invoice")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",children:[p("p",{children:t("invoice")}),p("button",{type:"button",onClick:()=>c(1),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[1],droppableId:"1",isDropDisabled:!0}),e.includes("credit")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("credit")}),p("button",{type:"button",onClick:()=>c(2),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[2],droppableId:"2",isDropDisabled:!0}),e.includes("quote")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("quote")}),p("button",{type:"button",onClick:()=>c(3),children:p(tm,{size:16})})]}),data:r[3],droppableId:"3",isDropDisabled:!0}),e.includes("payment")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("payment")}),p("button",{type:"button",onClick:()=>c(4),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[4],droppableId:"4",isDropDisabled:!0}),e.includes("vendor")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("vendor")}),p("button",{type:"button",onClick:()=>c(5),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[5],droppableId:"5",isDropDisabled:!0}),e.includes("purchase_order")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("purchase_order")}),p("button",{type:"button",onClick:()=>c(6),children:p(tm,{size:16})})]}),data:r[6],droppableId:"6",isDropDisabled:!0}),e.includes("task")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("task")}),p("button",{type:"button",onClick:()=>c(7),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[7],droppableId:"7",isDropDisabled:!0}),e.includes("expense")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("expense")}),p("button",{type:"button",onClick:()=>c(8),children:p(tm,{size:16})})]}),data:r[8],droppableId:"8",isDropDisabled:!0}),e.includes("recurring_invoice")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("recurring_invoice")}),p("button",{type:"button",onClick:()=>c(9),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[9],droppableId:"9",isDropDisabled:!0}),e.includes("contact")&&p(Jg,{title:()=>O("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[p("p",{children:t("contact")}),p("button",{type:"button",onClick:()=>c(10),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:p(tm,{size:16})})]}),data:r[10],droppableId:"10",isDropDisabled:!0}),p(Jg,{title:()=>O("div",{className:"flex items-center justify-between",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[O("p",{children:[t("report")," ",t("columns")]}),O("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:[p(qm,{size:19}),O("span",{className:"text-xs",children:["(",t("reset"),")"]})]})]}),data:r[sb],droppableId:sb.toString(),isDropDisabled:!1,onRemove:a})]})})})})}const EGe=Ro(null);function Fan(){const[n]=us(EGe),[e,t]=w.useState(null),i=[{identifier:"credit.number",format:r=>p(qi,{to:`/credits/${r.value}`,children:r.display_value})}];return w.useEffect(()=>{if(!n)return;const r=An.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 Ban(){const n=Fan(),[e,t]=w.useState(null),[i,r]=w.useState(),[o]=ve();if(!n)return null;const s=(u,d)=>{const h=An.cloneDeep(n);h.rows=h.rows.filter(f=>f.some(g=>{if(g.identifier!==u)return!1;if(typeof g.display_value=="number")return g.display_value.toString().toLowerCase().includes(d.toLowerCase());if(typeof g.display_value=="string")return g.display_value.toLowerCase().includes(d.toLowerCase());if(typeof g.display_value=="object")return g.display_value.props.children.toLowerCase().includes(d.toLowerCase())})),t(h)},a=u=>{const d=(i==null?void 0:i[u])==="asc"?"desc":"asc";r(f=>({...f,[u]:d}));const h=An.cloneDeep(n);h.rows=h.rows.sort((f,g)=>{const m=f.find(_=>_.identifier===u),v=g.find(_=>_.identifier===u);if(m&&v)return d==="asc"?m.display_value>v.display_value?1:-1:m.display_value<v.display_value?1:-1}),t(h)},l=(e==null?void 0:e.rows)||n.rows,c=()=>{const u=[n.columns.map(v=>v.display_value).join(",")];(e?e.rows:n.rows).map(v=>{u.push(v.map(_=>_.display_value.toString()==="true"?"Yes":_.display_value.toString()==="false"?"No":`"${_.display_value}"`).join(","))});const h=u.join(`
`),f=new Blob([h],{type:"text/csv;charset=utf-8;"}),g=document.createElement("a"),m=URL.createObjectURL(f);g.setAttribute("href",m),g.setAttribute("download","example.csv"),g.click()};return n?O("div",{id:"preview-table my-4",children:[p("div",{className:"flex justify-end",children:O(un,{behavior:"button",onClick:c,children:[o("download")," ",o("csv_file")]})}),O(ZS,{children:[p(eE,{children:n.columns.map((u,d)=>p(Ma,{children:O("div",{onClick:()=>a(u.identifier),className:"cursor-pointer inline-flex items-center space-x-2",children:[p("p",{children:u.display_value})," ",p(HAt,{})]})},d))}),O(JS,{children:[p(wc,{children:n.columns.map((u,d)=>p(To,{children:p(Ze,{onValueChange:h=>s(u.identifier,h)})},d))}),l.map((u,d)=>p(wc,{children:u.map((h,f)=>p(To,{children:h.display_value},f))},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 $an={last7:"last7_days",last30:"last30_days"};function Van(){const n=ki(),{preferences:e}=QS(),t=Wi(kG);return(i,r)=>{let o=[];i.identifier in e.reports.columns&&r&&(o=Ja(e.reports.columns[i.identifier][sb]).pluck("value").toArray()),t({...d3,report_name:i.identifier,start_date:i.payload.start_date,end_date:i.payload.end_date,client_id:i.payload.client_id||"",date_range:$an[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 xGe(n){const[e]=ve(),t=si(),i=qk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=$qe({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 O(St,{children:[a?p(G,{leftSide:e("clients"),children:p(_v,{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})}):p("div",{className:"flex justify-center items-center",children:p(ds,{})}),s&&p(Fs,{className:"mt-2",type:"danger",children:s})]})}function TGe(n){const[e]=ve(),t=si(),i=qk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=jve({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 O(St,{children:[a?p(G,{leftSide:e("expense_categories"),children:p(_v,{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})}):p("div",{className:"flex justify-center items-center",children:p(ds,{})}),s&&p(Fs,{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 qkr(n){const e=hs();return Ii(["/api/v1/projects/create"],()=>$e("GET",Ae("/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 Gkr(n){return Ii(["/api/v1/projects",n.id],()=>$e("GET",Ae("/api/v1/projects/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}function Han(n){return Ii(["/api/v1/projects",n],()=>{var e;return $e("GET",Ae("/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 kGe(n){const[e]=ve(),t=si(),i=qk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=Han({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 O(St,{children:[a?p(G,{leftSide:e("projects"),children:p(_v,{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})}):p("div",{className:"flex justify-center items-center",children:p(ds,{})}),s&&p(Fs,{className:"mt-2",type:"danger",children:s})]})}function IGe(n){const[e]=ve(),t=si(),i=qk(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=crn({});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 O(St,{children:[a?p(G,{leftSide:e("vendors"),children:p(_v,{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})}):p("div",{className:"flex justify-center items-center",children:p(ds,{})}),s&&p(Fs,{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 Wan={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 zan(n){const{report:e}=n;return t=>!!Wan[e].includes(t)}function Uan(n){const[e]=ve(),t=Va();return p(St,{children:!Bm()&&!xc()&&p("div",{className:n==null?void 0:n.className,children:p(Fs,{className:"mb-4",type:"warning",disableClosing:!0,children:O("div",{className:"flex items-center justify-between",children:[O("p",{className:"inline-flex items-center space-x-1",children:[p(qD,{fontSize:18}),O("span",{children:[e("start_free_trial_message"),"."]})]}),(t==null?void 0:t.company_user)&&p(qi,{to:t.company_user.ninja_portal_url||At("/settings/account_management"),className:"ml-10",external:!0,children:e("plan_change")})]})})})})}const DW=[{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"}],jan=(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 qan(){var N,P;const{documentTitle:n}=Mi("reports"),{t:e}=ve(),t=SGe(),i=Co(),r=Van(),[o,s]=w.useState(t[0]),[a,l]=w.useState(!1),[c,u]=w.useState(),[d,h]=w.useState(!1),f=zan({report:o.identifier}),{save:g,preferences:m}=QS(),v=[{name:e("reports"),href:"/reports"}],_=M=>{const B=t.find(F=>F.identifier===M);h(!1),B&&s(B)},b=(M,B)=>{s(F=>({...F,payload:{...F.payload,[M]:B}}))},y=M=>{const B=DW.find(F=>F.identifier===M);B&&s(F=>({...F,payload:{...F.payload,date_range:B.identifier}}))},C=(M,B)=>{s(F=>({...F,payload:{...F.payload,[M]:B}}))},E=M=>{s(B=>({...B,payload:{...B.payload,send_email:M}}))},x=()=>{he.processing(),l(!0),u(void 0);const{client_id:M}=o.payload;let B=o.identifier==="product_sales"?{...o.payload,client_id:M||null}:o.payload,F=[];o.identifier in m.reports.columns&&d&&(F=Ja(m.reports.columns[o.identifier][sb]).pluck("value").toArray()),B={...B,report_keys:F},$e("POST",Ae(o.endpoint),B,{}).then(U=>{if(o.payload.send_email)return l(!1),he.success();const H=U.data.message;i.fetchQuery({queryKey:["exports",H],queryFn:()=>$e("POST",Ae(`/api/v1/exports/preview/${H}`)).then(W=>W.data),retry:50,retryDelay:2e3}).then(W=>{jan(W,o.identifier),he.success()}).catch(W=>{console.error(W),he.error()}).finally(()=>{l(!1)})}).catch(U=>{var H;((H=U.response)==null?void 0:H.status)===422&&u(U.response.data),l(!1)}).finally(()=>{d&&g({silent:!0})})},[k,L]=us(EGe),D=async()=>{u(void 0),L(null);const{client_id:M}=o.payload;let B=o.identifier==="product_sales"?{...o.payload,client_id:M||null}:o.payload,F=[];o.identifier in m.reports.columns&&d&&(F=Ja(m.reports.columns[o.identifier][sb]).pluck("value").toArray()),B={...B,report_keys:F},$e("POST",Ae(o.preview),B,{}).then(U=>{const H=U.data.message;i.fetchQuery({queryKey:["reports",H],queryFn:()=>$e("POST",Ae(`/api/v1/reports/preview/${H}`)).then(W=>W.data),retry:10,retryDelay:5e3}).then(W=>{const{columns:q,...V}=W;L({columns:q,rows:Object.values(V)}),he.success()})})};w.useEffect(()=>()=>{i.cancelQueries(["reports"]),he.dismiss(),L(null)},[]);const A=si();return O(MR,{title:n,breadcrumbs:v,onSaveClick:x,saveButtonLabel:e("export"),disableSaveButton:a||!Bm()&&!xc(),navigationTopRight:O(Fm,{label:e("more_actions"),disabled:!Bm()&&!xc(),children:[o.supports_previews&&p(gt,{icon:p(nt,{element:ZEt}),onClick:D,children:e("preview")}),p(gt,{icon:p(nt,{element:cme}),onClick:()=>r(o,d),children:e("schedule")})]}),children:[p(Uan,{}),O("div",{className:"grid grid-cols-12 gap-4",style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},children:[O(tn,{className:"col-span-6 h-max",children:[p(G,{leftSide:e("report"),children:p(En,{onValueChange:M=>{_(M),L(null)},value:o.identifier,cypressRef:"reportNameSelector",children:t.map((M,B)=>p("option",{value:M.identifier,children:e(M.label)},B))})}),p(G,{leftSide:e("send_email"),children:p(kt,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},checked:o.payload.send_email,onValueChange:E})}),f("document_email_attachment")&&p(G,{leftSide:e("document_email_attachment"),children:p(kt,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},checked:o.payload.document_email_attachment,onValueChange:M=>b("document_email_attachment",M),cypressRef:"scheduleDocumentEmailAttachment"})}),f("is_expense_billed")&&p(G,{leftSide:e("expense_paid_report"),children:p(kt,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},checked:o.payload.is_expense_billed,onValueChange:M=>b("is_expense_billed",M),cypressRef:"expenseBilled"})}),f("is_income_billed")&&p(G,{leftSide:e("cash_vs_accrual"),children:p(kt,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},checked:o.payload.is_income_billed,onValueChange:M=>b("is_income_billed",M),cypressRef:"incomeBilled"})}),f("include_tax")&&p(G,{leftSide:e("include_tax"),children:p(kt,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},checked:o.payload.include_tax,onValueChange:M=>b("include_tax",M),cypressRef:"includeTax"})}),f("include_deleted")&&p(G,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:p(kt,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},checked:o.payload.include_deleted,onValueChange:M=>b("include_deleted",M),cypressRef:"includeDeleted"})}),f("status")&&p(G,{leftSide:e("status"),className:"mb-50 py-50",children:p(wGe,{report:o.identifier,onValueChange:M=>b("status",M)})}),f("product_key")&&p(Uqe,{onValueChange:M=>b("product_key",M)}),f("clients")&&p(xGe,{value:o.payload.clients,onValueChange:M=>b("clients",M)}),f("vendors")&&p(IGe,{value:o.payload.vendors,onValueChange:M=>b("vendors",M)}),f("projects")&&p(kGe,{value:o.payload.projects,onValueChange:M=>b("projects",M)}),f("categories")&&p(TGe,{value:o.payload.categories,onValueChange:M=>b("categories",M)})]}),O(tn,{className:"col-span-6 h-max",children:[p(G,{leftSide:e("range"),children:p(En,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1},onValueChange:M=>y(M),value:o.payload.date_range,cypressRef:"reportDateRange",children:DW.map((M,B)=>p("option",{value:M.identifier,children:e(M.label)},B))})}),o.payload.date_range==="custom"&&p(G,{leftSide:e("start_date"),children:p(Ze,{type:"date",value:o.payload.start_date,onValueChange:M=>C("start_date",M),errorMessage:(N=c==null?void 0:c.errors)==null?void 0:N.start_date,cypressRef:"reportStartDate"})}),o.payload.date_range==="custom"&&p(G,{leftSide:e("end_date"),children:p(Ze,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},type:"date",value:o.payload.end_date,onValueChange:M=>C("end_date",M),errorMessage:(P=c==null?void 0:c.errors)==null?void 0:P.end_date,cypressRef:"reportEndDate"})}),f("client")&&p(G,{leftSide:e("client"),children:p(TG,{value:o.payload.client_id,onChange:M=>b("client_id",M.id),clearButton:!0,onClearButtonClick:()=>b("client_id",""),withoutAction:!0})}),o.allow_custom_column&&p(G,{leftSide:`${e("customize")} ${e("columns")}`,children:p(kt,{style:{color:A.$3,colorScheme:A.$0,backgroundColor:A.$1,borderColor:A.$4},checked:d,onValueChange:M=>h(!!M)})})]})]}),d&&p(Man,{report:o.identifier,columns:o.custom_columns}),k&&p(Ban,{})]})}const Gan=Object.freeze(Object.defineProperty({__proto__:null,default:qan,ranges:DW},Symbol.toStringTag,{value:"Module"})),Fc=["send_email","range","start_date","end_date"],LGe={invoice:[...Fc,"status","document_email_attachment","report_keys","include_deleted","client"],invoice_item:[...Fc,"products","document_email_attachment","report_keys","status","include_deleted","client"],product_sales:[...Fc,"products","client"],profitloss:[...Fc,"expense_billed","income_billed","include_tax"],client:[...Fc,"document_email_attachment","report_keys","include_deleted"],contact:[...Fc,"report_keys"],recurring_invoice:[...Fc,"report_keys","status","include_deleted","client"],quote:[...Fc,"document_email_attachment","report_keys","status","include_deleted","client"],quote_item:[...Fc,"document_email_attachment","report_keys","status","include_deleted","client"],credit:[...Fc,"document_email_attachment","report_keys","include_deleted","status","client"],document:[...Fc,"document_email_attachment"],payment:[...Fc,"document_email_attachment","report_keys","status","client"],expense:[...Fc,"document_email_attachment","clients","vendors","projects","categories","report_keys","status","include_deleted"],task:[...Fc,"document_email_attachment","report_keys","status","include_deleted","client"],product:[...Fc,"document_email_attachment"],vendor:[...Fc,"document_email_attachment","report_keys"],purchase_order:[...Fc,"document_email_attachment","report_keys","status","include_deleted"],purchase_order_item:[...Fc,"document_email_attachment","report_keys","status","include_deleted"]};function Kan(n){const[e]=ve(),t=SGe(),{schedule:i,handleChange:r,errors:o}=n,s=a=>(LGe[i.parameters.report_name]||Fc).includes(a);return O(St,{children:[p(G,{leftSide:e("report"),children:p(En,{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)=>p("option",{value:a.schedule_identifier||a.identifier,children:e(a.label)},l))})}),s("send_email")&&p(G,{leftSide:e("send_email"),children:p(kt,{checked:i.parameters.send_email,onValueChange:a=>r("parameters.send_email",a),disabled:!0,cypressRef:"scheduleSendEmail"})}),s("document_email_attachment")&&p(G,{leftSide:e("document_email_attachment"),children:p(kt,{checked:i.parameters.document_email_attachment,onValueChange:a=>r("parameters.document_email_attachment",a),cypressRef:"scheduleDocumentEmailAttachment"})}),s("expense_billed")&&p(G,{leftSide:e("expense_paid_report"),children:p(kt,{checked:i.parameters.is_expense_billed,onValueChange:a=>r("parameters.is_expense_billed",a),cypressRef:"expenseBilled"})}),s("income_billed")&&p(G,{leftSide:e("cash_vs_accrual"),children:p(kt,{checked:i.parameters.is_income_billed,onValueChange:a=>r("parameters.is_income_billed",a),cypressRef:"incomeBilled"})}),s("include_tax")&&p(G,{leftSide:e("include_tax"),children:p(kt,{checked:i.parameters.include_tax,onValueChange:a=>r("parameters.include_tax",a),cypressRef:"includeTax"})}),s("include_deleted")&&p(G,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:p(kt,{checked:i.parameters.include_deleted,onValueChange:a=>r("parameters.include_deleted",a),cypressRef:"includeDeleted"})}),s("status")&&p(G,{leftSide:e("status"),children:p(wGe,{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")&&p(Uqe,{value:i.parameters.product_key,onValueChange:a=>r("parameters.product_key",a),errorMessage:o==null?void 0:o.errors["parameters.product_key"]}),s("range")&&p(G,{leftSide:e("range"),children:p(En,{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:DW.map((a,l)=>p("option",{value:a.scheduleIdentifier,children:e(a.label)},l))})}),s("range")&&i.parameters.date_range==="custom"&&O(St,{children:[p(G,{leftSide:e("start_date"),children:p(Ze,{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"})}),p(G,{leftSide:e("end_date"),children:p(Ze,{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")&&p(G,{leftSide:e("client"),children:p(TG,{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")&&p(xGe,{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")&&p(IGe,{value:i.parameters.vendors,onValueChange:a=>r("parameters.vendors",a),errorMessage:o==null?void 0:o.errors["parameters.vendors"]}),s("projects")&&p(kGe,{value:i.parameters.projects,onValueChange:a=>r("parameters.projects",a),errorMessage:o==null?void 0:o.errors["parameters.projects"]}),s("categories")&&p(TGe,{value:i.parameters.categories,onValueChange:a=>r("parameters.categories",a),errorMessage:o==null?void 0:o.errors["parameters.categories"]})]})}var vae=(n=>(n.EMAIL_STATEMENT="email_statement",n.EMAIL_RECORD="email_record",n.EMAIL_REPORT="email_report",n))(vae||{});function DGe(n){const[e]=ve(),{schedule:t,handleChange:i,errors:r,page:o}=n,s=ron({template:t.template});return O(tn,{title:e(o==="edit"?"edit_schedule":"new_schedule"),children:[s("template")&&p(G,{leftSide:e("template"),required:!0,children:O(En,{value:t.template,onValueChange:a=>i("template",a),errorMessage:r==null?void 0:r.errors.template,children:[p("option",{value:"email_statement",children:e("email_statement")}),p("option",{value:"email_record",children:e("email_record")}),p("option",{value:"email_report",children:e("email_report")})]})}),s("next_run")&&p(G,{leftSide:e("next_run"),required:!0,children:p(Ze,{type:"date",value:t.next_run,onValueChange:a=>i("next_run",a),errorMessage:r==null?void 0:r.errors.next_run})}),s("frequency")&&p(G,{leftSide:e("frequency"),children:p(En,{value:t.frequency_id,onValueChange:a=>i("frequency_id",a),errorMessage:r==null?void 0:r.errors.frequency_id,children:Object.keys(WT).map((a,l)=>p("option",{value:a,children:e(WT[a])},l))})}),s("remaining_cycles")&&p(G,{leftSide:e("remaining_cycles"),children:O(En,{value:t.remaining_cycles,onValueChange:a=>i("remaining_cycles",parseInt(a)),errorMessage:r==null?void 0:r.errors.remaining_cycles,children:[p("option",{value:"-1",children:e("endless")}),[...Array(60).keys()].map((a,l)=>p("option",{value:a,children:a},l))]})}),t.template&&p(vi,{}),t.template==="email_statement"&&p(ton,{schedule:t,handleChange:i,errors:r,page:o}),t.template==="email_record"&&p(non,{schedule:t,handleChange:i,errors:r}),t.template==="email_report"&&p(Kan,{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 Yan(){const[n]=ve();return[{id:"name",label:n("name"),format:(t,i)=>i.template===vae.EMAIL_RECORD?`${n(i.template)}: ${n(i.parameters.entity)}`:i.template===vae.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(WT[t])}]}function Qan(){const{documentTitle:n}=Mi("schedules"),[e]=ve(),t=Yan(),i=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"}];return p(sr,{title:n,docsLink:"en/advanced-settings/#schedules",breadcrumbs:i,children:p(Lg,{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 Xan={range:"date_range",expense_billed:"is_expense_billed",income_billed:"is_income_billed",products:"product_key",client:"client_id"};function Zan(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=(LGe[e.parameters.report_name]||Fc).map(o=>Xan[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 Jan={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"]},eln=["vendors","projects","categories"];function AGe(n){const{schedule:e}=n,t=Zan({schedule:e});return()=>{if(e){let i={};const r=Jan[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])=>{eln.includes(s)&&(i={...i,parameters:{...i.parameters,[s]:a||""}})}),i}}}function tln(){const{documentTitle:n}=Mi("new_schedule"),[e]=ve(),t=ki(),[i]=lF(),r=x0(),o=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("new_schedule"),href:"/settings/schedules/create"}],{data:s}=Jqe(),[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=us(kG),[f,g]=w.useState(!1),m=eGe({setErrors:u,setSchedule:l,schedule:a}),v=AGe({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:Qd.Monthly,remaining_cycles:-1,parameters:b||{...d3}}})},[s]),O(sr,{title:n,breadcrumbs:o,disableSaveButton:f||!a||r,onSaveClick:()=>{!f&&a&&(g(!0),u(void 0),he.processing(),$e("POST",Ae("/api/v1/task_schedulers"),v()).then(b=>{he.success("created_schedule"),In(["task_schedulers"]),t(At("/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),he.dismiss())}).finally(()=>g(!1)))},children:[r&&p(Iv,{}),a?p(DGe,{schedule:a,handleChange:m,errors:c}):p(ds,{})]})}function nln(){const[n]=ve(),e=qon();return[i=>Tr(i)===nr.Active&&p(gt,{onClick:()=>e([i.id],"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),i=>(Tr(i)===nr.Archived||Tr(i)===nr.Deleted)&&p(gt,{onClick:()=>e([i.id],"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),i=>(Tr(i)===nr.Active||Tr(i)===nr.Archived)&&p(gt,{onClick:()=>e([i.id],"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function iln(){const{documentTitle:n}=Mi("edit_schedule"),[e]=ve(),{id:t}=il(),i=nln(),r=x0(),o=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("edit_schedule"),href:At("/settings/schedules/:id/edit")}],{data:s}=jon({id:t}),[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=w.useState(!1),f=eGe({setErrors:u,setSchedule:l,schedule:a}),g=AGe({schedule:a}),m=()=>{!d&&a&&(h(!0),u(void 0),he.processing(),$e("PUT",Ae("/api/v1/task_schedulers/:id",{id:t}),g()).then(()=>{he.success("updated_schedule"),In(["task_schedulers"])}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(u(v.response.data),he.dismiss())}).finally(()=>h(!1)))};return w.useEffect(()=>{s&&l(s)},[s]),O(sr,{title:n,breadcrumbs:o,navigationTopRight:a&&p(R1,{resource:a,onSaveClick:m,actions:i,disableSaveButton:d||!a||r}),children:[r&&p(Iv,{}),a?p(DGe,{schedule:a,handleChange:f,errors:c,page:"edit"}):p(ds,{})]})}/**
* 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 rln(){const{t:n}=ve();return[{name:n("backup"),href:"/settings/backup_restore"},{name:n("restore"),href:"/settings/backup_restore/restore"}]}function oln(){const[n]=ve(),e=rln(),t=[{name:n("settings"),href:"/settings"},{name:n("backup_restore"),href:"/settings/backup_restore"}];return O(sr,{title:n("backup_restore"),breadcrumbs:t,children:[p(KS,{tabs:e,className:"mt-6"}),p("div",{className:"my-4",children:p(sp,{})})]})}function sln(n){const[e]=ve(),{data:t}=kWe(),[i,r]=w.useState(!1),[o,s]=w.useState(),[a,l]=w.useState(),c=Lqe(a,s,r,i,n.setIsModalOpen,n.onCreatedBankAccount),u=(f,g)=>{l(m=>m&&{...m,[f]:g})},d=()=>{i||n.setIsModalOpen(!1)};w.useEffect(()=>{t&&l(t)},[t]);const h=si();return O(Or,{title:e("new_bank_account"),visible:n.isModalOpen,onClose:d,children:[p(Ze,{style:{color:h.$3,colorScheme:h.$0},label:e("name"),value:a==null?void 0:a.bank_account_name,onValueChange:f=>u("bank_account_name",f),errorMessage:o==null?void 0:o.errors.bank_account_name}),p("div",{className:"flex justify-end",children:p(un,{onClick:c,style:{color:h.$3,colorScheme:h.$0},children:e("save")})})]})}function aln(n){var s;const[e]=ve(),[t,i]=w.useState(!1),{isAdmin:r,isOwner:o}=Fo();return O(St,{children:[p(sln,{isModalOpen:t,setIsModalOpen:i,onCreatedBankAccount:a=>n.onChange(a)}),p(Mh,{endpoint:Ae("/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 lln(n){const[e]=ve(),t=zi(),i=ki(),{onImport:r,importMap:o,entity:s}=n,a=vF(),l=_l(),[c,u]=w.useState(!1),[d,h]=w.useState(!1),[f,g]=w.useState(!1),[m,v]=w.useState(""),_=()=>{v(""),u(!1),i(`/${s}s`)},b=()=>{var k,L;if(!((k=l==null?void 0:l.import_templates)!=null&&k[s]))return!0;if(!Object.keys(o.column_map).length)return!1;let x=!1;return Object.values((L=l==null?void 0:l.import_templates)==null?void 0:L[s]).forEach(D=>{var A,N;An.isEqual(Object.values(D).map(P=>P||""),Object.values((N=(A=o.column_map)==null?void 0:A[s])==null?void 0:N.mapping).map(P=>P||""))&&(x=!0)}),!x},y=()=>{var k,L;if(!((k=l==null?void 0:l.import_templates)!=null&&k[s]))return!1;let x=!1;return Object.keys((L=l==null?void 0:l.import_templates)==null?void 0:L[s]).forEach(D=>{D===m&&(x=!0)}),x},C=()=>{var x,k,L,D;if(!f&&m){he.processing(),g(!0);const A=An.cloneDeep(a);if(A){const N=An.cloneDeep((k=(x=A.company_user)==null?void 0:x.react_settings.import_templates)==null?void 0:k[n.entity])||{},P={};Array.isArray(N)||Object.entries(N).forEach(([M,B])=>{!M||!B||!Array.isArray(B)||(P[M]=B)}),P[m]=Object.values((D=(L=o.column_map)==null?void 0:L[n.entity])==null?void 0:D.mapping).map(M=>M||""),An.set(A,`company_user.react_settings.import_templates.${n.entity}`,P),$e("PUT",Ae("/api/v1/company_users/:id",{id:A.id}),A).then(M=>{he.success("updated_settings"),An.set(A,"company_user",M.data.data),In(["company_users"]),t(qy(A)),_(),i(`/${s}s`)}).finally(()=>g(!1))}}};return O(St,{children:[p(un,{className:"flex float-right",behavior:"button",onClick:()=>{var x;(x=r())==null||x.then(()=>b()?h(!0):i(`/${s}s`))},children:e("import")}),O(Or,{title:e("save_as_template"),visible:c,onClose:_,children:[p(Ze,{label:e("name"),value:m,onValueChange:x=>v(x),changeOverride:!0}),p(un,{behavior:"button",onClick:C,disabled:!m||y()||f,disableWithoutIcon:!0,children:e("save")})]}),O(Or,{title:e("save_as_template"),visible:d,onClose:()=>{h(!1),i(`/${s}s`)},children:[p("span",{className:"font-medium text-base",children:e("save_template_body")}),O("div",{className:"flex justify-between",children:[p(un,{behavior:"button",type:"secondary",onClick:()=>{h(!1),i(`/${s}s`)},children:e("no")}),p(un,{behavior:"button",onClick:()=>{h(!1),setTimeout(()=>{u(!0)},310)},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 cln(n){var o,s;const e=_l(),{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 uln(n){const e=zi(),{name:t,entity:i,onDeletedTemplate:r}=n,o=vF(),[s,a]=w.useState(!1),l=()=>{var c,u,d,h,f,g,m,v,_,b,y,C,E;if(!s){he.processing(),a(!0);const x=An.cloneDeep(o);x&&(Object.keys(((d=(u=(c=x==null?void 0:x.company_user)==null?void 0:c.react_settings)==null?void 0:u.import_templates)==null?void 0:d[i])||{}).length>1?(g=(f=(h=x==null?void 0:x.company_user)==null?void 0:h.react_settings)==null?void 0:f.import_templates)==null||delete g[i][t]:Object.keys(((v=(m=x==null?void 0:x.company_user)==null?void 0:m.react_settings)==null?void 0:v.import_templates)||{}).length>1?(y=(b=(_=x==null?void 0:x.company_user)==null?void 0:_.react_settings)==null?void 0:b.import_templates)==null||delete y[i]:(E=(C=x==null?void 0:x.company_user)==null?void 0:C.react_settings)==null||delete E.import_templates,$e("PUT",Ae("/api/v1/company_users/:id",{id:x.id}),x).then(L=>{he.success("updated_settings"),An.set(x,"company_user",L.data.data),In(["company_users"]),e(qy(x)),r()}).finally(()=>a(!1)))}};return p(G,{children:O("div",{className:"flex items-center space-x-10",children:[p("span",{className:"font-medium",children:t}),p("div",{className:zt({"cursor-pointer":!s,"cursor-not-allowed":s}),onClick:()=>!s&&l(),children:p(nt,{element:el,size:22})})]})})}function RGe(n){const[e]=ve(),t=n.type==="zip",i={...!t&&{"text/*":[".csv"]},...t&&{"application/zip":[".zip"]}},r=si(),o=_l(),{numberOfTemplates:s,templates:a}=cln({entity:n.entity}),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,f]=w.useState(new FormData),[g,m]=w.useState([]),[v,_]=w.useState(),[b,y]=w.useState({hash:"",import_type:n.type,skip_header:!0,column_map:{[n.entity]:{mapping:{}}}}),[C,E]=w.useState(),[x,k]=w.useState(""),[L,D]=w.useState({}),A=ye=>{b.column_map[n.entity].mapping[ye.target.id]=ye.target.value,y({...b}),k("")},N=()=>{var He,Pe;const ye={};Object.entries(((Pe=(He=o==null?void 0:o.import_templates)==null?void 0:He[n.entity])==null?void 0:Pe[x])||{}).forEach(([Ge,Fe])=>{ye[Ge]=Fe||""}),y(Ge=>({...Ge,column_map:{[n.entity]:{mapping:ye}}}))},P=()=>{k(""),y(ye=>({...ye,column_map:{[n.entity]:{mapping:{...L}}}}))},M=ye=>{const He=ye.split(".");let Pe=He[1];return He[1]=="user_id"&&(Pe="user"),He[1]=="shipping_country_id"&&(Pe="shipping_country"),`${e(He[0])} - ${e(Pe)}`},B=()=>{if(!g.length&&t){he.error("select_file");return}he.processing(),E(void 0);let ye="/api/v1/import",He={};if(t)if(!l&&!u){he.error("settings_or_data");return}else ye="/api/v1/import_json?",l&&(ye+="&import_settings=:import_settings",He={import_settings:!0}),u&&(ye+="&import_data=:import_data",He={...He,import_data:!0});else b.hash=v.hash;const Pe=t?h:b;return $e("POST",Ae(ye,He),Pe).then(Ge=>{var Fe,bt;he.success(((Fe=Ge==null?void 0:Ge.data)==null?void 0:Fe.message)??"error_title"),(bt=n.onFileImported)==null||bt.call(n),n.onSuccess}).catch(Ge=>{var Fe;((Fe=Ge.response)==null?void 0:Fe.status)===422&&(he.dismiss(),E(Ge.response.data))})},F=ye=>{b.column_map[n.entity].mapping[ye]&&(b.column_map[n.entity].mapping[ye]="",k(""),y({...b}))},U=Gm({enableReinitialize:!0,initialValues:{},onSubmit:()=>{he.processing(),E(void 0),$e("POST",Ae("/api/v1/preimport"),h).then(ye=>{var He,Pe,Ge,Fe;_(ye.data),n.onSuccess,he.dismiss(),(Pe=(He=ye.data)==null?void 0:He.mappings[n.entity])!=null&&Pe.hints&&((Fe=(Ge=ye.data)==null?void 0:Ge.mappings[n.entity])==null||Fe.hints.forEach((bt,Mt)=>{var Ft,Yt,ln;b.column_map[n.entity].mapping[Mt]=((Ft=ye.data)==null?void 0:Ft.mappings[n.entity].available[bt])??"",y(b),D({...(ln=(Yt=b==null?void 0:b.column_map)==null?void 0:Yt[n.entity])==null?void 0:ln.mapping})})),k("")}).catch(ye=>{var He;((He=ye.response)==null?void 0:He.status)===422&&(he.dismiss(),E(ye.response.data))})}}),H=()=>{g.forEach(ye=>{h.append("files",ye)}),f(h)},W=ye=>{var He,Pe;return Object.keys((He=b==null?void 0:b.column_map[n.entity])==null?void 0:He.mapping).length?((Pe=b==null?void 0:b.column_map[n.entity])==null?void 0:Pe.mapping[ye])??null:null},q=ye=>{const He=g.filter((Ge,Fe)=>ye!==Fe),Pe=new FormData;He.forEach(Ge=>{Pe.append("files",Ge)}),m(He),f(Pe)},V=ye=>new Promise(He=>{try{const Pe=new FileReader;Pe.onload=Ge=>{var Mt;const bt=(((Mt=Ge.target)==null?void 0:Mt.result)||"").split(`
`);!bt.length||bt.length===1||bt.length===2&&!bt[1]?He(!1):He(!0)},Pe.readAsText(ye)}catch{He(!1)}}),re=async ye=>{for(let He=0;He<ye.length;He++)if(!await V(ye[He]))return!1;return!0},{getRootProps:oe,getInputProps:Q,isDragActive:Ne}=zR({accept:i,onDrop:async ye=>{await re(ye)?ye.every(({type:Ge})=>Ge.includes(n.type))?(await Promise.all(ye.map(async Ge=>{if(t)m(Fe=>[...Fe,Ge]);else{const Fe=await Ge.arrayBuffer(),Mt=new TextDecoder().decode(Fe),Yt=new TextEncoder().encode(Mt),ln=new File([Yt],Ge.name,{type:Ge.type});Ge.path&&Object.defineProperty(ln,"path",{value:Ge.path,writable:!1,enumerable:!0,configurable:!0}),h.append(`files[${n.entity}]`,ln)}})),t||(h.append("import_type",n.entity),U.submitForm(),f(h))):he.error("wrong_file_extension"):he.error("csv_rows_length")}});w.useEffect(()=>{H()},[g]),w.useEffect(()=>{x&&N()},[x]),w.useEffect(()=>()=>k(""),[]);const Ve=Ss(),Ye=()=>{n.exampleUrl&&window.open(n.exampleUrl,"_blank")};return O(St,{children:[O(tn,{title:e(n.entity),children:[O(G,{leftSide:e(t?"company_backup_file":"csv_file"),leftSideHelp:t&&e("company_backup_file_help"),children:[n.exampleUrl?p("button",{type:"button",style:{color:Ve},className:"inline-flex items-center space-x-1 mb-4",onClick:Ye,children:p("span",{children:e("download_example_file")})}):null,g.length?p("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:g.map((ye,He)=>O("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[ye.name," - ",(ye.size/1024).toPrecision(2)," KB"," ",p(p1,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>q(He)})]},He))}):O("div",{...oe(),className:"flex flex-col md:flex-row md:items-center",children:[O("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:[p("input",{...Q()}),p(RT,{className:"mx-auto h-12 w-12",style:{color:r.$3,colorScheme:r.$0}}),p("span",{className:"mt-2 block text-sm font-medium",style:{color:r.$3,colorScheme:r.$0},children:e(Ne?"drop_file_here":"dropzone_default_message")})]}),C&&Object.keys(C.errors).map((ye,He)=>p(Fs,{type:"danger",children:C.errors[ye]},He))]}),n.postWidgetSlot??null]}),t&&O(St,{children:[p(G,{leftSide:e("import_settings"),children:p(kt,{checked:l,onValueChange:ye=>c(ye)})}),p(G,{leftSide:e("import_data"),children:p(kt,{checked:u,onValueChange:ye=>d(ye)})}),p("div",{className:"flex justify-end pr-5",children:p(un,{behavior:"button",onClick:B,disableWithoutIcon:!0,disabled:!l&&!u||!g.length,children:e("import")})})]})]}),v&&!t&&!!s&&O(tn,{className:"mt-4",children:[p(G,{leftSide:e("template"),children:p(En,{value:x,onValueChange:ye=>{k(ye),ye||y(He=>({...He,column_map:{[n.entity]:{mapping:{...L}}}}))},withBlank:!0,children:a.filter(ye=>ye).map((ye,He)=>p("option",{value:ye,children:ye},He))})}),x&&p(uln,{name:x,entity:n.entity,onDeletedTemplate:P})]}),v&&!t&&O(ZS,{children:[O(eE,{children:[p(Ma,{children:e("header")}),p(Ma,{children:e("columns")})]}),O(JS,{children:[v.mappings[n.entity].headers[0].map((ye,He)=>O(wc,{children:[O(To,{className:"space-x-2",children:[p("span",{children:ye}),p("span",{className:"text-gray-400",children:v.mappings[n.entity].headers[1][He].substring(0,20)})]}),p(To,{children:O("div",{className:"flex items-center space-x-2",children:[p("div",{className:"flex-1",children:p(En,{id:He,value:W(He),onChange:A,withBlank:!0,children:v.mappings[n.entity].available.map((Pe,Ge)=>p("option",{value:Pe,children:M(Pe)},Ge))})}),p(nt,{className:"cursor-pointer",element:p1,size:24,onClick:()=>F(He)})]})})]},He)),n.entity==="bank_transaction"&&O(wc,{children:[p(To,{className:"space-x-2",children:p("span",{children:e("bank_account")})}),p(To,{colSpan:2,children:p(aln,{value:b.bank_integration_id,onChange:ye=>y(He=>({...He,bank_integration_id:ye==null?void 0:ye.id})),onClearButtonClick:()=>y(ye=>({...ye,bank_integration_id:""})),errorMessage:C==null?void 0:C.errors.bank_integration_id})})]}),p(wc,{children:p(To,{colSpan:2,children:p(lln,{entity:n.entity,importMap:b,onImport:B})})})]})]})]})}function dln(){const[n]=ve(),[e,t]=w.useState(!1);return p("div",{className:"grid grid-cols-12",children:p("div",{className:"col-span-12",children:e?p(tn,{title:n("restore"),children:p("span",{className:"text-gray-600 pl-6",children:n("import_started")})}):p(RGe,{entity:"company",onSuccess:!1,type:"zip",onFileImported:()=>t(!0)})})})}function hln(){const[n]=ve(),e=t=>{t.preventDefault(),he.processing(),$e("POST",Ae("/api/v1/export"),{send_email:!0,report_keys:[]}).then(i=>{he.success(i.data.message)})};return p(tn,{children:p(G,{leftSide:n("export_company"),leftSideHelp:n("exported_data"),children:p(un,{onClick:e,children:n("export")})})})}function fln(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 NGe(n){let{styling:e,arrowStyle:t="single",expanded:i,nodeType:r,onClick:o}=n;return ce.createElement("div",Tt({},e("arrowContainer",t),{onClick:o}),ce.createElement("div",e(["arrow","arrowSign"],r,i,t),"▶",t==="double"&&ce.createElement("div",e(["arrowSign","arrowSignInner"]),"▶")))}function pln(n,e){return n==="Object"?Object.keys(e).length:n==="Array"?e.length:1/0}function gln(n){return typeof n.set=="function"}function mln(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=gln(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 fee(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 _ln(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=mln.bind(null,n,e,t);if(!i)return s().entries;const a=o<1/0,l=Math.min(o-r,pln(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,...fee(r+i,r+2*i-1,i)]:d}else c=a?fee(r,o,i):[...s(0,i-5).entries,...fee(i-4,l-5,i),...s(l-4,l-1).entries];return c}function vln(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?ce.createElement("div",e("itemRange",s),r(n,t,i)):ce.createElement("div",Tt({},e("itemRange",s),{onClick:l}),ce.createElement(NGe,{nodeType:o,styling:e,expanded:!1,onClick:l,arrowStyle:"double"}),`${t} ... ${i}`)}function bln(n){return n.to!==void 0}function OGe(n,e,t){const{nodeType:i,data:r,collectionLimit:o,circularCache:s,keyPath:a,postprocessValue:l,sortObjectKeys:c}=n,u=[];return _ln(i,r,c,o,e,t).forEach(d=>{if(bln(d))u.push(ce.createElement(vln,Tt({},n,{key:`ItemRange--${d.from}-${d.to}`,from:d.from,to:d.to,renderChildNodes:OGe})));else{const{key:h,value:f}=d,g=s.indexOf(f)!==-1;u.push(ce.createElement(PGe,Tt({},n,{postprocessValue:l,collectionLimit:o,key:`Node--${h}`,keyPath:[h,...a],value:l(f),circularCache:[...s,f],isCircular:g,hideRoot:!1})))}}),u}function abe(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:f,shouldExpandNodeInitially:g,styling:m}=n,[v,_]=w.useState(l?!1:g(c,r,d)),b=w.useCallback(()=>{o&&_(!v)},[o,v]),y=v||a&&d===0?OGe({...n,circularCache:e,level:d+1}):null,C=ce.createElement("span",m("nestedNodeItemType",v),f),E=s(h,r,C,i(r,t),c),x=[c,h,v,o];return a?ce.createElement("li",m("rootNode",...x),ce.createElement("ul",m("rootNodeChildren",...x),y)):ce.createElement("li",m("nestedNode",...x),o&&ce.createElement(NGe,{styling:m,nodeType:h,expanded:v,onClick:b}),ce.createElement("label",Tt({},m(["label","nestedNodeLabel"],...x),{onClick:b}),u(...x)),ce.createElement("span",Tt({},m("nestedNodeItemString",...x),{onClick:b}),E),ce.createElement("ul",m("nestedNodeChildren",...x),y))}function yln(n){const e=Object.getOwnPropertyNames(n).length;return`${e} ${e!==1?"keys":"key"}`}function Cln(n){let{data:e,...t}=n;return ce.createElement(abe,Tt({},t,{data:e,nodeType:"Object",nodeTypeIndicator:t.nodeType==="Error"?"Error()":"{}",createItemString:yln,expandable:Object.getOwnPropertyNames(e).length>0}))}function wln(n){return`${n.length} ${n.length!==1?"items":"item"}`}function Sln(n){let{data:e,...t}=n;return ce.createElement(abe,Tt({},t,{data:e,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:wln,expandable:e.length>0}))}function Eln(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 xln(n){return ce.createElement(abe,Tt({},n,{nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:Eln,expandable:!0}))}function K0(n){let{nodeType:e,styling:t,labelRenderer:i,keyPath:r,valueRenderer:o,value:s,valueGetter:a=l=>l}=n;return ce.createElement("li",t("value",e,r),ce.createElement("label",t(["label","valueLabel"],e,r),i(r,e,!1,!1)),ce.createElement("span",t("valueText",e,r),o(a(s),s,...r)))}function PGe(n){let{getItemString:e,keyPath:t,labelRenderer:i,styling:r,value:o,valueRenderer:s,isCustomNode:a,...l}=n;const c=a(o)?"Custom":fln(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 ce.createElement(Cln,d);case"Array":return ce.createElement(Sln,d);case"Iterable":case"Map":case"Set":return ce.createElement(xln,d);case"String":return ce.createElement(K0,Tt({},u,{valueGetter:h=>`"${h}"`}));case"Number":return ce.createElement(K0,u);case"Boolean":return ce.createElement(K0,Tt({},u,{valueGetter:h=>h?"true":"false"}));case"Date":return ce.createElement(K0,Tt({},u,{valueGetter:h=>h.toISOString()}));case"Null":return ce.createElement(K0,Tt({},u,{valueGetter:()=>"null"}));case"Undefined":return ce.createElement(K0,Tt({},u,{valueGetter:()=>"undefined"}));case"Function":case"Symbol":return ce.createElement(K0,Tt({},u,{valueGetter:h=>h.toString()}));case"Custom":return ce.createElement(K0,u);default:return ce.createElement(K0,Tt({},u,{valueGetter:()=>`<${c}>`}))}}const Tln={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"},kln={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"},Iln={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"},Lln={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"},Dln={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"},Aln={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"},Rln={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"},Nln={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"},Oln={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"},Pln={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"},Mln={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"},Fln={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"},Bln={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"},$ln={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"},MGe={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"},Vln={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"},Hln={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"},Wln={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"},zln={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"},Uln={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"},jln={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"},qln={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"},Gln={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"},Kln={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"},Yln={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"},Qln={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"},Xln={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"},Zln={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"},Jln={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"},ecn={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"},tcn={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"},ncn={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"},icn={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"},rcn={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"},ocn={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"},scn={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"},acn={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"},lcn=Object.freeze(Object.defineProperty({__proto__:null,apathy:kln,ashes:Iln,atelierDune:Lln,atelierForest:Dln,atelierHeath:Aln,atelierLakeside:Rln,atelierSeaside:Nln,bespin:Oln,brewer:Pln,bright:Mln,chalk:Fln,codeschool:Bln,colors:$ln,default:MGe,eighties:Vln,embers:Hln,flat:Wln,google:zln,grayscale:Uln,greenscreen:jln,harmonic:qln,hopscotch:Gln,isotope:Kln,marrakesh:Yln,mocha:Qln,monokai:Xln,ocean:Zln,paraiso:Jln,pop:ecn,railscasts:tcn,shapeshifter:ncn,solarized:icn,summerfruit:rcn,threezerotwofour:Tln,tomorrow:ocn,tube:scn,twilight:acn},Symbol.toStringTag,{value:"Module"}));var FGe={exports:{}},BGe={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]},$Ge={exports:{}},ccn=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")},ucn=ccn,dcn=Array.prototype.concat,hcn=Array.prototype.slice,$De=$Ge.exports=function(e){for(var t=[],i=0,r=e.length;i<r;i++){var o=e[i];ucn(o)?t=dcn.call(t,hcn.call(o)):t.push(o)}return t};$De.wrap=function(n){return function(){return n($De(arguments))}};var fcn=$Ge.exports,_M=BGe,l6=fcn,VGe=Object.hasOwnProperty,HGe=Object.create(null);for(var pee in _M)VGe.call(_M,pee)&&(HGe[_M[pee]]=pee);var Qp=FGe.exports={to:{},get:{}};Qp.get=function(n){var e=n.substring(0,3).toLowerCase(),t,i;switch(e){case"hsl":t=Qp.get.hsl(n),i="hsl";break;case"hwb":t=Qp.get.hwb(n),i="hwb";break;default:t=Qp.get.rgb(n),i="rgb";break}return t?{model:i,value:t}:null};Qp.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]:VGe.call(_M,a[1])?(s=_M[a[1]],s[3]=1,s):null:null;for(l=0;l<3;l++)s[l]=Rw(s[l],0,255);return s[3]=Rw(s[3],0,1),s};Qp.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=Rw(parseFloat(t[2]),0,100),s=Rw(parseFloat(t[3]),0,100),a=Rw(isNaN(i)?1:i,0,1);return[r,o,s,a]}return null};Qp.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=Rw(parseFloat(t[2]),0,100),s=Rw(parseFloat(t[3]),0,100),a=Rw(isNaN(i)?1:i,0,1);return[r,o,s,a]}return null};Qp.to.hex=function(){var n=l6(arguments);return"#"+f9(n[0])+f9(n[1])+f9(n[2])+(n[3]<1?f9(Math.round(n[3]*255)):"")};Qp.to.rgb=function(){var n=l6(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]+")"};Qp.to.rgb.percent=function(){var n=l6(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]+")"};Qp.to.hsl=function(){var n=l6(arguments);return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};Qp.to.hwb=function(){var n=l6(arguments),e="";return n.length>=4&&n[3]!==1&&(e=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+e+")"};Qp.to.keyword=function(n){return HGe[n.slice(0,3)]};function Rw(n,e,t){return Math.min(Math.max(e,n),t)}function f9(n){var e=Math.round(n).toString(16).toUpperCase();return e.length<2?"0"+e:e}var pcn=FGe.exports,WGe={exports:{}},lT=BGe,zGe={};for(var gee in lT)lT.hasOwnProperty(gee)&&(zGe[lT[gee]]=gee);var Hi=WGe.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 uf in Hi)if(Hi.hasOwnProperty(uf)){if(!("channels"in Hi[uf]))throw new Error("missing channels property: "+uf);if(!("labels"in Hi[uf]))throw new Error("missing channel labels property: "+uf);if(Hi[uf].labels.length!==Hi[uf].channels)throw new Error("channel and label counts mismatch: "+uf);var gcn=Hi[uf].channels,mcn=Hi[uf].labels;delete Hi[uf].channels,delete Hi[uf].labels,Object.defineProperty(Hi[uf],"channels",{value:gcn}),Object.defineProperty(Hi[uf],"labels",{value:mcn})}Hi.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]};Hi.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]};Hi.rgb.hwb=function(n){var e=n[0],t=n[1],i=n[2],r=Hi.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]};Hi.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 _cn(n,e){return Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2)+Math.pow(n[2]-e[2],2)}Hi.rgb.keyword=function(n){var e=zGe[n];if(e)return e;var t=1/0,i;for(var r in lT)if(lT.hasOwnProperty(r)){var o=lT[r],s=_cn(n,o);s<t&&(t=s,i=r)}return i};Hi.keyword.rgb=function(n){return lT[n]};Hi.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]};Hi.rgb.lab=function(n){var e=Hi.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]};Hi.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};Hi.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]};Hi.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]}};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.rgb.ansi16=function(n){var e=n[0],t=n[1],i=n[2],r=1 in arguments?arguments[1]:Hi.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};Hi.hsv.ansi16=function(n){return Hi.rgb.ansi16(Hi.hsv.rgb(n),n[2])};Hi.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};Hi.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]};Hi.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]};Hi.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};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.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]};Hi.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};Hi.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};Hi.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};Hi.gray.hsl=Hi.gray.hsv=function(n){return[0,0,n[0]]};Hi.gray.hwb=function(n){return[0,100,n[0]]};Hi.gray.cmyk=function(n){return[0,0,0,n[0]]};Hi.gray.lab=function(n){return[n[0],0,0]};Hi.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};Hi.rgb.gray=function(n){var e=(n[0]+n[1]+n[2])/3;return[e/255*100]};var UGe=WGe.exports,AW=UGe;function vcn(){for(var n={},e=Object.keys(AW),t=e.length,i=0;i<t;i++)n[e[i]]={distance:-1,parent:null};return n}function bcn(n){var e=vcn(),t=[n];for(e[n].distance=0;t.length;)for(var i=t.pop(),r=Object.keys(AW[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 ycn(n,e){return function(t){return e(n(t))}}function Ccn(n,e){for(var t=[e[n].parent,n],i=AW[e[n].parent][n],r=e[n].parent;e[r].parent;)t.unshift(e[r].parent),i=ycn(AW[e[r].parent][r],i),r=e[r].parent;return i.conversion=t,i}var wcn=function(n){for(var e=bcn(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]=Ccn(s,e))}return t},bae=UGe,Scn=wcn,S2={},Ecn=Object.keys(bae);function xcn(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 Tcn(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}Ecn.forEach(function(n){S2[n]={},Object.defineProperty(S2[n],"channels",{value:bae[n].channels}),Object.defineProperty(S2[n],"labels",{value:bae[n].labels});var e=Scn(n),t=Object.keys(e);t.forEach(function(i){var r=e[i];S2[n][i]=Tcn(r),S2[n][i].raw=xcn(r)})});var kcn=S2,fP=pcn,$p=kcn,lbe=[].slice,jGe=["keyword","gray","hex"],yae={};Object.keys($p).forEach(function(n){yae[lbe.call($p[n].labels).sort().join("")]=n});var RW={};function pd(n,e){if(!(this instanceof pd))return new pd(n,e);if(e&&e in jGe&&(e=null),e&&!(e in $p))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 pd)this.model=n.model,this.color=n.color.slice(),this.valpha=n.valpha;else if(typeof n=="string"){var r=fP.get(n);if(r===null)throw new Error("Unable to parse color from string: "+n);this.model=r.model,i=$p[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=$p[this.model].channels;var o=lbe.call(n,0,i);this.color=Cae(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 yae))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=yae[a];var l=$p[this.model].labels,c=[];for(t=0;t<l.length;t++)c.push(n[l[t]]);this.color=Cae(c)}if(RW[this.model])for(i=$p[this.model].channels,t=0;t<i;t++){var u=RW[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)}pd.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(n){var e=this.model in fP.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 fP.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 fP.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var n={},e=$p[this.model].channels,t=$p[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 pd(this.color.map(Lcn(n)).concat(this.valpha),this.model)},alpha:function(n){return arguments.length?new pd(this.color.concat(Math.max(0,Math.min(1,n))),this.model):this.valpha},red:Ul("rgb",0,au(255)),green:Ul("rgb",1,au(255)),blue:Ul("rgb",2,au(255)),hue:Ul(["hsl","hsv","hsl","hwb","hcg"],0,function(n){return(n%360+360)%360}),saturationl:Ul("hsl",1,au(100)),lightness:Ul("hsl",2,au(100)),saturationv:Ul("hsv",1,au(100)),value:Ul("hsv",2,au(100)),chroma:Ul("hcg",1,au(100)),gray:Ul("hcg",2,au(100)),white:Ul("hwb",1,au(100)),wblack:Ul("hwb",2,au(100)),cyan:Ul("cmyk",0,au(100)),magenta:Ul("cmyk",1,au(100)),yellow:Ul("cmyk",2,au(100)),black:Ul("cmyk",3,au(100)),x:Ul("xyz",0,au(100)),y:Ul("xyz",1,au(100)),z:Ul("xyz",2,au(100)),l:Ul("lab",0,au(100)),a:Ul("lab",1),b:Ul("lab",2),keyword:function(n){return arguments.length?new pd(n):$p[this.model].keyword(this.color)},hex:function(n){return arguments.length?new pd(n):fP.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 pd.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 pd.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($p).forEach(function(n){if(jGe.indexOf(n)===-1){var e=$p[n].channels;pd.prototype[n]=function(){if(this.model===n)return new pd(this);if(arguments.length)return new pd(arguments,n);var t=typeof arguments[e]=="number"?e:this.valpha;return new pd(Dcn($p[this.model][n].raw(this.color)).concat(t),n)},pd[n]=function(t){return typeof t=="number"&&(t=Cae(lbe.call(arguments),e)),new pd(t,n)}}});function Icn(n,e){return Number(n.toFixed(e))}function Lcn(n){return function(e){return Icn(e,n)}}function Ul(n,e,t){return n=Array.isArray(n)?n:[n],n.forEach(function(i){(RW[i]||(RW[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 au(n){return function(e){return Math.max(0,Math.min(n,e))}}function Dcn(n){return Array.isArray(n)?n:[n]}function Cae(n,e){for(var t=0;t<e;t++)typeof n[t]!="number"&&(n[t]=0);return n}var Acn=pd;const VDe=nl(Acn);var Rcn="Expected a function",HDe="__lodash_placeholder__",zT=1,MG=2,Ncn=4,cT=8,vM=16,jL=32,h3=64,qGe=128,Ocn=256,GGe=512,WDe=1/0,Pcn=9007199254740991,Mcn=17976931348623157e292,zDe=0/0,Fcn=[["ary",qGe],["bind",zT],["bindKey",MG],["curry",cT],["curryRight",vM],["flip",GGe],["partial",jL],["partialRight",h3],["rearg",Ocn]],Bcn="[object Function]",$cn="[object GeneratorFunction]",Vcn="[object Symbol]",Hcn=/[\\^$.*+?()[\]{}|]/g,Wcn=/^\s+|\s+$/g,zcn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ucn=/\{\n\/\* \[wrapped with (.+)\] \*/,jcn=/,? & /,qcn=/^[-+]0x[0-9a-f]+$/i,Gcn=/^0b[01]+$/i,Kcn=/^\[object .+?Constructor\]$/,Ycn=/^0o[0-7]+$/i,Qcn=/^(?:0|[1-9]\d*)$/,Xcn=parseInt,Zcn=typeof Po=="object"&&Po&&Po.Object===Object&&Po,Jcn=typeof self=="object"&&self&&self.Object===Object&&self,c6=Zcn||Jcn||Function("return this")();function KGe(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 eun(n,e){for(var t=-1,i=n?n.length:0;++t<i&&e(n[t],t,n)!==!1;);return n}function tun(n,e){var t=n?n.length:0;return!!t&&iun(n,e,0)>-1}function nun(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 iun(n,e,t){if(e!==e)return nun(n,run,t);for(var i=t-1,r=n.length;++i<r;)if(n[i]===e)return i;return-1}function run(n){return n!==n}function oun(n,e){for(var t=n.length,i=0;t--;)n[t]===e&&i++;return i}function sun(n,e){return n==null?void 0:n[e]}function aun(n){var e=!1;if(n!=null&&typeof n.toString!="function")try{e=!!(n+"")}catch{}return e}function YGe(n,e){for(var t=-1,i=n.length,r=0,o=[];++t<i;){var s=n[t];(s===e||s===HDe)&&(n[t]=HDe,o[r++]=t)}return o}var lun=Function.prototype,QGe=Object.prototype,mee=c6["__core-js_shared__"],UDe=function(){var n=/[^.]+$/.exec(mee&&mee.keys&&mee.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),XGe=lun.toString,cun=QGe.hasOwnProperty,ZGe=QGe.toString,uun=RegExp("^"+XGe.call(cun).replace(Hcn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dun=Object.create,NW=Math.max,hun=Math.min,jDe=function(){var n=qDe(Object,"defineProperty"),e=qDe.name;return e&&e.length>2?n:void 0}();function fun(n){return uA(n)?dun(n):{}}function pun(n){if(!uA(n)||xun(n))return!1;var e=Lun(n)||aun(n)?uun:Kcn;return e.test(kun(n))}function gun(n,e,t,i){for(var r=-1,o=n.length,s=t.length,a=-1,l=e.length,c=NW(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 mun(n,e,t,i){for(var r=-1,o=n.length,s=-1,a=t.length,l=-1,c=e.length,u=NW(o-a,0),d=Array(u+c),h=!i;++r<u;)d[r]=n[r];for(var f=r;++l<c;)d[f+l]=e[l];for(;++s<a;)(h||r<o)&&(d[f+t[s]]=n[r++]);return d}function _un(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}function vun(n,e,t){var i=e&zT,r=f3(n);function o(){var s=this&&this!==c6&&this instanceof o?r:n;return s.apply(i?t:this,arguments)}return o}function f3(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=fun(n.prototype),i=n.apply(t,e);return uA(i)?i:t}}function bun(n,e,t){var i=f3(n);function r(){for(var o=arguments.length,s=Array(o),a=o,l=eKe(r);a--;)s[a]=arguments[a];var c=o<3&&s[0]!==l&&s[o-1]!==l?[]:YGe(s,l);if(o-=c.length,o<t)return JGe(n,e,cbe,r.placeholder,void 0,s,c,void 0,void 0,t-o);var u=this&&this!==c6&&this instanceof r?i:n;return KGe(u,this,s)}return r}function cbe(n,e,t,i,r,o,s,a,l,c){var u=e&qGe,d=e&zT,h=e&MG,f=e&(cT|vM),g=e&GGe,m=h?void 0:f3(n);function v(){for(var _=arguments.length,b=Array(_),y=_;y--;)b[y]=arguments[y];if(f)var C=eKe(v),E=oun(b,C);if(i&&(b=gun(b,i,r,f)),o&&(b=mun(b,o,s,f)),_-=E,f&&_<c){var x=YGe(b,C);return JGe(n,e,cbe,v.placeholder,t,b,x,a,l,c-_)}var k=d?t:this,L=h?k[n]:n;return _=b.length,a?b=Tun(b,a):g&&_>1&&b.reverse(),u&&l<_&&(b.length=l),this&&this!==c6&&this instanceof v&&(L=m||f3(L)),L.apply(k,b)}return v}function yun(n,e,t,i){var r=e&zT,o=f3(n);function s(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=Array(u+l),h=this&&this!==c6&&this instanceof s?o:n;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return KGe(h,r?t:this,d)}return s}function JGe(n,e,t,i,r,o,s,a,l,c){var u=e&cT,d=u?s:void 0,h=u?void 0:s,f=u?o:void 0,g=u?void 0:o;e|=u?jL:h3,e&=~(u?h3:jL),e&Ncn||(e&=~(zT|MG));var m=t(n,e,r,f,d,g,h,a,l,c);return m.placeholder=i,tKe(m,n,e)}function Cun(n,e,t,i,r,o,s,a){var l=e&MG;if(!l&&typeof n!="function")throw new TypeError(Rcn);var c=i?i.length:0;if(c||(e&=~(jL|h3),i=r=void 0),s=s===void 0?s:NW(GDe(s),0),a=a===void 0?a:GDe(a),c-=r?r.length:0,e&h3){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:NW(h[9]-c,0),!a&&e&(cT|vM)&&(e&=~(cT|vM)),!e||e==zT)var f=vun(n,e,t);else e==cT||e==vM?f=bun(n,e,a):(e==jL||e==(zT|jL))&&!r.length?f=yun(n,e,t,i):f=cbe.apply(void 0,h);return tKe(f,n,e)}function eKe(n){var e=n;return e.placeholder}function qDe(n,e){var t=sun(n,e);return pun(t)?t:void 0}function wun(n){var e=n.match(Ucn);return e?e[1].split(jcn):[]}function Sun(n,e){var t=e.length,i=t-1;return e[i]=(t>1?"& ":"")+e[i],e=e.join(t>2?", ":" "),n.replace(zcn,`{
/* [wrapped with `+e+`] */
`)}function Eun(n,e){return e=e??Pcn,!!e&&(typeof n=="number"||Qcn.test(n))&&n>-1&&n%1==0&&n<e}function xun(n){return!!UDe&&UDe in n}function Tun(n,e){for(var t=n.length,i=hun(e.length,t),r=_un(n);i--;){var o=e[i];n[i]=Eun(o,t)?r[o]:void 0}return n}var tKe=jDe?function(n,e,t){var i=e+"";return jDe(n,"toString",{configurable:!0,enumerable:!1,value:Oun(Sun(i,Iun(wun(i),t)))})}:Pun;function kun(n){if(n!=null){try{return XGe.call(n)}catch{}try{return n+""}catch{}}return""}function Iun(n,e){return eun(Fcn,function(t){var i="_."+t[0];e&t[1]&&!tun(n,i)&&n.push(i)}),n.sort()}function ube(n,e,t){e=t?void 0:e;var i=Cun(n,cT,void 0,void 0,void 0,void 0,void 0,e);return i.placeholder=ube.placeholder,i}function Lun(n){var e=uA(n)?ZGe.call(n):"";return e==Bcn||e==$cn}function uA(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function Dun(n){return!!n&&typeof n=="object"}function Aun(n){return typeof n=="symbol"||Dun(n)&&ZGe.call(n)==Vcn}function Run(n){if(!n)return n===0?n:0;if(n=Nun(n),n===WDe||n===-WDe){var e=n<0?-1:1;return e*Mcn}return n===n?n:0}function GDe(n){var e=Run(n),t=e%1;return e===e?t?e-t:e:0}function Nun(n){if(typeof n=="number")return n;if(Aun(n))return zDe;if(uA(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=uA(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(Wcn,"");var t=Gcn.test(n);return t||Ycn.test(n)?Xcn(n.slice(2),t?2:8):qcn.test(n)?zDe:+n}function Oun(n){return function(){return n}}function Pun(n){return n}ube.placeholder={};var Mun=ube;const KDe=nl(Mun);function Fun(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 Bun(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 YDe(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 Nf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?YDe(Object(t),!0).forEach(function(i){it(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):YDe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var nKe=MGe,QDe=Object.keys(nKe),$un=function(e){return e<.25?1:e<.5?.9-e:1.1-e},Vun=function(e){var t=VDe(e),i=Bun(t.array()),r=cn(i,3),o=r[0],s=r[1],a=r[2],l=[$un(o),s,a],c=Fun(l);return VDe.rgb(c).hex()},GI=function(e){return function(t){return{className:[t.className,e.className].filter(Boolean).join(" "),style:Nf(Nf({},t.style||{}),e.style||{})}}},Hun=function(e,t){if(e===void 0)return t;if(t===void 0)return e;var i=Zr(e),r=Zr(t);switch(i){case"string":switch(r){case"string":return[t,e].filter(Boolean).join(" ");case"object":return GI({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 GI({className:e})(t.apply(void 0,[o].concat(a)))}}break;case"object":switch(r){case"string":return GI({className:t,style:e});case"object":return Nf(Nf({},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 GI({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,[GI(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,[GI(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))}}}},Wun=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]=Hun(e[s],t[s]),o},{})},zun=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(" "):Zr(c)==="object"?l.style=Nf(Nf({},l.style),c):typeof c=="function"&&(l=Nf(Nf({},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},wae=function(e){return Object.keys(e).reduce(function(t,i){return t[i]=/^base/.test(i)?Vun(e[i]):i==="scheme"?e[i]+":inverted":e[i],t},{})},Uun=KDe(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?nKe:i,o=e.base16Themes,s=o===void 0?null:o,a=jun(t,s);a&&(t=Nf(Nf({},a),t));for(var l=QDe.reduce(function(m,v){return m[v]=t[v]||r[v],m},{}),c=Object.keys(t).reduce(function(m,v){return QDe.indexOf(v)===-1&&(m[v]=t[v]),m},{}),u=n(l),d=Wun(c,u),h=arguments.length,f=new Array(h>3?h-3:0),g=3;g<h;g++)f[g-3]=arguments[g];return KDe(zun,2).apply(void 0,[d].concat(f))},3),iKe=function(e){return!!e.extend},jun=function(e,t){if(e&&iKe(e)&&e.extend&&(e=e.extend),typeof e=="string"){var i=e.split(":"),r=cn(i,2),o=r[0],s=r[1];t?e=t[o]:e=lcn[o],s==="inverted"&&(e=wae(e))}return e&&Object.prototype.hasOwnProperty.call(e,"base00")?e:void 0},qun=function(e){return typeof e=="string"?"".concat(e,":inverted"):e&&iKe(e)&&e.extend?typeof e.extend=="string"?Nf(Nf({},e),{},{extend:"".concat(e.extend,":inverted")}):Nf(Nf({},e),{},{extend:wae(e.extend)}):e&&wae(e)};const Gun={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"},Kun=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}),Yun=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}),Qun=n=>{const e=Kun(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:Yun(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"}}},Xun=Uun(Qun,{defaultBase16:Gun}),Zun=Xun,XDe=n=>n,Jun=(n,e,t)=>t===0,edn=(n,e,t,i)=>ce.createElement("span",null,t," ",i),tdn=n=>{let[e]=n;return ce.createElement("span",null,e,":")},ndn=()=>!1;function idn(n){let{data:e,theme:t,invertTheme:i,keyPath:r=["root"],labelRenderer:o=tdn,valueRenderer:s=XDe,shouldExpandNodeInitially:a=Jun,hideRoot:l=!1,getItemString:c=edn,postprocessValue:u=XDe,isCustomNode:d=ndn,collectionLimit:h=50,sortObjectKeys:f=!1}=n;const g=w.useMemo(()=>Zun(i?qun(t):t),[t,i]);return ce.createElement("ul",g("tree"),ce.createElement(PGe,{keyPath:l?[]:r,value:u(e),isCustomNode:d,styling:g,labelRenderer:o,valueRenderer:s,shouldExpandNodeInitially:a,hideRoot:l,getItemString:c,postprocessValue:u,collectionLimit:h,sortObjectKeys:f}))}const rdn={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 odn(){const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("system_logs"),href:"/settings/system_logs"}],{dateFormat:t}=sc(),{data:i,isLoading:r}=Ii(["/api/v1/system_logs","per_page=200","sort=created_at|DESC"],()=>$e("GET",Ae("/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 f=o.find(g=>g.id===h);return f?f.name:"Undefined Category"},c=h=>{const f=s.find(g=>g.id===h);return f?f.name:"Undefined Event"},u=h=>{const f=a.find(g=>g.id===h);return f?f.name:"Undefined Type"},d=h=>p(idn,{data:JSON.parse(h),theme:rdn})||h;return O(sr,{title:n("system_logs"),breadcrumbs:e,children:[r&&p(BUt,{children:p(ds,{})}),p(tn,{children:i==null?void 0:i.data.data.map((h,f,{length:g})=>O("div",{children:[p(G,{leftSide:l(h.category_id),leftSideHelp:`${u(h.type_id)} ${xo(h.created_at,t)}`,children:O("div",{className:"flex flex-col space-y-2",children:[p("div",{children:p(_r,{children:c(h.event_id)})}),p("div",{children:d(h.log)})]})},f),f+1!==g&&p(vi,{})]},f))})]})}/**
* 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 FG(n){const e=ki(),t=zi(),{withoutNavigation:i}=n||{},r=Wi(Uk);return o=>{r(o),t(go({object:"company",property:"settings",value:o.settings})),t(LF({status:{name:o.name,level:"group"}})),!i&&e("/settings/company_details")}}function rKe(){const[n]=ve(),e=ml(),t=ki(),i=Co(),r=FG(),{id:o}=il(),s=Yrn(),a=e.pathname.includes(o),l=async u=>{const d=await i.fetchQuery(["/api/v1/group_settings",u],()=>$e("GET",Ae("/api/v1/group_settings/:id",{id:u})).then(h=>h.data.data),{staleTime:1/0});r(d)};return[u=>!a&&p(gt,{onClick:()=>l(u.id),icon:p(nt,{className:"h-4 w-4",element:$ge}),children:n("configure_settings")}),u=>Tr(u)===nr.Active&&p(gt,{onClick:()=>t(At("/clients/create?group=:groupId",{groupId:u.id})),icon:p(nt,{element:qp}),children:n("new_client")}),()=>a&&p(vi,{withoutPadding:!0}),u=>a&&Tr(u)===nr.Active&&p(gt,{onClick:()=>s([u.id],"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),u=>a&&(Tr(u)===nr.Archived||Tr(u)===nr.Deleted)&&p(gt,{onClick:()=>s([u.id],"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),u=>a&&(Tr(u)===nr.Active||Tr(u)===nr.Archived)&&p(gt,{onClick:()=>s([u.id],"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function sdn(){const{documentTitle:n}=Mi("online_payments"),[e]=ve(),t=rKe(),i=[{name:e("settings"),href:"/settings"},{name:e("group_settings"),href:"/settings/group_settings"}],r=[{id:"status_id",label:e("status"),format:(o,s)=>p($m,{entity:s})},{id:"name",label:e("name"),format:(o,s)=>p(qi,{to:At("/settings/group_settings/:id/edit",{id:s.id}),children:o})}];return p(sr,{title:n,breadcrumbs:i,docsLink:"en/advanced-settings/#group_settings",children:p(Lg,{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 oKe={id:"",name:"",settings:{},created_at:0,updated_at:0,archived_at:0,is_deleted:!1,documents:[]};function sKe(n){const{setGroupSettings:e,setErrors:t,isCreatePage:i}=n;return(r,o)=>{t(void 0),e(i?{...oKe,[r]:o}:s=>s&&{...s,[r]:o})}}function aKe(n){const[e]=ve(),{groupSettings:t,handleChange:i,errors:r}=n;return p(G,{leftSide:e("name"),children:p(Ze,{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 adn(n){const e=ki(),t=Co(),i=Gi(Eu),{groupSettings:r,setErrors:o,setIsFormBusy:s,isFormBusy:a}=n;return()=>{a||(he.processing(),o(void 0),s(!0),$e("POST",Ae("/api/v1/group_settings"),r).then(l=>{he.success("created_group"),In(["group_settings"]),i&&t.invalidateQueries([i]),e(At("/settings/group_settings/:id/edit",{id:l.data.data.id}))}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(he.dismiss(),o(l.response.data))}).finally(()=>s(!1)))}}function ldn(){const[n]=ve(),{documentTitle:e}=Mi("new_group"),t=x0(),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=sKe({setGroupSettings:o,setErrors:a,isCreatePage:!0}),d=adn({groupSettings:r,setErrors:a,isFormBusy:l,setIsFormBusy:c});return w.useEffect(()=>{o(oKe)},[]),O(sr,{title:e,breadcrumbs:i,onSaveClick:d,disableSaveButton:l||!r||t,children:[t&&p(Iv,{}),r&&p(tn,{title:n("new_group"),children:p(aKe,{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 dbe(n){const e=ki(),t=zi(),i=Ti(),r=Zi(),{withoutNavigation:o}=n||{},s=Wi(Uk);return a=>{s(a),t(r?go({object:"company",property:"settings",value:a.settings}):AT({object:"company",data:{...i,settings:a.settings}})),t(LF({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 cdn(n){const e=ki(),t=Co(),{setIsPurgeOrMergeActionCalled:i}=n||{},r=Wi(ap);return(o,s)=>{he.processing(),i==null||i(!0),$e("POST",Ae("/api/v1/clients/:id/purge",{id:s}),{},{headers:{"X-Api-Password":o}}).then(()=>{he.success("purged_client"),t.invalidateQueries(),e("/clients")}).catch(a=>{var l;((l=a.response)==null?void 0:l.status)===412&&(he.error("password_error_incorrect"),r(0)),i==null||i(!1)})}}function udn(n){const[e]=ve(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,r=cdn({setIsPurgeOrMergeActionCalled:i}),[o,s]=w.useState(!1);return O(St,{children:[p(gt,{onClick:()=>s(!0),icon:p(nt,{element:FEt}),children:e("purge")}),p(Tg,{show:o,onClose:s,onSave:a=>r(a,t.id)})]})}function ddn(n){const[e]=ve(),t=zi(),i=ki(),{isEditOrShowPage:r}=tE({entity:"client"}),{setIsPurgeOrMergeActionCalled:o}=n,s=Wi(ap),[a,l]=w.useState(""),[c,u]=w.useState(!1),[d,h]=w.useState(!1),f=g=>{d||(he.processing(),h(!0),o==null||o(!0),$e("POST",Ae("/api/v1/clients/:mergeIntoClientId/:mergeFromClientId/merge",{mergeIntoClientId:a,mergeFromClientId:n.mergeFromClientId}),{},{headers:{"X-Api-Password":g}}).then(()=>{In(["clients"]),$e("POST",Ae("/api/v1/refresh")).then(m=>{he.success("merged_clients"),t(y0(m.data.data)),l(""),n.setVisible(!1),r&&i("/clients")}).catch(()=>o==null?void 0:o(!1))}).catch(m=>{var v;((v=m.response)==null?void 0:v.status)===412&&(he.error("password_error_incorrect"),s(0)),o==null||o(!1)}).finally(()=>h(!1)))};return O(Or,{title:e("merge_into"),visible:n.visible,onClose:()=>{l(""),n.setVisible(!1)},overflowVisible:!0,children:[p(TG,{inputLabel:e("client"),onChange:g=>l(g.id),value:a,clearButton:!0,onClearButtonClick:()=>l(""),withoutAction:!0,exclude:[n.mergeFromClientId],dropdownLabelFn:g=>{var m;return O("div",{className:"flex items-center space-x-1",children:[p("span",{children:g.display_name}),((m=g.contacts[0])==null?void 0:m.email)&&O("span",{className:"text-xs",children:["(",g.contacts[0].email,")"]})]})},initiallyVisible:!0}),p("div",{className:"self-end pt-2",children:p(un,{disableWithoutIcon:!0,disabled:!a,onClick:()=>u(!0),children:e("merge")})}),p(Tg,{show:c,onClose:u,onSave:f})]})}function hdn(n){const[e]=ve(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,[r,o]=w.useState(!1);return O(St,{children:[p(gt,{onClick:()=>o(!0),icon:p(nt,{element:VAt}),children:e("merge")}),p(ddn,{visible:r,setVisible:o,mergeFromClientId:t.id,setIsPurgeOrMergeActionCalled:i})]})}function fdn(n){const[e]=ve(),t=Xve(),{setIsPurgeOrMergeActionCalled:i}=n||{},r=hs(),{isAdmin:o,isOwner:s}=Fo(),{isEditOrShowPage:a,isShowPage:l}=tE({entity:"client"}),c=dbe(),{setChangeTemplateVisible:u,setChangeTemplateResources:d,setChangeTemplateEntityContext:h}=qR();return[g=>!g.is_deleted&&p(gt,{to:At("/clients/:id/statement",{id:g.id}),icon:p(nt,{element:oq}),children:e("view_statement")}),g=>!g.is_deleted&&!l&&p(gt,{onClick:()=>window.open(At(`${g.contacts[0].link}?silent=true&client_hash=:clientHash`,{clientHash:g.client_hash}),"__blank"),icon:p(nt,{element:hme}),children:e("client_portal")}),g=>p(OG,{entity:"client",entityId:g.id,label:g.display_name,labelElement:p(gt,{icon:p(nt,{element:rq}),children:e("add_comment")})}),g=>!g.is_deleted&&(o||s)&&p(gt,{onClick:()=>c(g),icon:p(nt,{element:VEt}),children:e("settings")}),g=>!g.is_deleted&&r("create_invoice")&&p(gt,{to:At("/invoices/create?client=:id",{id:g.id}),icon:p(nt,{element:qp}),children:e("new_invoice")}),g=>!g.is_deleted&&r("create_payment")&&p(gt,{to:At("/payments/create?client=:id",{id:g.id}),icon:p(nt,{element:qp}),children:e("new_payment")}),g=>!g.is_deleted&&r("create_quote")&&p(gt,{to:At("/quotes/create?client=:id",{id:g.id}),icon:p(nt,{element:qp}),children:e("new_quote")}),g=>!g.is_deleted&&r("create_credit")&&p(gt,{to:At("/credits/create?client=:id",{id:g.id}),icon:p(nt,{element:qp}),children:e("new_credit")}),g=>!g.is_deleted&&(o||s)&&g&&p(hdn,{client:g,setIsPurgeOrMergeActionCalled:i}),g=>p(gt,{onClick:()=>{u(!0),d([g]),h({endpoint:"/api/v1/clients/bulk",entity:"clients"})},icon:p(nt,{element:SR}),children:e("run_template")}),g=>a&&!g.is_deleted&&p(vi,{withoutPadding:!0}),g=>a&&Tr(g)===nr.Active&&p(gt,{onClick:()=>t([g.id],"archive"),icon:p(nt,{element:Dc}),children:e("archive")}),g=>a&&(Tr(g)===nr.Archived||Tr(g)===nr.Deleted)&&p(gt,{onClick:()=>t([g.id],"restore"),icon:p(nt,{element:Lc}),children:e("restore")}),g=>a&&(Tr(g)===nr.Active||Tr(g)===nr.Archived)&&p(gt,{onClick:()=>t([g.id],"delete"),icon:p(nt,{element:el}),children:e("delete")}),g=>(o||s)&&g&&p(udn,{client:g,setIsPurgeOrMergeActionCalled:i},"purge")]}const pdn=["name","contact_email","id_number","balance","paid_to_date","created_at","last_login_at","website"];function gdn(){const[n,e,t,i]=cp({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 mdn(){var _;const{t:n}=ve(),{dateFormat:e}=sc(),t=nE(),i=Ti(),r=_l(),o=ef(),s=$R(),a=XS(),l=PBe(),c=Gk(),u=w.useCallback(b=>{const y=[];return b.contacts.map(C=>y.push(`${C.first_name} ${C.last_name}`)),y.join("<br />")},[]);gdn();const[d,h,f,g]=cp({entity:"client"}),m=[{column:"number",id:"number",label:n("number")},{column:"name",id:"display_name",label:n("name"),format:(b,y)=>p(Rf,{to:At("/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&&O(Rf,{to:At("/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&&p(Oc,{text:y.contacts[0].email})},{column:"last_login_at",id:"last_login",label:n("last_login"),format:b=>xo(b,e)},{column:"address2",id:"address2",label:n("address2")},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>xo(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)=>p("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=>xo(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,E;return((C=y.settings)==null?void 0:C.currency_id)&&((E=a(y.settings.currency_id))==null?void 0:E.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:f,id:"custom_value3",label:f,format:b=>c("client3",b==null?void 0:b.toString())},{column:g,id:"custom_value4",label:g,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)=>p($m,{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=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(b)}})}),children:p("span",{children:i0(Xc(b)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:b=>p(Yu,{width:"auto",tooltipElement:p("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:p("article",{className:zt("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:Xc(b)}})}),children:p("span",{children:i0(Xc(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=>xo(b,e)},{column:"vat_number",id:"vat_number",label:n("vat_number")},{column:"website",id:"website",label:n("website"),format:b=>p(qi,{to:b.toString(),external:!0,children:O(Q4,{children:[p("span",{children:b}),b.toString().length>0&&p(Z8e,{size:14})]})})},{column:"group",id:"group_settings_id",label:n("group"),format:(b,y)=>{var C;return!!b&&p(qi,{to:At("/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:_.client)||pdn;return m.filter(b=>v.includes(b.column)).sort((b,y)=>v.indexOf(b.column)-v.indexOf(y.column))}function _dn(n){var t;const[e]=ve();return p(Mh,{endpoint:Ae("/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 vdn(n){const[e]=ve(),{clients:t,setSelected:i}=n,r=Xve(),[o,s]=w.useState(!1),[a,l]=w.useState(""),c=()=>{s(!1),l("")};return O(St,{children:[p(gt,{onClick:()=>s(!0),icon:p(nt,{element:$9e}),children:e("assign_group")}),O(Or,{title:e("group"),visible:o,onClose:c,overflowVisible:!0,children:[p(_dn,{value:a,onChange:u=>l(u.id),onClearButtonClick:()=>l("")}),p(un,{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 bdn(){const{data:n}=ph(),[e,t]=w.useState();return w.useEffect(()=>{n!=null&&n.bulk_updates&&t(n.bulk_updates)},[n]),e}const ydn=[{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 Cdn(n){var b;const[e]=ve(),{setSelected:t,resourceIds:i}=n,r=Xve(),{data:o}=ph(),s=Ti(),a=bdn(),[l,c]=w.useState(""),[u,d]=w.useState(""),[h,f]=w.useState(!1),g=()=>{f(!1),c(""),d("")},m=()=>{var y;return((y=ydn.find(({key:C})=>C===l))==null?void 0:y.type)||""},v=y=>y.startsWith("custom_value")?!!s.custom_fields[y.replace("custom_value",n.entity)]:!0,_=()=>l.replace("custom_value",n.entity);return O(St,{children:[p(gt,{onClick:()=>f(!0),icon:p(nt,{element:MEt}),children:e("bulk_update")}),p(Or,{title:e("bulk_update"),size:"regular",visible:h,onClose:g,overflowVisible:!0,children:O("div",{className:"flex flex-col space-y-5",children:[p(En,{label:e("column"),value:l,onValueChange:y=>{c(y),d("")},withBlank:!0,children:a==null?void 0:a[n.entity].map(y=>v(y)&&p("option",{value:y,children:e(y)},y))}),O("div",{className:"flex flex-col",children:[!!m()&&p(pg,{className:"mb-2",children:e("value")}),m()==="markdownEditor"&&p(dd,{value:u,onChange:y=>d(y)}),m()==="industrySelector"&&p(En,{value:u,onValueChange:y=>d(y),withBlank:!0,children:o==null?void 0:o.industries.map(y=>p("option",{value:y.id,children:y.name},y.id))}),m()==="sizeSelector"&&p(En,{value:u,onValueChange:y=>d(y),withBlank:!0,children:o==null?void 0:o.sizes.map((y,C)=>p("option",{value:y.id,children:y.name},C))}),m()==="countrySelector"&&p(a6,{value:u,onChange:y=>d(y),dismissable:!0}),m()==="customField"&&((b=s==null?void 0:s.custom_fields)==null?void 0:b[_()])&&p(rs,{field:_(),defaultValue:u,value:s.custom_fields[_()],onValueChange:y=>d(y),fieldOnly:!0})]}),p("div",{className:"flex self-end",children:p(un,{behavior:"button",onClick:()=>{r(i,"bulk_update",{column:l,newValue:u}).then(()=>g()),t([])},disabled:!l,disableWithoutIcon:!0,children:e("update")})})]})})]})}const wdn=()=>{const[n]=ve(),e=YWe(),t=d=>d.flatMap(({documents:h})=>h.map(({id:f})=>f)),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 f=t(d);e(f,"download"),h([])},{setChangeTemplateVisible:a,setChangeTemplateResources:l,setChangeTemplateEntityContext:c}=qR();return[({selectedResources:d,setSelected:h})=>r(d)&&p(gt,{onClick:()=>i(d)?s(d,h):he.error("no_documents_to_download"),icon:p(nt,{element:sS}),children:n("documents")}),({selectedResources:d})=>p(gt,{onClick:()=>{a(!0),l(d),c({endpoint:"/api/v1/clients/bulk",entity:"client"})},icon:p(nt,{element:SR}),children:n("run_template")}),({selectedResources:d,setSelected:h})=>o(d)&&p(vdn,{clients:d,setSelected:h}),({selectedIds:d,setSelected:h})=>p(Cdn,{entity:"client",resourceIds:d,setSelected:h})]};function Sdn(){const{id:n}=il(),e=fdn(),t=mdn(),i=wdn();return p("div",{className:"mt-8",children:p(Lg,{resource:"client",endpoint:At("/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:At("/clients/create?group=:groupId",{groupId:n})})})}function Edn(){const[n]=ve(),{id:e}=il(),{documentTitle:t}=Mi("edit_group"),{data:i}=Krn({id:e}),r=rKe(),o=FG(),s=[{name:n("settings"),href:"/settings"},{name:n("group_settings"),href:"/settings/group_settings"},{name:n("edit_group"),href:At("/settings/group_settings/:id/edit",{id:e})}],[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=w.useState(!1),f=sKe({setGroupSettings:l,setErrors:u}),g=GWe({groupSettings:a,setErrors:u,isFormBusy:d,setIsFormBusy:h});w.useEffect(()=>{i&&l(i)},[i]);const m=()=>{In(["group_settings"])};return p(sr,{title:t,breadcrumbs:s,onSaveClick:g,disableSaveButton:d||!a,navigationTopRight:a&&p(R1,{label:n("more_actions"),resource:a,actions:r}),children:O(kv,{tabs:[n("overview"),n("clients"),n("documents")],formatTabLabel:v=>{if(v===2)return p(O_e,{numberOfDocuments:a==null?void 0:a.documents.length})},children:[p("div",{children:a&&i&&p(tn,{title:n("edit_group"),topRight:O(un,{behavior:"button",onClick:()=>o(i),children:[p(nt,{className:"h-4 w-4",element:$ge,color:"white"}),p("span",{children:n("configure_settings")})]}),children:p("div",{children:p(aKe,{groupSettings:a,handleChange:f,errors:c})})})}),p("div",{children:p(Sdn,{})}),O("div",{children:[p(Zve,{endpoint:Ae("/api/v1/group_settings/:id/upload",{id:e}),onSuccess:m,widgetOnly:!0}),p(Wqe,{documents:(a==null?void 0:a.documents)||[],onDocumentDelete:m})]})]})})}function xdn(){Mi("user_management");const n=Va(),[e]=ve(),[t,i]=w.useState(!1),[r,o]=w.useState(),[s,a]=w.useState([]),l=Jrn(),c=[{name:e("settings"),href:"/settings"},{name:e("user_management"),href:"/settings/users"}],u=[{id:"name",label:"name",format:(d,h)=>O(qi,{to:At("/settings/users/:id/edit",{id:h.id}),children:[h.first_name," ",h.last_name]})},{id:"email",label:"email"}];return O(St,{children:[p(sr,{title:e("user_details"),breadcrumbs:c,docsLink:"/docs/advanced-settings/#user_management",children:p(Lg,{resource:"user",columns:u,endpoint:At("/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)}})}),p(Tg,{show:t,onClose:i,onSave:d=>r&&l(s,r,d),tableActions:!0})]})}function Tdn(n){const[e]=ve(),[t,i]=w.useState(!1),[r,o]=w.useState(),{user:s}=n,{id:a}=il(),l=ki(),c=()=>{he.processing(),$e("POST",Ae("/api/v1/users/:id/invite",{id:a})).then(()=>{In(["users"]),he.success("email_sent_to_confirm_email")})},u=()=>{he.processing(),$e("DELETE",Ae("/api/v1/users/:id/detach_from_company",{id:a})).then(()=>{he.success("removed_user"),In(["users"]),l("/settings/users")}).catch(h=>{var f;((f=h.response)==null?void 0:f.status)===412&&he.error("password_error_incorrect")})};return O(St,{children:[p(Tg,{show:t,onClose:i,onSave:()=>{if(r==="remove")return u();const h={archive:"archived_user",restore:"restored_user",delete:"deleted_user",remove:"removed_user"};he.processing(),$e("POST",Ae("/api/v1/users/bulk"),{action:r,ids:[a]}).then(()=>{const f=h[r]||`${r}d_user`;he.success(f),In(["users"])}).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===412&&he.error("password_error_incorrect")})}}),O(Fm,{label:e("more_actions"),className:"divide-y",children:[O("div",{children:[p(gt,{onClick:()=>c(),icon:p(nt,{element:dme}),children:e("resend_email")}),p(gt,{onClick:()=>{o("remove"),i(!0)},icon:p(nt,{element:jEt}),children:e("remove")})]}),O("div",{children:[s.archived_at===0&&p(gt,{onClick:()=>{o("archive"),i(!0)},icon:p(nt,{element:Dc}),children:e("archive")}),s.archived_at>0&&p(gt,{onClick:()=>{o("restore"),i(!0)},icon:p(nt,{element:Lc}),children:e("restore")}),!s.is_deleted&&p(gt,{onClick:()=>{o("delete"),i(!0)},icon:p(nt,{element:el}),children:e("delete")})]})]})]})}function lKe(n){var s,a,l,c,u,d,h,f;const[e]=ve(),{user:t,setUser:i}=n,r=(g,m)=>{i(v=>v&&{...v,[g]:m})},o=Ti();return O(tn,{title:e("details"),children:[p(G,{leftSide:e("first_name"),required:!0,children:p(Ze,{value:t==null?void 0:t.first_name,onValueChange:g=>r("first_name",g),errorMessage:(s=n.errors)==null?void 0:s.errors.first_name})}),p(G,{leftSide:e("last_name"),required:!0,children:p(Ze,{value:t==null?void 0:t.last_name,onValueChange:g=>r("last_name",g),errorMessage:(a=n.errors)==null?void 0:a.errors.last_name})}),p(G,{leftSide:e("email"),children:p(Ze,{type:"email",value:t==null?void 0:t.email,onValueChange:g=>r("email",g),errorMessage:(l=n.errors)==null?void 0:l.errors.email})}),p(G,{leftSide:e("phone"),children:p(Ze,{value:t==null?void 0:t.phone,onValueChange:g=>r("phone",g),errorMessage:(c=n.errors)==null?void 0:c.errors.phone})}),p(G,{leftSide:e("login_notification"),leftSideHelp:e("login_notification_help"),children:p(kt,{checked:t==null?void 0:t.user_logged_in_notification,onChange:g=>r("user_logged_in_notification",g)})}),((u=o==null?void 0:o.custom_fields)==null?void 0:u.user1)&&p(rs,{field:"user1",defaultValue:t.custom_value1,value:o.custom_fields.user1,onValueChange:g=>r("custom_value1",String(g))}),((d=o==null?void 0:o.custom_fields)==null?void 0:d.user2)&&p(rs,{field:"user2",defaultValue:t.custom_value2,value:o.custom_fields.user2,onValueChange:g=>r("custom_value2",String(g))}),((h=o==null?void 0:o.custom_fields)==null?void 0:h.user3)&&p(rs,{field:"user3",defaultValue:t.custom_value3,value:o.custom_fields.user3,onValueChange:g=>r("custom_value3",String(g))}),((f=o==null?void 0:o.custom_fields)==null?void 0:f.user4)&&p(rs,{field:"user4",defaultValue:t.custom_value4,value:o.custom_fields.user4,onValueChange:g=>r("custom_value4",String(g))})]})}function cKe(n){const[e]=ve(),{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,f;const d=An.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 g=(h=d.company_user)==null?void 0:h.notifications.email.filter(m=>!m.startsWith(c));d.company_user.notifications.email=g}else{const g=((f=d.company_user)==null?void 0:f.notifications.email.filter(m=>!m.startsWith(c)))||[];g==null||g.push(u),d.company_user&&(d.company_user.notifications.email=g)}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 O(tn,{title:e("notifications"),children:[p(G,{children:e("email")}),p(G,{leftSide:e("all_events"),children:O(En,{withBlank:!0,value:o(),onValueChange:c=>s("all_events",c),children:[p("option",{value:"all_notifications",children:e("all_records")}),p("option",{value:"all_user_notifications",children:e("owned_by_user")}),p("option",{value:"",children:e("custom")})]})}),r.map((c,u)=>p(G,{leftSide:e(c.label),children:O(En,{value:a(c.id),disabled:l(),onValueChange:d=>s(c.id,d),children:[p("option",{value:`${c.id}_all`,children:e("all_records")}),p("option",{value:`${c.id}_user`,children:e("owned_by_user")}),p("option",{value:`${c.id}_none`,children:e("none")})]})},u))]})}function uKe(n){var l;const[e]=ve(),{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 g;let d=An.clone(((g=t==null?void 0:t.company_user)==null?void 0:g.permissions)??"").split(",").filter(m=>m!==c);const[h,f]=c.split("_");if(f==="all")d=d.filter(m=>!m.startsWith(h)||m==="view_reports"||m==="view_dashboard");else if(d.includes(`${h}_all`)&&c!=="view_reports"&&c!=="view_dashboard"){const m=r.map(v=>`${h}_${v}`).filter(v=>v!==c);d=d.filter(v=>v!==`${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 O(tn,{title:e("permissions"),children:[p(G,{leftSide:e("administrator"),leftSideHelp:e("administrator_help"),children:p(kt,{checked:(l=t==null?void 0:t.company_user)==null?void 0:l.is_admin,onChange:c=>o(c),cypressRef:"admin"})}),p(G,{leftSide:e("view_dashboard"),children:p(kt,{checked:s("view_dashboard"),onValueChange:c=>a("view_dashboard",c),cypressRef:"viewDashboard"})}),p(G,{leftSide:e("reports"),leftSideHelp:e("view_report_permission"),children:p(kt,{checked:s("view_reports"),onValueChange:c=>a("view_reports",c),cypressRef:"viewReports"})}),p(G,{children:O("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[p("div",{className:"col-1",children:e("create")}),p("div",{className:"col-1",children:e("view")}),p("div",{className:"col-1",children:e("edit")})]})}),p(G,{leftSide:e("all"),children:O("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[p("div",{className:"col-1",children:p(Oh,{checked:s("create_all"),onChange:c=>a("create_all",c.target.checked),cypressRef:"create_all"})}),p("div",{className:"col-1",children:p(Oh,{checked:s("view_all"),onChange:c=>a("view_all",c.target.checked),cypressRef:"view_all"})}),p("div",{className:"col-1",children:p(Oh,{checked:s("edit_all"),onChange:c=>a("edit_all",c.target.checked),cypressRef:"edit_all"})})]})}),r.map((c,u)=>p(G,{leftSide:e(c),children:O("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[p("div",{className:"col-1",children:p(Oh,{checked:s(`create_${c}`),onChange:d=>a(`create_${c}`,d.target.checked),cypressRef:`create_${c}`})}),p("div",{className:"col-1",children:p(Oh,{checked:s(`view_${c}`),onChange:d=>a(`view_${c}`,d.target.checked),cypressRef:`view_${c}`})}),p("div",{className:"col-1",children:p(Oh,{checked:s(`edit_${c}`),onChange:d=>a(`edit_${c}`,d.target.checked),cypressRef:`edit_${c}`})})]})},u))]})}function kdn(){const[n,e]=w.useState(!1),{id:t}=il(),{data:i}=Xrn({id:t,enabled:n}),[r,o]=w.useState(),[s]=ve(),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:At("/settings/users/:id/edit",{id:t})}],c=Va(),u=ki(),d=Co(),[h,f]=w.useState(),g=Wi(ap);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=()=>{he.processing(),$e("PUT",Ae("/api/v1/users/:id?include=company_user",{id:t}),r).then(()=>{he.success("updated_user"),In(["users"])}).catch(_=>{var b;((b=_.response)==null?void 0:b.status)===422&&(f(_.response.data),he.dismiss())})},v=_=>{he.processing(),d.fetchQuery(["/api/v1/users",t],()=>$e("GET",Ae("/api/v1/users/:id?include=company_user",{id:t}),{},{headers:{"X-Api-Password":_}}),{staleTime:1/0}).then(()=>{e(!0),he.dismiss()}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===412&&(he.error("password_error_incorrect"),g(0))})};return O(sr,{breadcrumbs:l,title:s("edit_user"),onSaveClick:m,navigationTopRight:r&&p(Tdn,{user:r}),children:[p(Tg,{show:!n,onSave:v,onClose:e}),r&&r.email_verified_at===null&&O(Fs,{type:"warning",children:[s("email_sent_to_confirm_email"),"."]}),O(kv,{tabs:a,children:[p("div",{children:r&&p(lKe,{user:r,setUser:o,errors:h})}),p("div",{children:r&&p(cKe,{user:r,setUser:o})}),p("div",{children:r&&p(uKe,{user:r,setUser:o})})]})]})}function Idn(){Mi("new_user");const[n]=ve(),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=Wi(ap),{data:r}=Zrn(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState(!1),d=ki();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=f=>{he.processing(),u(!1),$e("POST",Ae("/api/v1/users?include=company_user"),o,{headers:{"X-Api-Password":f,...LT()}}).then(g=>{he.success("created_user"),In(["users"]),d(At("/settings/users/:id/edit",{id:g.data.data.id}))}).catch(g=>{var m,v;if(((m=g.response)==null?void 0:m.status)===412)he.error("password_error_incorrect"),i(0);else if(((v=g.response)==null?void 0:v.status)===422){const _=g.response.data;_.errors.id?he.error(_.errors.id):he.dismiss(),l(_)}})};return O(sr,{title:n("new_user"),breadcrumbs:e,onSaveClick:()=>u(!0),disableSaveButton:!xc()&&qo(),children:[!xc()&&qo()&&p(Iv,{message:n("add_users_not_supported")}),p(Tg,{show:c,onSave:h,onClose:u}),O(kv,{tabs:t,children:[p("div",{children:o&&p(lKe,{user:o,setUser:s,errors:a})}),p("div",{children:o&&p(cKe,{user:o,setUser:s})}),p("div",{children:o&&p(uKe,{user:o,setUser:s})})]})]})}function dKe(n){return O("div",{className:"flex justify-center",children:[p(Bme,{pages:n.breadcrumbs}),p("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 Ldn(n){const{setPaymentTerm:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function Ddn(){const{documentTitle:n}=Mi("create_payment_term"),[e]=ve(),t=ki(),{data:i}=otn(),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=Ldn({setErrors:s,setPaymentTerm:u}),h=(g,m)=>{g.preventDefault(),a||(he.processing(),l(!0),$e("POST",Ae("/api/v1/payment_terms"),c).then(v=>{he.success("created_payment_term"),In(["payment_terms"]),m==="save"?t(At("/settings/payment_terms/:id/edit",{id:v.data.data.id})):i&&u(i)}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(he.dismiss(),s(v.response.data))}).finally(()=>l(!1)))},f=[{onClick:g=>h(g,"create"),text:`${e("save")} / ${e("create")}`,icon:p(nt,{element:qp})}];return w.useEffect(()=>{i&&u(i)},[i]),p(sr,{title:e("payment_terms"),breadcrumbs:r,children:p(dKe,{breadcrumbs:[],children:p(tn,{title:n,withSaveButton:!0,disableSubmitButton:a,onFormSubmit:g=>h(g,"save"),onSaveClick:g=>h(g,"save"),additionalSaveOptions:f,children:p(S0,{children:p(mo,{precision:0,required:!0,value:(c==null?void 0:c.num_days)||"",label:e("number_of_days"),onValueChange:g=>d("num_days",Number(g)),errorMessage:o==null?void 0:o.errors.num_days,disablePrecision:!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 Adn(){return n=>{he.processing(),Wve([n],"archive").then(()=>he.success("archived_payment_term")).finally(()=>In(["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 Rdn(){return n=>{he.processing(),Wve([n],"delete").then(()=>he.success("deleted_payment_term")).finally(()=>In(["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 Ndn(){return n=>{he.processing(),Wve([n],"restore").then(()=>he.success("restored_payment_term")).finally(()=>In(["payment_terms"]))}}function Odn(n){const[e]=ve(),t=Adn(),i=Ndn(),r=Rdn();return O(Fm,{label:e("more_actions"),children:[!n.paymentTerm.archived_at&&!n.paymentTerm.is_deleted&&p(gt,{onClick:()=>t(n.paymentTerm.id),icon:p(nt,{element:Dc}),children:e("archive")}),(n.paymentTerm.archived_at||n.paymentTerm.is_deleted)&&p(gt,{onClick:()=>i(n.paymentTerm.id),icon:p(nt,{element:Lc}),children:e("restore")}),!n.paymentTerm.is_deleted&&p(gt,{onClick:()=>r(n.paymentTerm.id),icon:p(nt,{element:el}),children:e("delete")})]})}function Pdn(){Mi("payment_terms");const[n]=ve(),{id:e}=il(),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:At("/settings/payment_terms/:id/edit",{id:e})}],{data:i}=rtn({id:e}),r=()=>{In(["payment_terms"])},o=Gm({enableReinitialize:!0,initialValues:{num_days:(i==null?void 0:i.data.data.num_days)||0},onSubmit:s=>{he.processing(),$e("PUT",Ae("/api/v1/payment_terms/:id",{id:i==null?void 0:i.data.data.id}),s).then(()=>he.success("updated_payment_term")).finally(()=>{o.setSubmitting(!1),r()})}});return O(sr,{title:n("payment_terms"),breadcrumbs:t,navigationTopRight:i&&p(Odn,{paymentTerm:i.data.data}),children:[!i&&p("div",{className:"flex justify-center",children:p(ds,{})}),i&&p(dKe,{breadcrumbs:[],children:O(tn,{title:i.data.data.name,disableSubmitButton:o.isSubmitting,onFormSubmit:o.handleSubmit,withSaveButton:!0,children:[O(G,{leftSide:"Status",children:[!i.data.data.is_deleted&&!i.data.data.archived_at&&p(_r,{variant:"primary",children:n("active")}),i.data.data.archived_at&&!i.data.data.is_deleted?p(_r,{variant:"yellow",children:n("archived")}):null,i.data.data.is_deleted&&p(_r,{variant:"red",children:n("deleted")})]}),p(S0,{children:p(mo,{precision:0,value:o.values.num_days||"",label:n("number_of_days"),onValueChange:s=>o.setFieldValue("num_days",s),disablePrecision:!0})})]})})]})}function Mdn(){const{documentTitle:n}=Mi("payment_terms"),[e]=ve(),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)=>p(qi,{to:At("/settings/payment_terms/:id/edit",{id:o.id}),children:r})}];return p(sr,{breadcrumbs:t,title:n,children:p(Lg,{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 Fdn=()=>{const[n]=ve();return[{id:"name",label:n("name"),format:(t,i)=>p(qi,{to:At("/settings/tax_rates/:id/edit",{id:i.id}),children:i==null?void 0:i.name})},{id:"rate",label:n("tax_rate"),format:t=>O("span",{children:[t,"%"]})}]};function Bdn(){const n=zi(),e=Fdn(),t=i=>{(i==="archive"||i==="delete")&&$e("POST",Ae("/api/v1/refresh")).then(r=>{n(y0(r.data.data)),n(Xpe("company"))})};return p(Lg,{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 $dn(n){const{setTaxRate:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function Vdn(){const{documentTitle:n}=Mi("create_tax_rate"),[e]=ve(),t=ki(),{data:i}=O$t(),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=$dn({setErrors:s,setTaxRate:l}),h=(g,m)=>{g.preventDefault(),c||(he.processing(),u(!0),$e("POST",Ae("/api/v1/tax_rates"),a).then(v=>{he.success("created_tax_rate"),In(["tax_rates"]),m==="save"?t(At("/settings/tax_rates/:id/edit",{id:v.data.data.id})):i&&l(i)}).catch(v=>{var _;((_=v.response)==null?void 0:_.status)===422&&(he.dismiss(),s(v.response.data))}).finally(()=>u(!1)))},f=[{onClick:g=>h(g,"create"),text:`${e("save")} / ${e("create")}`,icon:p(nt,{element:qp})}];return w.useEffect(()=>{i&&l(i)},[i]),p(sr,{title:e("tax_rates"),breadcrumbs:r,children:p("div",{className:"max-w-3xl",children:p(tn,{title:n,withSaveButton:!0,disableSubmitButton:c,onFormSubmit:g=>h(g,"save"),onSaveClick:g=>h(g,"save"),additionalSaveOptions:f,children:O(S0,{children:[p(Ze,{required:!0,type:"text",label:e("name"),value:a==null?void 0:a.name,onValueChange:g=>d("name",g),errorMessage:o==null?void 0:o.errors.name}),p(mo,{required:!0,label:e("tax_rate"),value:(a==null?void 0:a.rate)||"",onValueChange:g=>d("rate",Number(g)),errorMessage:o==null?void 0:o.errors.rate})]})})})})}function Hdn(){const[n]=ve(),e=P$t();return[i=>i.archived_at===0&&p(gt,{onClick:()=>e(i.id,"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),i=>i.archived_at>0&&p(gt,{onClick:()=>e(i.id,"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),i=>!i.is_deleted&&p(gt,{onClick:()=>e(i.id,"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function Wdn(){var u,d;const{setDocumentTitle:n}=Mi("edit_tax_rate"),[e]=ve(),{id:t}=il(),i=[{name:e("settings"),href:"/settings"},{name:e("tax_settings"),href:"/settings/tax_settings"},{name:e("edit_tax_rate"),href:At("/settings/tax_rates/:id/edit",{id:t})}],{data:r}=N$t({id:t}),[o,s]=w.useState({}),a=Hdn();w.useEffect(()=>{n(r==null?void 0:r.data.data.name)},[r]);const l=()=>{In(["tax_rates"])},c=Gm({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({}),he.processing(),$e("PUT",Ae("/api/v1/tax_rates/:id",{id:t}),h).then(()=>he.success("updated_tax_rate")).catch(f=>{var g;((g=f.response)==null?void 0:g.status)===422&&(he.dismiss(),s(f.response.data))}).finally(()=>{c.setSubmitting(!1),l()})}});return O(sr,{title:e("tax_rates"),navigationTopRight:r&&p(R1,{label:e("more_actions"),resource:r.data.data,actions:a}),breadcrumbs:i,children:[!r&&p("div",{className:"flex justify-center",children:p(ds,{})}),r&&p("div",{className:"max-w-3xl",children:O(tn,{withSaveButton:!0,onFormSubmit:c.handleSubmit,disableSubmitButton:c.isSubmitting,title:r.data.data.name,children:[O(G,{leftSide:e("status"),children:[!r.data.data.is_deleted&&!r.data.data.archived_at&&p(_r,{variant:"primary",children:e("active")}),r.data.data.archived_at&&!r.data.data.is_deleted?p(_r,{variant:"yellow",children:e("archived")}):null,r.data.data.is_deleted&&p(_r,{variant:"red",children:e("deleted")})]}),O(S0,{children:[p(Ze,{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}),p(mo,{value:c.values.rate||"",label:e("tax_rate"),onValueChange:h=>c.setFieldValue("rate",h),errorMessage:(d=o==null?void 0:o.errors)==null?void 0:d.rate})]})]})})]})}function zdn(){const n=()=>{In(["documents"])},e=Ti();return O(St,{children:[e&&p(Zve,{endpoint:Ae("/api/v1/companies/:id/upload",{id:e.id}),onSuccess:n}),p(Vrn,{})]})}function Udn(){var a,l,c,u,d,h;const[n]=ve(),e=zi(),t=pa(),i=Bo(),r=Zi(),o=Gi(Bs),s=f=>e(go({object:"company",property:f.target.id,value:f.target.value}));return p(St,{children:(r==null?void 0:r.settings)&&O(tn,{title:n("address"),children:[p(G,{leftSide:p(Ht,{propertyKey:"address1",labelElement:p(Wt,{label:n("address1")})}),children:p(Ze,{value:((a=r==null?void 0:r.settings)==null?void 0:a.address1)||"",onChange:s,id:"settings.address1",disabled:t("address1"),errorMessage:o==null?void 0:o.errors["settings.address1"]})}),p(G,{leftSide:p(Ht,{propertyKey:"address2",labelElement:p(Wt,{label:n("address2")})}),children:p(Ze,{value:((l=r==null?void 0:r.settings)==null?void 0:l.address2)||"",onChange:s,id:"settings.address2",disabled:t("address2"),errorMessage:o==null?void 0:o.errors["settings.address2"]})}),p(G,{leftSide:p(Ht,{propertyKey:"city",labelElement:p(Wt,{label:n("city")})}),children:p(Ze,{value:((c=r==null?void 0:r.settings)==null?void 0:c.city)||"",onChange:s,id:"settings.city",disabled:t("city"),errorMessage:o==null?void 0:o.errors["settings.city"]})}),p(G,{leftSide:p(Ht,{propertyKey:"state",labelElement:p(Wt,{label:n("state")})}),children:p(Ze,{value:((u=r==null?void 0:r.settings)==null?void 0:u.state)||"",onChange:s,id:"settings.state",disabled:t("state"),errorMessage:o==null?void 0:o.errors["settings.state"]})}),p(G,{leftSide:p(Ht,{propertyKey:"postal_code",labelElement:p(Wt,{label:n("postal_code")})}),children:p(Ze,{value:((d=r==null?void 0:r.settings)==null?void 0:d.postal_code)||"",onChange:s,id:"settings.postal_code",disabled:t("postal_code"),errorMessage:o==null?void 0:o.errors["settings.postal_code"]})}),p(G,{leftSide:p(Ht,{propertyKey:"country_id",labelElement:p(Wt,{label:n("country")})}),children:p(a6,{value:((h=r==null?void 0:r.settings)==null?void 0:h.country_id)||"",onChange:f=>i("settings.country_id",f),disabled:t("country_id"),dismissable:!0,errorMessage:o==null?void 0:o.errors["settings.country_id"]})})]})})}function jdn(){var r,o,s,a,l,c,u,d;const[n]=ve(),e=zi(),t=pa(),i=Nc(h=>h.companyUsers.changes.company);return p(St,{children:(i==null?void 0:i.settings)&&O(tn,{title:n("defaults"),children:[p(G,{leftSide:p(Ht,{propertyKey:"invoice_terms",labelElement:p(Wt,{label:n("invoice_terms")})}),children:p(dd,{value:((r=i==null?void 0:i.settings)==null?void 0:r.invoice_terms)||"",onChange:h=>e(go({object:"company",property:"settings.invoice_terms",value:h})),disabled:t("invoice_terms")})}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"invoice_footer",labelElement:p(Wt,{label:n("invoice_footer")})}),children:p(dd,{value:((o=i==null?void 0:i.settings)==null?void 0:o.invoice_footer)||"",onChange:h=>e(go({object:"company",property:"settings.invoice_footer",value:h})),disabled:t("invoice_footer")})}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"quote_terms",labelElement:p(Wt,{label:n("quote_terms")})}),children:p(dd,{value:((s=i==null?void 0:i.settings)==null?void 0:s.quote_terms)||"",onChange:h=>e(go({object:"company",property:"settings.quote_terms",value:h})),disabled:t("quote_terms")})}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"quote_footer",labelElement:p(Wt,{label:n("quote_footer")})}),children:p(dd,{value:((a=i==null?void 0:i.settings)==null?void 0:a.quote_footer)||"",onChange:h=>e(go({object:"company",property:"settings.quote_footer",value:h})),disabled:t("quote_footer")})}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"credit_terms",labelElement:p(Wt,{label:n("credit_terms")})}),children:p(dd,{value:((l=i==null?void 0:i.settings)==null?void 0:l.credit_terms)||"",onChange:h=>e(go({object:"company",property:"settings.credit_terms",value:h})),disabled:t("credit_terms")})}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"credit_footer",labelElement:p(Wt,{label:n("credit_footer")})}),children:p(dd,{value:((c=i==null?void 0:i.settings)==null?void 0:c.credit_footer)||"",onChange:h=>e(go({object:"company",property:"settings.credit_footer",value:h})),disabled:t("credit_footer")})}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"purchase_order_terms",labelElement:p(Wt,{label:n("purchase_order_terms")})}),children:p(dd,{value:((u=i==null?void 0:i.settings)==null?void 0:u.purchase_order_terms)||"",onChange:h=>e(go({object:"company",property:"settings.purchase_order_terms",value:h})),disabled:t("purchase_order_terms")})}),p(G,{className:"mt-4",leftSide:p(Ht,{propertyKey:"purchase_order_footer",labelElement:p(Wt,{label:n("purchase_order_footer")})}),children:p(dd,{value:((d=i==null?void 0:i.settings)==null?void 0:d.purchase_order_footer)||"",onChange:h=>e(go({object:"company",property:"settings.purchase_order_footer",value:h})),disabled:t("purchase_order_footer")})})]})})}function qdn(){var l,c,u,d,h,f,g,m,v,_,b,y,C;const[n]=ve(),e=zi(),t=pa(),{isCompanySettingsActive:i}=$s(),{data:r}=ph(),o=Gi(Bs),s=Nc(E=>E.companyUsers.changes.company),a=(E,x)=>e(go({object:"company",property:E,value:x}));return p(St,{children:(s==null?void 0:s.settings)&&O(tn,{title:n("details"),children:[p(G,{leftSide:p(Ht,{propertyKey:"name",labelElement:p(Wt,{label:n("company_name")})}),children:p(Ze,{value:((l=s==null?void 0:s.settings)==null?void 0:l.name)||"",onValueChange:E=>a("settings.name",E.toString()),disabled:t("name"),errorMessage:o==null?void 0:o.errors["settings.name"]})}),p(G,{leftSide:p(Ht,{propertyKey:"id_number",labelElement:p(Wt,{label:n("id_number")})}),children:p(Ze,{value:((c=s==null?void 0:s.settings)==null?void 0:c.id_number)||"",onValueChange:E=>a("settings.id_number",E.toString()),disabled:t("id_number"),errorMessage:o==null?void 0:o.errors["settings.id_number"]})}),p(G,{leftSide:p(Ht,{propertyKey:"vat_number",labelElement:p(Wt,{label:n("vat_number")})}),children:p(Ze,{value:((u=s==null?void 0:s.settings)==null?void 0:u.vat_number)||"",onValueChange:E=>a("settings.vat_number",E.toString()),disabled:t("vat_number"),errorMessage:o==null?void 0:o.errors["settings.vat_number"]})}),p(G,{leftSide:p(Ht,{propertyKey:"website",labelElement:p(Wt,{label:n("website")})}),children:p(Ze,{value:((d=s==null?void 0:s.settings)==null?void 0:d.website)||"",onValueChange:E=>a("settings.website",E.toString()),disabled:t("website"),errorMessage:o==null?void 0:o.errors["settings.website"]})}),p(G,{leftSide:p(Ht,{propertyKey:"email",labelElement:p(Wt,{label:n("email")})}),children:p(Ze,{value:((h=s==null?void 0:s.settings)==null?void 0:h.email)||"",onValueChange:E=>a("settings.email",E.toString()),disabled:t("email"),errorMessage:o==null?void 0:o.errors["settings.email"]})}),p(G,{leftSide:p(Ht,{propertyKey:"phone",labelElement:p(Wt,{label:`${n("company")} ${n("phone")}`})}),children:p(Ze,{value:((f=s==null?void 0:s.settings)==null?void 0:f.phone)||"",onValueChange:E=>a("settings.phone",E.toString()),disabled:t("phone"),errorMessage:o==null?void 0:o.errors["settings.phone"]})}),(s==null?void 0:s.settings.country_id)=="756"?O(St,{children:[p(G,{leftSide:p(Ht,{propertyKey:"qr_iban",labelElement:p(Wt,{label:n("qr_iban")})}),children:p(Ze,{value:((g=s==null?void 0:s.settings)==null?void 0:g.qr_iban)||"",onValueChange:E=>a("settings.qr_iban",E.toString()),disabled:t("qr_iban"),errorMessage:o==null?void 0:o.errors["settings.qr_iban"]})}),p(G,{leftSide:p(Ht,{propertyKey:"besr_id",labelElement:p(Wt,{label:n("besr_id")})}),children:p(Ze,{value:((m=s==null?void 0:s.settings)==null?void 0:m.besr_id)||"",onValueChange:E=>a("settings.besr_id",E.toString()),disabled:t("besr_id"),errorMessage:o==null?void 0:o.errors["settings.besr_id"]})})]}):"",i&&p(G,{leftSide:n("size_id"),children:p(En,{value:(s==null?void 0:s.size_id)||"1",onValueChange:E=>a("size_id",E.toString()),errorMessage:o==null?void 0:o.errors.size_id,children:r==null?void 0:r.sizes.map(E=>p("option",{value:E.id,children:E.name},E.id))})}),i&&p(G,{leftSide:n("industry_id"),children:p(En,{value:(s==null?void 0:s.industry_id)||"1",onValueChange:E=>a("industry_id",E.toString()),errorMessage:o==null?void 0:o.errors.industry_id,children:r==null?void 0:r.industries.map(E=>p("option",{value:E.id,children:E.name},E.id))})}),p(G,{leftSide:p(Ht,{propertyKey:"classification",labelElement:p(Wt,{label:n("classification")})}),children:O(En,{id:"classification",value:((v=s==null?void 0:s.settings)==null?void 0:v.classification)??"",onValueChange:E=>a("settings.classification",E.toString()),disabled:t("classification"),withBlank:!0,children:[p("option",{value:"individual",children:n("individual")}),p("option",{value:"business",children:n("business")}),p("option",{value:"company",children:n("company")}),p("option",{value:"partnership",children:n("partnership")}),p("option",{value:"trust",children:n("trust")}),p("option",{value:"charity",children:n("charity")}),p("option",{value:"government",children:n("government")}),p("option",{value:"other",children:n("other")})]})}),((_=s==null?void 0:s.custom_fields)==null?void 0:_.company1)&&p(rs,{field:"company1",defaultValue:s.settings.custom_value1||"",value:s.custom_fields.company1,onValueChange:E=>a("settings.custom_value1",E.toString())}),((b=s==null?void 0:s.custom_fields)==null?void 0:b.company2)&&p(rs,{field:"company2",defaultValue:s.settings.custom_value2||"",value:s.custom_fields.company2,onValueChange:E=>a("settings.custom_value2",E.toString())}),((y=s==null?void 0:s.custom_fields)==null?void 0:y.company3)&&p(rs,{field:"company3",defaultValue:s.settings.custom_value3||"",value:s.custom_fields.company3,onValueChange:E=>a("settings.custom_value3",E.toString())}),((C=s==null?void 0:s.custom_fields)==null?void 0:C.company4)&&p(rs,{field:"company4",defaultValue:s.settings.custom_value4||"",value:s.custom_fields.company4,onValueChange:E=>a("settings.custom_value4",E.toString())})]})})}function ZDe({isSettingsPage:n=!0}){const[e]=ve(),t=Zi(),i=Ti(),r=zi(),{isGroupSettingsActive:o,isCompanySettingsActive:s,isClientSettingsActive:a}=$s(),l=Gi(Uk),c=FG({withoutNavigation:!0}),u=dbe({withoutNavigation:!0}),d=Gm({enableReinitialize:!0,initialValues:t,onSubmit:()=>{he.processing();let f="/api/v1/companies/:id",g=i.id;l&&(o&&(f="/api/v1/group_settings/:id",g=l.id),a&&(f="/api/v1/clients/:id",g=l.id)),$e("PUT",Ae(f,{id:g}),d.values).then(m=>{s&&r(US({object:"company",data:m.data.data})),o&&(In(["group_settings"]),c(m.data.data)),a&&(In(["clients"]),u(m.data.data)),he.success("removed_logo")})}}),h=()=>{d.setFieldValue("settings.company_logo",""),d.submitForm()};return n?p(G,{children:p(un,{behavior:"button",type:"minimal",onClick:()=>h(),children:e("remove_logo")})}):p(un,{behavior:"button",type:"minimal",onClick:()=>h(),children:e("remove_logo")})}function hKe({isSettingsPage:n=!0}){const[e]=ve(),t=Ti(),i=zi(),[r,o]=w.useState(new FormData),s=Sq(),{isGroupSettingsActive:a,isCompanySettingsActive:l,isClientSettingsActive:c}=$s(),u=Gi(Uk),d=FG({withoutNavigation:!0}),h=dbe({withoutNavigation:!0}),f=Gm({enableReinitialize:!0,initialValues:r,onSubmit:()=>{he.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)),$e("POST",Ae(b,{id:y}),r,{headers:{"Content-Type":"multipart/form-data"}}).then(C=>{l&&i(US({object:"company",data:C.data.data})),a&&(In(["group_settings"]),d(C.data.data)),c&&(In(["clients"]),h(C.data.data)),he.success("uploaded_logo")}).finally(()=>o(new FormData))}}),g=w.useCallback(b=>{r.append("company_logo",b[0]),r.append("_method","PUT"),o(r),f.submitForm()},[r]),{getRootProps:m,getInputProps:v,isDragActive:_}=zR({onDrop:g,multiple:!1,maxFiles:1,accept:{"image/*":[".jpeg",".png"]}});return n?O(tn,{title:e("logo"),children:[p(G,{leftSide:e("logo"),children:O("div",{className:"grid grid-cols-12 lg:gap-4 space-y-4 lg:space-y-0",children:[p("div",{className:"bg-gray-200 col-span-12 lg:col-span-5 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})}),p("div",{className:"col-span-12 lg:col-span-5 bg-gray-900 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})})]})}),p(G,{leftSide:e("upload_logo"),children:p("div",{...m(),className:"flex flex-col md:flex-row md:items-center",children:O("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:[p("input",{...v()}),p(RT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium",children:_?"drop_your_logo_here":e("dropzone_default_message")})]})})}),p(ZDe,{})]}):O("div",{className:"flex flex-col space-y-5",children:[p("span",{className:"text-lg font-medium",children:e("upload_logo")}),O("div",{className:"grid grid-cols-12 gap-x-4",children:[p("div",{className:"bg-gray-200 col-span-6 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})}),p("div",{className:"col-span-6 bg-gray-900 rounded-lg p-6",children:p("img",{src:s,alt:e("company_logo")??"Company logo"})})]}),O("div",{className:"flex flex-col space-y-3",children:[p("div",{...m(),className:"flex flex-col md:flex-row md:items-center",children:O("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:[p("input",{...v()}),p(RT,{className:"mx-auto h-12 w-12 text-gray-400"}),p("span",{className:"mt-2 block text-sm font-medium",children:_?"drop_your_logo_here":e("dropzone_default_message")})]})}),p("div",{className:"self-start",children:p(ZDe,{isSettingsPage:!1})})]})]})}function Gdn(){const[n]=ve(),e=Ti(),t=Qm();return O(St,{children:[p(gve,{}),p(tn,{title:n("custom_fields"),children:p("div",{className:"px-6",children:e&&["company1","company2","company3","company4"].map(i=>p(Zf,{initialValue:e.custom_fields[i]||"",field:i,placeholder:n("company_field"),onChange:r=>t(i,r)},i))})})]})}function Kdn(){const[n]=ve(),e=[{id:"name",label:n("name"),format:(t,i)=>p(qi,{to:At("/settings/task_statuses/:id/edit",{id:i.id}),children:t})},{id:"color",label:n("color"),format:t=>p("div",{className:"w-10 h-4 border border-gray-300 rounded-sm",style:{backgroundColor:t.toString()}})}];return p(Lg,{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 Ydn(){const{documentTitle:n}=Mi("new_task_status"),[e]=ve(),t=ki(),i=Ss(),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}=gGe(),[s,a]=w.useState(),[l,c]=w.useState(!1),[u,d]=w.useState(),h=rbe({setErrors:a,setTaskStatus:d}),f=(m,v)=>{m.preventDefault(),l||(he.processing(),a(void 0),c(!0),$e("POST",Ae("/api/v1/task_statuses"),u).then(_=>{he.success("created_task_status"),In(["task_statuses"]),v==="save"?t(At("/settings/task_statuses/:id/edit",{id:_.data.data.id})):d(o)}).catch(_=>{var b;((b=_.response)==null?void 0:b.status)===422&&(a(_.response.data),he.dismiss())}).finally(()=>c(!1)))};w.useEffect(()=>{o&&d(o)},[o]);const g=[{onClick:m=>f(m,"create"),text:`${e("save")} / ${e("create")}`,icon:p(nt,{element:qp})}];return p(sr,{title:e("task_statuses"),breadcrumbs:r,children:p("div",{className:"max-w-3xl",children:p(tn,{title:n,withSaveButton:!0,disableSubmitButton:l,onSaveClick:m=>f(m,"save"),additionalSaveOptions:g,children:O(S0,{children:[p(Ze,{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}),p(pg,{children:e("color")}),p(jk,{value:(u==null?void 0:u.color)||i,onValueChange:m=>h("color",m)})]})})})})}function Qdn(){var _;const[n]=ve(),{id:e}=il(),t=gan(),i=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"},{name:n("edit_task_status"),href:At("/settings/task_statuses/:id/edit",{id:e})}],{data:r}=han({id:e}),[o,s]=w.useState(),[a,l]=w.useState(!1),{documentTitle:c,setDocumentTitle:u}=Mi(""),[d,h]=w.useState(!1),[f,g]=w.useState(),m=rbe({setErrors:g,setTaskStatus:s}),v=b=>{b.preventDefault(),d||(he.processing(),g(void 0),h(!0),$e("PUT",Ae("/api/v1/task_statuses/:id",{id:e}),o).then(()=>{he.success("updated_task_status"),In(["task_statuses"]),l(!1)}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(g(y.response.data),he.dismiss())}).finally(()=>h(!1)))};return w.useEffect(()=>{r&&s(r.data.data)},[r]),w.useEffect(()=>{o&&!a&&(u(o.name),l(!0))},[o]),O(sr,{title:n("task_statuses"),navigationTopRight:o&&p(R1,{label:n("more_actions"),resource:o,actions:t}),breadcrumbs:i,children:[!o&&p("div",{className:"flex justify-center",children:p(ds,{})}),o&&p("div",{className:"max-w-3xl",children:O(tn,{title:c,withSaveButton:!0,disableSubmitButton:d,onFormSubmit:v,children:[O(G,{leftSide:n("status"),children:[!o.is_deleted&&!o.archived_at&&p(_r,{variant:"primary",children:n("active")}),o.archived_at&&!o.is_deleted?p(_r,{variant:"yellow",children:n("archived")}):null,o.is_deleted&&p(_r,{variant:"red",children:n("deleted")})]}),O(S0,{children:[p(Ze,{required:!0,label:n("name"),value:o.name,onValueChange:b=>m("name",b),errorMessage:(_=f==null?void 0:f.errors)==null?void 0:_.name}),p(pg,{children:n("color")}),p(jk,{value:o.color,onValueChange:b=>m("color",b)})]})]})})]})}function Xdn(){const[n]=ve(),{documentTitle:e}=Mi("api_tokens"),{dateFormat:t}=sc(),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)=>p(qi,{to:At("/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)=>xo(s.created_at,t)}];return p(sr,{title:e,breadcrumbs:i,children:p(Lg,{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 Zdn(n){const{isOwner:e,isAdmin:t}=Fo();return Ii(["/api/v1/tokens",n.id],()=>$e("GET",Ae("/api/v1/tokens/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function Jdn(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/tokens/bulk"),{action:e,ids:[n]}).then(()=>{he.success(`${e}d_token`),In(["tokens"])})}}function ehn(){const{isAdmin:n}=Fo();return Ii("/api/v1/tokens/create",()=>$e("GET",Ae("/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 fKe(n){const{setApiToken:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function thn(){const[n]=ve(),{documentTitle:e}=Mi("new_token"),t=ki(),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}=ehn(),o=Wi(ap),[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(),[h,f]=w.useState(),g=fKe({setApiToken:d,setErrors:f}),m=v=>{l||(f(void 0),he.processing(),c(!0),$e("POST",Ae("/api/v1/tokens"),u,{headers:{"X-Api-Password":v}}).then(_=>{he.success("created_token"),In(["tokens"]),t(At("/settings/integrations/api_tokens/:id/edit",{id:_.data.data.id}))}).catch(_=>{var b,y;((b=_.response)==null?void 0:b.status)===422&&(he.dismiss(),f(_.response.data)),((y=_.response)==null?void 0:y.status)===412&&(he.error("password_error_incorrect"),o(0))}).finally(()=>c(!1)))};return w.useEffect(()=>{r&&d(r)},[r]),O(St,{children:[p(Tg,{show:s,onClose:a,onSave:m}),p(sr,{title:e,breadcrumbs:i,onSaveClick:()=>a(!0),disableSaveButton:!u,children:p(tn,{title:n("new_token"),children:p(G,{leftSide:n("name"),required:!0,children:p(Ze,{required:!0,onValueChange:v=>g("name",v),errorMessage:h==null?void 0:h.errors.name})})})})]})}function nhn(){const[n]=ve(),e=Jdn();return[i=>i.archived_at===0&&p(gt,{onClick:()=>e(i.id,"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),i=>i.archived_at>0&&p(gt,{onClick:()=>e(i.id,"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),i=>!i.is_deleted&&p(gt,{onClick:()=>e(i.id,"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function ihn(){const[n]=ve(),{id:e}=il(),{data:t}=Zdn({id:e}),i=ki(),{documentTitle:r}=Mi("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:At("/settings/integrations/api_tokens/:id/edit",{id:e})}],s=nhn(),{dateFormat:a}=sc(),l=Wi(ap),[c,u]=w.useState(!1),[d,h]=w.useState(!1),[f,g]=w.useState(),[m,v]=w.useState(),_=fKe({setApiToken:g,setErrors:v}),b=y=>{d||(v(void 0),he.processing(),h(!0),$e("PUT",Ae("/api/v1/tokens/:id",{id:e}),f,{headers:{"X-Api-Password":y}}).then(()=>{he.success("updated_token"),In(["tokens"]),i(At("/settings/integrations/api_tokens"))}).catch(C=>{var E,x;((E=C.response)==null?void 0:E.status)===422&&(he.dismiss(),v(C.response.data)),((x=C.response)==null?void 0:x.status)===412&&(he.error("password_error_incorrect"),l(0))}).finally(()=>h(!1)))};return w.useEffect(()=>{t&&g(t)},[t]),O(St,{children:[p(Tg,{show:c,onClose:u,onSave:b}),p(sr,{title:r,breadcrumbs:o,disableSaveButton:!f,onSaveClick:()=>u(!0),navigationTopRight:f&&p(R1,{resource:f,label:n("more_actions"),actions:s}),children:t&&f&&O(tn,{title:t.name,children:[O(G,{leftSide:"Status",children:[!f.is_deleted&&!f.archived_at&&p(_r,{variant:"primary",children:n("active")}),f.archived_at&&!f.is_deleted?p(_r,{variant:"yellow",children:n("archived")}):null,f.is_deleted&&p(_r,{variant:"red",children:n("deleted")})]}),p(G,{leftSide:n("name"),required:!0,children:p(Ze,{value:f.name,onValueChange:y=>_("name",y),errorMessage:m==null?void 0:m.errors.name})}),p(G,{leftSide:n("token"),children:p(Oc,{secure:!0,className:"break-all",text:f.token})}),p(G,{leftSide:n("created_on"),children:xo(f.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 hbe(){const[n]=ve(),e="1",t="2",i="3",r="4",o="5",s="6",a="7",l="8",c="9",u="10",d="11",h="12",f="13",g="14",m="15",v="16",_="17",b="18",y="19",C="20",E="21",x="22",k="23",L="24",D="33",A="37",N="41",P="45",M="60",B="61",F="34",U="42",H="64",W="27",q="62",V="28",re="35",oe="43",Q="29",Ne="31",Ve="32",Ye="40",ye="48",He="49",Pe="39",Ge="47",Fe="36",bt="44",Mt="25",Ft="26",Yt="38",ln="46",Et="30",mt="50",Lt="51",be="52",Te="53",se="54",Y="55",X="63",le="56",te="57",me="58",Me="59",rt="65";return[{event:e,label:n("create_client")},{event:u,label:n("update_client")},{event:A,label:n("archive_client")},{event:P,label:n("restore_client")},{event:d,label:n("delete_client")},{event:t,label:n("create_invoice")},{event:M,label:n("sent_invoice")},{event:l,label:n("update_invoice")},{event:x,label:n("late_invoice")},{event:L,label:n("remind_invoice")},{event:D,label:n("archive_invoice")},{event:N,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:E,label:n("approve_quote")},{event:k,label:n("expired_quote")},{event:F,label:n("archive_quote")},{event:U,label:n("restore_quote")},{event:a,label:n("delete_quote")},{event:H,label:n("remind_quote")},{event:W,label:n("create_credit")},{event:q,label:n("sent_credit")},{event:V,label:n("update_credit")},{event:re,label:n("archive_credit")},{event:oe,label:n("restore_credit")},{event:Q,label:n("delete_credit")},{event:r,label:n("create_payment")},{event:Ne,label:n("update_payment")},{event:Ve,label:n("archive_payment")},{event:Ye,label:n("restore_payment")},{event:h,label:n("delete_payment")},{event:o,label:n("create_vendor")},{event:f,label:n("update_vendor")},{event:ye,label:n("archive_vendor")},{event:He,label:n("restore_vendor")},{event:g,label:n("delete_vendor")},{event:m,label:n("create_expense")},{event:v,label:n("update_expense")},{event:Pe,label:n("archive_expense")},{event:Ge,label:n("restore_expense")},{event:_,label:n("delete_expense")},{event:b,label:n("create_task")},{event:y,label:n("update_task")},{event:Fe,label:n("archive_task")},{event:bt,label:n("restore_task")},{event:C,label:n("delete_task")},{event:Mt,label:n("create_project")},{event:Ft,label:n("update_project")},{event:Yt,label:n("archive_project")},{event:ln,label:n("restore_project")},{event:Et,label:n("delete_project")},{event:mt,label:n("create_product")},{event:Lt,label:n("update_product")},{event:be,label:n("delete_product")},{event:Te,label:n("restore_product")},{event:se,label:n("archive_product")},{event:Y,label:n("create_purchase_order")},{event:X,label:n("sent_purchase_order")},{event:le,label:n("update_purchase_order")},{event:te,label:n("delete_purchase_order")},{event:me,label:n("restore_purchase_order")},{event:Me,label:n("archive_purchase_order")},{event:rt,label:n("accept_purchase_order")}]}function rhn(){const[n]=ve(),e=hbe();return[{id:"endpoint",label:n("endpoint"),format:(i,r)=>p(qi,{to:At("/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 ohn(){Mi("api_webhooks");const[n]=ve(),e=rhn(),t=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"}];return p(sr,{title:n("api_webhooks"),breadcrumbs:t,children:p(Lg,{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 shn(n){const{isAdmin:e}=Fo();return Ii(["/api/v1/webhooks",n.id],()=>$e("GET",Ae("/api/v1/webhooks/:id",{id:n.id})).then(t=>t.data.data),{staleTime:1/0,enabled:e})}function ahn(){const{isAdmin:n}=Fo();return Ii("/api/v1/webhooks/create",()=>$e("GET",Ae("/api/v1/webhooks/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function lhn(){return(n,e)=>{he.processing(),$e("POST",Ae("/api/v1/webhooks/bulk"),{action:e,ids:[n]}).then(()=>{he.success(`${e}d_webhook`),In(["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 pKe(n){const{setApiWebHook:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function chn(){const[n]=ve(),{documentTitle:e}=Mi("new_webhook"),{data:t}=ahn(),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=hbe(),[o,s]=w.useState({}),[a,l]=w.useState({}),[c,u]=w.useState(),[d,h]=w.useState(),[f,g]=w.useState(!1),m=pKe({setApiWebHook:h,setErrors:u}),v=y=>{if(Object.hasOwn(o,y)){const C={...o};delete C[y],s(C)}},_=ki(),b=()=>{d&&!f&&(he.processing(),g(!0),u(void 0),d.headers=o,$e("POST",Ae("/api/v1/webhooks"),d).then(y=>{he.success("created_webhook"),In(["webhooks"]),_(At("/settings/integrations/api_webhooks/:id/edit",{id:y.data.data.id}))}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(he.dismiss(),u(y.response.data))}).finally(()=>g(!1)))};return w.useEffect(()=>{t&&h({...t,headers:{}})},[t]),p(sr,{title:n("api_webhooks"),breadcrumbs:i,disableSaveButton:!d,onSaveClick:b,children:O(tn,{title:e,children:[p(G,{leftSide:n("target_url"),required:!0,children:p(Ze,{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})}),p(G,{leftSide:n("event_type"),children:p(A1,{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=>p("option",{value:y.event,children:y.label},y.event))})}),p(G,{leftSide:n("method"),children:O(En,{value:d==null?void 0:d.rest_method,onValueChange:y=>m("rest_method",y),errorMessage:c==null?void 0:c.errors.method,children:[p("option",{value:"post",children:"POST"}),p("option",{value:"put",children:"PUT"})]})}),p(G,{leftSide:n("add_header"),children:O("div",{className:"flex flex-col",children:[O("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[p("div",{className:"flex-1",children:p(Ze,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:a.key||"",onValueChange:y=>l({...a,key:y})})}),p("div",{className:"flex-1",children:p(Ze,{className:"flex-1",debounceTimeout:0,id:"header_value",value:a.value||"",placeholder:n("header_value"),onValueChange:y=>l({...a,value:y})})}),p(un,{behavior:"button",type:"minimal",disableWithoutIcon:!0,disabled:!a.key||!a.value,onClick:()=>{s(y=>({...y,[a.key]:a.value})),l({})},children:p(Gd,{})})]}),O("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(o).map(([y,C],E)=>O("div",{className:"flex justify-between items-center space-x-4",children:[p("span",{className:"flex-1 text-start",children:y}),p("span",{className:"flex-1 text-start",children:C}),p(un,{behavior:"button",type:"minimal",onClick:()=>v(y),children:p(qm,{size:18})})]},E)),!Object.entries(o).length&&p("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function uhn(){const[n]=ve(),e=lhn();return[i=>i.archived_at===0&&p(gt,{onClick:()=>e(i.id,"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),i=>i.archived_at>0&&p(gt,{onClick:()=>e(i.id,"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),i=>!i.is_deleted&&p(gt,{onClick:()=>e(i.id,"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function dhn(){const[n]=ve(),{id:e}=il();Mi("edit_webhook");const t=ki(),i=uhn(),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:At("/settings/integrations/api_webhooks/:id/edit",{id:e})}],o=hbe(),[s,a]=w.useState({}),[l,c]=w.useState({}),[u,d]=w.useState(),[h,f]=w.useState(!1),[g,m]=w.useState(),v=pKe({setApiWebHook:m,setErrors:d}),{data:_}=shn({id:e}),b=C=>{if(Object.hasOwn(s,C)){const E={...s};delete E[C],a(E)}},y=()=>{g&&!h&&(he.processing(),f(!0),d(void 0),g.headers=s,$e("PUT",Ae("/api/v1/webhooks/:id",{id:e}),g).then(()=>{he.success("created_webhook"),In(["webhooks"]),t("/settings/integrations/api_webhooks")}).catch(C=>{var E;((E=C.response)==null?void 0:E.status)===422&&(he.dismiss(),d(C.response.data))}).finally(()=>f(!1)))};return w.useEffect(()=>{_&&(m(_),a(_.headers))},[_]),p(sr,{title:n("api_webhooks"),breadcrumbs:r,disableSaveButton:!g,onSaveClick:y,navigationTopRight:g&&p(R1,{label:n("more_actions"),resource:g,actions:i}),children:O(tn,{title:_==null?void 0:_.target_url,children:[p(G,{leftSide:n("target_url"),required:!0,children:p(Ze,{required:!0,value:g==null?void 0:g.target_url,onValueChange:C=>v("target_url",C),errorMessage:u==null?void 0:u.errors.target_url})}),p(G,{leftSide:n("event_type"),children:p(A1,{value:g==null?void 0:g.event_id,onValueChange:C=>v("event_id",C),errorMessage:u==null?void 0:u.errors.event_id,children:o.map(C=>p("option",{value:C.event,children:C.label},C.event))})}),p(G,{leftSide:n("method"),children:O(En,{value:g==null?void 0:g.rest_method,onValueChange:C=>v("rest_method",C),errorMessage:u==null?void 0:u.errors.rest_method,children:[p("option",{value:"post",children:"POST"}),p("option",{value:"put",children:"PUT"})]})}),p(G,{leftSide:n("add_header"),children:O("div",{className:"flex flex-col",children:[O("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[p("div",{className:"flex-1",children:p(Ze,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:l.key||"",onValueChange:C=>c({...l,key:C})})}),p("div",{className:"flex-1",children:p(Ze,{debounceTimeout:0,id:"header_value",value:l.value||"",placeholder:n("header_value"),onValueChange:C=>c({...l,value:C})})}),p(un,{behavior:"button",type:"minimal",disableWithoutIcon:!0,disabled:!l.key||!l.value,onClick:()=>{a(C=>({...C,[l.key]:l.value})),c({})},children:p(Gd,{})})]}),O("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(s).map(([C,E],x)=>O("div",{className:"flex justify-between items-center space-x-4",children:[p("span",{className:"flex-1 text-start",children:C}),p("span",{className:"flex-1 text-start",children:E}),p(un,{behavior:"button",type:"minimal",onClick:()=>b(C),children:p(qm,{size:18})})]},x)),!Object.entries(s).length&&p("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function hhn(){const[n]=ve(),e=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("analytics"),href:"/settings/integrations/analytics"}];Mi("analytics");const t=zi(),i=Ti(),r=Zi(),[o,s]=w.useState(),[a,l]=w.useState(!1);w.useEffect(()=>{t(AT({object:"company",data:i}))},[i]);const c=d=>{s(void 0),t(go({object:"company",property:d.target.id,value:d.target.value}))},u=()=>{a||(he.processing(),l(!0),s(void 0),$e("PUT",Ae("/api/v1/companies/:id",{id:r.id}),r).then(d=>{t(US({object:"company",data:d.data.data})),he.success("updated_settings")}).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(s(d.response.data),he.dismiss())}).finally(()=>l(!1)))};return p(sr,{title:n("analytics"),breadcrumbs:e,onSaveClick:u,disableSaveButton:a,children:O(tn,{title:n("analytics"),children:[p(G,{leftSide:O("div",{className:"flex flex-col items-start",children:[n("google_analytics_tracking_id"),p(qi,{to:"https://support.google.com/analytics/answer/1037249?hl=en",external:!0,children:n("learn_more")})]}),children:p(Ze,{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})}),p(G,{leftSide:n("matomo_id"),children:p(Ze,{id:"matomo_id",value:r==null?void 0:r.matomo_id,onChange:c,errorMessage:o==null?void 0:o.errors.matomo_id})}),p(G,{leftSide:n("matomo_url"),children:p(Ze,{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 gKe(){const[n,e]=w.useState([]),{data:t}=ph();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 mKe(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 _Ke(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 BG(n){const e=JSON.parse(n.config);return t=>e[t]||""}function vKe(n,e){const t=BG(n),i=_Ke(e),r=Ss();return(o,s,a)=>{if(o.toLowerCase().endsWith("color"))return p(jk,{value:t(o)||r,onValueChange:l=>i(o,l)});if(o==="text")return p(dd,{value:t(o),onChange:l=>i(o,l)});if(o==="appleDomainVerification")return p(Ze,{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 p(Ze,{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 p(kt,{checked:t(o),onChange:l=>i(o,l)});if(typeof s=="object")return p(En,{onChange:l=>i(o,l.target.value),value:t(o),errorMessage:a==null?void 0:a.errors[o],children:s.map((l,c)=>p("option",{value:l,children:l},c))})}}function fhn(){const[n]=ve();return p(G,{children:p(un,{onClick:()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"stripe_connect"}).then(t=>{var i;return(i=window.open(At("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 phn(){const[n]=ve();return p(G,{children:p(un,{onClick:()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"wepay"}).then(t=>{var i;return(i=window.open(At("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 ghn(n){const[e]=ve(),t=()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(a=>{var l;return(l=window.open(At("https://invoicing.co/paypal?hash=:hash",{hash:a.data.hash}),"_blank"))==null?void 0:l.focus()})},i=BG(n.companyGateway),r=vKe(n.companyGateway,n.setCompanyGateway),o=()=>{const a=i("status"),l=i("merchantId");return a==="activated"&&l},s=()=>i("merchantId").length>0;return O(St,{children:[p(G,{leftSide:e("status"),children:O("ul",{className:"list-none",children:[O("li",{children:[p("b",{children:"Merchant id:"})," ",i("merchantId")]}),O("li",{children:[O("b",{children:[e("status"),":"]})," ",i("status")]}),O("li",{children:[O("b",{children:[e("email"),":"]})," ",i("emailVerified")]}),O("li",{children:[O("b",{children:[e("permissions"),":"]})," ",i("permissions")]}),O("li",{children:[O("b",{children:[e("notifications"),":"]})," ",i("returnMessage")]})]})}),n.companyGateway&&!o()&&p(G,{children:p(un,{onClick:t,type:"minimal",behavior:"button",children:e("gateway_setup")})}),n.gateway&&s()&&Object.keys(JSON.parse(n.gateway.fields)).map((a,l)=>p(G,{leftSide:mKe(a),children:r(a,JSON.parse(n.gateway.fields)[a],n.errors)},l))]})}function mhn({companyGateway:n,setCompanyGateway:e}){const{t}=ve(),i=BG(n),r=_Ke(e);return O(St,{children:[p(G,{leftSide:t("OAuth 2.0"),children:p(Qj,{size:18})}),p(G,{leftSide:t("test_mode"),children:p(kt,{checked:i("testMode"),onChange:o=>r("testMode",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 bKe(){return()=>$e("POST",Ae("/api/v1/one_time_token"),{context:"gocardless_oauth2"}).then(n=>{var e;return(e=window.open(At("https://invoicing.co/gocardless/oauth/connect/:token",{token:n.data.hash}),"_blank"))==null?void 0:e.focus()})}function JDe(n){const e=[],t=String(n||"");let i=t.indexOf(","),r=0,o=!1;for(;!o;){i===-1&&(i=t.length,o=!0);const s=t.slice(r,i).trim();(s||!o)&&e.push(s),r=i+1,i=t.indexOf(",",r)}return e}function yKe(n,e){const t=e||{};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const _hn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vhn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bhn={};function eAe(n,e){return((e||bhn).jsx?vhn:_hn).test(n)}const yhn=/[ \t\n\f\r]/g;function Chn(n){return typeof n=="object"?n.type==="text"?tAe(n.value):!1:tAe(n)}function tAe(n){return n.replace(yhn,"")===""}class u6{constructor(e,t,i){this.property=e,this.normal=t,i&&(this.space=i)}}u6.prototype.property={};u6.prototype.normal={};u6.prototype.space=null;function CKe(n,e){const t={},i={};let r=-1;for(;++r<n.length;)Object.assign(t,n[r].property),Object.assign(i,n[r].normal);return new u6(t,i,e)}function p3(n){return n.toLowerCase()}class Zm{constructor(e,t){this.property=e,this.attribute=t}}Zm.prototype.space=null;Zm.prototype.boolean=!1;Zm.prototype.booleanish=!1;Zm.prototype.overloadedBoolean=!1;Zm.prototype.number=!1;Zm.prototype.commaSeparated=!1;Zm.prototype.spaceSeparated=!1;Zm.prototype.commaOrSpaceSeparated=!1;Zm.prototype.mustUseProperty=!1;Zm.prototype.defined=!1;let whn=0;const fo=Kk(),Vc=Kk(),wKe=Kk(),Fn=Kk(),qa=Kk(),qL=Kk(),Ip=Kk();function Kk(){return 2**++whn}const Sae=Object.freeze(Object.defineProperty({__proto__:null,boolean:fo,booleanish:Vc,commaOrSpaceSeparated:Ip,commaSeparated:qL,number:Fn,overloadedBoolean:wKe,spaceSeparated:qa},Symbol.toStringTag,{value:"Module"})),_ee=Object.keys(Sae);class fbe extends Zm{constructor(e,t,i,r){let o=-1;if(super(e,t),nAe(this,"space",r),typeof i=="number")for(;++o<_ee.length;){const s=_ee[o];nAe(this,_ee[o],(i&Sae[s])===Sae[s])}}}fbe.prototype.defined=!0;function nAe(n,e,t){t&&(n[e]=t)}const Shn={}.hasOwnProperty;function GR(n){const e={},t={};let i;for(i in n.properties)if(Shn.call(n.properties,i)){const r=n.properties[i],o=new fbe(i,n.transform(n.attributes||{},i),r,n.space);n.mustUseProperty&&n.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),e[i]=o,t[p3(i)]=i,t[p3(o.attribute)]=i}return new u6(e,t,n.space)}const SKe=GR({space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),EKe=GR({space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function xKe(n,e){return e in n?n[e]:e}function TKe(n,e){return xKe(n,e.toLowerCase())}const kKe=GR({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:TKe,properties:{xmlns:null,xmlnsXLink:null}}),IKe=GR({transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Vc,ariaAutoComplete:null,ariaBusy:Vc,ariaChecked:Vc,ariaColCount:Fn,ariaColIndex:Fn,ariaColSpan:Fn,ariaControls:qa,ariaCurrent:null,ariaDescribedBy:qa,ariaDetails:null,ariaDisabled:Vc,ariaDropEffect:qa,ariaErrorMessage:null,ariaExpanded:Vc,ariaFlowTo:qa,ariaGrabbed:Vc,ariaHasPopup:null,ariaHidden:Vc,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qa,ariaLevel:Fn,ariaLive:null,ariaModal:Vc,ariaMultiLine:Vc,ariaMultiSelectable:Vc,ariaOrientation:null,ariaOwns:qa,ariaPlaceholder:null,ariaPosInSet:Fn,ariaPressed:Vc,ariaReadOnly:Vc,ariaRelevant:null,ariaRequired:Vc,ariaRoleDescription:qa,ariaRowCount:Fn,ariaRowIndex:Fn,ariaRowSpan:Fn,ariaSelected:Vc,ariaSetSize:Fn,ariaSort:null,ariaValueMax:Fn,ariaValueMin:Fn,ariaValueNow:Fn,ariaValueText:null,role:null}}),Ehn=GR({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:TKe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qL,acceptCharset:qa,accessKey:qa,action:null,allow:null,allowFullScreen:fo,allowPaymentRequest:fo,allowUserMedia:fo,alt:null,as:null,async:fo,autoCapitalize:null,autoComplete:qa,autoFocus:fo,autoPlay:fo,blocking:qa,capture:null,charSet:null,checked:fo,cite:null,className:qa,cols:Fn,colSpan:null,content:null,contentEditable:Vc,controls:fo,controlsList:qa,coords:Fn|qL,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fo,defer:fo,dir:null,dirName:null,disabled:fo,download:wKe,draggable:Vc,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fo,formTarget:null,headers:qa,height:Fn,hidden:fo,high:Fn,href:null,hrefLang:null,htmlFor:qa,httpEquiv:qa,id:null,imageSizes:null,imageSrcSet:null,inert:fo,inputMode:null,integrity:null,is:null,isMap:fo,itemId:null,itemProp:qa,itemRef:qa,itemScope:fo,itemType:qa,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fo,low:Fn,manifest:null,max:null,maxLength:Fn,media:null,method:null,min:null,minLength:Fn,multiple:fo,muted:fo,name:null,nonce:null,noModule:fo,noValidate:fo,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fo,optimum:Fn,pattern:null,ping:qa,placeholder:null,playsInline:fo,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fo,referrerPolicy:null,rel:qa,required:fo,reversed:fo,rows:Fn,rowSpan:Fn,sandbox:qa,scope:null,scoped:fo,seamless:fo,selected:fo,shadowRootClonable:fo,shadowRootDelegatesFocus:fo,shadowRootMode:null,shape:null,size:Fn,sizes:null,slot:null,span:Fn,spellCheck:Vc,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Fn,step:null,style:null,tabIndex:Fn,target:null,title:null,translate:null,type:null,typeMustMatch:fo,useMap:null,value:Vc,width:Fn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qa,axis:null,background:null,bgColor:null,border:Fn,borderColor:null,bottomMargin:Fn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fo,declare:fo,event:null,face:null,frame:null,frameBorder:null,hSpace:Fn,leftMargin:Fn,link:null,longDesc:null,lowSrc:null,marginHeight:Fn,marginWidth:Fn,noResize:fo,noHref:fo,noShade:fo,noWrap:fo,object:null,profile:null,prompt:null,rev:null,rightMargin:Fn,rules:null,scheme:null,scrolling:Vc,standby:null,summary:null,text:null,topMargin:Fn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Fn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fo,disableRemotePlayback:fo,prefix:null,property:null,results:Fn,security:null,unselectable:null}}),xhn=GR({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:xKe,properties:{about:Ip,accentHeight:Fn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Fn,amplitude:Fn,arabicForm:null,ascent:Fn,attributeName:null,attributeType:null,azimuth:Fn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Fn,by:null,calcMode:null,capHeight:Fn,className:qa,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Fn,diffuseConstant:Fn,direction:null,display:null,dur:null,divisor:Fn,dominantBaseline:null,download:fo,dx:null,dy:null,edgeMode:null,editable:null,elevation:Fn,enableBackground:null,end:null,event:null,exponent:Fn,externalResourcesRequired:null,fill:null,fillOpacity:Fn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qL,g2:qL,glyphName:qL,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Fn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Fn,horizOriginX:Fn,horizOriginY:Fn,id:null,ideographic:Fn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Fn,k:Fn,k1:Fn,k2:Fn,k3:Fn,k4:Fn,kernelMatrix:Ip,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Fn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Fn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Fn,overlineThickness:Fn,paintOrder:null,panose1:null,path:null,pathLength:Fn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qa,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Fn,pointsAtY:Fn,pointsAtZ:Fn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ip,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ip,rev:Ip,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ip,requiredFeatures:Ip,requiredFonts:Ip,requiredFormats:Ip,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Fn,specularExponent:Fn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Fn,strikethroughThickness:Fn,string:null,stroke:null,strokeDashArray:Ip,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Fn,strokeOpacity:Fn,strokeWidth:null,style:null,surfaceScale:Fn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ip,tabIndex:Fn,tableValues:null,target:null,targetX:Fn,targetY:Fn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ip,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Fn,underlineThickness:Fn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Fn,values:null,vAlphabetic:Fn,vMathematical:Fn,vectorEffect:null,vHanging:Fn,vIdeographic:Fn,version:null,vertAdvY:Fn,vertOriginX:Fn,vertOriginY:Fn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Fn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Thn=/^data[-\w.:]+$/i,iAe=/-[a-z]/g,khn=/[A-Z]/g;function $G(n,e){const t=p3(e);let i=e,r=Zm;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Thn.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(iAe,Lhn);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!iAe.test(o)){let s=o.replace(khn,Ihn);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}r=fbe}return new r(i,e)}function Ihn(n){return"-"+n.toLowerCase()}function Lhn(n){return n.charAt(1).toUpperCase()}const Dhn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},d6=CKe([EKe,SKe,kKe,IKe,Ehn],"html"),rE=CKe([EKe,SKe,kKe,IKe,xhn],"svg");function rAe(n){const e=String(n||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function LKe(n){return n.join(" ").trim()}var DKe={},oAe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ahn=/\n/g,Rhn=/^\s*/,Nhn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ohn=/^:\s*/,Phn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Mhn=/^[;\s]*/,Fhn=/^\s+|\s+$/g,Bhn=`
`,sAe="/",aAe="*",mx="",$hn="comment",Vhn="declaration",Hhn=function(n,e){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];e=e||{};var t=1,i=1;function r(g){var m=g.match(Ahn);m&&(t+=m.length);var v=g.lastIndexOf(Bhn);i=~v?g.length-v:i+g.length}function o(){var g={line:t,column:i};return function(m){return m.position=new s(g),c(),m}}function s(g){this.start=g,this.end={line:t,column:i},this.source=e.source}s.prototype.content=n;function a(g){var m=new Error(e.source+":"+t+":"+i+": "+g);if(m.reason=g,m.filename=e.source,m.line=t,m.column=i,m.source=n,!e.silent)throw m}function l(g){var m=g.exec(n);if(m){var v=m[0];return r(v),n=n.slice(v.length),m}}function c(){l(Rhn)}function u(g){var m;for(g=g||[];m=d();)m!==!1&&g.push(m);return g}function d(){var g=o();if(!(sAe!=n.charAt(0)||aAe!=n.charAt(1))){for(var m=2;mx!=n.charAt(m)&&(aAe!=n.charAt(m)||sAe!=n.charAt(m+1));)++m;if(m+=2,mx===n.charAt(m-1))return a("End of comment missing");var v=n.slice(2,m-2);return i+=2,r(v),n=n.slice(m),i+=2,g({type:$hn,comment:v})}}function h(){var g=o(),m=l(Nhn);if(m){if(d(),!l(Ohn))return a("property missing ':'");var v=l(Phn),_=g({type:Vhn,property:lAe(m[0].replace(oAe,mx)),value:v?lAe(v[0].replace(oAe,mx)):mx});return l(Mhn),_}}function f(){var g=[];u(g);for(var m;m=h();)m!==!1&&(g.push(m),u(g));return g}return c(),f()};function lAe(n){return n?n.replace(Fhn,mx):mx}var Whn=Po&&Po.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(DKe,"__esModule",{value:!0});var cAe=DKe.default=Uhn,zhn=Whn(Hhn);function Uhn(n,e){var t=null;if(!n||typeof n!="string")return t;var i=(0,zhn.default)(n),r=typeof e=="function";return i.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;r?e(s,a,o):a&&(t=t||{},t[s]=a)}}),t}const jhn=cAe.default||cAe,VG=AKe("end"),T0=AKe("start");function AKe(n){return e;function e(t){const i=t&&t.position&&t.position[n]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function qhn(n){const e=T0(n),t=VG(n);if(e&&t)return{start:e,end:t}}function bM(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?uAe(n.position):"start"in n||"end"in n?uAe(n):"line"in n||"column"in n?Eae(n):""}function Eae(n){return dAe(n&&n.line)+":"+dAe(n&&n.column)}function uAe(n){return Eae(n&&n.start)+"-"+Eae(n&&n.end)}function dAe(n){return n&&typeof n=="number"?n:1}class mh extends Error{constructor(e,t,i){super(),typeof t=="string"&&(i=t,t=void 0);let r="",o={},s=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof e=="string"?r=e:!o.cause&&e&&(s=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?o.ruleId=i:(o.source=i.slice(0,l),o.ruleId=i.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=bM(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}mh.prototype.file="";mh.prototype.name="";mh.prototype.reason="";mh.prototype.message="";mh.prototype.stack="";mh.prototype.column=void 0;mh.prototype.line=void 0;mh.prototype.ancestors=void 0;mh.prototype.cause=void 0;mh.prototype.fatal=void 0;mh.prototype.place=void 0;mh.prototype.ruleId=void 0;mh.prototype.source=void 0;const pbe={}.hasOwnProperty,Ghn=new Map,Khn=/[A-Z]/g,Yhn=/-([a-z])/g,Qhn=new Set(["table","tbody","thead","tfoot","tr"]),Xhn=new Set(["td","th"]),RKe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Zhn(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=sfn(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=ofn(t,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?rE:d6,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},o=NKe(r,n,void 0);return o&&typeof o!="string"?o:r.create(n,r.Fragment,{children:o||void 0},void 0)}function NKe(n,e,t){if(e.type==="element")return Jhn(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return efn(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return nfn(n,e,t);if(e.type==="mdxjsEsm")return tfn(n,e);if(e.type==="root")return ifn(n,e,t);if(e.type==="text")return rfn(n,e)}function Jhn(n,e,t){const i=n.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=rE,n.schema=r),n.ancestors.push(e);const o=PKe(n,e.tagName,!1),s=afn(n,e);let a=mbe(n,e);return Qhn.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Chn(l):!0})),OKe(n,s,o,e),gbe(s,a),n.ancestors.pop(),n.schema=i,n.create(e,o,s,t)}function efn(n,e){if(e.data&&e.data.estree&&n.evaluater){const i=e.data.estree.body[0];return i.type,n.evaluater.evaluateExpression(i.expression)}g3(n,e.position)}function tfn(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);g3(n,e.position)}function nfn(n,e,t){const i=n.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=rE,n.schema=r),n.ancestors.push(e);const o=e.name===null?n.Fragment:PKe(n,e.name,!0),s=lfn(n,e),a=mbe(n,e);return OKe(n,s,o,e),gbe(s,a),n.ancestors.pop(),n.schema=i,n.create(e,o,s,t)}function ifn(n,e,t){const i={};return gbe(i,mbe(n,e)),n.create(e,n.Fragment,i,t)}function rfn(n,e){return e.value}function OKe(n,e,t,i){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=i)}function gbe(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function ofn(n,e,t){return i;function i(r,o,s,a){const c=Array.isArray(s.children)?t:e;return a?c(o,s,a):c(o,s)}}function sfn(n,e){return t;function t(i,r,o,s){const a=Array.isArray(o.children),l=T0(i);return e(r,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:n,lineNumber:l?l.line:void 0},void 0)}}function afn(n,e){const t={};let i,r;for(r in e.properties)if(r!=="children"&&pbe.call(e.properties,r)){const o=cfn(n,r,e.properties[r]);if(o){const[s,a]=o;n.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Xhn.has(e.tagName)?i=a:t[s]=a}}if(i){const o=t.style||(t.style={});o[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return t}function lfn(n,e){const t={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&n.evaluater){const o=i.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(t,n.evaluater.evaluateExpression(a.argument))}else g3(n,e.position);else{const r=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&n.evaluater){const a=i.value.data.estree.body[0];a.type,o=n.evaluater.evaluateExpression(a.expression)}else g3(n,e.position);else o=i.value===null?!0:i.value;t[r]=o}return t}function mbe(n,e){const t=[];let i=-1;const r=n.passKeys?new Map:Ghn;for(;++i<e.children.length;){const o=e.children[i];let s;if(n.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=r.get(l)||0;s=l+"-"+c,r.set(l,c+1)}}const a=NKe(n,o,s);a!==void 0&&t.push(a)}return t}function cfn(n,e,t){const i=$G(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=i.commaSeparated?yKe(t):LKe(t)),i.property==="style"){let r=typeof t=="object"?t:ufn(n,String(t));return n.stylePropertyNameCase==="css"&&(r=dfn(r)),["style",r]}return[n.elementAttributeNameCase==="react"&&i.space?Dhn[i.property]||i.property:i.attribute,t]}}function ufn(n,e){const t={};try{jhn(e,i)}catch(r){if(!n.ignoreInvalidStyle){const o=r,s=new mh("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=RKe+"#cannot-parse-style-attribute",s}}return t;function i(r,o){let s=r;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(Yhn,ffn)),t[s]=o}}function PKe(n,e,t){let i;if(!t)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let o=-1,s;for(;++o<r.length;){const a=eAe(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}i=s}else i=eAe(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return pbe.call(n.components,r)?n.components[r]:r}if(n.evaluater)return n.evaluater.evaluateExpression(i);g3(n)}function g3(n,e){const t=new mh("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=n.filePath||void 0,t.url=RKe+"#cannot-handle-mdx-estrees-without-createevaluater",t}function dfn(n){const e={};let t;for(t in n)pbe.call(n,t)&&(e[hfn(t)]=n[t]);return e}function hfn(n){let e=n.replace(Khn,pfn);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function ffn(n,e){return e.toUpperCase()}function pfn(n){return"-"+n.toLowerCase()}const vee={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},gfn={};function mfn(n,e){const t=e||gfn,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,r=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return MKe(n,i,r)}function MKe(n,e,t){if(_fn(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return hAe(n.children,e,t)}return Array.isArray(n)?hAe(n,e,t):""}function hAe(n,e,t){const i=[];let r=-1;for(;++r<n.length;)i[r]=MKe(n[r],e,t);return i.join("")}function _fn(n){return!!(n&&typeof n=="object")}const fAe=document.createElement("i");function _be(n){const e="&"+n+";";fAe.innerHTML=e;const t=fAe.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function v1(n,e,t,i){const r=n.length;let o=0,s;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,t=t>0?t:0,i.length<1e4)s=Array.from(i),s.unshift(e,t),n.splice(...s);else for(t&&n.splice(e,t);o<i.length;)s=i.slice(o,o+1e4),s.unshift(e,0),n.splice(...s),o+=1e4,e+=1e4}function cm(n,e){return n.length>0?(v1(n,n.length,0,e),n):e}const pAe={}.hasOwnProperty;function vfn(n){const e={};let t=-1;for(;++t<n.length;)bfn(e,n[t]);return e}function bfn(n,e){let t;for(t in e){const r=(pAe.call(n,t)?n[t]:void 0)||(n[t]={}),o=e[t];let s;if(o)for(s in o){pAe.call(r,s)||(r[s]=[]);const a=o[s];yfn(r[s],Array.isArray(a)?a:a?[a]:[])}}}function yfn(n,e){let t=-1;const i=[];for(;++t<e.length;)(e[t].add==="after"?n:i).push(e[t]);v1(n,0,0,i)}function FKe(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"<22>":String.fromCodePoint(t)}function GL(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const mb=oE(/[A-Za-z]/),Xp=oE(/[\dA-Za-z]/),Cfn=oE(/[#-'*+\--9=?A-Z^-~]/);function xae(n){return n!==null&&(n<32||n===127)}const Tae=oE(/\d/),wfn=oE(/[\dA-Fa-f]/),Sfn=oE(/[!-/:-@[-`{-~]/);function Gr(n){return n!==null&&n<-2}function zf(n){return n!==null&&(n<0||n===32)}function Ps(n){return n===-2||n===-1||n===32}const Efn=oE(/\p{P}|\p{S}/u),xfn=oE(/\s/);function oE(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function KR(n){const e=[];let t=-1,i=0,r=0;for(;++t<n.length;){const o=n.charCodeAt(t);let s="";if(o===37&&Xp(n.charCodeAt(t+1))&&Xp(n.charCodeAt(t+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=n.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),r=1):s="<22>"}else s=String.fromCharCode(o);s&&(e.push(n.slice(i,t),encodeURIComponent(s)),i=t+r+1,s=""),r&&(t+=r,r=0)}return e.join("")+n.slice(i)}function Za(n,e,t,i){const r=i?i-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Ps(l)?(n.enter(t),a(l)):e(l)}function a(l){return Ps(l)&&o++<r?(n.consume(l),a):(n.exit(t),e(l))}}const Tfn={tokenize:kfn};function kfn(n){const e=n.attempt(this.parser.constructs.contentInitial,i,r);let t;return e;function i(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),Za(n,e,"linePrefix")}function r(a){return n.enter("paragraph"),o(a)}function o(a){const l=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,s(a)}function s(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return Gr(a)?(n.consume(a),n.exit("chunkText"),o):(n.consume(a),s)}}const Ifn={tokenize:Lfn},gAe={tokenize:Dfn};function Lfn(n){const e=this,t=[];let i=0,r,o,s;return a;function a(y){if(i<t.length){const C=t[i];return e.containerState=C[1],n.attempt(C[0].continuation,l,c)(y)}return c(y)}function l(y){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&b();const C=e.events.length;let E=C,x;for(;E--;)if(e.events[E][0]==="exit"&&e.events[E][1].type==="chunkFlow"){x=e.events[E][1].end;break}_(i);let k=C;for(;k<e.events.length;)e.events[k][1].end=Object.assign({},x),k++;return v1(e.events,E+1,0,e.events.slice(C)),e.events.length=k,c(y)}return a(y)}function c(y){if(i===t.length){if(!r)return h(y);if(r.currentConstruct&&r.currentConstruct.concrete)return g(y);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(gAe,u,d)(y)}function u(y){return r&&b(),_(i),h(y)}function d(y){return e.parser.lazy[e.now().line]=i!==t.length,s=e.now().offset,g(y)}function h(y){return e.containerState={},n.attempt(gAe,f,g)(y)}function f(y){return i++,t.push([e.currentConstruct,e.containerState]),h(y)}function g(y){if(y===null){r&&b(),_(0),n.consume(y);return}return r=r||e.parser.flow(e.now()),n.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),m(y)}function m(y){if(y===null){v(n.exit("chunkFlow"),!0),_(0),n.consume(y);return}return Gr(y)?(n.consume(y),v(n.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(n.consume(y),m)}function v(y,C){const E=e.sliceStream(y);if(C&&E.push(null),y.previous=o,o&&(o.next=y),o=y,r.defineSkip(y.start),r.write(E),e.parser.lazy[y.start.line]){let x=r.events.length;for(;x--;)if(r.events[x][1].start.offset<s&&(!r.events[x][1].end||r.events[x][1].end.offset>s))return;const k=e.events.length;let L=k,D,A;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(D){A=e.events[L][1].end;break}D=!0}for(_(i),x=k;x<e.events.length;)e.events[x][1].end=Object.assign({},A),x++;v1(e.events,L+1,0,e.events.slice(k)),e.events.length=x}}function _(y){let C=t.length;for(;C-- >y;){const E=t[C];e.containerState=E[1],E[0].exit.call(e,n)}t.length=y}function b(){r.write([null]),o=void 0,r=void 0,e.containerState._closeFlow=void 0}}function Dfn(n,e,t){return Za(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mAe(n){if(n===null||zf(n)||xfn(n))return 1;if(Efn(n))return 2}function vbe(n,e,t){const i=[];let r=-1;for(;++r<n.length;){const o=n[r].resolveAll;o&&!i.includes(o)&&(e=o(e,t),i.push(o))}return e}const kae={name:"attention",tokenize:Rfn,resolveAll:Afn};function Afn(n,e){let t=-1,i,r,o,s,a,l,c,u;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(i=t;i--;)if(n[i][0]==="exit"&&n[i][1].type==="attentionSequence"&&n[i][1]._open&&e.sliceSerialize(n[i][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[i][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[i][1].end.offset-n[i][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;l=n[i][1].end.offset-n[i][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const d=Object.assign({},n[i][1].end),h=Object.assign({},n[t][1].start);_Ae(d,-l),_Ae(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},n[i][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},n[t][1].start),end:h},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},n[i][1].end),end:Object.assign({},n[t][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},n[i][1].end=Object.assign({},s.start),n[t][1].start=Object.assign({},a.end),c=[],n[i][1].end.offset-n[i][1].start.offset&&(c=cm(c,[["enter",n[i][1],e],["exit",n[i][1],e]])),c=cm(c,[["enter",r,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=cm(c,vbe(e.parser.constructs.insideSpan.null,n.slice(i+1,t),e)),c=cm(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",r,e]]),n[t][1].end.offset-n[t][1].start.offset?(u=2,c=cm(c,[["enter",n[t][1],e],["exit",n[t][1],e]])):u=0,v1(n,i-1,t-i+3,c),t=i+c.length-u-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function Rfn(n,e){const t=this.parser.constructs.attentionMarkers.null,i=this.previous,r=mAe(i);let o;return s;function s(l){return o=l,n.enter("attentionSequence"),a(l)}function a(l){if(l===o)return n.consume(l),a;const c=n.exit("attentionSequence"),u=mAe(l),d=!u||u===2&&r||t.includes(l),h=!r||r===2&&u||t.includes(i);return c._open=!!(o===42?d:d&&(r||!h)),c._close=!!(o===42?h:h&&(u||!d)),e(l)}}function _Ae(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const Nfn={name:"autolink",tokenize:Ofn};function Ofn(n,e,t){let i=0;return r;function r(f){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(f),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),o}function o(f){return mb(f)?(n.consume(f),s):f===64?t(f):c(f)}function s(f){return f===43||f===45||f===46||Xp(f)?(i=1,a(f)):c(f)}function a(f){return f===58?(n.consume(f),i=0,l):(f===43||f===45||f===46||Xp(f))&&i++<32?(n.consume(f),a):(i=0,c(f))}function l(f){return f===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(f),n.exit("autolinkMarker"),n.exit("autolink"),e):f===null||f===32||f===60||xae(f)?t(f):(n.consume(f),l)}function c(f){return f===64?(n.consume(f),u):Cfn(f)?(n.consume(f),c):t(f)}function u(f){return Xp(f)?d(f):t(f)}function d(f){return f===46?(n.consume(f),i=0,u):f===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(f),n.exit("autolinkMarker"),n.exit("autolink"),e):h(f)}function h(f){if((f===45||Xp(f))&&i++<63){const g=f===45?h:d;return n.consume(f),g}return t(f)}}const HG={tokenize:Pfn,partial:!0};function Pfn(n,e,t){return i;function i(o){return Ps(o)?Za(n,r,"linePrefix")(o):r(o)}function r(o){return o===null||Gr(o)?e(o):t(o)}}const BKe={name:"blockQuote",tokenize:Mfn,continuation:{tokenize:Ffn},exit:Bfn};function Mfn(n,e,t){const i=this;return r;function r(s){if(s===62){const a=i.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(s),n.exit("blockQuoteMarker"),o}return t(s)}function o(s){return Ps(s)?(n.enter("blockQuotePrefixWhitespace"),n.consume(s),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(s))}}function Ffn(n,e,t){const i=this;return r;function r(s){return Ps(s)?Za(n,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return n.attempt(BKe,e,t)(s)}}function Bfn(n){n.exit("blockQuote")}const $Ke={name:"characterEscape",tokenize:$fn};function $fn(n,e,t){return i;function i(o){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(o),n.exit("escapeMarker"),r}function r(o){return Sfn(o)?(n.enter("characterEscapeValue"),n.consume(o),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(o)}}const VKe={name:"characterReference",tokenize:Vfn};function Vfn(n,e,t){const i=this;let r=0,o,s;return a;function a(d){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(d),n.exit("characterReferenceMarker"),l}function l(d){return d===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(d),n.exit("characterReferenceMarkerNumeric"),c):(n.enter("characterReferenceValue"),o=31,s=Xp,u(d))}function c(d){return d===88||d===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(d),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),o=6,s=wfn,u):(n.enter("characterReferenceValue"),o=7,s=Tae,u(d))}function u(d){if(d===59&&r){const h=n.exit("characterReferenceValue");return s===Xp&&!_be(i.sliceSerialize(h))?t(d):(n.enter("characterReferenceMarker"),n.consume(d),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return s(d)&&r++<o?(n.consume(d),u):t(d)}}const vAe={tokenize:Wfn,partial:!0},bAe={name:"codeFenced",tokenize:Hfn,concrete:!0};function Hfn(n,e,t){const i=this,r={tokenize:E,partial:!0};let o=0,s=0,a;return l;function l(x){return c(x)}function c(x){const k=i.events[i.events.length-1];return o=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,a=x,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),u(x)}function u(x){return x===a?(s++,n.consume(x),u):s<3?t(x):(n.exit("codeFencedFenceSequence"),Ps(x)?Za(n,d,"whitespace")(x):d(x))}function d(x){return x===null||Gr(x)?(n.exit("codeFencedFence"),i.interrupt?e(x):n.check(vAe,m,C)(x)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||Gr(x)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),d(x)):Ps(x)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Za(n,f,"whitespace")(x)):x===96&&x===a?t(x):(n.consume(x),h)}function f(x){return x===null||Gr(x)?d(x):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||Gr(x)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),d(x)):x===96&&x===a?t(x):(n.consume(x),g)}function m(x){return n.attempt(r,C,v)(x)}function v(x){return n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),_}function _(x){return o>0&&Ps(x)?Za(n,b,"linePrefix",o+1)(x):b(x)}function b(x){return x===null||Gr(x)?n.check(vAe,m,C)(x):(n.enter("codeFlowValue"),y(x))}function y(x){return x===null||Gr(x)?(n.exit("codeFlowValue"),b(x)):(n.consume(x),y)}function C(x){return n.exit("codeFenced"),e(x)}function E(x,k,L){let D=0;return A;function A(F){return x.enter("lineEnding"),x.consume(F),x.exit("lineEnding"),N}function N(F){return x.enter("codeFencedFence"),Ps(F)?Za(x,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):P(F)}function P(F){return F===a?(x.enter("codeFencedFenceSequence"),M(F)):L(F)}function M(F){return F===a?(D++,x.consume(F),M):D>=s?(x.exit("codeFencedFenceSequence"),Ps(F)?Za(x,B,"whitespace")(F):B(F)):L(F)}function B(F){return F===null||Gr(F)?(x.exit("codeFencedFence"),k(F)):L(F)}}}function Wfn(n,e,t){const i=this;return r;function r(s){return s===null?t(s):(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),o)}function o(s){return i.parser.lazy[i.now().line]?t(s):e(s)}}const bee={name:"codeIndented",tokenize:Ufn},zfn={tokenize:jfn,partial:!0};function Ufn(n,e,t){const i=this;return r;function r(c){return n.enter("codeIndented"),Za(n,o,"linePrefix",4+1)(c)}function o(c){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):t(c)}function s(c){return c===null?l(c):Gr(c)?n.attempt(zfn,s,l)(c):(n.enter("codeFlowValue"),a(c))}function a(c){return c===null||Gr(c)?(n.exit("codeFlowValue"),s(c)):(n.consume(c),a)}function l(c){return n.exit("codeIndented"),e(c)}}function jfn(n,e,t){const i=this;return r;function r(s){return i.parser.lazy[i.now().line]?t(s):Gr(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),r):Za(n,o,"linePrefix",4+1)(s)}function o(s){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):Gr(s)?r(s):t(s)}}const qfn={name:"codeText",tokenize:Yfn,resolve:Gfn,previous:Kfn};function Gfn(n){let e=n.length-4,t=3,i,r;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(i=t;++i<e;)if(n[i][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(i=t-1,e++;++i<=e;)r===void 0?i!==e&&n[i][1].type!=="lineEnding"&&(r=i):(i===e||n[i][1].type==="lineEnding")&&(n[r][1].type="codeTextData",i!==r+2&&(n[r][1].end=n[i-1][1].end,n.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return n}function Kfn(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Yfn(n,e,t){let i=0,r,o;return s;function s(d){return n.enter("codeText"),n.enter("codeTextSequence"),a(d)}function a(d){return d===96?(n.consume(d),i++,a):(n.exit("codeTextSequence"),l(d))}function l(d){return d===null?t(d):d===32?(n.enter("space"),n.consume(d),n.exit("space"),l):d===96?(o=n.enter("codeTextSequence"),r=0,u(d)):Gr(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),l):(n.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||Gr(d)?(n.exit("codeTextData"),l(d)):(n.consume(d),c)}function u(d){return d===96?(n.consume(d),r++,u):r===i?(n.exit("codeTextSequence"),n.exit("codeText"),e(d)):(o.type="codeTextData",c(d))}}class Qfn{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const i=t??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,t,i){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&vO(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),vO(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vO(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);vO(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);vO(this.left,t.reverse())}}}function vO(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function HKe(n){const e={};let t=-1,i,r,o,s,a,l,c;const u=new Qfn(n);for(;++t<u.length;){for(;t in e;)t=e[t];if(i=u.get(t),t&&i[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,Xfn(u,t)),t=e[t],c=!0);else if(i[1]._container){for(o=t,r=void 0;o--&&(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(r&&(u.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=o);r&&(i[1].end=Object.assign({},u.get(r)[1].start),a=u.slice(r,t),a.unshift(i),u.splice(r,t-r+1,a))}}return v1(n,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Xfn(n,e){const t=n.get(e)[1],i=n.get(e)[2];let r=e-1;const o=[],s=t._tokenizer||i.parser[t.contentType](t.start),a=s.events,l=[],c={};let u,d,h=-1,f=t,g=0,m=0;const v=[m];for(;f;){for(;n.get(++r)[1]!==f;);o.push(r),f._tokenizer||(u=i.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=t;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,v.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),h=v.length;h--;){const _=a.slice(v[h],v[h+1]),b=o.pop();l.push([b,b+_.length-1]),n.splice(b,2,_)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const Zfn={tokenize:tpn,resolve:epn},Jfn={tokenize:npn,partial:!0};function epn(n){return HKe(n),n}function tpn(n,e){let t;return i;function i(a){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),r(a)}function r(a){return a===null?o(a):Gr(a)?n.check(Jfn,s,o)(a):(n.consume(a),r)}function o(a){return n.exit("chunkContent"),n.exit("content"),e(a)}function s(a){return n.consume(a),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}}function npn(n,e,t){const i=this;return r;function r(s){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),Za(n,o,"linePrefix")}function o(s){if(s===null||Gr(s))return t(s);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):n.interrupt(i.parser.constructs.flow,t,e)(s)}}function WKe(n,e,t,i,r,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(_){return _===60?(n.enter(i),n.enter(r),n.enter(o),n.consume(_),n.exit(o),h):_===null||_===32||_===41||xae(_)?t(_):(n.enter(i),n.enter(s),n.enter(a),n.enter("chunkString",{contentType:"string"}),m(_))}function h(_){return _===62?(n.enter(o),n.consume(_),n.exit(o),n.exit(r),n.exit(i),e):(n.enter(a),n.enter("chunkString",{contentType:"string"}),f(_))}function f(_){return _===62?(n.exit("chunkString"),n.exit(a),h(_)):_===null||_===60||Gr(_)?t(_):(n.consume(_),_===92?g:f)}function g(_){return _===60||_===62||_===92?(n.consume(_),f):f(_)}function m(_){return!u&&(_===null||_===41||zf(_))?(n.exit("chunkString"),n.exit(a),n.exit(s),n.exit(i),e(_)):u<c&&_===40?(n.consume(_),u++,m):_===41?(n.consume(_),u--,m):_===null||_===32||_===40||xae(_)?t(_):(n.consume(_),_===92?v:m)}function v(_){return _===40||_===41||_===92?(n.consume(_),m):m(_)}}function zKe(n,e,t,i,r,o){const s=this;let a=0,l;return c;function c(f){return n.enter(i),n.enter(r),n.consume(f),n.exit(r),n.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?t(f):f===93?(n.exit(o),n.enter(r),n.consume(f),n.exit(r),n.exit(i),e):Gr(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):(n.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||Gr(f)||a++>999?(n.exit("chunkString"),u(f)):(n.consume(f),l||(l=!Ps(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(n.consume(f),a++,d):d(f)}}function UKe(n,e,t,i,r,o){let s;return a;function a(h){return h===34||h===39||h===40?(n.enter(i),n.enter(r),n.consume(h),n.exit(r),s=h===40?41:h,l):t(h)}function l(h){return h===s?(n.enter(r),n.consume(h),n.exit(r),n.exit(i),e):(n.enter(o),c(h))}function c(h){return h===s?(n.exit(o),l(s)):h===null?t(h):Gr(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),Za(n,c,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||Gr(h)?(n.exit("chunkString"),c(h)):(n.consume(h),h===92?d:u)}function d(h){return h===s||h===92?(n.consume(h),u):u(h)}}function yM(n,e){let t;return i;function i(r){return Gr(r)?(n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),t=!0,i):Ps(r)?Za(n,i,t?"linePrefix":"lineSuffix")(r):e(r)}}const ipn={name:"definition",tokenize:opn},rpn={tokenize:spn,partial:!0};function opn(n,e,t){const i=this;let r;return o;function o(f){return n.enter("definition"),s(f)}function s(f){return zKe.call(i,n,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return r=GL(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),f===58?(n.enter("definitionMarker"),n.consume(f),n.exit("definitionMarker"),l):t(f)}function l(f){return zf(f)?yM(n,c)(f):c(f)}function c(f){return WKe(n,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return n.attempt(rpn,d,d)(f)}function d(f){return Ps(f)?Za(n,h,"whitespace")(f):h(f)}function h(f){return f===null||Gr(f)?(n.exit("definition"),i.parser.defined.push(r),e(f)):t(f)}}function spn(n,e,t){return i;function i(a){return zf(a)?yM(n,r)(a):t(a)}function r(a){return UKe(n,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ps(a)?Za(n,s,"whitespace")(a):s(a)}function s(a){return a===null||Gr(a)?e(a):t(a)}}const apn={name:"hardBreakEscape",tokenize:lpn};function lpn(n,e,t){return i;function i(o){return n.enter("hardBreakEscape"),n.consume(o),r}function r(o){return Gr(o)?(n.exit("hardBreakEscape"),e(o)):t(o)}}const cpn={name:"headingAtx",tokenize:dpn,resolve:upn};function upn(n,e){let t=n.length-2,i=3,r,o;return n[i][1].type==="whitespace"&&(i+=2),t-2>i&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(i===t-1||t-4>i&&n[t-2][1].type==="whitespace")&&(t-=i+1===t?2:4),t>i&&(r={type:"atxHeadingText",start:n[i][1].start,end:n[t][1].end},o={type:"chunkText",start:n[i][1].start,end:n[t][1].end,contentType:"text"},v1(n,i,t-i+1,[["enter",r,e],["enter",o,e],["exit",o,e],["exit",r,e]])),n}function dpn(n,e,t){let i=0;return r;function r(u){return n.enter("atxHeading"),o(u)}function o(u){return n.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&i++<6?(n.consume(u),s):u===null||zf(u)?(n.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(n.enter("atxHeadingSequence"),l(u)):u===null||Gr(u)?(n.exit("atxHeading"),e(u)):Ps(u)?Za(n,a,"whitespace")(u):(n.enter("atxHeadingText"),c(u))}function l(u){return u===35?(n.consume(u),l):(n.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||zf(u)?(n.exit("atxHeadingText"),a(u)):(n.consume(u),c)}}const hpn=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],yAe=["pre","script","style","textarea"],fpn={name:"htmlFlow",tokenize:_pn,resolveTo:mpn,concrete:!0},ppn={tokenize:bpn,partial:!0},gpn={tokenize:vpn,partial:!0};function mpn(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function _pn(n,e,t){const i=this;let r,o,s,a,l;return c;function c(Q){return u(Q)}function u(Q){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(Q),d}function d(Q){return Q===33?(n.consume(Q),h):Q===47?(n.consume(Q),o=!0,m):Q===63?(n.consume(Q),r=3,i.interrupt?e:V):mb(Q)?(n.consume(Q),s=String.fromCharCode(Q),v):t(Q)}function h(Q){return Q===45?(n.consume(Q),r=2,f):Q===91?(n.consume(Q),r=5,a=0,g):mb(Q)?(n.consume(Q),r=4,i.interrupt?e:V):t(Q)}function f(Q){return Q===45?(n.consume(Q),i.interrupt?e:V):t(Q)}function g(Q){const Ne="CDATA[";return Q===Ne.charCodeAt(a++)?(n.consume(Q),a===Ne.length?i.interrupt?e:P:g):t(Q)}function m(Q){return mb(Q)?(n.consume(Q),s=String.fromCharCode(Q),v):t(Q)}function v(Q){if(Q===null||Q===47||Q===62||zf(Q)){const Ne=Q===47,Ve=s.toLowerCase();return!Ne&&!o&&yAe.includes(Ve)?(r=1,i.interrupt?e(Q):P(Q)):hpn.includes(s.toLowerCase())?(r=6,Ne?(n.consume(Q),_):i.interrupt?e(Q):P(Q)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(Q):o?b(Q):y(Q))}return Q===45||Xp(Q)?(n.consume(Q),s+=String.fromCharCode(Q),v):t(Q)}function _(Q){return Q===62?(n.consume(Q),i.interrupt?e:P):t(Q)}function b(Q){return Ps(Q)?(n.consume(Q),b):A(Q)}function y(Q){return Q===47?(n.consume(Q),A):Q===58||Q===95||mb(Q)?(n.consume(Q),C):Ps(Q)?(n.consume(Q),y):A(Q)}function C(Q){return Q===45||Q===46||Q===58||Q===95||Xp(Q)?(n.consume(Q),C):E(Q)}function E(Q){return Q===61?(n.consume(Q),x):Ps(Q)?(n.consume(Q),E):y(Q)}function x(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?t(Q):Q===34||Q===39?(n.consume(Q),l=Q,k):Ps(Q)?(n.consume(Q),x):L(Q)}function k(Q){return Q===l?(n.consume(Q),l=null,D):Q===null||Gr(Q)?t(Q):(n.consume(Q),k)}function L(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||zf(Q)?E(Q):(n.consume(Q),L)}function D(Q){return Q===47||Q===62||Ps(Q)?y(Q):t(Q)}function A(Q){return Q===62?(n.consume(Q),N):t(Q)}function N(Q){return Q===null||Gr(Q)?P(Q):Ps(Q)?(n.consume(Q),N):t(Q)}function P(Q){return Q===45&&r===2?(n.consume(Q),U):Q===60&&r===1?(n.consume(Q),H):Q===62&&r===4?(n.consume(Q),re):Q===63&&r===3?(n.consume(Q),V):Q===93&&r===5?(n.consume(Q),q):Gr(Q)&&(r===6||r===7)?(n.exit("htmlFlowData"),n.check(ppn,oe,M)(Q)):Q===null||Gr(Q)?(n.exit("htmlFlowData"),M(Q)):(n.consume(Q),P)}function M(Q){return n.check(gpn,B,oe)(Q)}function B(Q){return n.enter("lineEnding"),n.consume(Q),n.exit("lineEnding"),F}function F(Q){return Q===null||Gr(Q)?M(Q):(n.enter("htmlFlowData"),P(Q))}function U(Q){return Q===45?(n.consume(Q),V):P(Q)}function H(Q){return Q===47?(n.consume(Q),s="",W):P(Q)}function W(Q){if(Q===62){const Ne=s.toLowerCase();return yAe.includes(Ne)?(n.consume(Q),re):P(Q)}return mb(Q)&&s.length<8?(n.consume(Q),s+=String.fromCharCode(Q),W):P(Q)}function q(Q){return Q===93?(n.consume(Q),V):P(Q)}function V(Q){return Q===62?(n.consume(Q),re):Q===45&&r===2?(n.consume(Q),V):P(Q)}function re(Q){return Q===null||Gr(Q)?(n.exit("htmlFlowData"),oe(Q)):(n.consume(Q),re)}function oe(Q){return n.exit("htmlFlow"),e(Q)}}function vpn(n,e,t){const i=this;return r;function r(s){return Gr(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),o):t(s)}function o(s){return i.parser.lazy[i.now().line]?t(s):e(s)}}function bpn(n,e,t){return i;function i(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),n.attempt(HG,e,t)}}const ypn={name:"htmlText",tokenize:Cpn};function Cpn(n,e,t){const i=this;let r,o,s;return a;function a(V){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(V),l}function l(V){return V===33?(n.consume(V),c):V===47?(n.consume(V),E):V===63?(n.consume(V),y):mb(V)?(n.consume(V),L):t(V)}function c(V){return V===45?(n.consume(V),u):V===91?(n.consume(V),o=0,g):mb(V)?(n.consume(V),b):t(V)}function u(V){return V===45?(n.consume(V),f):t(V)}function d(V){return V===null?t(V):V===45?(n.consume(V),h):Gr(V)?(s=d,H(V)):(n.consume(V),d)}function h(V){return V===45?(n.consume(V),f):d(V)}function f(V){return V===62?U(V):V===45?h(V):d(V)}function g(V){const re="CDATA[";return V===re.charCodeAt(o++)?(n.consume(V),o===re.length?m:g):t(V)}function m(V){return V===null?t(V):V===93?(n.consume(V),v):Gr(V)?(s=m,H(V)):(n.consume(V),m)}function v(V){return V===93?(n.consume(V),_):m(V)}function _(V){return V===62?U(V):V===93?(n.consume(V),_):m(V)}function b(V){return V===null||V===62?U(V):Gr(V)?(s=b,H(V)):(n.consume(V),b)}function y(V){return V===null?t(V):V===63?(n.consume(V),C):Gr(V)?(s=y,H(V)):(n.consume(V),y)}function C(V){return V===62?U(V):y(V)}function E(V){return mb(V)?(n.consume(V),x):t(V)}function x(V){return V===45||Xp(V)?(n.consume(V),x):k(V)}function k(V){return Gr(V)?(s=k,H(V)):Ps(V)?(n.consume(V),k):U(V)}function L(V){return V===45||Xp(V)?(n.consume(V),L):V===47||V===62||zf(V)?D(V):t(V)}function D(V){return V===47?(n.consume(V),U):V===58||V===95||mb(V)?(n.consume(V),A):Gr(V)?(s=D,H(V)):Ps(V)?(n.consume(V),D):U(V)}function A(V){return V===45||V===46||V===58||V===95||Xp(V)?(n.consume(V),A):N(V)}function N(V){return V===61?(n.consume(V),P):Gr(V)?(s=N,H(V)):Ps(V)?(n.consume(V),N):D(V)}function P(V){return V===null||V===60||V===61||V===62||V===96?t(V):V===34||V===39?(n.consume(V),r=V,M):Gr(V)?(s=P,H(V)):Ps(V)?(n.consume(V),P):(n.consume(V),B)}function M(V){return V===r?(n.consume(V),r=void 0,F):V===null?t(V):Gr(V)?(s=M,H(V)):(n.consume(V),M)}function B(V){return V===null||V===34||V===39||V===60||V===61||V===96?t(V):V===47||V===62||zf(V)?D(V):(n.consume(V),B)}function F(V){return V===47||V===62||zf(V)?D(V):t(V)}function U(V){return V===62?(n.consume(V),n.exit("htmlTextData"),n.exit("htmlText"),e):t(V)}function H(V){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(V),n.exit("lineEnding"),W}function W(V){return Ps(V)?Za(n,q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):q(V)}function q(V){return n.enter("htmlTextData"),s(V)}}const bbe={name:"labelEnd",tokenize:kpn,resolveTo:Tpn,resolveAll:xpn},wpn={tokenize:Ipn},Spn={tokenize:Lpn},Epn={tokenize:Dpn};function xpn(n){let e=-1;for(;++e<n.length;){const t=n[e][1];(t.type==="labelImage"||t.type==="labelLink"||t.type==="labelEnd")&&(n.splice(e+1,t.type==="labelImage"?4:2),t.type="data",e++)}return n}function Tpn(n,e){let t=n.length,i=0,r,o,s,a;for(;t--;)if(r=n[t][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;n[t][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(n[t][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=t,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(s=t);const l={type:n[o][1].type==="labelLink"?"link":"image",start:Object.assign({},n[o][1].start),end:Object.assign({},n[n.length-1][1].end)},c={type:"label",start:Object.assign({},n[o][1].start),end:Object.assign({},n[s][1].end)},u={type:"labelText",start:Object.assign({},n[o+i+2][1].end),end:Object.assign({},n[s-2][1].start)};return a=[["enter",l,e],["enter",c,e]],a=cm(a,n.slice(o+1,o+i+3)),a=cm(a,[["enter",u,e]]),a=cm(a,vbe(e.parser.constructs.insideSpan.null,n.slice(o+i+4,s-3),e)),a=cm(a,[["exit",u,e],n[s-2],n[s-1],["exit",c,e]]),a=cm(a,n.slice(s+1)),a=cm(a,[["exit",l,e]]),v1(n,o,n.length,a),n}function kpn(n,e,t){const i=this;let r=i.events.length,o,s;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){o=i.events[r][1];break}return a;function a(h){return o?o._inactive?d(h):(s=i.parser.defined.includes(GL(i.sliceSerialize({start:o.end,end:i.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(h),n.exit("labelMarker"),n.exit("labelEnd"),l):t(h)}function l(h){return h===40?n.attempt(wpn,u,s?u:d)(h):h===91?n.attempt(Spn,u,s?c:d)(h):s?u(h):d(h)}function c(h){return n.attempt(Epn,u,d)(h)}function u(h){return e(h)}function d(h){return o._balanced=!0,t(h)}}function Ipn(n,e,t){return i;function i(d){return n.enter("resource"),n.enter("resourceMarker"),n.consume(d),n.exit("resourceMarker"),r}function r(d){return zf(d)?yM(n,o)(d):o(d)}function o(d){return d===41?u(d):WKe(n,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return zf(d)?yM(n,l)(d):u(d)}function a(d){return t(d)}function l(d){return d===34||d===39||d===40?UKe(n,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return zf(d)?yM(n,u)(d):u(d)}function u(d){return d===41?(n.enter("resourceMarker"),n.consume(d),n.exit("resourceMarker"),n.exit("resource"),e):t(d)}}function Lpn(n,e,t){const i=this;return r;function r(a){return zKe.call(i,n,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return i.parser.defined.includes(GL(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(a):t(a)}function s(a){return t(a)}}function Dpn(n,e,t){return i;function i(o){return n.enter("reference"),n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),r}function r(o){return o===93?(n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),n.exit("reference"),e):t(o)}}const Apn={name:"labelStartImage",tokenize:Rpn,resolveAll:bbe.resolveAll};function Rpn(n,e,t){const i=this;return r;function r(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),o}function o(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),s):t(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(a):e(a)}}const Npn={name:"labelStartLink",tokenize:Opn,resolveAll:bbe.resolveAll};function Opn(n,e,t){const i=this;return r;function r(s){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(s),n.exit("labelMarker"),n.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(s):e(s)}}const yee={name:"lineEnding",tokenize:Ppn};function Ppn(n,e){return t;function t(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),Za(n,e,"linePrefix")}}const M$={name:"thematicBreak",tokenize:Mpn};function Mpn(n,e,t){let i=0,r;return o;function o(c){return n.enter("thematicBreak"),s(c)}function s(c){return r=c,a(c)}function a(c){return c===r?(n.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||Gr(c))?(n.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===r?(n.consume(c),i++,l):(n.exit("thematicBreakSequence"),Ps(c)?Za(n,a,"whitespace")(c):a(c))}}const gf={name:"list",tokenize:$pn,continuation:{tokenize:Vpn},exit:Wpn},Fpn={tokenize:zpn,partial:!0},Bpn={tokenize:Hpn,partial:!0};function $pn(n,e,t){const i=this,r=i.events[i.events.length-1];let o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(f){const g=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:Tae(f)){if(i.containerState.type||(i.containerState.type=g,n.enter(g,{_container:!0})),g==="listUnordered")return n.enter("listItemPrefix"),f===42||f===45?n.check(M$,t,c)(f):c(f);if(!i.interrupt||f===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),l(f)}return t(f)}function l(f){return Tae(f)&&++s<10?(n.consume(f),l):(!i.interrupt||s<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(n.exit("listItemValue"),c(f)):t(f)}function c(f){return n.enter("listItemMarker"),n.consume(f),n.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,n.check(HG,i.interrupt?t:u,n.attempt(Fpn,h,d))}function u(f){return i.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Ps(f)?(n.enter("listItemPrefixWhitespace"),n.consume(f),n.exit("listItemPrefixWhitespace"),h):t(f)}function h(f){return i.containerState.size=o+i.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(f)}}function Vpn(n,e,t){const i=this;return i.containerState._closeFlow=void 0,n.check(HG,r,o);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Za(n,e,"listItemIndent",i.containerState.size+1)(a)}function o(a){return i.containerState.furtherBlankLines||!Ps(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,n.attempt(Bpn,e,s)(a))}function s(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,Za(n,n.attempt(gf,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Hpn(n,e,t){const i=this;return Za(n,r,"listItemIndent",i.containerState.size+1);function r(o){const s=i.events[i.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?e(o):t(o)}}function Wpn(n){n.exit(this.containerState.type)}function zpn(n,e,t){const i=this;return Za(n,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function r(o){const s=i.events[i.events.length-1];return!Ps(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):t(o)}}const CAe={name:"setextUnderline",tokenize:jpn,resolveTo:Upn};function Upn(n,e){let t=n.length,i,r,o;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){i=t;break}n[t][1].type==="paragraph"&&(r=t)}else n[t][1].type==="content"&&n.splice(t,1),!o&&n[t][1].type==="definition"&&(o=t);const s={type:"setextHeading",start:Object.assign({},n[r][1].start),end:Object.assign({},n[n.length-1][1].end)};return n[r][1].type="setextHeadingText",o?(n.splice(r,0,["enter",s,e]),n.splice(o+1,0,["exit",n[i][1],e]),n[i][1].end=Object.assign({},n[o][1].end)):n[i][1]=s,n.push(["exit",s,e]),n}function jpn(n,e,t){const i=this;let r;return o;function o(c){let u=i.events.length,d;for(;u--;)if(i.events[u][1].type!=="lineEnding"&&i.events[u][1].type!=="linePrefix"&&i.events[u][1].type!=="content"){d=i.events[u][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(n.enter("setextHeadingLine"),r=c,s(c)):t(c)}function s(c){return n.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===r?(n.consume(c),a):(n.exit("setextHeadingLineSequence"),Ps(c)?Za(n,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Gr(c)?(n.exit("setextHeadingLine"),e(c)):t(c)}}const qpn={tokenize:Gpn};function Gpn(n){const e=this,t=n.attempt(HG,i,n.attempt(this.parser.constructs.flowInitial,r,Za(n,n.attempt(this.parser.constructs.flow,r,n.attempt(Zfn,r)),"linePrefix")));return t;function i(o){if(o===null){n.consume(o);return}return n.enter("lineEndingBlank"),n.consume(o),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function r(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const Kpn={resolveAll:qKe()},Ypn=jKe("string"),Qpn=jKe("text");function jKe(n){return{tokenize:e,resolveAll:qKe(n==="text"?Xpn:void 0)};function e(t){const i=this,r=this.parser.constructs[n],o=t.attempt(r,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),l}function l(u){return c(u)?(t.exit("data"),o(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const d=r[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(i,i.previous))return!0}return!1}}}function qKe(n){return e;function e(t,i){let r=-1,o;for(;++r<=t.length;)o===void 0?t[r]&&t[r][1].type==="data"&&(o=r,r++):(!t[r]||t[r][1].type!=="data")&&(r!==o+2&&(t[o][1].end=t[r-1][1].end,t.splice(o+2,r-o-2),r=o+2),o=void 0);return n?n(t,i):t}}function Xpn(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const i=n[t-1][1],r=e.sliceStream(i);let o=r.length,s=-1,a=0,l;for(;o--;){const c=r[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:t===n.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:i.end.line,column:i.end.column-a,offset:i.end.offset-a,_index:i.start._index+o,_bufferIndex:o?s:i.start._bufferIndex+s},end:Object.assign({},i.end)};i.end=Object.assign({},c.start),i.start.offset===i.end.offset?Object.assign(i,c):(n.splice(t,0,["enter",c,e],["exit",c,e]),t+=2)}t++}return n}function Zpn(n,e,t){let i=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const r={},o=[];let s=[],a=[];const l={consume:b,enter:y,exit:C,attempt:k(E),check:k(x),interrupt:k(x,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:n,sliceStream:f,sliceSerialize:h,now:g,defineSkip:m,write:d};let u=e.tokenize.call(c,l);return e.resolveAll&&o.push(e),c;function d(N){return s=cm(s,N),v(),s[s.length-1]!==null?[]:(L(e,0),c.events=vbe(o,c.events,c),c.events)}function h(N,P){return egn(f(N),P)}function f(N){return Jpn(s,N)}function g(){const{line:N,column:P,offset:M,_index:B,_bufferIndex:F}=i;return{line:N,column:P,offset:M,_index:B,_bufferIndex:F}}function m(N){r[N.line]=N.column,A()}function v(){let N;for(;i._index<s.length;){const P=s[i._index];if(typeof P=="string")for(N=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===N&&i._bufferIndex<P.length;)_(P.charCodeAt(i._bufferIndex));else _(P)}}function _(N){u=u(N)}function b(N){Gr(N)?(i.line++,i.column=1,i.offset+=N===-3?2:1,A()):N!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=N}function y(N,P){const M=P||{};return M.type=N,M.start=g(),c.events.push(["enter",M,c]),a.push(M),M}function C(N){const P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function E(N,P){L(N,P.from)}function x(N,P){P.restore()}function k(N,P){return M;function M(B,F,U){let H,W,q,V;return Array.isArray(B)?oe(B):"tokenize"in B?oe([B]):re(B);function re(Ye){return ye;function ye(He){const Pe=He!==null&&Ye[He],Ge=He!==null&&Ye.null,Fe=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return oe(Fe)(He)}}function oe(Ye){return H=Ye,W=0,Ye.length===0?U:Q(Ye[W])}function Q(Ye){return ye;function ye(He){return V=D(),q=Ye,Ye.partial||(c.currentConstruct=Ye),Ye.name&&c.parser.constructs.disable.null.includes(Ye.name)?Ve():Ye.tokenize.call(P?Object.assign(Object.create(c),P):c,l,Ne,Ve)(He)}}function Ne(Ye){return N(q,V),F}function Ve(Ye){return V.restore(),++W<H.length?Q(H[W]):U}}}function L(N,P){N.resolveAll&&!o.includes(N)&&o.push(N),N.resolve&&v1(c.events,P,c.events.length-P,N.resolve(c.events.slice(P),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function D(){const N=g(),P=c.previous,M=c.currentConstruct,B=c.events.length,F=Array.from(a);return{restore:U,from:B};function U(){i=N,c.previous=P,c.currentConstruct=M,c.events.length=B,a=F,A()}}function A(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function Jpn(n,e){const t=e.start._index,i=e.start._bufferIndex,r=e.end._index,o=e.end._bufferIndex;let s;if(t===r)s=[n[t].slice(i,o)];else{if(s=n.slice(t,r),i>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(i):s.shift()}o>0&&s.push(n[r].slice(0,o))}return s}function egn(n,e){let t=-1;const i=[];let r;for(;++t<n.length;){const o=n[t];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
`;break}case-3:{s=`\r
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&r)continue;s=" ";break}default:s=String.fromCharCode(o)}r=o===-2,i.push(s)}return i.join("")}const tgn={42:gf,43:gf,45:gf,48:gf,49:gf,50:gf,51:gf,52:gf,53:gf,54:gf,55:gf,56:gf,57:gf,62:BKe},ngn={91:ipn},ign={[-2]:bee,[-1]:bee,32:bee},rgn={35:cpn,42:M$,45:[CAe,M$],60:fpn,61:CAe,95:M$,96:bAe,126:bAe},ogn={38:VKe,92:$Ke},sgn={[-5]:yee,[-4]:yee,[-3]:yee,33:Apn,38:VKe,42:kae,60:[Nfn,ypn],91:Npn,92:[apn,$Ke],93:bbe,95:kae,96:qfn},agn={null:[kae,Kpn]},lgn={null:[42,95]},cgn={null:[]},ugn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:lgn,contentInitial:ngn,disable:cgn,document:tgn,flow:rgn,flowInitial:ign,insideSpan:agn,string:ogn,text:sgn},Symbol.toStringTag,{value:"Module"}));function dgn(n){const t=vfn([ugn,...(n||{}).extensions||[]]),i={defined:[],lazy:{},constructs:t,content:r(Tfn),document:r(Ifn),flow:r(qpn),string:r(Ypn),text:r(Qpn)};return i;function r(o){return s;function s(a){return Zpn(i,o,a)}}}function hgn(n){for(;!HKe(n););return n}const wAe=/[\0\t\n\r]/g;function fgn(){let n=1,e="",t=!0,i;return r;function r(o,s,a){const l=[];let c,u,d,h,f;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,e="",t&&(o.charCodeAt(0)===65279&&d++,t=void 0);d<o.length;){if(wAe.lastIndex=d,c=wAe.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){e=o.slice(d);break}if(f===10&&d===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),d<h&&(l.push(o.slice(d,h)),n+=h-d),f){case 0:{l.push(65533),n++;break}case 9:{for(u=Math.ceil(n/4)*4,l.push(-2);n++<u;)l.push(-1);break}case 10:{l.push(-4),n=1;break}default:i=!0,n=1}d=h+1}return a&&(i&&l.push(-5),e&&l.push(e),l.push(null)),l}}const pgn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ggn(n){return n.replace(pgn,mgn)}function mgn(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const r=t.charCodeAt(1),o=r===120||r===88;return FKe(t.slice(o?2:1),o?16:10)}return _be(t)||n}const GKe={}.hasOwnProperty;function _gn(n,e,t){return typeof e!="string"&&(t=e,e=void 0),vgn(t)(hgn(dgn(t).document().write(fgn()(n,e,!0))))}function vgn(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Lt),autolinkProtocol:D,autolinkEmail:D,atxHeading:o(Yt),blockQuote:o(Ge),characterEscape:D,characterReference:D,codeFenced:o(Fe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Fe,s),codeText:o(bt,s),codeTextData:D,data:D,codeFlowValue:D,definition:o(Mt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ft),hardBreakEscape:o(ln),hardBreakTrailing:o(ln),htmlFlow:o(Et,s),htmlFlowData:D,htmlText:o(Et,s),htmlTextData:D,image:o(mt),label:s,link:o(Lt),listItem:o(Te),listItemValue:h,listOrdered:o(be,d),listUnordered:o(be),paragraph:o(se),reference:Q,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Yt),strong:o(Y),thematicBreak:o(le)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:Pe,autolinkProtocol:He,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:Ve,characterReferenceMarkerNumeric:Ve,characterReferenceValue:Ye,characterReference:ye,codeFenced:l(v),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:l(_),codeText:l(F),codeTextData:A,data:A,definition:l(),definitionDestinationString:C,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(P),hardBreakTrailing:l(P),htmlFlow:l(M),htmlFlowData:A,htmlText:l(B),htmlTextData:A,image:l(H),label:q,labelText:W,lineEnding:N,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ne,resourceDestinationString:V,resourceTitleString:re,resource:oe,setextHeading:l(L),setextHeadingLineSequence:k,setextHeadingText:x,strong:l(),thematicBreak:l()}};KKe(e,(n||{}).mdastExtensions||[]);const t={};return i;function i(te){let me={type:"root",children:[]};const Me={stack:[me],tokenStack:[],config:e,enter:a,exit:c,buffer:s,resume:u,data:t},rt=[];let It=-1;for(;++It<te.length;)if(te[It][1].type==="listOrdered"||te[It][1].type==="listUnordered")if(te[It][0]==="enter")rt.push(It);else{const Qt=rt.pop();It=r(te,Qt,It)}for(It=-1;++It<te.length;){const Qt=e[te[It][0]];GKe.call(Qt,te[It][1].type)&&Qt[te[It][1].type].call(Object.assign({sliceSerialize:te[It][2].sliceSerialize},Me),te[It][1])}if(Me.tokenStack.length>0){const Qt=Me.tokenStack[Me.tokenStack.length-1];(Qt[1]||SAe).call(Me,void 0,Qt[0])}for(me.position={start:oC(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:oC(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},It=-1;++It<e.transforms.length;)me=e.transforms[It](me)||me;return me}function r(te,me,Me){let rt=me-1,It=-1,Qt=!1,pe,We,ne,Se;for(;++rt<=Me;){const Ie=te[rt];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?It++:It--,Se=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(pe&&!Se&&!It&&!ne&&(ne=rt),Se=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Se=void 0}if(!It&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||It===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(pe){let Ke=rt;for(We=void 0;Ke--;){const Je=te[Ke];if(Je[1].type==="lineEnding"||Je[1].type==="lineEndingBlank"){if(Je[0]==="exit")continue;We&&(te[We][1].type="lineEndingBlank",Qt=!0),Je[1].type="lineEnding",We=Ke}else if(!(Je[1].type==="linePrefix"||Je[1].type==="blockQuotePrefix"||Je[1].type==="blockQuotePrefixWhitespace"||Je[1].type==="blockQuoteMarker"||Je[1].type==="listItemIndent"))break}ne&&(!We||ne<We)&&(pe._spread=!0),pe.end=Object.assign({},We?te[We][1].start:Ie[1].end),te.splice(We||rt,0,["exit",pe,Ie[2]]),rt++,Me++}if(Ie[1].type==="listItemPrefix"){const Ke={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};pe=Ke,te.splice(rt,0,["enter",Ke,Ie[2]]),rt++,Me++,ne=void 0,Se=!0}}}return te[me][1]._spread=Qt,Me}function o(te,me){return Me;function Me(rt){a.call(this,te(rt),rt),me&&me.call(this,rt)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(te,me,Me){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([me,Me]),te.position={start:oC(me.start),end:void 0}}function l(te){return me;function me(Me){te&&te.call(this,Me),c.call(this,Me)}}function c(te,me){const Me=this.stack.pop(),rt=this.tokenStack.pop();if(rt)rt[0].type!==te.type&&(me?me.call(this,te,rt[0]):(rt[1]||SAe).call(this,te,rt[0]));else throw new Error("Cannot close `"+te.type+"` ("+bM({start:te.start,end:te.end})+"): its not open");Me.position.end=oC(te.end)}function u(){return mfn(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(te){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function f(){const te=this.resume(),me=this.stack[this.stack.length-1];me.lang=te}function g(){const te=this.resume(),me=this.stack[this.stack.length-1];me.meta=te}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te.replace(/(\r?\n|\r)$/g,"")}function b(te){const me=this.resume(),Me=this.stack[this.stack.length-1];Me.label=me,Me.identifier=GL(this.sliceSerialize(te)).toLowerCase()}function y(){const te=this.resume(),me=this.stack[this.stack.length-1];me.title=te}function C(){const te=this.resume(),me=this.stack[this.stack.length-1];me.url=te}function E(te){const me=this.stack[this.stack.length-1];if(!me.depth){const Me=this.sliceSerialize(te).length;me.depth=Me}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function k(te){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function D(te){const Me=this.stack[this.stack.length-1].children;let rt=Me[Me.length-1];(!rt||rt.type!=="text")&&(rt=X(),rt.position={start:oC(te.start),end:void 0},Me.push(rt)),this.stack.push(rt)}function A(te){const me=this.stack.pop();me.value+=this.sliceSerialize(te),me.position.end=oC(te.end)}function N(te){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=me.children[me.children.length-1];Me.position.end=oC(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(D.call(this,te),A.call(this,te))}function P(){this.data.atHardBreak=!0}function M(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function B(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function F(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function U(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=me,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function H(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=me,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function W(te){const me=this.sliceSerialize(te),Me=this.stack[this.stack.length-2];Me.label=ggn(me),Me.identifier=GL(me).toLowerCase()}function q(){const te=this.stack[this.stack.length-1],me=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const rt=te.children;Me.children=rt}else Me.alt=me}function V(){const te=this.resume(),me=this.stack[this.stack.length-1];me.url=te}function re(){const te=this.resume(),me=this.stack[this.stack.length-1];me.title=te}function oe(){this.data.inReference=void 0}function Q(){this.data.referenceType="collapsed"}function Ne(te){const me=this.resume(),Me=this.stack[this.stack.length-1];Me.label=me,Me.identifier=GL(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function Ve(te){this.data.characterReferenceType=te.type}function Ye(te){const me=this.sliceSerialize(te),Me=this.data.characterReferenceType;let rt;Me?(rt=FKe(me,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):rt=_be(me);const It=this.stack[this.stack.length-1];It.value+=rt}function ye(te){const me=this.stack.pop();me.position.end=oC(te.end)}function He(te){A.call(this,te);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(te)}function Pe(te){A.call(this,te);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(te)}function Ge(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function bt(){return{type:"inlineCode",value:""}}function Mt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ft(){return{type:"emphasis",children:[]}}function Yt(){return{type:"heading",depth:0,children:[]}}function ln(){return{type:"break"}}function Et(){return{type:"html",value:""}}function mt(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function be(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Te(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function se(){return{type:"paragraph",children:[]}}function Y(){return{type:"strong",children:[]}}function X(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function oC(n){return{line:n.line,column:n.column,offset:n.offset}}function KKe(n,e){let t=-1;for(;++t<e.length;){const i=e[t];Array.isArray(i)?KKe(n,i):bgn(n,i)}}function bgn(n,e){let t;for(t in e)if(GKe.call(e,t))switch(t){case"canContainEols":{const i=e[t];i&&n[t].push(...i);break}case"transforms":{const i=e[t];i&&n[t].push(...i);break}case"enter":case"exit":{const i=e[t];i&&Object.assign(n[t],i);break}}}function SAe(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+bM({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+bM({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+bM({start:e.start,end:e.end})+") is still open")}function ygn(n){const e=this;e.parser=t;function t(i){return _gn(i,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Cgn(n,e){const t={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(e),!0)};return n.patch(e,t),n.applyData(e,t)}function wgn(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:`
`}]}function Sgn(n,e){const t=e.value?e.value+`
`:"",i={};e.lang&&(i.className=["language-"+e.lang]);let r={type:"element",tagName:"code",properties:i,children:[{type:"text",value:t}]};return e.meta&&(r.data={meta:e.meta}),n.patch(e,r),r=n.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},n.patch(e,r),r}function Egn(n,e){const t={type:"element",tagName:"del",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function xgn(n,e){const t={type:"element",tagName:"em",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Tgn(n,e){const t=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=KR(i.toLowerCase()),o=n.footnoteOrder.indexOf(i);let s,a=n.footnoteCounts.get(i);a===void 0?(a=0,n.footnoteOrder.push(i),s=n.footnoteOrder.length):s=o+1,a+=1,n.footnoteCounts.set(i,a);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+r,id:t+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};n.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return n.patch(e,c),n.applyData(e,c)}function kgn(n,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Ign(n,e){if(n.options.allowDangerousHtml){const t={type:"raw",value:e.value};return n.patch(e,t),n.applyData(e,t)}}function YKe(n,e){const t=e.referenceType;let i="]";if(t==="collapsed"?i+="[]":t==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=n.all(e),o=r[0];o&&o.type==="text"?o.value="["+o.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&s.type==="text"?s.value+=i:r.push({type:"text",value:i}),r}function Lgn(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return YKe(n,e);const r={src:KR(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"img",properties:r,children:[]};return n.patch(e,o),n.applyData(e,o)}function Dgn(n,e){const t={src:KR(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"img",properties:t,children:[]};return n.patch(e,i),n.applyData(e,i)}function Agn(n,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};n.patch(e,t);const i={type:"element",tagName:"code",properties:{},children:[t]};return n.patch(e,i),n.applyData(e,i)}function Rgn(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return YKe(n,e);const r={href:KR(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"a",properties:r,children:n.all(e)};return n.patch(e,o),n.applyData(e,o)}function Ngn(n,e){const t={href:KR(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"a",properties:t,children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function Ogn(n,e,t){const i=n.all(e),r=t?Pgn(t):QKe(e),o={},s=[];if(typeof e.checked=="boolean"){const u=i[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},i.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<i.length;){const u=i[a];(r||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!r?s.push(...u.children):s.push(u)}const l=i[i.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:o,children:s};return n.patch(e,c),n.applyData(e,c)}function Pgn(n){let e=!1;if(n.type==="list"){e=n.spread||!1;const t=n.children;let i=-1;for(;!e&&++i<t.length;)e=QKe(t[i])}return e}function QKe(n){const e=n.spread;return e??n.children.length>1}function Mgn(n,e){const t={},i=n.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++r<i.length;){const s=i[r];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:n.wrap(i,!0)};return n.patch(e,o),n.applyData(e,o)}function Fgn(n,e){const t={type:"element",tagName:"p",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Bgn(n,e){const t={type:"root",children:n.wrap(n.all(e))};return n.patch(e,t),n.applyData(e,t)}function $gn(n,e){const t={type:"element",tagName:"strong",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Vgn(n,e){const t=n.all(e),i=t.shift(),r=[];if(i){const s={type:"element",tagName:"thead",properties:{},children:n.wrap([i],!0)};n.patch(e.children[0],s),r.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:n.wrap(t,!0)},a=T0(e.children[1]),l=VG(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),r.push(s)}const o={type:"element",tagName:"table",properties:{},children:n.wrap(r,!0)};return n.patch(e,o),n.applyData(e,o)}function Hgn(n,e,t){const i=t?t.children:void 0,o=(i?i.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,a=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<a;){const d=e.children[l],h={},f=s?s[l]:void 0;f&&(h.align=f);let g={type:"element",tagName:o,properties:h,children:[]};d&&(g.children=n.all(d),n.patch(d,g),g=n.applyData(d,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:n.wrap(c,!0)};return n.patch(e,u),n.applyData(e,u)}function Wgn(n,e){const t={type:"element",tagName:"td",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}const EAe=9,xAe=32;function zgn(n){const e=String(n),t=/\r?\n|\r/g;let i=t.exec(e),r=0;const o=[];for(;i;)o.push(TAe(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return o.push(TAe(e.slice(r),r>0,!1)),o.join("")}function TAe(n,e,t){let i=0,r=n.length;if(e){let o=n.codePointAt(i);for(;o===EAe||o===xAe;)i++,o=n.codePointAt(i)}if(t){let o=n.codePointAt(r-1);for(;o===EAe||o===xAe;)r--,o=n.codePointAt(r-1)}return r>i?n.slice(i,r):""}function Ugn(n,e){const t={type:"text",value:zgn(String(e.value))};return n.patch(e,t),n.applyData(e,t)}function jgn(n,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(e,t),n.applyData(e,t)}const qgn={blockquote:Cgn,break:wgn,code:Sgn,delete:Egn,emphasis:xgn,footnoteReference:Tgn,heading:kgn,html:Ign,imageReference:Lgn,image:Dgn,inlineCode:Agn,linkReference:Rgn,link:Ngn,listItem:Ogn,list:Mgn,paragraph:Fgn,root:Bgn,strong:$gn,table:Vgn,tableCell:Wgn,tableRow:Hgn,text:Ugn,thematicBreak:jgn,toml:p9,yaml:p9,definition:p9,footnoteDefinition:p9};function p9(){}const XKe=-1,WG=0,OW=1,PW=2,ybe=3,Cbe=4,wbe=5,Sbe=6,ZKe=7,JKe=8,kAe=typeof self=="object"?self:globalThis,Ggn=(n,e)=>{const t=(r,o)=>(n.set(o,r),r),i=r=>{if(n.has(r))return n.get(r);const[o,s]=e[r];switch(o){case WG:case XKe:return t(s,r);case OW:{const a=t([],r);for(const l of s)a.push(i(l));return a}case PW:{const a=t({},r);for(const[l,c]of s)a[i(l)]=i(c);return a}case ybe:return t(new Date(s),r);case Cbe:{const{source:a,flags:l}=s;return t(new RegExp(a,l),r)}case wbe:{const a=t(new Map,r);for(const[l,c]of s)a.set(i(l),i(c));return a}case Sbe:{const a=t(new Set,r);for(const l of s)a.add(i(l));return a}case ZKe:{const{name:a,message:l}=s;return t(new kAe[a](l),r)}case JKe:return t(BigInt(s),r);case"BigInt":return t(Object(BigInt(s)),r)}return t(new kAe[o](s),r)};return i},IAe=n=>Ggn(new Map,n)(0),KI="",{toString:Kgn}={},{keys:Ygn}=Object,bO=n=>{const e=typeof n;if(e!=="object"||!n)return[WG,e];const t=Kgn.call(n).slice(8,-1);switch(t){case"Array":return[OW,KI];case"Object":return[PW,KI];case"Date":return[ybe,KI];case"RegExp":return[Cbe,KI];case"Map":return[wbe,KI];case"Set":return[Sbe,KI]}return t.includes("Array")?[OW,t]:t.includes("Error")?[ZKe,t]:[PW,t]},g9=([n,e])=>n===WG&&(e==="function"||e==="symbol"),Qgn=(n,e,t,i)=>{const r=(s,a)=>{const l=i.push(s)-1;return t.set(a,l),l},o=s=>{if(t.has(s))return t.get(s);let[a,l]=bO(s);switch(a){case WG:{let u=s;switch(l){case"bigint":a=JKe,u=s.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return r([XKe],s)}return r([a,u],s)}case OW:{if(l)return r([l,[...s]],s);const u=[],d=r([a,u],s);for(const h of s)u.push(o(h));return d}case PW:{if(l)switch(l){case"BigInt":return r([l,s.toString()],s);case"Boolean":case"Number":case"String":return r([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const u=[],d=r([a,u],s);for(const h of Ygn(s))(n||!g9(bO(s[h])))&&u.push([o(h),o(s[h])]);return d}case ybe:return r([a,s.toISOString()],s);case Cbe:{const{source:u,flags:d}=s;return r([a,{source:u,flags:d}],s)}case wbe:{const u=[],d=r([a,u],s);for(const[h,f]of s)(n||!(g9(bO(h))||g9(bO(f))))&&u.push([o(h),o(f)]);return d}case Sbe:{const u=[],d=r([a,u],s);for(const h of s)(n||!g9(bO(h)))&&u.push(o(h));return d}}const{message:c}=s;return r([a,{name:l,message:c}],s)};return o},LAe=(n,{json:e,lossy:t}={})=>{const i=[];return Qgn(!(e||t),!!e,new Map,i)(n),i},dA=typeof structuredClone=="function"?(n,e)=>e&&("json"in e||"lossy"in e)?IAe(LAe(n,e)):structuredClone(n):(n,e)=>IAe(LAe(n,e));function Xgn(n,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function Zgn(n,e){return"Back to reference "+(n+1)+(e>1?"-"+e:"")}function Jgn(n){const e=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",t=n.options.footnoteBackContent||Xgn,i=n.options.footnoteBackLabel||Zgn,r=n.options.footnoteLabel||"Footnotes",o=n.options.footnoteLabelTagName||"h2",s=n.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<n.footnoteOrder.length;){const c=n.footnoteById.get(n.footnoteOrder[l]);if(!c)continue;const u=n.all(c),d=String(c.identifier).toUpperCase(),h=KR(d.toLowerCase());let f=0;const g=[],m=n.footnoteCounts.get(d);for(;m!==void 0&&++f<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof t=="string"?t:t(l,f);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(l,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else u.push(...g);const _={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:n.wrap(u,!0)};n.patch(c,_),a.push(_)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...dA(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(a,!0)},{type:"text",value:`
`}]}}const eYe=function(n){if(n==null)return imn;if(typeof n=="function")return zG(n);if(typeof n=="object")return Array.isArray(n)?emn(n):tmn(n);if(typeof n=="string")return nmn(n);throw new Error("Expected function, string, or object as test")};function emn(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=eYe(n[t]);return zG(i);function i(...r){let o=-1;for(;++o<e.length;)if(e[o].apply(this,r))return!0;return!1}}function tmn(n){const e=n;return zG(t);function t(i){const r=i;let o;for(o in n)if(r[o]!==e[o])return!1;return!0}}function nmn(n){return zG(e);function e(t){return t&&t.type===n}}function zG(n){return e;function e(t,i,r){return!!(rmn(t)&&n.call(this,t,typeof i=="number"?i:void 0,r||void 0))}}function imn(){return!0}function rmn(n){return n!==null&&typeof n=="object"&&"type"in n}const tYe=[],omn=!0,DAe=!1,smn="skip";function amn(n,e,t,i){let r;typeof e=="function"&&typeof t!="function"?(i=t,t=e):r=e;const o=eYe(r),s=i?-1:1;a(n,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=tYe,g,m,v;if((!e||o(l,c,u[u.length-1]||void 0))&&(f=lmn(t(l,u)),f[0]===DAe))return f;if("children"in l&&l.children){const _=l;if(_.children&&f[0]!==smn)for(m=(i?_.children.length:-1)+s,v=u.concat(_);m>-1&&m<_.children.length;){const b=_.children[m];if(g=a(b,m,v)(),g[0]===DAe)return g;m=typeof g[1]=="number"?g[1]:m+s}}return f}}}function lmn(n){return Array.isArray(n)?n:typeof n=="number"?[omn,n]:n==null?tYe:[n]}function Ebe(n,e,t,i){let r,o,s;typeof e=="function"&&typeof t!="function"?(o=void 0,s=e,r=t):(o=e,s=t,r=i),amn(n,o,a,r);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const Iae={}.hasOwnProperty,cmn={};function umn(n,e){const t=e||cmn,i=new Map,r=new Map,o=new Map,s={...qgn,...t.handlers},a={all:c,applyData:hmn,definitionById:i,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:t,patch:dmn,wrap:pmn};return Ebe(n,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?i:r,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,f=a.handlers[h];if(Iae.call(a.handlers,h)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:m,...v}=u,_=dA(v);return _.children=a.all(u),_}return dA(u)}return(a.options.unknownHandler||fmn)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const g=a.one(h[f],u);if(g){if(f&&h[f-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=AAe(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=AAe(m.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function dmn(n,e){n.position&&(e.position=qhn(n))}function hmn(n,e){let t=e;if(n&&n.data){const i=n.data.hName,r=n.data.hChildren,o=n.data.hProperties;if(typeof i=="string")if(t.type==="element")t.tagName=i;else{const s="children"in t?t.children:[t];t={type:"element",tagName:i,properties:{},children:s}}t.type==="element"&&o&&Object.assign(t.properties,dA(o)),"children"in t&&t.children&&r!==null&&r!==void 0&&(t.children=r)}return t}function fmn(n,e){const t=e.data||{},i="value"in e&&!(Iae.call(t,"hProperties")||Iae.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function pmn(n,e){const t=[];let i=-1;for(e&&t.push({type:"text",value:`
`});++i<n.length;)i&&t.push({type:"text",value:`
`}),t.push(n[i]);return e&&n.length>0&&t.push({type:"text",value:`
`}),t}function AAe(n){let e=0,t=n.charCodeAt(e);for(;t===9||t===32;)e++,t=n.charCodeAt(e);return n.slice(e)}function RAe(n,e){const t=umn(n,e),i=t.one(n,void 0),r=Jgn(t),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&o.children.push({type:"text",value:`
`},r),o}function gmn(n,e){return n&&"run"in n?async function(t,i){const r=RAe(t,{file:i,...e});await n.run(r,i)}:function(t,i){return RAe(t,{file:i,...n||e})}}function NAe(n){if(n)throw n}var F$=Object.prototype.hasOwnProperty,nYe=Object.prototype.toString,OAe=Object.defineProperty,PAe=Object.getOwnPropertyDescriptor,MAe=function(e){return typeof Array.isArray=="function"?Array.isArray(e):nYe.call(e)==="[object Array]"},FAe=function(e){if(!e||nYe.call(e)!=="[object Object]")return!1;var t=F$.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&F$.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!i)return!1;var r;for(r in e);return typeof r>"u"||F$.call(e,r)},BAe=function(e,t){OAe&&t.name==="__proto__"?OAe(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},$Ae=function(e,t){if(t==="__proto__")if(F$.call(e,t)){if(PAe)return PAe(e,t).value}else return;return e[t]},mmn=function n(){var e,t,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(e=arguments[l],e!=null)for(t in e)i=$Ae(a,t),r=$Ae(e,t),a!==r&&(u&&r&&(FAe(r)||(o=MAe(r)))?(o?(o=!1,s=i&&MAe(i)?i:[]):s=i&&FAe(i)?i:{},BAe(a,{name:t,newValue:n(u,s,r)})):typeof r<"u"&&BAe(a,{name:t,newValue:r}));return a};const Cee=nl(mmn);function Lae(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function _mn(){const n=[],e={run:t,use:i};return e;function t(...r){let o=-1;const s=r.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...r);function a(l,...c){const u=n[++o];let d=-1;if(l){s(l);return}for(;++d<r.length;)(c[d]===null||c[d]===void 0)&&(c[d]=r[d]);r=c,u?vmn(u,a)(...c):s(null,...c)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return n.push(r),e}}function vmn(n,e){let t;return i;function i(...s){const a=n.length>s.length;let l;a&&s.push(r);try{l=n.apply(this,s)}catch(c){const u=c;if(a&&t)throw u;return r(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,r):l instanceof Error?r(l):o(l))}function r(s,...a){t||(t=!0,e(s,...a))}function o(s){r(null,s)}}const Qv={basename:bmn,dirname:ymn,extname:Cmn,join:wmn,sep:"/"};function bmn(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');h6(n);let t=0,i=-1,r=n.length,o;if(e===void 0||e.length===0||e.length>n.length){for(;r--;)if(n.codePointAt(r)===47){if(o){t=r+1;break}}else i<0&&(o=!0,i=r+1);return i<0?"":n.slice(t,i)}if(e===n)return"";let s=-1,a=e.length-1;for(;r--;)if(n.codePointAt(r)===47){if(o){t=r+1;break}}else s<0&&(o=!0,s=r+1),a>-1&&(n.codePointAt(r)===e.codePointAt(a--)?a<0&&(i=r):(a=-1,i=s));return t===i?i=s:i<0&&(i=n.length),n.slice(t,i)}function ymn(n){if(h6(n),n.length===0)return".";let e=-1,t=n.length,i;for(;--t;)if(n.codePointAt(t)===47){if(i){e=t;break}}else i||(i=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function Cmn(n){h6(n);let e=n.length,t=-1,i=0,r=-1,o=0,s;for(;e--;){const a=n.codePointAt(e);if(a===47){if(s){i=e+1;break}continue}t<0&&(s=!0,t=e+1),a===46?r<0?r=e:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||t<0||o===0||o===1&&r===t-1&&r===i+1?"":n.slice(r,t)}function wmn(...n){let e=-1,t;for(;++e<n.length;)h6(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":Smn(t)}function Smn(n){h6(n);const e=n.codePointAt(0)===47;let t=Emn(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function Emn(n,e){let t="",i=0,r=-1,o=0,s=-1,a,l;for(;++s<=n.length;){if(s<n.length)a=n.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(r===s-1||o===1))if(r!==s-1&&o===2){if(t.length<2||i!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",i=0):(t=t.slice(0,l),i=t.length-1-t.lastIndexOf("/")),r=s,o=0;continue}}else if(t.length>0){t="",i=0,r=s,o=0;continue}}e&&(t=t.length>0?t+"/..":"..",i=2)}else t.length>0?t+="/"+n.slice(r+1,s):t=n.slice(r+1,s),i=s-r-1;r=s,o=0}else a===46&&o>-1?o++:o=-1}return t}function h6(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const xmn={cwd:Tmn};function Tmn(){return"/"}function Dae(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function kmn(n){if(typeof n=="string")n=new URL(n);else if(!Dae(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Imn(n)}function Imn(n){if(n.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const i=e.codePointAt(t+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const wee=["history","path","basename","stem","extname","dirname"];class iYe{constructor(e){let t;e?Dae(e)?t={path:e}:typeof e=="string"||Lmn(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":xmn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<wee.length;){const o=wee[i];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let r;for(r in t)wee.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path=="string"?Qv.basename(this.path):void 0}set basename(e){Eee(e,"basename"),See(e,"basename"),this.path=Qv.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Qv.dirname(this.path):void 0}set dirname(e){VAe(this.basename,"dirname"),this.path=Qv.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Qv.extname(this.path):void 0}set extname(e){if(See(e,"extname"),VAe(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Qv.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Dae(e)&&(e=kmn(e)),Eee(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Qv.basename(this.path,this.extname):void 0}set stem(e){Eee(e,"stem"),See(e,"stem"),this.path=Qv.join(this.dirname||"",e+(this.extname||""))}fail(e,t,i){const r=this.message(e,t,i);throw r.fatal=!0,r}info(e,t,i){const r=this.message(e,t,i);return r.fatal=void 0,r}message(e,t,i){const r=new mh(e,t,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function See(n,e){if(n&&n.includes(Qv.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Qv.sep+"`")}function Eee(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function VAe(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Lmn(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Dmn=function(n){const i=this.constructor.prototype,r=i[n],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,i),o},Amn={}.hasOwnProperty;class xbe extends Dmn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_mn()}copy(){const e=new xbe;let t=-1;for(;++t<this.attachers.length;){const i=this.attachers[t];e.use(...i)}return e.data(Cee(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(kee("data",this.frozen),this.namespace[e]=t,this):Amn.call(this.namespace,e)&&this.namespace[e]||void 0:e?(kee("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=t.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=m9(e),i=this.parser||this.Parser;return xee("parse",i),i(String(t),t)}process(e,t){const i=this;return this.freeze(),xee("process",this.parser||this.Parser),Tee("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(o,s){const a=m9(e),l=i.parse(a);i.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,g=i.stringify(f,h);Omn(g)?h.value=g:h.result=g,c(u,h)});function c(u,d){u||!d?s(u):o?o(d):t(void 0,d)}}}processSync(e){let t=!1,i;return this.freeze(),xee("processSync",this.parser||this.Parser),Tee("processSync",this.compiler||this.Compiler),this.process(e,r),WAe("processSync","process",t),i;function r(o,s){t=!0,NAe(o),i=s}}run(e,t,i){HAe(e),this.freeze();const r=this.transformers;return!i&&typeof t=="function"&&(i=t,t=void 0),i?o(void 0,i):new Promise(o);function o(s,a){const l=m9(t);r.run(e,l,c);function c(u,d,h){const f=d||e;u?a(u):s?s(f):i(void 0,f,h)}}}runSync(e,t){let i=!1,r;return this.run(e,t,o),WAe("runSync","run",i),r;function o(s,a){NAe(s),r=a,i=!0}}stringify(e,t){this.freeze();const i=m9(t),r=this.compiler||this.Compiler;return Tee("stringify",r),HAe(e),r(e,i)}use(e,...t){const i=this.attachers,r=this.namespace;if(kee("use",this.frozen),e!=null)if(typeof e=="function")l(e,t);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(r.settings=Cee(!0,r.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<i.length;)if(i[d][0]===c){h=d;break}if(h===-1)i.push([c,...u]);else if(u.length>0){let[f,...g]=u;const m=i[h][1];Lae(m)&&Lae(f)&&(f=Cee(!0,m,f)),i[h]=[c,f,...g]}}}}const Rmn=new xbe().freeze();function xee(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Tee(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function kee(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function HAe(n){if(!Lae(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function WAe(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function m9(n){return Nmn(n)?n:new iYe(n)}function Nmn(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Omn(n){return typeof n=="string"||Pmn(n)}function Pmn(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Mmn="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",zAe=[],UAe={allowDangerousHtml:!0},Fmn=/^(https?|ircs?|mailto|xmpp)$/i,Bmn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $mn(n){const e=n.allowedElements,t=n.allowElement,i=n.children||"",r=n.className,o=n.components,s=n.disallowedElements,a=n.rehypePlugins||zAe,l=n.remarkPlugins||zAe,c=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...UAe}:UAe,u=n.skipHtml,d=n.unwrapDisallowed,h=n.urlTransform||Vmn,f=Rmn().use(ygn).use(l).use(gmn,c).use(a),g=new iYe;typeof i=="string"&&(g.value=i);for(const b of Bmn)Object.hasOwn(n,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Mmn+b.id,void 0);const m=f.parse(g);let v=f.runSync(m,g);return r&&(v={type:"element",tagName:"div",properties:{className:r},children:v.type==="root"?v.children:[v]}),Ebe(v,_),Zhn(v,{Fragment:St,components:o,ignoreInvalidStyle:!0,jsx:p,jsxs:O,passKeys:!0,passNode:!0});function _(b,y,C){if(b.type==="raw"&&C&&typeof y=="number")return u?C.children.splice(y,1):C.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let E;for(E in vee)if(Object.hasOwn(vee,E)&&Object.hasOwn(b.properties,E)){const x=b.properties[E],k=vee[E];(k===null||k.includes(b.tagName))&&(b.properties[E]=h(String(x||""),E,b))}}if(b.type==="element"){let E=e?!e.includes(b.tagName):s?s.includes(b.tagName):!1;if(!E&&t&&typeof y=="number"&&(E=!t(b,y,C)),E&&C&&typeof y=="number")return d&&b.children?C.children.splice(y,1,...b.children):C.children.splice(y,1),y}}}function Vmn(n){const e=n.indexOf(":"),t=n.indexOf("?"),i=n.indexOf("#"),r=n.indexOf("/");return e<0||r>-1&&e>r||t>-1&&e>t||i>-1&&e>i||Fmn.test(n.slice(0,e))?n:""}const jAe=/[#.]/g;function Hmn(n,e){const t=n||"",i={};let r=0,o,s;for(;r<t.length;){jAe.lastIndex=r;const a=jAe.exec(t),l=t.slice(r,a?a.index:t.length);l&&(o?o==="#"?i.id=l:Array.isArray(i.className)?i.className.push(l):i.className=[l]:s=l,r+=l.length),a&&(o=a[0],r++)}return{type:"element",tagName:s||e||"div",properties:i,children:[]}}const Wmn=new Set(["button","menu","reset","submit"]),Aae={}.hasOwnProperty;function rYe(n,e,t){const i=t&&qmn(t);function r(o,s,...a){let l=-1,c;if(o==null){c={type:"root",children:[]};const u=s;a.unshift(u)}else if(c=Hmn(o,e),c.tagName=c.tagName.toLowerCase(),i&&Aae.call(i,c.tagName)&&(c.tagName=i[c.tagName]),zmn(s,c.tagName)){let u;for(u in s)Aae.call(s,u)&&Umn(n,c.properties,u,s[u])}else a.unshift(s);for(;++l<a.length;)Rae(c.children,a[l]);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return r}function zmn(n,e){return n==null||typeof n!="object"||Array.isArray(n)?!1:e==="input"||!n.type||typeof n.type!="string"?!0:"children"in n&&Array.isArray(n.children)?!1:e==="button"?Wmn.has(n.type.toLowerCase()):!("value"in n)}function Umn(n,e,t,i){const r=$G(n,t);let o=-1,s;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;s=i}else typeof i=="boolean"?s=i:typeof i=="string"?r.spaceSeparated?s=rAe(i):r.commaSeparated?s=JDe(i):r.commaOrSpaceSeparated?s=rAe(JDe(i).join(" ")):s=qAe(r,r.property,i):Array.isArray(i)?s=i.concat():s=r.property==="style"?jmn(i):String(i);if(Array.isArray(s)){const a=[];for(;++o<s.length;){const l=qAe(r,r.property,s[o]);a[o]=l}s=a}if(r.property==="className"&&Array.isArray(e.className)){const a=s;s=e.className.concat(a)}e[r.property]=s}}function Rae(n,e){let t=-1;if(e!=null)if(typeof e=="string"||typeof e=="number")n.push({type:"text",value:String(e)});else if(Array.isArray(e))for(;++t<e.length;)Rae(n,e[t]);else if(typeof e=="object"&&"type"in e)e.type==="root"?Rae(n,e.children):n.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function qAe(n,e,t){if(typeof t=="string"){if(n.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((n.boolean||n.overloadedBoolean)&&(t===""||p3(t)===p3(e)))return!0}return t}function jmn(n){const e=[];let t;for(t in n)Aae.call(n,t)&&e.push([t,n[t]].join(": "));return e.join("; ")}function qmn(n){const e={};let t=-1;for(;++t<n.length;)e[n[t].toLowerCase()]=n[t];return e}const Gmn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","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","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Kmn=rYe(d6,"div"),Ymn=rYe(rE,"g",Gmn);function Qmn(n){const e=String(n),t=[];return{toOffset:r,toPoint:i};function i(o){if(typeof o=="number"&&o>-1&&o<=e.length){let s=0;for(;;){let a=t[s];if(a===void 0){const l=GAe(e,t[s-1]);a=l===-1?e.length+1:l+1,t[s]=a}if(a>o)return{line:s+1,column:o-(s>0?t[s-1]:0)+1,offset:o};s++}}}function r(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;t.length<o.line;){const a=t[t.length-1],l=GAe(e,a),c=l===-1?e.length+1:l+1;if(a===c)break;t.push(c)}const s=(o.line>1?t[o.line-2]:0)+o.column-1;if(s<t[o.line-1])return s}}}function GAe(n,e){const t=n.indexOf("\r",e),i=n.indexOf(`
`,e);return i===-1?t:t===-1||t+1===i?i:t<i?t:i}const Vx={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},oYe={}.hasOwnProperty,Xmn=Object.prototype;function Zmn(n,e){const t=e||{};return Tbe({file:t.file||void 0,location:!1,schema:t.space==="svg"?rE:d6,verbose:t.verbose||!1},n)}function Tbe(n,e){let t;switch(e.nodeName){case"#comment":{const i=e;return t={type:"comment",value:i.data},B$(n,i,t),t}case"#document":case"#document-fragment":{const i=e,r="mode"in i?i.mode==="quirks"||i.mode==="limited-quirks":!1;if(t={type:"root",children:sYe(n,e.childNodes),data:{quirksMode:r}},n.file&&n.location){const o=String(n.file),s=Qmn(o),a=s.toPoint(0),l=s.toPoint(o.length);t.position={start:a,end:l}}return t}case"#documentType":{const i=e;return t={type:"doctype"},B$(n,i,t),t}case"#text":{const i=e;return t={type:"text",value:i.value},B$(n,i,t),t}default:return t=Jmn(n,e),t}}function sYe(n,e){let t=-1;const i=[];for(;++t<e.length;){const r=Tbe(n,e[t]);i.push(r)}return i}function Jmn(n,e){const t=n.schema;n.schema=e.namespaceURI===Vx.svg?rE:d6;let i=-1;const r={};for(;++i<e.attrs.length;){const a=e.attrs[i],l=(a.prefix?a.prefix+":":"")+a.name;oYe.call(Xmn,l)||(r[l]=a.value)}const s=(n.schema.space==="svg"?Ymn:Kmn)(e.tagName,r,sYe(n,e.childNodes));if(B$(n,e,s),s.tagName==="template"){const a=e,l=a.sourceCodeLocation,c=l&&l.startTag&&J2(l.startTag),u=l&&l.endTag&&J2(l.endTag),d=Tbe(n,a.content);c&&u&&n.file&&(d.position={start:c.end,end:u.start}),s.content=d}return n.schema=t,s}function B$(n,e,t){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&n.file){const i=e_n(n,t,e.sourceCodeLocation);i&&(n.location=!0,t.position=i)}}function e_n(n,e,t){const i=J2(t);if(e.type==="element"){const r=e.children[e.children.length-1];if(i&&!t.endTag&&r&&r.position&&r.position.end&&(i.end=Object.assign({},r.position.end)),n.verbose){const o={};let s;if(t.attrs)for(s in t.attrs)oYe.call(t.attrs,s)&&(o[$G(n.schema,s).property]=J2(t.attrs[s]));t.startTag;const a=J2(t.startTag),l=t.endTag?J2(t.endTag):void 0,c={opening:a};l&&(c.closing=l),c.properties=o,e.data={position:c}}}return i}function J2(n){const e=KAe({line:n.startLine,column:n.startCol,offset:n.startOffset}),t=KAe({line:n.endLine,column:n.endCol,offset:n.endOffset});return e||t?{start:e,end:t}:void 0}function KAe(n){return n.line&&n.column?n:void 0}const YAe={}.hasOwnProperty;function aYe(n,e){const t=e||{};function i(r,...o){let s=i.invalid;const a=i.handlers;if(r&&YAe.call(r,n)){const l=String(r[n]);s=YAe.call(a,l)?a[l]:i.unknown}if(s)return s.call(this,r,...o)}return i.handlers=t.handlers||{},i.invalid=t.invalid,i.unknown=t.unknown,i}const t_n={},n_n={}.hasOwnProperty,lYe=aYe("type",{handlers:{root:r_n,element:c_n,text:a_n,comment:l_n,doctype:s_n}});function i_n(n,e){const i=(e||t_n).space;return lYe(n,i==="svg"?rE:d6)}function r_n(n,e){const t={nodeName:"#document",mode:(n.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return t.childNodes=kbe(n.children,t,e),YR(n,t),t}function o_n(n,e){const t={nodeName:"#document-fragment",childNodes:[]};return t.childNodes=kbe(n.children,t,e),YR(n,t),t}function s_n(n){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return YR(n,e),e}function a_n(n){const e={nodeName:"#text",value:n.value,parentNode:null};return YR(n,e),e}function l_n(n){const e={nodeName:"#comment",data:n.value,parentNode:null};return YR(n,e),e}function c_n(n,e){const t=e;let i=t;n.type==="element"&&n.tagName.toLowerCase()==="svg"&&t.space==="html"&&(i=rE);const r=[];let o;if(n.properties){for(o in n.properties)if(o!=="children"&&n_n.call(n.properties,o)){const l=u_n(i,o,n.properties[o]);l&&r.push(l)}}const s=i.space,a={nodeName:n.tagName,tagName:n.tagName,attrs:r,namespaceURI:Vx[s],childNodes:[],parentNode:null};return a.childNodes=kbe(n.children,a,i),YR(n,a),n.tagName==="template"&&n.content&&(a.content=o_n(n.content,i)),a}function u_n(n,e,t){const i=$G(n,e);if(t===!1||t===null||t===void 0||typeof t=="number"&&Number.isNaN(t)||!t&&i.boolean)return;Array.isArray(t)&&(t=i.commaSeparated?yKe(t):LKe(t));const r={name:i.attribute,value:t===!0?"":String(t)};if(i.space&&i.space!=="html"&&i.space!=="svg"){const o=r.name.indexOf(":");o<0?r.prefix="":(r.name=r.name.slice(o+1),r.prefix=i.attribute.slice(0,o)),r.namespace=Vx[i.space]}return r}function kbe(n,e,t){let i=-1;const r=[];if(n)for(;++i<n.length;){const o=lYe(n[i],t);o.parentNode=e,r.push(o)}return r}function YR(n,e){const t=n.position;t&&t.start&&t.end&&(t.start.offset,t.end.offset,e.sourceCodeLocation={startLine:t.start.line,startCol:t.start.column,startOffset:t.start.offset,endLine:t.end.line,endCol:t.end.column,endOffset:t.end.offset})}const d_n=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],h_n=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),yl="<22>";var we;(function(n){n[n.EOF=-1]="EOF",n[n.NULL=0]="NULL",n[n.TABULATION=9]="TABULATION",n[n.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",n[n.LINE_FEED=10]="LINE_FEED",n[n.FORM_FEED=12]="FORM_FEED",n[n.SPACE=32]="SPACE",n[n.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",n[n.QUOTATION_MARK=34]="QUOTATION_MARK",n[n.NUMBER_SIGN=35]="NUMBER_SIGN",n[n.AMPERSAND=38]="AMPERSAND",n[n.APOSTROPHE=39]="APOSTROPHE",n[n.HYPHEN_MINUS=45]="HYPHEN_MINUS",n[n.SOLIDUS=47]="SOLIDUS",n[n.DIGIT_0=48]="DIGIT_0",n[n.DIGIT_9=57]="DIGIT_9",n[n.SEMICOLON=59]="SEMICOLON",n[n.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",n[n.EQUALS_SIGN=61]="EQUALS_SIGN",n[n.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",n[n.QUESTION_MARK=63]="QUESTION_MARK",n[n.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",n[n.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",n[n.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",n[n.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",n[n.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",n[n.GRAVE_ACCENT=96]="GRAVE_ACCENT",n[n.LATIN_SMALL_A=97]="LATIN_SMALL_A",n[n.LATIN_SMALL_F=102]="LATIN_SMALL_F",n[n.LATIN_SMALL_X=120]="LATIN_SMALL_X",n[n.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",n[n.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER"})(we=we||(we={}));const df={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function cYe(n){return n>=55296&&n<=57343}function f_n(n){return n>=56320&&n<=57343}function p_n(n,e){return(n-55296)*1024+9216+e}function uYe(n){return n!==32&&n!==10&&n!==13&&n!==9&&n!==12&&n>=1&&n<=31||n>=127&&n<=159}function dYe(n){return n>=64976&&n<=65007||h_n.has(n)}var Ut;(function(n){n.controlCharacterInInputStream="control-character-in-input-stream",n.noncharacterInInputStream="noncharacter-in-input-stream",n.surrogateInInputStream="surrogate-in-input-stream",n.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",n.endTagWithAttributes="end-tag-with-attributes",n.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",n.unexpectedSolidusInTag="unexpected-solidus-in-tag",n.unexpectedNullCharacter="unexpected-null-character",n.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",n.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",n.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",n.missingEndTagName="missing-end-tag-name",n.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",n.unknownNamedCharacterReference="unknown-named-character-reference",n.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",n.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",n.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",n.eofBeforeTagName="eof-before-tag-name",n.eofInTag="eof-in-tag",n.missingAttributeValue="missing-attribute-value",n.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",n.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",n.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",n.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",n.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",n.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",n.missingDoctypePublicIdentifier="missing-doctype-public-identifier",n.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",n.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",n.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",n.cdataInHtmlContent="cdata-in-html-content",n.incorrectlyOpenedComment="incorrectly-opened-comment",n.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",n.eofInDoctype="eof-in-doctype",n.nestedComment="nested-comment",n.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",n.eofInComment="eof-in-comment",n.incorrectlyClosedComment="incorrectly-closed-comment",n.eofInCdata="eof-in-cdata",n.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",n.nullCharacterReference="null-character-reference",n.surrogateCharacterReference="surrogate-character-reference",n.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",n.controlCharacterReference="control-character-reference",n.noncharacterCharacterReference="noncharacter-character-reference",n.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",n.missingDoctypeName="missing-doctype-name",n.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",n.duplicateAttribute="duplicate-attribute",n.nonConformingDoctype="non-conforming-doctype",n.missingDoctype="missing-doctype",n.misplacedDoctype="misplaced-doctype",n.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",n.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",n.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",n.openElementsLeftAfterEof="open-elements-left-after-eof",n.abandonedHeadElementChild="abandoned-head-element-child",n.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",n.nestedNoscriptInHead="nested-noscript-in-head",n.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Ut=Ut||(Ut={}));const g_n=65536;class m_n{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=g_n,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e){const{line:t,col:i,offset:r}=this;return{code:e,startLine:t,endLine:t,startCol:i,endCol:i,startOffset:r,endOffset:r}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(f_n(t))return this.pos++,this._addGap(),p_n(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,we.EOF;return this._err(Ut.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let i=0;i<e.length;i++)if((this.html.charCodeAt(this.pos+i)|32)!==e.charCodeAt(i))return!1;return!0}peek(e){const t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,we.EOF;const i=this.html.charCodeAt(t);return i===we.CARRIAGE_RETURN?we.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,we.EOF;let e=this.html.charCodeAt(this.pos);return e===we.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,we.LINE_FEED):e===we.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,cYe(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===we.LINE_FEED||e===we.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){uYe(e)?this._err(Ut.controlCharacterInInputStream):dYe(e)&&this._err(Ut.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Do;(function(n){n[n.CHARACTER=0]="CHARACTER",n[n.NULL_CHARACTER=1]="NULL_CHARACTER",n[n.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",n[n.START_TAG=3]="START_TAG",n[n.END_TAG=4]="END_TAG",n[n.COMMENT=5]="COMMENT",n[n.DOCTYPE=6]="DOCTYPE",n[n.EOF=7]="EOF",n[n.HIBERNATION=8]="HIBERNATION"})(Do=Do||(Do={}));function hYe(n,e){for(let t=n.attrs.length-1;t>=0;t--)if(n.attrs[t].name===e)return n.attrs[t].value;return null}const gC=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎸᏄϨrrowƀ;BDᅐᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ\0ᚕ᚛ᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsuᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ拔;櫙artint;樍Āao⁕Ācsα‰‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0耻¾䂾;慗;慜5;慘ƶ⁌\0;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚ;檒;檥;檤ȀEaes;扩pĀ;p℣檊rox»Ā;q檈Ā;qim;拧pf;쀀𝕘Āci⅃r;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❶❼➅➇ròࢨorneòarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;efभ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛òðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬Āet;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ëĀ;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓pĀ;sᆴ㑵;쀀⊔uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;h㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊;쀀⫋setneqĀ;q㦏㦒쀀⊋;쀀⫌Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(n=>n.charCodeAt(0))),__n=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(n=>n.charCodeAt(0)));var Iee;const v_n=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),b_n=(Iee=String.fromCodePoint)!==null&&Iee!==void 0?Iee:function(n){let e="";return n>65535&&(n-=65536,e+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),e+=String.fromCharCode(n),e};function y_n(n){var e;return n>=55296&&n<=57343||n>1114111?65533:(e=v_n.get(n))!==null&&e!==void 0?e:n}var Uu;(function(n){n[n.NUM=35]="NUM",n[n.SEMI=59]="SEMI",n[n.EQUALS=61]="EQUALS",n[n.ZERO=48]="ZERO",n[n.NINE=57]="NINE",n[n.LOWER_A=97]="LOWER_A",n[n.LOWER_F=102]="LOWER_F",n[n.LOWER_X=120]="LOWER_X",n[n.LOWER_Z=122]="LOWER_Z",n[n.UPPER_A=65]="UPPER_A",n[n.UPPER_F=70]="UPPER_F",n[n.UPPER_Z=90]="UPPER_Z"})(Uu||(Uu={}));const C_n=32;var Ab;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(Ab||(Ab={}));function Nae(n){return n>=Uu.ZERO&&n<=Uu.NINE}function w_n(n){return n>=Uu.UPPER_A&&n<=Uu.UPPER_F||n>=Uu.LOWER_A&&n<=Uu.LOWER_F}function S_n(n){return n>=Uu.UPPER_A&&n<=Uu.UPPER_Z||n>=Uu.LOWER_A&&n<=Uu.LOWER_Z||Nae(n)}function E_n(n){return n===Uu.EQUALS||S_n(n)}var Au;(function(n){n[n.EntityStart=0]="EntityStart",n[n.NumericStart=1]="NumericStart",n[n.NumericDecimal=2]="NumericDecimal",n[n.NumericHex=3]="NumericHex",n[n.NamedEntity=4]="NamedEntity"})(Au||(Au={}));var _x;(function(n){n[n.Legacy=0]="Legacy",n[n.Strict=1]="Strict",n[n.Attribute=2]="Attribute"})(_x||(_x={}));class x_n{constructor(e,t,i){this.decodeTree=e,this.emitCodePoint=t,this.errors=i,this.state=Au.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_x.Strict}startEntity(e){this.decodeMode=e,this.state=Au.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Au.EntityStart:return e.charCodeAt(t)===Uu.NUM?(this.state=Au.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Au.NamedEntity,this.stateNamedEntity(e,t));case Au.NumericStart:return this.stateNumericStart(e,t);case Au.NumericDecimal:return this.stateNumericDecimal(e,t);case Au.NumericHex:return this.stateNumericHex(e,t);case Au.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|C_n)===Uu.LOWER_X?(this.state=Au.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Au.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,i,r){if(t!==i){const o=i-t;this.result=this.result*Math.pow(r,o)+parseInt(e.substr(t,o),r),this.consumed+=o}}stateNumericHex(e,t){const i=t;for(;t<e.length;){const r=e.charCodeAt(t);if(Nae(r)||w_n(r))t+=1;else return this.addToNumericResult(e,i,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,i,t,16),-1}stateNumericDecimal(e,t){const i=t;for(;t<e.length;){const r=e.charCodeAt(t);if(Nae(r))t+=1;else return this.addToNumericResult(e,i,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,i,t,10),-1}emitNumericEntity(e,t){var i;if(this.consumed<=t)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Uu.SEMI)this.consumed+=1;else if(this.decodeMode===_x.Strict)return 0;return this.emitCodePoint(y_n(this.result),this.consumed),this.errors&&(e!==Uu.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:i}=this;let r=i[this.treeIndex],o=(r&Ab.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const s=e.charCodeAt(t);if(this.treeIndex=pYe(i,r,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===_x.Attribute&&(o===0||E_n(s))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],o=(r&Ab.VALUE_LENGTH)>>14,o!==0){if(s===Uu.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==_x.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:i}=this,r=(i[t]&Ab.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,i){const{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Ab.VALUE_LENGTH:r[e+1],i),t===3&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case Au.NamedEntity:return this.result!==0&&(this.decodeMode!==_x.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Au.NumericDecimal:return this.emitNumericEntity(0,2);case Au.NumericHex:return this.emitNumericEntity(0,3);case Au.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Au.EntityStart:return 0}}}function fYe(n){let e="";const t=new x_n(n,i=>e+=b_n(i));return function(r,o){let s=0,a=0;for(;(a=r.indexOf("&",a))>=0;){e+=r.slice(s,a),t.startEntity(o);const c=t.write(r,a+1);if(c<0){s=a+t.end();break}s=a+c,a=c===0?s+1:s}const l=e+r.slice(s);return e="",l}}function pYe(n,e,t,i){const r=(e&Ab.BRANCH_LENGTH)>>7,o=e&Ab.JUMP_TABLE;if(r===0)return o!==0&&i===o?t:-1;if(o){const l=i-o;return l<0||l>=r?-1:n[t+l]-1}let s=t,a=s+r-1;for(;s<=a;){const l=s+a>>>1,c=n[l];if(c<i)s=l+1;else if(c>i)a=l-1;else return n[l+r]}return-1}fYe(gC);fYe(__n);var nn;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.MATHML="http://www.w3.org/1998/Math/MathML",n.SVG="http://www.w3.org/2000/svg",n.XLINK="http://www.w3.org/1999/xlink",n.XML="http://www.w3.org/XML/1998/namespace",n.XMLNS="http://www.w3.org/2000/xmlns/"})(nn=nn||(nn={}));var Nw;(function(n){n.TYPE="type",n.ACTION="action",n.ENCODING="encoding",n.PROMPT="prompt",n.NAME="name",n.COLOR="color",n.FACE="face",n.SIZE="size"})(Nw=Nw||(Nw={}));var Pp;(function(n){n.NO_QUIRKS="no-quirks",n.QUIRKS="quirks",n.LIMITED_QUIRKS="limited-quirks"})(Pp=Pp||(Pp={}));var _t;(function(n){n.A="a",n.ADDRESS="address",n.ANNOTATION_XML="annotation-xml",n.APPLET="applet",n.AREA="area",n.ARTICLE="article",n.ASIDE="aside",n.B="b",n.BASE="base",n.BASEFONT="basefont",n.BGSOUND="bgsound",n.BIG="big",n.BLOCKQUOTE="blockquote",n.BODY="body",n.BR="br",n.BUTTON="button",n.CAPTION="caption",n.CENTER="center",n.CODE="code",n.COL="col",n.COLGROUP="colgroup",n.DD="dd",n.DESC="desc",n.DETAILS="details",n.DIALOG="dialog",n.DIR="dir",n.DIV="div",n.DL="dl",n.DT="dt",n.EM="em",n.EMBED="embed",n.FIELDSET="fieldset",n.FIGCAPTION="figcaption",n.FIGURE="figure",n.FONT="font",n.FOOTER="footer",n.FOREIGN_OBJECT="foreignObject",n.FORM="form",n.FRAME="frame",n.FRAMESET="frameset",n.H1="h1",n.H2="h2",n.H3="h3",n.H4="h4",n.H5="h5",n.H6="h6",n.HEAD="head",n.HEADER="header",n.HGROUP="hgroup",n.HR="hr",n.HTML="html",n.I="i",n.IMG="img",n.IMAGE="image",n.INPUT="input",n.IFRAME="iframe",n.KEYGEN="keygen",n.LABEL="label",n.LI="li",n.LINK="link",n.LISTING="listing",n.MAIN="main",n.MALIGNMARK="malignmark",n.MARQUEE="marquee",n.MATH="math",n.MENU="menu",n.META="meta",n.MGLYPH="mglyph",n.MI="mi",n.MO="mo",n.MN="mn",n.MS="ms",n.MTEXT="mtext",n.NAV="nav",n.NOBR="nobr",n.NOFRAMES="noframes",n.NOEMBED="noembed",n.NOSCRIPT="noscript",n.OBJECT="object",n.OL="ol",n.OPTGROUP="optgroup",n.OPTION="option",n.P="p",n.PARAM="param",n.PLAINTEXT="plaintext",n.PRE="pre",n.RB="rb",n.RP="rp",n.RT="rt",n.RTC="rtc",n.RUBY="ruby",n.S="s",n.SCRIPT="script",n.SECTION="section",n.SELECT="select",n.SOURCE="source",n.SMALL="small",n.SPAN="span",n.STRIKE="strike",n.STRONG="strong",n.STYLE="style",n.SUB="sub",n.SUMMARY="summary",n.SUP="sup",n.TABLE="table",n.TBODY="tbody",n.TEMPLATE="template",n.TEXTAREA="textarea",n.TFOOT="tfoot",n.TD="td",n.TH="th",n.THEAD="thead",n.TITLE="title",n.TR="tr",n.TRACK="track",n.TT="tt",n.U="u",n.UL="ul",n.SVG="svg",n.VAR="var",n.WBR="wbr",n.XMP="xmp"})(_t=_t||(_t={}));var $;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.A=1]="A",n[n.ADDRESS=2]="ADDRESS",n[n.ANNOTATION_XML=3]="ANNOTATION_XML",n[n.APPLET=4]="APPLET",n[n.AREA=5]="AREA",n[n.ARTICLE=6]="ARTICLE",n[n.ASIDE=7]="ASIDE",n[n.B=8]="B",n[n.BASE=9]="BASE",n[n.BASEFONT=10]="BASEFONT",n[n.BGSOUND=11]="BGSOUND",n[n.BIG=12]="BIG",n[n.BLOCKQUOTE=13]="BLOCKQUOTE",n[n.BODY=14]="BODY",n[n.BR=15]="BR",n[n.BUTTON=16]="BUTTON",n[n.CAPTION=17]="CAPTION",n[n.CENTER=18]="CENTER",n[n.CODE=19]="CODE",n[n.COL=20]="COL",n[n.COLGROUP=21]="COLGROUP",n[n.DD=22]="DD",n[n.DESC=23]="DESC",n[n.DETAILS=24]="DETAILS",n[n.DIALOG=25]="DIALOG",n[n.DIR=26]="DIR",n[n.DIV=27]="DIV",n[n.DL=28]="DL",n[n.DT=29]="DT",n[n.EM=30]="EM",n[n.EMBED=31]="EMBED",n[n.FIELDSET=32]="FIELDSET",n[n.FIGCAPTION=33]="FIGCAPTION",n[n.FIGURE=34]="FIGURE",n[n.FONT=35]="FONT",n[n.FOOTER=36]="FOOTER",n[n.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",n[n.FORM=38]="FORM",n[n.FRAME=39]="FRAME",n[n.FRAMESET=40]="FRAMESET",n[n.H1=41]="H1",n[n.H2=42]="H2",n[n.H3=43]="H3",n[n.H4=44]="H4",n[n.H5=45]="H5",n[n.H6=46]="H6",n[n.HEAD=47]="HEAD",n[n.HEADER=48]="HEADER",n[n.HGROUP=49]="HGROUP",n[n.HR=50]="HR",n[n.HTML=51]="HTML",n[n.I=52]="I",n[n.IMG=53]="IMG",n[n.IMAGE=54]="IMAGE",n[n.INPUT=55]="INPUT",n[n.IFRAME=56]="IFRAME",n[n.KEYGEN=57]="KEYGEN",n[n.LABEL=58]="LABEL",n[n.LI=59]="LI",n[n.LINK=60]="LINK",n[n.LISTING=61]="LISTING",n[n.MAIN=62]="MAIN",n[n.MALIGNMARK=63]="MALIGNMARK",n[n.MARQUEE=64]="MARQUEE",n[n.MATH=65]="MATH",n[n.MENU=66]="MENU",n[n.META=67]="META",n[n.MGLYPH=68]="MGLYPH",n[n.MI=69]="MI",n[n.MO=70]="MO",n[n.MN=71]="MN",n[n.MS=72]="MS",n[n.MTEXT=73]="MTEXT",n[n.NAV=74]="NAV",n[n.NOBR=75]="NOBR",n[n.NOFRAMES=76]="NOFRAMES",n[n.NOEMBED=77]="NOEMBED",n[n.NOSCRIPT=78]="NOSCRIPT",n[n.OBJECT=79]="OBJECT",n[n.OL=80]="OL",n[n.OPTGROUP=81]="OPTGROUP",n[n.OPTION=82]="OPTION",n[n.P=83]="P",n[n.PARAM=84]="PARAM",n[n.PLAINTEXT=85]="PLAINTEXT",n[n.PRE=86]="PRE",n[n.RB=87]="RB",n[n.RP=88]="RP",n[n.RT=89]="RT",n[n.RTC=90]="RTC",n[n.RUBY=91]="RUBY",n[n.S=92]="S",n[n.SCRIPT=93]="SCRIPT",n[n.SECTION=94]="SECTION",n[n.SELECT=95]="SELECT",n[n.SOURCE=96]="SOURCE",n[n.SMALL=97]="SMALL",n[n.SPAN=98]="SPAN",n[n.STRIKE=99]="STRIKE",n[n.STRONG=100]="STRONG",n[n.STYLE=101]="STYLE",n[n.SUB=102]="SUB",n[n.SUMMARY=103]="SUMMARY",n[n.SUP=104]="SUP",n[n.TABLE=105]="TABLE",n[n.TBODY=106]="TBODY",n[n.TEMPLATE=107]="TEMPLATE",n[n.TEXTAREA=108]="TEXTAREA",n[n.TFOOT=109]="TFOOT",n[n.TD=110]="TD",n[n.TH=111]="TH",n[n.THEAD=112]="THEAD",n[n.TITLE=113]="TITLE",n[n.TR=114]="TR",n[n.TRACK=115]="TRACK",n[n.TT=116]="TT",n[n.U=117]="U",n[n.UL=118]="UL",n[n.SVG=119]="SVG",n[n.VAR=120]="VAR",n[n.WBR=121]="WBR",n[n.XMP=122]="XMP"})($=$||($={}));const T_n=new Map([[_t.A,$.A],[_t.ADDRESS,$.ADDRESS],[_t.ANNOTATION_XML,$.ANNOTATION_XML],[_t.APPLET,$.APPLET],[_t.AREA,$.AREA],[_t.ARTICLE,$.ARTICLE],[_t.ASIDE,$.ASIDE],[_t.B,$.B],[_t.BASE,$.BASE],[_t.BASEFONT,$.BASEFONT],[_t.BGSOUND,$.BGSOUND],[_t.BIG,$.BIG],[_t.BLOCKQUOTE,$.BLOCKQUOTE],[_t.BODY,$.BODY],[_t.BR,$.BR],[_t.BUTTON,$.BUTTON],[_t.CAPTION,$.CAPTION],[_t.CENTER,$.CENTER],[_t.CODE,$.CODE],[_t.COL,$.COL],[_t.COLGROUP,$.COLGROUP],[_t.DD,$.DD],[_t.DESC,$.DESC],[_t.DETAILS,$.DETAILS],[_t.DIALOG,$.DIALOG],[_t.DIR,$.DIR],[_t.DIV,$.DIV],[_t.DL,$.DL],[_t.DT,$.DT],[_t.EM,$.EM],[_t.EMBED,$.EMBED],[_t.FIELDSET,$.FIELDSET],[_t.FIGCAPTION,$.FIGCAPTION],[_t.FIGURE,$.FIGURE],[_t.FONT,$.FONT],[_t.FOOTER,$.FOOTER],[_t.FOREIGN_OBJECT,$.FOREIGN_OBJECT],[_t.FORM,$.FORM],[_t.FRAME,$.FRAME],[_t.FRAMESET,$.FRAMESET],[_t.H1,$.H1],[_t.H2,$.H2],[_t.H3,$.H3],[_t.H4,$.H4],[_t.H5,$.H5],[_t.H6,$.H6],[_t.HEAD,$.HEAD],[_t.HEADER,$.HEADER],[_t.HGROUP,$.HGROUP],[_t.HR,$.HR],[_t.HTML,$.HTML],[_t.I,$.I],[_t.IMG,$.IMG],[_t.IMAGE,$.IMAGE],[_t.INPUT,$.INPUT],[_t.IFRAME,$.IFRAME],[_t.KEYGEN,$.KEYGEN],[_t.LABEL,$.LABEL],[_t.LI,$.LI],[_t.LINK,$.LINK],[_t.LISTING,$.LISTING],[_t.MAIN,$.MAIN],[_t.MALIGNMARK,$.MALIGNMARK],[_t.MARQUEE,$.MARQUEE],[_t.MATH,$.MATH],[_t.MENU,$.MENU],[_t.META,$.META],[_t.MGLYPH,$.MGLYPH],[_t.MI,$.MI],[_t.MO,$.MO],[_t.MN,$.MN],[_t.MS,$.MS],[_t.MTEXT,$.MTEXT],[_t.NAV,$.NAV],[_t.NOBR,$.NOBR],[_t.NOFRAMES,$.NOFRAMES],[_t.NOEMBED,$.NOEMBED],[_t.NOSCRIPT,$.NOSCRIPT],[_t.OBJECT,$.OBJECT],[_t.OL,$.OL],[_t.OPTGROUP,$.OPTGROUP],[_t.OPTION,$.OPTION],[_t.P,$.P],[_t.PARAM,$.PARAM],[_t.PLAINTEXT,$.PLAINTEXT],[_t.PRE,$.PRE],[_t.RB,$.RB],[_t.RP,$.RP],[_t.RT,$.RT],[_t.RTC,$.RTC],[_t.RUBY,$.RUBY],[_t.S,$.S],[_t.SCRIPT,$.SCRIPT],[_t.SECTION,$.SECTION],[_t.SELECT,$.SELECT],[_t.SOURCE,$.SOURCE],[_t.SMALL,$.SMALL],[_t.SPAN,$.SPAN],[_t.STRIKE,$.STRIKE],[_t.STRONG,$.STRONG],[_t.STYLE,$.STYLE],[_t.SUB,$.SUB],[_t.SUMMARY,$.SUMMARY],[_t.SUP,$.SUP],[_t.TABLE,$.TABLE],[_t.TBODY,$.TBODY],[_t.TEMPLATE,$.TEMPLATE],[_t.TEXTAREA,$.TEXTAREA],[_t.TFOOT,$.TFOOT],[_t.TD,$.TD],[_t.TH,$.TH],[_t.THEAD,$.THEAD],[_t.TITLE,$.TITLE],[_t.TR,$.TR],[_t.TRACK,$.TRACK],[_t.TT,$.TT],[_t.U,$.U],[_t.UL,$.UL],[_t.SVG,$.SVG],[_t.VAR,$.VAR],[_t.WBR,$.WBR],[_t.XMP,$.XMP]]);function QR(n){var e;return(e=T_n.get(n))!==null&&e!==void 0?e:$.UNKNOWN}const Dn=$,k_n={[nn.HTML]:new Set([Dn.ADDRESS,Dn.APPLET,Dn.AREA,Dn.ARTICLE,Dn.ASIDE,Dn.BASE,Dn.BASEFONT,Dn.BGSOUND,Dn.BLOCKQUOTE,Dn.BODY,Dn.BR,Dn.BUTTON,Dn.CAPTION,Dn.CENTER,Dn.COL,Dn.COLGROUP,Dn.DD,Dn.DETAILS,Dn.DIR,Dn.DIV,Dn.DL,Dn.DT,Dn.EMBED,Dn.FIELDSET,Dn.FIGCAPTION,Dn.FIGURE,Dn.FOOTER,Dn.FORM,Dn.FRAME,Dn.FRAMESET,Dn.H1,Dn.H2,Dn.H3,Dn.H4,Dn.H5,Dn.H6,Dn.HEAD,Dn.HEADER,Dn.HGROUP,Dn.HR,Dn.HTML,Dn.IFRAME,Dn.IMG,Dn.INPUT,Dn.LI,Dn.LINK,Dn.LISTING,Dn.MAIN,Dn.MARQUEE,Dn.MENU,Dn.META,Dn.NAV,Dn.NOEMBED,Dn.NOFRAMES,Dn.NOSCRIPT,Dn.OBJECT,Dn.OL,Dn.P,Dn.PARAM,Dn.PLAINTEXT,Dn.PRE,Dn.SCRIPT,Dn.SECTION,Dn.SELECT,Dn.SOURCE,Dn.STYLE,Dn.SUMMARY,Dn.TABLE,Dn.TBODY,Dn.TD,Dn.TEMPLATE,Dn.TEXTAREA,Dn.TFOOT,Dn.TH,Dn.THEAD,Dn.TITLE,Dn.TR,Dn.TRACK,Dn.UL,Dn.WBR,Dn.XMP]),[nn.MATHML]:new Set([Dn.MI,Dn.MO,Dn.MN,Dn.MS,Dn.MTEXT,Dn.ANNOTATION_XML]),[nn.SVG]:new Set([Dn.TITLE,Dn.FOREIGN_OBJECT,Dn.DESC]),[nn.XLINK]:new Set,[nn.XML]:new Set,[nn.XMLNS]:new Set};function gYe(n){return n===Dn.H1||n===Dn.H2||n===Dn.H3||n===Dn.H4||n===Dn.H5||n===Dn.H6}_t.STYLE,_t.SCRIPT,_t.XMP,_t.IFRAME,_t.NOEMBED,_t.NOFRAMES,_t.PLAINTEXT;const I_n=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var ke;(function(n){n[n.DATA=0]="DATA",n[n.RCDATA=1]="RCDATA",n[n.RAWTEXT=2]="RAWTEXT",n[n.SCRIPT_DATA=3]="SCRIPT_DATA",n[n.PLAINTEXT=4]="PLAINTEXT",n[n.TAG_OPEN=5]="TAG_OPEN",n[n.END_TAG_OPEN=6]="END_TAG_OPEN",n[n.TAG_NAME=7]="TAG_NAME",n[n.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",n[n.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",n[n.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",n[n.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",n[n.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",n[n.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",n[n.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",n[n.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",n[n.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",n[n.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",n[n.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",n[n.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",n[n.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",n[n.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",n[n.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",n[n.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",n[n.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",n[n.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",n[n.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",n[n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",n[n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",n[n.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",n[n.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",n[n.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",n[n.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",n[n.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",n[n.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",n[n.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",n[n.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",n[n.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",n[n.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",n[n.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",n[n.BOGUS_COMMENT=40]="BOGUS_COMMENT",n[n.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",n[n.COMMENT_START=42]="COMMENT_START",n[n.COMMENT_START_DASH=43]="COMMENT_START_DASH",n[n.COMMENT=44]="COMMENT",n[n.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",n[n.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",n[n.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",n[n.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",n[n.COMMENT_END_DASH=49]="COMMENT_END_DASH",n[n.COMMENT_END=50]="COMMENT_END",n[n.COMMENT_END_BANG=51]="COMMENT_END_BANG",n[n.DOCTYPE=52]="DOCTYPE",n[n.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",n[n.DOCTYPE_NAME=54]="DOCTYPE_NAME",n[n.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",n[n.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",n[n.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",n[n.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",n[n.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",n[n.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",n[n.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",n[n.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",n[n.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",n[n.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",n[n.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",n[n.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",n[n.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",n[n.CDATA_SECTION=68]="CDATA_SECTION",n[n.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",n[n.CDATA_SECTION_END=70]="CDATA_SECTION_END",n[n.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",n[n.NAMED_CHARACTER_REFERENCE=72]="NAMED_CHARACTER_REFERENCE",n[n.AMBIGUOUS_AMPERSAND=73]="AMBIGUOUS_AMPERSAND",n[n.NUMERIC_CHARACTER_REFERENCE=74]="NUMERIC_CHARACTER_REFERENCE",n[n.HEXADEMICAL_CHARACTER_REFERENCE_START=75]="HEXADEMICAL_CHARACTER_REFERENCE_START",n[n.HEXADEMICAL_CHARACTER_REFERENCE=76]="HEXADEMICAL_CHARACTER_REFERENCE",n[n.DECIMAL_CHARACTER_REFERENCE=77]="DECIMAL_CHARACTER_REFERENCE",n[n.NUMERIC_CHARACTER_REFERENCE_END=78]="NUMERIC_CHARACTER_REFERENCE_END"})(ke||(ke={}));const Cc={DATA:ke.DATA,RCDATA:ke.RCDATA,RAWTEXT:ke.RAWTEXT,SCRIPT_DATA:ke.SCRIPT_DATA,PLAINTEXT:ke.PLAINTEXT,CDATA_SECTION:ke.CDATA_SECTION};function CM(n){return n>=we.DIGIT_0&&n<=we.DIGIT_9}function pP(n){return n>=we.LATIN_CAPITAL_A&&n<=we.LATIN_CAPITAL_Z}function L_n(n){return n>=we.LATIN_SMALL_A&&n<=we.LATIN_SMALL_Z}function mC(n){return L_n(n)||pP(n)}function Oae(n){return mC(n)||CM(n)}function mYe(n){return n>=we.LATIN_CAPITAL_A&&n<=we.LATIN_CAPITAL_F}function _Ye(n){return n>=we.LATIN_SMALL_A&&n<=we.LATIN_SMALL_F}function D_n(n){return CM(n)||mYe(n)||_Ye(n)}function _9(n){return n+32}function vYe(n){return n===we.SPACE||n===we.LINE_FEED||n===we.TABULATION||n===we.FORM_FEED}function A_n(n){return n===we.EQUALS_SIGN||Oae(n)}function QAe(n){return vYe(n)||n===we.SOLIDUS||n===we.GREATER_THAN_SIGN}class R_n{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=ke.DATA,this.returnState=ke.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new m_n(t),this.currentLocation=this.getCurrentLocation(-1)}_err(e){var t,i;(i=(t=this.handler).onParseError)===null||i===void 0||i.call(t,this.preprocessor.getError(e))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,t,i){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this._unconsume(this.consumedAfterSnapshot),this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(e){this.consumedAfterSnapshot-=e,this.preprocessor.retreat(e)}_reconsumeInState(e,t){this.state=e,this._callState(t)}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Do.START_TAG,tagName:"",tagID:$.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Do.END_TAG,tagName:"",tagID:$.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Do.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Do.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,t;const i=this.currentToken;if(hYe(i,this.currentAttr.name)===null){if(i.attrs.push(this.currentAttr),i.location&&this.currentLocation){const r=(e=(t=i.location).attrs)!==null&&e!==void 0?e:t.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Ut.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=QR(e.tagName),e.type===Do.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(Ut.endTagWithAttributes),e.selfClosing&&this._err(Ut.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Do.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Do.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Do.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Do.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type!==e)this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();else{this.currentCharacterToken.chars+=t;return}this._createCharacterToken(e,t)}_emitCodePoint(e){const t=vYe(e)?Do.WHITESPACE_CHARACTER:e===we.NULL?Do.NULL_CHARACTER:Do.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Do.CHARACTER,e)}_matchNamedCharacterReference(e){let t=null,i=0,r=!1;for(let o=0,s=gC[0];o>=0&&(o=pYe(gC,s,o+1,e),!(o<0));e=this._consume()){i+=1,s=gC[o];const a=s&Ab.VALUE_LENGTH;if(a){const l=(a>>14)-1;if(e!==we.SEMICOLON&&this._isCharacterReferenceInAttribute()&&A_n(this.preprocessor.peek(1))?(t=[we.AMPERSAND],o+=l):(t=l===0?[gC[o]&~Ab.VALUE_LENGTH]:l===1?[gC[++o]]:[gC[++o],gC[++o]],i=0,r=e!==we.SEMICOLON),l===0){this._consume();break}}}return this._unconsume(i),r&&!this.preprocessor.endOfChunkHit&&this._err(Ut.missingSemicolonAfterCharacterReference),this._unconsume(1),t}_isCharacterReferenceInAttribute(){return this.returnState===ke.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===ke.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===ke.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case ke.DATA:{this._stateData(e);break}case ke.RCDATA:{this._stateRcdata(e);break}case ke.RAWTEXT:{this._stateRawtext(e);break}case ke.SCRIPT_DATA:{this._stateScriptData(e);break}case ke.PLAINTEXT:{this._statePlaintext(e);break}case ke.TAG_OPEN:{this._stateTagOpen(e);break}case ke.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case ke.TAG_NAME:{this._stateTagName(e);break}case ke.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case ke.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case ke.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case ke.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case ke.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case ke.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case ke.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case ke.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case ke.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case ke.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case ke.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case ke.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case ke.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case ke.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case ke.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case ke.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case ke.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case ke.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case ke.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case ke.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case ke.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case ke.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case ke.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case ke.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case ke.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case ke.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case ke.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case ke.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case ke.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case ke.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case ke.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case ke.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case ke.BOGUS_COMMENT:{this._stateBogusComment(e);break}case ke.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case ke.COMMENT_START:{this._stateCommentStart(e);break}case ke.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case ke.COMMENT:{this._stateComment(e);break}case ke.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case ke.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case ke.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case ke.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case ke.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case ke.COMMENT_END:{this._stateCommentEnd(e);break}case ke.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case ke.DOCTYPE:{this._stateDoctype(e);break}case ke.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case ke.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case ke.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case ke.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case ke.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case ke.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case ke.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case ke.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case ke.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case ke.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case ke.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case ke.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case ke.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case ke.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case ke.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case ke.CDATA_SECTION:{this._stateCdataSection(e);break}case ke.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case ke.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case ke.CHARACTER_REFERENCE:{this._stateCharacterReference(e);break}case ke.NAMED_CHARACTER_REFERENCE:{this._stateNamedCharacterReference(e);break}case ke.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}case ke.NUMERIC_CHARACTER_REFERENCE:{this._stateNumericCharacterReference(e);break}case ke.HEXADEMICAL_CHARACTER_REFERENCE_START:{this._stateHexademicalCharacterReferenceStart(e);break}case ke.HEXADEMICAL_CHARACTER_REFERENCE:{this._stateHexademicalCharacterReference(e);break}case ke.DECIMAL_CHARACTER_REFERENCE:{this._stateDecimalCharacterReference(e);break}case ke.NUMERIC_CHARACTER_REFERENCE_END:{this._stateNumericCharacterReferenceEnd(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case we.LESS_THAN_SIGN:{this.state=ke.TAG_OPEN;break}case we.AMPERSAND:{this.returnState=ke.DATA,this.state=ke.CHARACTER_REFERENCE;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._emitCodePoint(e);break}case we.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case we.AMPERSAND:{this.returnState=ke.RCDATA,this.state=ke.CHARACTER_REFERENCE;break}case we.LESS_THAN_SIGN:{this.state=ke.RCDATA_LESS_THAN_SIGN;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._emitChars(yl);break}case we.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case we.LESS_THAN_SIGN:{this.state=ke.RAWTEXT_LESS_THAN_SIGN;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._emitChars(yl);break}case we.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case we.LESS_THAN_SIGN:{this.state=ke.SCRIPT_DATA_LESS_THAN_SIGN;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._emitChars(yl);break}case we.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._emitChars(yl);break}case we.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(mC(e))this._createStartTagToken(),this.state=ke.TAG_NAME,this._stateTagName(e);else switch(e){case we.EXCLAMATION_MARK:{this.state=ke.MARKUP_DECLARATION_OPEN;break}case we.SOLIDUS:{this.state=ke.END_TAG_OPEN;break}case we.QUESTION_MARK:{this._err(Ut.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=ke.BOGUS_COMMENT,this._stateBogusComment(e);break}case we.EOF:{this._err(Ut.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Ut.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=ke.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(mC(e))this._createEndTagToken(),this.state=ke.TAG_NAME,this._stateTagName(e);else switch(e){case we.GREATER_THAN_SIGN:{this._err(Ut.missingEndTagName),this.state=ke.DATA;break}case we.EOF:{this._err(Ut.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Ut.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=ke.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this.state=ke.BEFORE_ATTRIBUTE_NAME;break}case we.SOLIDUS:{this.state=ke.SELF_CLOSING_START_TAG;break}case we.GREATER_THAN_SIGN:{this.state=ke.DATA,this.emitCurrentTagToken();break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.tagName+=yl;break}case we.EOF:{this._err(Ut.eofInTag),this._emitEOFToken();break}default:t.tagName+=String.fromCodePoint(pP(e)?_9(e):e)}}_stateRcdataLessThanSign(e){e===we.SOLIDUS?this.state=ke.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=ke.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){mC(e)?(this.state=ke.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=ke.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=ke.BEFORE_ATTRIBUTE_NAME,!1;case we.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=ke.SELF_CLOSING_START_TAG,!1;case we.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=ke.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=ke.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===we.SOLIDUS?this.state=ke.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=ke.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){mC(e)?(this.state=ke.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=ke.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=ke.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case we.SOLIDUS:{this.state=ke.SCRIPT_DATA_END_TAG_OPEN;break}case we.EXCLAMATION_MARK:{this.state=ke.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=ke.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){mC(e)?(this.state=ke.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=ke.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=ke.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===we.HYPHEN_MINUS?(this.state=ke.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=ke.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===we.HYPHEN_MINUS?(this.state=ke.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=ke.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case we.HYPHEN_MINUS:{this.state=ke.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case we.LESS_THAN_SIGN:{this.state=ke.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._emitChars(yl);break}case we.EOF:{this._err(Ut.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case we.HYPHEN_MINUS:{this.state=ke.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case we.LESS_THAN_SIGN:{this.state=ke.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.state=ke.SCRIPT_DATA_ESCAPED,this._emitChars(yl);break}case we.EOF:{this._err(Ut.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=ke.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case we.HYPHEN_MINUS:{this._emitChars("-");break}case we.LESS_THAN_SIGN:{this.state=ke.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case we.GREATER_THAN_SIGN:{this.state=ke.SCRIPT_DATA,this._emitChars(">");break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.state=ke.SCRIPT_DATA_ESCAPED,this._emitChars(yl);break}case we.EOF:{this._err(Ut.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=ke.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===we.SOLIDUS?this.state=ke.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:mC(e)?(this._emitChars("<"),this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=ke.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){mC(e)?(this.state=ke.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=ke.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=ke.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(df.SCRIPT,!1)&&QAe(this.preprocessor.peek(df.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<df.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=ke.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case we.HYPHEN_MINUS:{this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case we.LESS_THAN_SIGN:{this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._emitChars(yl);break}case we.EOF:{this._err(Ut.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case we.HYPHEN_MINUS:{this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case we.LESS_THAN_SIGN:{this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(yl);break}case we.EOF:{this._err(Ut.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case we.HYPHEN_MINUS:{this._emitChars("-");break}case we.LESS_THAN_SIGN:{this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case we.GREATER_THAN_SIGN:{this.state=ke.SCRIPT_DATA,this._emitChars(">");break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(yl);break}case we.EOF:{this._err(Ut.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===we.SOLIDUS?(this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(df.SCRIPT,!1)&&QAe(this.preprocessor.peek(df.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<df.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=ke.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=ke.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.SOLIDUS:case we.GREATER_THAN_SIGN:case we.EOF:{this.state=ke.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case we.EQUALS_SIGN:{this._err(Ut.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=ke.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=ke.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:case we.SOLIDUS:case we.GREATER_THAN_SIGN:case we.EOF:{this._leaveAttrName(),this.state=ke.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case we.EQUALS_SIGN:{this._leaveAttrName(),this.state=ke.BEFORE_ATTRIBUTE_VALUE;break}case we.QUOTATION_MARK:case we.APOSTROPHE:case we.LESS_THAN_SIGN:{this._err(Ut.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.currentAttr.name+=yl;break}default:this.currentAttr.name+=String.fromCodePoint(pP(e)?_9(e):e)}}_stateAfterAttributeName(e){switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.SOLIDUS:{this.state=ke.SELF_CLOSING_START_TAG;break}case we.EQUALS_SIGN:{this.state=ke.BEFORE_ATTRIBUTE_VALUE;break}case we.GREATER_THAN_SIGN:{this.state=ke.DATA,this.emitCurrentTagToken();break}case we.EOF:{this._err(Ut.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=ke.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.QUOTATION_MARK:{this.state=ke.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case we.APOSTROPHE:{this.state=ke.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case we.GREATER_THAN_SIGN:{this._err(Ut.missingAttributeValue),this.state=ke.DATA,this.emitCurrentTagToken();break}default:this.state=ke.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case we.QUOTATION_MARK:{this.state=ke.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case we.AMPERSAND:{this.returnState=ke.ATTRIBUTE_VALUE_DOUBLE_QUOTED,this.state=ke.CHARACTER_REFERENCE;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.currentAttr.value+=yl;break}case we.EOF:{this._err(Ut.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case we.APOSTROPHE:{this.state=ke.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case we.AMPERSAND:{this.returnState=ke.ATTRIBUTE_VALUE_SINGLE_QUOTED,this.state=ke.CHARACTER_REFERENCE;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.currentAttr.value+=yl;break}case we.EOF:{this._err(Ut.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this._leaveAttrValue(),this.state=ke.BEFORE_ATTRIBUTE_NAME;break}case we.AMPERSAND:{this.returnState=ke.ATTRIBUTE_VALUE_UNQUOTED,this.state=ke.CHARACTER_REFERENCE;break}case we.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=ke.DATA,this.emitCurrentTagToken();break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),this.currentAttr.value+=yl;break}case we.QUOTATION_MARK:case we.APOSTROPHE:case we.LESS_THAN_SIGN:case we.EQUALS_SIGN:case we.GRAVE_ACCENT:{this._err(Ut.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case we.EOF:{this._err(Ut.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this._leaveAttrValue(),this.state=ke.BEFORE_ATTRIBUTE_NAME;break}case we.SOLIDUS:{this._leaveAttrValue(),this.state=ke.SELF_CLOSING_START_TAG;break}case we.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=ke.DATA,this.emitCurrentTagToken();break}case we.EOF:{this._err(Ut.eofInTag),this._emitEOFToken();break}default:this._err(Ut.missingWhitespaceBetweenAttributes),this.state=ke.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case we.GREATER_THAN_SIGN:{const t=this.currentToken;t.selfClosing=!0,this.state=ke.DATA,this.emitCurrentTagToken();break}case we.EOF:{this._err(Ut.eofInTag),this._emitEOFToken();break}default:this._err(Ut.unexpectedSolidusInTag),this.state=ke.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const t=this.currentToken;switch(e){case we.GREATER_THAN_SIGN:{this.state=ke.DATA,this.emitCurrentComment(t);break}case we.EOF:{this.emitCurrentComment(t),this._emitEOFToken();break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.data+=yl;break}default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(df.DASH_DASH,!0)?(this._createCommentToken(df.DASH_DASH.length+1),this.state=ke.COMMENT_START):this._consumeSequenceIfMatch(df.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(df.DOCTYPE.length+1),this.state=ke.DOCTYPE):this._consumeSequenceIfMatch(df.CDATA_START,!0)?this.inForeignNode?this.state=ke.CDATA_SECTION:(this._err(Ut.cdataInHtmlContent),this._createCommentToken(df.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=ke.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Ut.incorrectlyOpenedComment),this._createCommentToken(2),this.state=ke.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case we.HYPHEN_MINUS:{this.state=ke.COMMENT_START_DASH;break}case we.GREATER_THAN_SIGN:{this._err(Ut.abruptClosingOfEmptyComment),this.state=ke.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=ke.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case we.HYPHEN_MINUS:{this.state=ke.COMMENT_END;break}case we.GREATER_THAN_SIGN:{this._err(Ut.abruptClosingOfEmptyComment),this.state=ke.DATA,this.emitCurrentComment(t);break}case we.EOF:{this._err(Ut.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=ke.COMMENT,this._stateComment(e)}}_stateComment(e){const t=this.currentToken;switch(e){case we.HYPHEN_MINUS:{this.state=ke.COMMENT_END_DASH;break}case we.LESS_THAN_SIGN:{t.data+="<",this.state=ke.COMMENT_LESS_THAN_SIGN;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.data+=yl;break}case we.EOF:{this._err(Ut.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case we.EXCLAMATION_MARK:{t.data+="!",this.state=ke.COMMENT_LESS_THAN_SIGN_BANG;break}case we.LESS_THAN_SIGN:{t.data+="<";break}default:this.state=ke.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===we.HYPHEN_MINUS?this.state=ke.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=ke.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===we.HYPHEN_MINUS?this.state=ke.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=ke.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==we.GREATER_THAN_SIGN&&e!==we.EOF&&this._err(Ut.nestedComment),this.state=ke.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case we.HYPHEN_MINUS:{this.state=ke.COMMENT_END;break}case we.EOF:{this._err(Ut.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=ke.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case we.GREATER_THAN_SIGN:{this.state=ke.DATA,this.emitCurrentComment(t);break}case we.EXCLAMATION_MARK:{this.state=ke.COMMENT_END_BANG;break}case we.HYPHEN_MINUS:{t.data+="-";break}case we.EOF:{this._err(Ut.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--",this.state=ke.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case we.HYPHEN_MINUS:{t.data+="--!",this.state=ke.COMMENT_END_DASH;break}case we.GREATER_THAN_SIGN:{this._err(Ut.incorrectlyClosedComment),this.state=ke.DATA,this.emitCurrentComment(t);break}case we.EOF:{this._err(Ut.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--!",this.state=ke.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this.state=ke.BEFORE_DOCTYPE_NAME;break}case we.GREATER_THAN_SIGN:{this.state=ke.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case we.EOF:{this._err(Ut.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.missingWhitespaceBeforeDoctypeName),this.state=ke.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(pP(e))this._createDoctypeToken(String.fromCharCode(_9(e))),this.state=ke.DOCTYPE_NAME;else switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.NULL:{this._err(Ut.unexpectedNullCharacter),this._createDoctypeToken(yl),this.state=ke.DOCTYPE_NAME;break}case we.GREATER_THAN_SIGN:{this._err(Ut.missingDoctypeName),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.EOF:{this._err(Ut.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=ke.DOCTYPE_NAME}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this.state=ke.AFTER_DOCTYPE_NAME;break}case we.GREATER_THAN_SIGN:{this.state=ke.DATA,this.emitCurrentDoctype(t);break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.name+=yl;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.name+=String.fromCodePoint(pP(e)?_9(e):e)}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.GREATER_THAN_SIGN:{this.state=ke.DATA,this.emitCurrentDoctype(t);break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(df.PUBLIC,!1)?this.state=ke.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(df.SYSTEM,!1)?this.state=ke.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Ut.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this.state=ke.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case we.QUOTATION_MARK:{this._err(Ut.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=ke.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case we.APOSTROPHE:{this._err(Ut.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=ke.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case we.GREATER_THAN_SIGN:{this._err(Ut.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=ke.DATA,this.emitCurrentDoctype(t);break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.QUOTATION_MARK:{t.publicId="",this.state=ke.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case we.APOSTROPHE:{t.publicId="",this.state=ke.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case we.GREATER_THAN_SIGN:{this._err(Ut.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=ke.DATA,this.emitCurrentDoctype(t);break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case we.QUOTATION_MARK:{this.state=ke.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.publicId+=yl;break}case we.GREATER_THAN_SIGN:{this._err(Ut.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case we.APOSTROPHE:{this.state=ke.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.publicId+=yl;break}case we.GREATER_THAN_SIGN:{this._err(Ut.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this.state=ke.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case we.GREATER_THAN_SIGN:{this.state=ke.DATA,this.emitCurrentDoctype(t);break}case we.QUOTATION_MARK:{this._err(Ut.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case we.APOSTROPHE:{this._err(Ut.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.QUOTATION_MARK:{t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case we.APOSTROPHE:{t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:{this.state=ke.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case we.QUOTATION_MARK:{this._err(Ut.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case we.APOSTROPHE:{this._err(Ut.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case we.GREATER_THAN_SIGN:{this._err(Ut.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=ke.DATA,this.emitCurrentDoctype(t);break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.QUOTATION_MARK:{t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case we.APOSTROPHE:{t.systemId="",this.state=ke.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case we.GREATER_THAN_SIGN:{this._err(Ut.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=ke.DATA,this.emitCurrentDoctype(t);break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case we.QUOTATION_MARK:{this.state=ke.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.systemId+=yl;break}case we.GREATER_THAN_SIGN:{this._err(Ut.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case we.APOSTROPHE:{this.state=ke.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter),t.systemId+=yl;break}case we.GREATER_THAN_SIGN:{this._err(Ut.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case we.SPACE:case we.LINE_FEED:case we.TABULATION:case we.FORM_FEED:break;case we.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.EOF:{this._err(Ut.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(Ut.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=ke.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case we.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=ke.DATA;break}case we.NULL:{this._err(Ut.unexpectedNullCharacter);break}case we.EOF:{this.emitCurrentDoctype(t),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case we.RIGHT_SQUARE_BRACKET:{this.state=ke.CDATA_SECTION_BRACKET;break}case we.EOF:{this._err(Ut.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===we.RIGHT_SQUARE_BRACKET?this.state=ke.CDATA_SECTION_END:(this._emitChars("]"),this.state=ke.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case we.GREATER_THAN_SIGN:{this.state=ke.DATA;break}case we.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=ke.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(e){e===we.NUMBER_SIGN?this.state=ke.NUMERIC_CHARACTER_REFERENCE:Oae(e)?(this.state=ke.NAMED_CHARACTER_REFERENCE,this._stateNamedCharacterReference(e)):(this._flushCodePointConsumedAsCharacterReference(we.AMPERSAND),this._reconsumeInState(this.returnState,e))}_stateNamedCharacterReference(e){const t=this._matchNamedCharacterReference(e);if(!this._ensureHibernation())if(t){for(let i=0;i<t.length;i++)this._flushCodePointConsumedAsCharacterReference(t[i]);this.state=this.returnState}else this._flushCodePointConsumedAsCharacterReference(we.AMPERSAND),this.state=ke.AMBIGUOUS_AMPERSAND}_stateAmbiguousAmpersand(e){Oae(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===we.SEMICOLON&&this._err(Ut.unknownNamedCharacterReference),this._reconsumeInState(this.returnState,e))}_stateNumericCharacterReference(e){this.charRefCode=0,e===we.LATIN_SMALL_X||e===we.LATIN_CAPITAL_X?this.state=ke.HEXADEMICAL_CHARACTER_REFERENCE_START:CM(e)?(this.state=ke.DECIMAL_CHARACTER_REFERENCE,this._stateDecimalCharacterReference(e)):(this._err(Ut.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(we.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(we.NUMBER_SIGN),this._reconsumeInState(this.returnState,e))}_stateHexademicalCharacterReferenceStart(e){D_n(e)?(this.state=ke.HEXADEMICAL_CHARACTER_REFERENCE,this._stateHexademicalCharacterReference(e)):(this._err(Ut.absenceOfDigitsInNumericCharacterReference),this._flushCodePointConsumedAsCharacterReference(we.AMPERSAND),this._flushCodePointConsumedAsCharacterReference(we.NUMBER_SIGN),this._unconsume(2),this.state=this.returnState)}_stateHexademicalCharacterReference(e){mYe(e)?this.charRefCode=this.charRefCode*16+e-55:_Ye(e)?this.charRefCode=this.charRefCode*16+e-87:CM(e)?this.charRefCode=this.charRefCode*16+e-48:e===we.SEMICOLON?this.state=ke.NUMERIC_CHARACTER_REFERENCE_END:(this._err(Ut.missingSemicolonAfterCharacterReference),this.state=ke.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e))}_stateDecimalCharacterReference(e){CM(e)?this.charRefCode=this.charRefCode*10+e-48:e===we.SEMICOLON?this.state=ke.NUMERIC_CHARACTER_REFERENCE_END:(this._err(Ut.missingSemicolonAfterCharacterReference),this.state=ke.NUMERIC_CHARACTER_REFERENCE_END,this._stateNumericCharacterReferenceEnd(e))}_stateNumericCharacterReferenceEnd(e){if(this.charRefCode===we.NULL)this._err(Ut.nullCharacterReference),this.charRefCode=we.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(Ut.characterReferenceOutsideUnicodeRange),this.charRefCode=we.REPLACEMENT_CHARACTER;else if(cYe(this.charRefCode))this._err(Ut.surrogateCharacterReference),this.charRefCode=we.REPLACEMENT_CHARACTER;else if(dYe(this.charRefCode))this._err(Ut.noncharacterCharacterReference);else if(uYe(this.charRefCode)||this.charRefCode===we.CARRIAGE_RETURN){this._err(Ut.controlCharacterReference);const t=I_n.get(this.charRefCode);t!==void 0&&(this.charRefCode=t)}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,e)}}const bYe=new Set([$.DD,$.DT,$.LI,$.OPTGROUP,$.OPTION,$.P,$.RB,$.RP,$.RT,$.RTC]),XAe=new Set([...bYe,$.CAPTION,$.COLGROUP,$.TBODY,$.TD,$.TFOOT,$.TH,$.THEAD,$.TR]),v9=new Map([[$.APPLET,nn.HTML],[$.CAPTION,nn.HTML],[$.HTML,nn.HTML],[$.MARQUEE,nn.HTML],[$.OBJECT,nn.HTML],[$.TABLE,nn.HTML],[$.TD,nn.HTML],[$.TEMPLATE,nn.HTML],[$.TH,nn.HTML],[$.ANNOTATION_XML,nn.MATHML],[$.MI,nn.MATHML],[$.MN,nn.MATHML],[$.MO,nn.MATHML],[$.MS,nn.MATHML],[$.MTEXT,nn.MATHML],[$.DESC,nn.SVG],[$.FOREIGN_OBJECT,nn.SVG],[$.TITLE,nn.SVG]]),N_n=[$.H1,$.H2,$.H3,$.H4,$.H5,$.H6],O_n=[$.TR,$.TEMPLATE,$.HTML],P_n=[$.TBODY,$.TFOOT,$.THEAD,$.TEMPLATE,$.HTML],M_n=[$.TABLE,$.TEMPLATE,$.HTML],F_n=[$.TD,$.TH];class B_n{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,i){this.treeAdapter=t,this.handler=i,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=$.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===$.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===nn.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const i=this._indexOf(e);this.items[i]=t,i===this.stackTop&&(this.current=t)}insertAfter(e,t,i){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==nn.HTML);this.shortenToLength(t<0?0:t)}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){const t=this._indexOf(e);this.shortenToLength(t<0?0:t)}popUntilPopped(e,t){const i=this._indexOfTagNames(e,t);this.shortenToLength(i<0?0:i)}popUntilNumberedHeaderPopped(){this.popUntilPopped(N_n,nn.HTML)}popUntilTableCellPopped(){this.popUntilPopped(F_n,nn.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let i=this.stackTop;i>=0;i--)if(e.includes(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===t)return i;return-1}clearBackTo(e,t){const i=this._indexOfTagNames(e,t);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(M_n,nn.HTML)}clearBackToTableBodyContext(){this.clearBackTo(P_n,nn.HTML)}clearBackToTableRowContext(){this.clearBackTo(O_n,nn.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===$.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===$.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(i===e&&r===nn.HTML)return!0;if(v9.get(i)===r)return!1}return!0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e],i=this.treeAdapter.getNamespaceURI(this.items[e]);if(gYe(t)&&i===nn.HTML)return!0;if(v9.get(t)===i)return!1}return!0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(i===e&&r===nn.HTML)return!0;if((i===$.UL||i===$.OL)&&r===nn.HTML||v9.get(i)===r)return!1}return!0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(i===e&&r===nn.HTML)return!0;if(i===$.BUTTON&&r===nn.HTML||v9.get(i)===r)return!1}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===nn.HTML){if(i===e)return!0;if(i===$.TABLE||i===$.TEMPLATE||i===$.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];if(this.treeAdapter.getNamespaceURI(this.items[e])===nn.HTML){if(t===$.TBODY||t===$.THEAD||t===$.TFOOT)return!0;if(t===$.TABLE||t===$.HTML)return!1}}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const i=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===nn.HTML){if(i===e)return!0;if(i!==$.OPTION&&i!==$.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;bYe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;XAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==e&&XAe.has(this.currentTagId);)this.pop()}}const Lee=3;var H_;(function(n){n[n.Marker=0]="Marker",n[n.Element=1]="Element"})(H_=H_||(H_={}));const ZAe={type:H_.Marker};class $_n{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const i=[],r=t.length,o=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let a=0;a<this.entries.length;a++){const l=this.entries[a];if(l.type===H_.Marker)break;const{element:c}=l;if(this.treeAdapter.getTagName(c)===o&&this.treeAdapter.getNamespaceURI(c)===s){const u=this.treeAdapter.getAttrList(c);u.length===r&&i.push({idx:a,attrs:u})}}return i}_ensureNoahArkCondition(e){if(this.entries.length<Lee)return;const t=this.treeAdapter.getAttrList(e),i=this._getNoahArkConditionCandidates(e,t);if(i.length<Lee)return;const r=new Map(t.map(s=>[s.name,s.value]));let o=0;for(let s=0;s<i.length;s++){const a=i[s];a.attrs.every(l=>r.get(l.name)===l.value)&&(o+=1,o>=Lee&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(ZAe)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:H_.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:H_.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);t>=0&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(ZAe);e>=0?this.entries.splice(0,e+1):this.entries.length=0}getElementEntryInScopeWithTagName(e){const t=this.entries.find(i=>i.type===H_.Marker||this.treeAdapter.getTagName(i.element)===e);return t&&t.type===H_.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===H_.Element&&t.element===e)}}function JAe(n){return{nodeName:"#text",value:n,parentNode:null}}const E2={createDocument(){return{nodeName:"#document",mode:Pp.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(n,e,t){return{nodeName:n,tagName:n,attrs:t,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(n){return{nodeName:"#comment",data:n,parentNode:null}},appendChild(n,e){n.childNodes.push(e),e.parentNode=n},insertBefore(n,e,t){const i=n.childNodes.indexOf(t);n.childNodes.splice(i,0,e),e.parentNode=n},setTemplateContent(n,e){n.content=e},getTemplateContent(n){return n.content},setDocumentType(n,e,t,i){const r=n.childNodes.find(o=>o.nodeName==="#documentType");if(r)r.name=e,r.publicId=t,r.systemId=i;else{const o={nodeName:"#documentType",name:e,publicId:t,systemId:i,parentNode:null};E2.appendChild(n,o)}},setDocumentMode(n,e){n.mode=e},getDocumentMode(n){return n.mode},detachNode(n){if(n.parentNode){const e=n.parentNode.childNodes.indexOf(n);n.parentNode.childNodes.splice(e,1),n.parentNode=null}},insertText(n,e){if(n.childNodes.length>0){const t=n.childNodes[n.childNodes.length-1];if(E2.isTextNode(t)){t.value+=e;return}}E2.appendChild(n,JAe(e))},insertTextBefore(n,e,t){const i=n.childNodes[n.childNodes.indexOf(t)-1];i&&E2.isTextNode(i)?i.value+=e:E2.insertBefore(n,JAe(e),t)},adoptAttributes(n,e){const t=new Set(n.attrs.map(i=>i.name));for(let i=0;i<e.length;i++)t.has(e[i].name)||n.attrs.push(e[i])},getFirstChild(n){return n.childNodes[0]},getChildNodes(n){return n.childNodes},getParentNode(n){return n.parentNode},getAttrList(n){return n.attrs},getTagName(n){return n.tagName},getNamespaceURI(n){return n.namespaceURI},getTextNodeContent(n){return n.value},getCommentNodeContent(n){return n.data},getDocumentTypeNodeName(n){return n.name},getDocumentTypeNodePublicId(n){return n.publicId},getDocumentTypeNodeSystemId(n){return n.systemId},isTextNode(n){return n.nodeName==="#text"},isCommentNode(n){return n.nodeName==="#comment"},isDocumentTypeNode(n){return n.nodeName==="#documentType"},isElementNode(n){return Object.prototype.hasOwnProperty.call(n,"tagName")},setNodeSourceCodeLocation(n,e){n.sourceCodeLocation=e},getNodeSourceCodeLocation(n){return n.sourceCodeLocation},updateNodeSourceCodeLocation(n,e){n.sourceCodeLocation={...n.sourceCodeLocation,...e}}},yYe="html",V_n="about:legacy-compat",H_n="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",CYe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],W_n=[...CYe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],z_n=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),wYe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],U_n=[...wYe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function eRe(n,e){return e.some(t=>n.startsWith(t))}function j_n(n){return n.name===yYe&&n.publicId===null&&(n.systemId===null||n.systemId===V_n)}function q_n(n){if(n.name!==yYe)return Pp.QUIRKS;const{systemId:e}=n;if(e&&e.toLowerCase()===H_n)return Pp.QUIRKS;let{publicId:t}=n;if(t!==null){if(t=t.toLowerCase(),z_n.has(t))return Pp.QUIRKS;let i=e===null?W_n:CYe;if(eRe(t,i))return Pp.QUIRKS;if(i=e===null?wYe:U_n,eRe(t,i))return Pp.LIMITED_QUIRKS}return Pp.NO_QUIRKS}const tRe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},G_n="definitionurl",K_n="definitionURL",Y_n=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(n=>[n.toLowerCase(),n])),Q_n=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:nn.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:nn.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:nn.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:nn.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:nn.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:nn.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:nn.XLINK}],["xml:base",{prefix:"xml",name:"base",namespace:nn.XML}],["xml:lang",{prefix:"xml",name:"lang",namespace:nn.XML}],["xml:space",{prefix:"xml",name:"space",namespace:nn.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:nn.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:nn.XMLNS}]]),X_n=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(n=>[n.toLowerCase(),n])),Z_n=new Set([$.B,$.BIG,$.BLOCKQUOTE,$.BODY,$.BR,$.CENTER,$.CODE,$.DD,$.DIV,$.DL,$.DT,$.EM,$.EMBED,$.H1,$.H2,$.H3,$.H4,$.H5,$.H6,$.HEAD,$.HR,$.I,$.IMG,$.LI,$.LISTING,$.MENU,$.META,$.NOBR,$.OL,$.P,$.PRE,$.RUBY,$.S,$.SMALL,$.SPAN,$.STRONG,$.STRIKE,$.SUB,$.SUP,$.TABLE,$.TT,$.U,$.UL,$.VAR]);function J_n(n){const e=n.tagID;return e===$.FONT&&n.attrs.some(({name:i})=>i===Nw.COLOR||i===Nw.SIZE||i===Nw.FACE)||Z_n.has(e)}function SYe(n){for(let e=0;e<n.attrs.length;e++)if(n.attrs[e].name===G_n){n.attrs[e].name=K_n;break}}function EYe(n){for(let e=0;e<n.attrs.length;e++){const t=Y_n.get(n.attrs[e].name);t!=null&&(n.attrs[e].name=t)}}function Ibe(n){for(let e=0;e<n.attrs.length;e++){const t=Q_n.get(n.attrs[e].name);t&&(n.attrs[e].prefix=t.prefix,n.attrs[e].name=t.name,n.attrs[e].namespace=t.namespace)}}function evn(n){const e=X_n.get(n.tagName);e!=null&&(n.tagName=e,n.tagID=QR(n.tagName))}function tvn(n,e){return e===nn.MATHML&&(n===$.MI||n===$.MO||n===$.MN||n===$.MS||n===$.MTEXT)}function nvn(n,e,t){if(e===nn.MATHML&&n===$.ANNOTATION_XML){for(let i=0;i<t.length;i++)if(t[i].name===Nw.ENCODING){const r=t[i].value.toLowerCase();return r===tRe.TEXT_HTML||r===tRe.APPLICATION_XML}}return e===nn.SVG&&(n===$.FOREIGN_OBJECT||n===$.DESC||n===$.TITLE)}function ivn(n,e,t,i){return(!i||i===nn.HTML)&&nvn(n,e,t)||(!i||i===nn.MATHML)&&tvn(n,e)}const rvn="hidden",ovn=8,svn=3;var Ue;(function(n){n[n.INITIAL=0]="INITIAL",n[n.BEFORE_HTML=1]="BEFORE_HTML",n[n.BEFORE_HEAD=2]="BEFORE_HEAD",n[n.IN_HEAD=3]="IN_HEAD",n[n.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",n[n.AFTER_HEAD=5]="AFTER_HEAD",n[n.IN_BODY=6]="IN_BODY",n[n.TEXT=7]="TEXT",n[n.IN_TABLE=8]="IN_TABLE",n[n.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",n[n.IN_CAPTION=10]="IN_CAPTION",n[n.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",n[n.IN_TABLE_BODY=12]="IN_TABLE_BODY",n[n.IN_ROW=13]="IN_ROW",n[n.IN_CELL=14]="IN_CELL",n[n.IN_SELECT=15]="IN_SELECT",n[n.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",n[n.IN_TEMPLATE=17]="IN_TEMPLATE",n[n.AFTER_BODY=18]="AFTER_BODY",n[n.IN_FRAMESET=19]="IN_FRAMESET",n[n.AFTER_FRAMESET=20]="AFTER_FRAMESET",n[n.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",n[n.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Ue||(Ue={}));const avn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},xYe=new Set([$.TABLE,$.TBODY,$.TFOOT,$.THEAD,$.TR]),nRe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:E2,onParseError:null};let iRe=class{constructor(e,t,i=null,r=null){this.fragmentContext=i,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Ue.INITIAL,this.originalInsertionMode=Ue.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...nRe,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new R_n(this.options,this),this.activeFormattingElements=new $_n(this.treeAdapter),this.fragmentContextID=i?QR(this.treeAdapter.getTagName(i)):$.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new B_n(this.document,this.treeAdapter,this)}static parse(e,t){const i=new this(t);return i.tokenizer.write(e,!0),i.document}static getFragmentParser(e,t){const i={...nRe,...t};e??(e=i.treeAdapter.createElement(_t.TEMPLATE,nn.HTML,[]));const r=i.treeAdapter.createElement("documentmock",nn.HTML,[]),o=new this(i,r,e);return o.fragmentContextID===$.TEMPLATE&&o.tmplInsertionModeStack.unshift(Ue.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,i){var r;if(!this.onParseError)return;const o=(r=e.location)!==null&&r!==void 0?r:avn,s={code:t,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:i?o.startLine:o.endLine,endCol:i?o.startCol:o.endCol,endOffset:i?o.startOffset:o.endOffset};this.onParseError(s)}onItemPush(e,t,i){var r,o;(o=(r=this.treeAdapter).onItemPush)===null||o===void 0||o.call(r,e),i&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,e,this.openElements.current),t){let o,s;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,s=this.fragmentContextID):{current:o,currentTagId:s}=this.openElements,this._setContextModes(o,s)}}_setContextModes(e,t){const i=e===this.document||this.treeAdapter.getNamespaceURI(e)===nn.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,nn.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ue.TEXT}switchToPlaintextParsing(){this.insertionMode=Ue.TEXT,this.originalInsertionMode=Ue.IN_BODY,this.tokenizer.state=Cc.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===_t.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==nn.HTML))switch(this.fragmentContextID){case $.TITLE:case $.TEXTAREA:{this.tokenizer.state=Cc.RCDATA;break}case $.STYLE:case $.XMP:case $.IFRAME:case $.NOEMBED:case $.NOFRAMES:case $.NOSCRIPT:{this.tokenizer.state=Cc.RAWTEXT;break}case $.SCRIPT:{this.tokenizer.state=Cc.SCRIPT_DATA;break}case $.PLAINTEXT:{this.tokenizer.state=Cc.PLAINTEXT;break}}}_setDocumentType(e){const t=e.name||"",i=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,i,r),e.location){const s=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));s&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const i=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i,e)}}_appendElement(e,t){const i=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(i,e.location)}_insertElement(e,t){const i=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(i,e.location),this.openElements.push(i,e.tagID)}_insertFakeElement(e,t){const i=this.treeAdapter.createElement(e,nn.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,nn.HTML,e.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,i),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(_t.HTML,nn.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,$.HTML)}_appendCommentNode(e,t){const i=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_insertCharacters(e){let t,i;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(t,e.chars,i):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),o=i?r.lastIndexOf(i):r.length,s=r[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:c,endOffset:u}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:c,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}_adoptNodes(e,t){for(let i=this.treeAdapter.getFirstChild(e);i;i=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(t,i)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const i=t.location,r=this.treeAdapter.getTagName(e),o=t.type===Do.END_TAG&&r===t.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,o)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,i;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,i=this.fragmentContextID):{current:t,currentTagId:i}=this.openElements,e.tagID===$.SVG&&this.treeAdapter.getTagName(t)===_t.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===nn.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===$.MGLYPH||e.tagID===$.MALIGNMARK)&&!this._isIntegrationPoint(i,t,nn.HTML)}_processToken(e){switch(e.type){case Do.CHARACTER:{this.onCharacter(e);break}case Do.NULL_CHARACTER:{this.onNullCharacter(e);break}case Do.COMMENT:{this.onComment(e);break}case Do.DOCTYPE:{this.onDoctype(e);break}case Do.START_TAG:{this._processStartTag(e);break}case Do.END_TAG:{this.onEndTag(e);break}case Do.EOF:{this.onEof(e);break}case Do.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,t,i){const r=this.treeAdapter.getNamespaceURI(t),o=this.treeAdapter.getAttrList(t);return ivn(e,r,o,i)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex(r=>r.type===H_.Marker||this.openElements.contains(r.element)),i=t<0?e-1:t-1;for(let r=i;r>=0;r--){const o=this.activeFormattingElements.entries[r];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ue.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion($.P),this.openElements.popUntilTagNamePopped($.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case $.TR:{this.insertionMode=Ue.IN_ROW;return}case $.TBODY:case $.THEAD:case $.TFOOT:{this.insertionMode=Ue.IN_TABLE_BODY;return}case $.CAPTION:{this.insertionMode=Ue.IN_CAPTION;return}case $.COLGROUP:{this.insertionMode=Ue.IN_COLUMN_GROUP;return}case $.TABLE:{this.insertionMode=Ue.IN_TABLE;return}case $.BODY:{this.insertionMode=Ue.IN_BODY;return}case $.FRAMESET:{this.insertionMode=Ue.IN_FRAMESET;return}case $.SELECT:{this._resetInsertionModeForSelect(e);return}case $.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case $.HTML:{this.insertionMode=this.headElement?Ue.AFTER_HEAD:Ue.BEFORE_HEAD;return}case $.TD:case $.TH:{if(e>0){this.insertionMode=Ue.IN_CELL;return}break}case $.HEAD:{if(e>0){this.insertionMode=Ue.IN_HEAD;return}break}}this.insertionMode=Ue.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const i=this.openElements.tagIDs[t];if(i===$.TEMPLATE)break;if(i===$.TABLE){this.insertionMode=Ue.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ue.IN_SELECT}_isElementCausesFosterParenting(e){return xYe.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case $.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(t)===nn.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break}case $.TABLE:{const i=this.treeAdapter.getParentNode(t);return i?{parent:i,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const i=this.treeAdapter.getNamespaceURI(e);return k_n[i].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Fbn(this,e);return}switch(this.insertionMode){case Ue.INITIAL:{yO(this,e);break}case Ue.BEFORE_HTML:{wM(this,e);break}case Ue.BEFORE_HEAD:{SM(this,e);break}case Ue.IN_HEAD:{EM(this,e);break}case Ue.IN_HEAD_NO_SCRIPT:{xM(this,e);break}case Ue.AFTER_HEAD:{TM(this,e);break}case Ue.IN_BODY:case Ue.IN_CAPTION:case Ue.IN_CELL:case Ue.IN_TEMPLATE:{kYe(this,e);break}case Ue.TEXT:case Ue.IN_SELECT:case Ue.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case Ue.IN_TABLE:case Ue.IN_TABLE_BODY:case Ue.IN_ROW:{Dee(this,e);break}case Ue.IN_TABLE_TEXT:{NYe(this,e);break}case Ue.IN_COLUMN_GROUP:{MW(this,e);break}case Ue.AFTER_BODY:{FW(this,e);break}case Ue.AFTER_AFTER_BODY:{$$(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Mbn(this,e);return}switch(this.insertionMode){case Ue.INITIAL:{yO(this,e);break}case Ue.BEFORE_HTML:{wM(this,e);break}case Ue.BEFORE_HEAD:{SM(this,e);break}case Ue.IN_HEAD:{EM(this,e);break}case Ue.IN_HEAD_NO_SCRIPT:{xM(this,e);break}case Ue.AFTER_HEAD:{TM(this,e);break}case Ue.TEXT:{this._insertCharacters(e);break}case Ue.IN_TABLE:case Ue.IN_TABLE_BODY:case Ue.IN_ROW:{Dee(this,e);break}case Ue.IN_COLUMN_GROUP:{MW(this,e);break}case Ue.AFTER_BODY:{FW(this,e);break}case Ue.AFTER_AFTER_BODY:{$$(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Pae(this,e);return}switch(this.insertionMode){case Ue.INITIAL:case Ue.BEFORE_HTML:case Ue.BEFORE_HEAD:case Ue.IN_HEAD:case Ue.IN_HEAD_NO_SCRIPT:case Ue.AFTER_HEAD:case Ue.IN_BODY:case Ue.IN_TABLE:case Ue.IN_CAPTION:case Ue.IN_COLUMN_GROUP:case Ue.IN_TABLE_BODY:case Ue.IN_ROW:case Ue.IN_CELL:case Ue.IN_SELECT:case Ue.IN_SELECT_IN_TABLE:case Ue.IN_TEMPLATE:case Ue.IN_FRAMESET:case Ue.AFTER_FRAMESET:{Pae(this,e);break}case Ue.IN_TABLE_TEXT:{CO(this,e);break}case Ue.AFTER_BODY:{pvn(this,e);break}case Ue.AFTER_AFTER_BODY:case Ue.AFTER_AFTER_FRAMESET:{gvn(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Ue.INITIAL:{mvn(this,e);break}case Ue.BEFORE_HEAD:case Ue.IN_HEAD:case Ue.IN_HEAD_NO_SCRIPT:case Ue.AFTER_HEAD:{this._err(e,Ut.misplacedDoctype);break}case Ue.IN_TABLE_TEXT:{CO(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,Ut.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Bbn(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Ue.INITIAL:{yO(this,e);break}case Ue.BEFORE_HTML:{_vn(this,e);break}case Ue.BEFORE_HEAD:{bvn(this,e);break}case Ue.IN_HEAD:{Lv(this,e);break}case Ue.IN_HEAD_NO_SCRIPT:{wvn(this,e);break}case Ue.AFTER_HEAD:{Evn(this,e);break}case Ue.IN_BODY:{_h(this,e);break}case Ue.IN_TABLE:{hA(this,e);break}case Ue.IN_TABLE_TEXT:{CO(this,e);break}case Ue.IN_CAPTION:{ybn(this,e);break}case Ue.IN_COLUMN_GROUP:{Abe(this,e);break}case Ue.IN_TABLE_BODY:{qG(this,e);break}case Ue.IN_ROW:{GG(this,e);break}case Ue.IN_CELL:{Sbn(this,e);break}case Ue.IN_SELECT:{MYe(this,e);break}case Ue.IN_SELECT_IN_TABLE:{xbn(this,e);break}case Ue.IN_TEMPLATE:{kbn(this,e);break}case Ue.AFTER_BODY:{Lbn(this,e);break}case Ue.IN_FRAMESET:{Dbn(this,e);break}case Ue.AFTER_FRAMESET:{Rbn(this,e);break}case Ue.AFTER_AFTER_BODY:{Obn(this,e);break}case Ue.AFTER_AFTER_FRAMESET:{Pbn(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?$bn(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Ue.INITIAL:{yO(this,e);break}case Ue.BEFORE_HTML:{vvn(this,e);break}case Ue.BEFORE_HEAD:{yvn(this,e);break}case Ue.IN_HEAD:{Cvn(this,e);break}case Ue.IN_HEAD_NO_SCRIPT:{Svn(this,e);break}case Ue.AFTER_HEAD:{xvn(this,e);break}case Ue.IN_BODY:{jG(this,e);break}case Ue.TEXT:{ubn(this,e);break}case Ue.IN_TABLE:{m3(this,e);break}case Ue.IN_TABLE_TEXT:{CO(this,e);break}case Ue.IN_CAPTION:{Cbn(this,e);break}case Ue.IN_COLUMN_GROUP:{wbn(this,e);break}case Ue.IN_TABLE_BODY:{Mae(this,e);break}case Ue.IN_ROW:{PYe(this,e);break}case Ue.IN_CELL:{Ebn(this,e);break}case Ue.IN_SELECT:{FYe(this,e);break}case Ue.IN_SELECT_IN_TABLE:{Tbn(this,e);break}case Ue.IN_TEMPLATE:{Ibn(this,e);break}case Ue.AFTER_BODY:{$Ye(this,e);break}case Ue.IN_FRAMESET:{Abn(this,e);break}case Ue.AFTER_FRAMESET:{Nbn(this,e);break}case Ue.AFTER_AFTER_BODY:{$$(this,e);break}}}onEof(e){switch(this.insertionMode){case Ue.INITIAL:{yO(this,e);break}case Ue.BEFORE_HTML:{wM(this,e);break}case Ue.BEFORE_HEAD:{SM(this,e);break}case Ue.IN_HEAD:{EM(this,e);break}case Ue.IN_HEAD_NO_SCRIPT:{xM(this,e);break}case Ue.AFTER_HEAD:{TM(this,e);break}case Ue.IN_BODY:case Ue.IN_TABLE:case Ue.IN_CAPTION:case Ue.IN_COLUMN_GROUP:case Ue.IN_TABLE_BODY:case Ue.IN_ROW:case Ue.IN_CELL:case Ue.IN_SELECT:case Ue.IN_SELECT_IN_TABLE:{AYe(this,e);break}case Ue.TEXT:{dbn(this,e);break}case Ue.IN_TABLE_TEXT:{CO(this,e);break}case Ue.IN_TEMPLATE:{BYe(this,e);break}case Ue.AFTER_BODY:case Ue.IN_FRAMESET:case Ue.AFTER_FRAMESET:case Ue.AFTER_AFTER_BODY:case Ue.AFTER_AFTER_FRAMESET:{Dbe(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===we.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Ue.IN_HEAD:case Ue.IN_HEAD_NO_SCRIPT:case Ue.AFTER_HEAD:case Ue.TEXT:case Ue.IN_COLUMN_GROUP:case Ue.IN_SELECT:case Ue.IN_SELECT_IN_TABLE:case Ue.IN_FRAMESET:case Ue.AFTER_FRAMESET:{this._insertCharacters(e);break}case Ue.IN_BODY:case Ue.IN_CAPTION:case Ue.IN_CELL:case Ue.IN_TEMPLATE:case Ue.AFTER_BODY:case Ue.AFTER_AFTER_BODY:case Ue.AFTER_AFTER_FRAMESET:{TYe(this,e);break}case Ue.IN_TABLE:case Ue.IN_TABLE_BODY:case Ue.IN_ROW:{Dee(this,e);break}case Ue.IN_TABLE_TEXT:{RYe(this,e);break}}}};function lvn(n,e){let t=n.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return t?n.openElements.contains(t.element)?n.openElements.hasInScope(e.tagID)||(t=null):(n.activeFormattingElements.removeEntry(t),t=null):DYe(n,e),t}function cvn(n,e){let t=null,i=n.openElements.stackTop;for(;i>=0;i--){const r=n.openElements.items[i];if(r===e.element)break;n._isSpecialElement(r,n.openElements.tagIDs[i])&&(t=r)}return t||(n.openElements.shortenToLength(i<0?0:i),n.activeFormattingElements.removeEntry(e)),t}function uvn(n,e,t){let i=e,r=n.openElements.getCommonAncestor(e);for(let o=0,s=r;s!==t;o++,s=r){r=n.openElements.getCommonAncestor(s);const a=n.activeFormattingElements.getElementEntry(s),l=a&&o>=svn;!a||l?(l&&n.activeFormattingElements.removeEntry(a),n.openElements.remove(s)):(s=dvn(n,a),i===e&&(n.activeFormattingElements.bookmark=a),n.treeAdapter.detachNode(i),n.treeAdapter.appendChild(s,i),i=s)}return i}function dvn(n,e){const t=n.treeAdapter.getNamespaceURI(e.element),i=n.treeAdapter.createElement(e.token.tagName,t,e.token.attrs);return n.openElements.replace(e.element,i),e.element=i,i}function hvn(n,e,t){const i=n.treeAdapter.getTagName(e),r=QR(i);if(n._isElementCausesFosterParenting(r))n._fosterParentElement(t);else{const o=n.treeAdapter.getNamespaceURI(e);r===$.TEMPLATE&&o===nn.HTML&&(e=n.treeAdapter.getTemplateContent(e)),n.treeAdapter.appendChild(e,t)}}function fvn(n,e,t){const i=n.treeAdapter.getNamespaceURI(t.element),{token:r}=t,o=n.treeAdapter.createElement(r.tagName,i,r.attrs);n._adoptNodes(e,o),n.treeAdapter.appendChild(e,o),n.activeFormattingElements.insertElementAfterBookmark(o,r),n.activeFormattingElements.removeEntry(t),n.openElements.remove(t.element),n.openElements.insertAfter(e,o,r.tagID)}function Lbe(n,e){for(let t=0;t<ovn;t++){const i=lvn(n,e);if(!i)break;const r=cvn(n,i);if(!r)break;n.activeFormattingElements.bookmark=i;const o=uvn(n,r,i.element),s=n.openElements.getCommonAncestor(i.element);n.treeAdapter.detachNode(o),s&&hvn(n,s,o),fvn(n,r,i)}}function Pae(n,e){n._appendCommentNode(e,n.openElements.currentTmplContentOrNode)}function pvn(n,e){n._appendCommentNode(e,n.openElements.items[0])}function gvn(n,e){n._appendCommentNode(e,n.document)}function Dbe(n,e){if(n.stopped=!0,e.location){const t=n.fragmentContext?0:2;for(let i=n.openElements.stackTop;i>=t;i--)n._setEndLocation(n.openElements.items[i],e);if(!n.fragmentContext&&n.openElements.stackTop>=0){const i=n.openElements.items[0],r=n.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(n._setEndLocation(i,e),n.openElements.stackTop>=1)){const o=n.openElements.items[1],s=n.treeAdapter.getNodeSourceCodeLocation(o);s&&!s.endTag&&n._setEndLocation(o,e)}}}}function mvn(n,e){n._setDocumentType(e);const t=e.forceQuirks?Pp.QUIRKS:q_n(e);j_n(e)||n._err(e,Ut.nonConformingDoctype),n.treeAdapter.setDocumentMode(n.document,t),n.insertionMode=Ue.BEFORE_HTML}function yO(n,e){n._err(e,Ut.missingDoctype,!0),n.treeAdapter.setDocumentMode(n.document,Pp.QUIRKS),n.insertionMode=Ue.BEFORE_HTML,n._processToken(e)}function _vn(n,e){e.tagID===$.HTML?(n._insertElement(e,nn.HTML),n.insertionMode=Ue.BEFORE_HEAD):wM(n,e)}function vvn(n,e){const t=e.tagID;(t===$.HTML||t===$.HEAD||t===$.BODY||t===$.BR)&&wM(n,e)}function wM(n,e){n._insertFakeRootElement(),n.insertionMode=Ue.BEFORE_HEAD,n._processToken(e)}function bvn(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.HEAD:{n._insertElement(e,nn.HTML),n.headElement=n.openElements.current,n.insertionMode=Ue.IN_HEAD;break}default:SM(n,e)}}function yvn(n,e){const t=e.tagID;t===$.HEAD||t===$.BODY||t===$.HTML||t===$.BR?SM(n,e):n._err(e,Ut.endTagWithoutMatchingOpenElement)}function SM(n,e){n._insertFakeElement(_t.HEAD,$.HEAD),n.headElement=n.openElements.current,n.insertionMode=Ue.IN_HEAD,n._processToken(e)}function Lv(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:{n._appendElement(e,nn.HTML),e.ackSelfClosing=!0;break}case $.TITLE:{n._switchToTextParsing(e,Cc.RCDATA);break}case $.NOSCRIPT:{n.options.scriptingEnabled?n._switchToTextParsing(e,Cc.RAWTEXT):(n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_HEAD_NO_SCRIPT);break}case $.NOFRAMES:case $.STYLE:{n._switchToTextParsing(e,Cc.RAWTEXT);break}case $.SCRIPT:{n._switchToTextParsing(e,Cc.SCRIPT_DATA);break}case $.TEMPLATE:{n._insertTemplate(e),n.activeFormattingElements.insertMarker(),n.framesetOk=!1,n.insertionMode=Ue.IN_TEMPLATE,n.tmplInsertionModeStack.unshift(Ue.IN_TEMPLATE);break}case $.HEAD:{n._err(e,Ut.misplacedStartTagForHeadElement);break}default:EM(n,e)}}function Cvn(n,e){switch(e.tagID){case $.HEAD:{n.openElements.pop(),n.insertionMode=Ue.AFTER_HEAD;break}case $.BODY:case $.BR:case $.HTML:{EM(n,e);break}case $.TEMPLATE:{Yk(n,e);break}default:n._err(e,Ut.endTagWithoutMatchingOpenElement)}}function Yk(n,e){n.openElements.tmplCount>0?(n.openElements.generateImpliedEndTagsThoroughly(),n.openElements.currentTagId!==$.TEMPLATE&&n._err(e,Ut.closingOfElementWithOpenChildElements),n.openElements.popUntilTagNamePopped($.TEMPLATE),n.activeFormattingElements.clearToLastMarker(),n.tmplInsertionModeStack.shift(),n._resetInsertionMode()):n._err(e,Ut.endTagWithoutMatchingOpenElement)}function EM(n,e){n.openElements.pop(),n.insertionMode=Ue.AFTER_HEAD,n._processToken(e)}function wvn(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.BASEFONT:case $.BGSOUND:case $.HEAD:case $.LINK:case $.META:case $.NOFRAMES:case $.STYLE:{Lv(n,e);break}case $.NOSCRIPT:{n._err(e,Ut.nestedNoscriptInHead);break}default:xM(n,e)}}function Svn(n,e){switch(e.tagID){case $.NOSCRIPT:{n.openElements.pop(),n.insertionMode=Ue.IN_HEAD;break}case $.BR:{xM(n,e);break}default:n._err(e,Ut.endTagWithoutMatchingOpenElement)}}function xM(n,e){const t=e.type===Do.EOF?Ut.openElementsLeftAfterEof:Ut.disallowedContentInNoscriptInHead;n._err(e,t),n.openElements.pop(),n.insertionMode=Ue.IN_HEAD,n._processToken(e)}function Evn(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.BODY:{n._insertElement(e,nn.HTML),n.framesetOk=!1,n.insertionMode=Ue.IN_BODY;break}case $.FRAMESET:{n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_FRAMESET;break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{n._err(e,Ut.abandonedHeadElementChild),n.openElements.push(n.headElement,$.HEAD),Lv(n,e),n.openElements.remove(n.headElement);break}case $.HEAD:{n._err(e,Ut.misplacedStartTagForHeadElement);break}default:TM(n,e)}}function xvn(n,e){switch(e.tagID){case $.BODY:case $.HTML:case $.BR:{TM(n,e);break}case $.TEMPLATE:{Yk(n,e);break}default:n._err(e,Ut.endTagWithoutMatchingOpenElement)}}function TM(n,e){n._insertFakeElement(_t.BODY,$.BODY),n.insertionMode=Ue.IN_BODY,UG(n,e)}function UG(n,e){switch(e.type){case Do.CHARACTER:{kYe(n,e);break}case Do.WHITESPACE_CHARACTER:{TYe(n,e);break}case Do.COMMENT:{Pae(n,e);break}case Do.START_TAG:{_h(n,e);break}case Do.END_TAG:{jG(n,e);break}case Do.EOF:{AYe(n,e);break}}}function TYe(n,e){n._reconstructActiveFormattingElements(),n._insertCharacters(e)}function kYe(n,e){n._reconstructActiveFormattingElements(),n._insertCharacters(e),n.framesetOk=!1}function Tvn(n,e){n.openElements.tmplCount===0&&n.treeAdapter.adoptAttributes(n.openElements.items[0],e.attrs)}function kvn(n,e){const t=n.openElements.tryPeekProperlyNestedBodyElement();t&&n.openElements.tmplCount===0&&(n.framesetOk=!1,n.treeAdapter.adoptAttributes(t,e.attrs))}function Ivn(n,e){const t=n.openElements.tryPeekProperlyNestedBodyElement();n.framesetOk&&t&&(n.treeAdapter.detachNode(t),n.openElements.popAllUpToHtmlElement(),n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_FRAMESET)}function Lvn(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,nn.HTML)}function Dvn(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),gYe(n.openElements.currentTagId)&&n.openElements.pop(),n._insertElement(e,nn.HTML)}function Avn(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,nn.HTML),n.skipNextNewLine=!0,n.framesetOk=!1}function Rvn(n,e){const t=n.openElements.tmplCount>0;(!n.formElement||t)&&(n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,nn.HTML),t||(n.formElement=n.openElements.current))}function Nvn(n,e){n.framesetOk=!1;const t=e.tagID;for(let i=n.openElements.stackTop;i>=0;i--){const r=n.openElements.tagIDs[i];if(t===$.LI&&r===$.LI||(t===$.DD||t===$.DT)&&(r===$.DD||r===$.DT)){n.openElements.generateImpliedEndTagsWithExclusion(r),n.openElements.popUntilTagNamePopped(r);break}if(r!==$.ADDRESS&&r!==$.DIV&&r!==$.P&&n._isSpecialElement(n.openElements.items[i],r))break}n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,nn.HTML)}function Ovn(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,nn.HTML),n.tokenizer.state=Cc.PLAINTEXT}function Pvn(n,e){n.openElements.hasInScope($.BUTTON)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped($.BUTTON)),n._reconstructActiveFormattingElements(),n._insertElement(e,nn.HTML),n.framesetOk=!1}function Mvn(n,e){const t=n.activeFormattingElements.getElementEntryInScopeWithTagName(_t.A);t&&(Lbe(n,e),n.openElements.remove(t.element),n.activeFormattingElements.removeEntry(t)),n._reconstructActiveFormattingElements(),n._insertElement(e,nn.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function Fvn(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,nn.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function Bvn(n,e){n._reconstructActiveFormattingElements(),n.openElements.hasInScope($.NOBR)&&(Lbe(n,e),n._reconstructActiveFormattingElements()),n._insertElement(e,nn.HTML),n.activeFormattingElements.pushElement(n.openElements.current,e)}function $vn(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,nn.HTML),n.activeFormattingElements.insertMarker(),n.framesetOk=!1}function Vvn(n,e){n.treeAdapter.getDocumentMode(n.document)!==Pp.QUIRKS&&n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._insertElement(e,nn.HTML),n.framesetOk=!1,n.insertionMode=Ue.IN_TABLE}function IYe(n,e){n._reconstructActiveFormattingElements(),n._appendElement(e,nn.HTML),n.framesetOk=!1,e.ackSelfClosing=!0}function LYe(n){const e=hYe(n,Nw.TYPE);return e!=null&&e.toLowerCase()===rvn}function Hvn(n,e){n._reconstructActiveFormattingElements(),n._appendElement(e,nn.HTML),LYe(e)||(n.framesetOk=!1),e.ackSelfClosing=!0}function Wvn(n,e){n._appendElement(e,nn.HTML),e.ackSelfClosing=!0}function zvn(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._appendElement(e,nn.HTML),n.framesetOk=!1,e.ackSelfClosing=!0}function Uvn(n,e){e.tagName=_t.IMG,e.tagID=$.IMG,IYe(n,e)}function jvn(n,e){n._insertElement(e,nn.HTML),n.skipNextNewLine=!0,n.tokenizer.state=Cc.RCDATA,n.originalInsertionMode=n.insertionMode,n.framesetOk=!1,n.insertionMode=Ue.TEXT}function qvn(n,e){n.openElements.hasInButtonScope($.P)&&n._closePElement(),n._reconstructActiveFormattingElements(),n.framesetOk=!1,n._switchToTextParsing(e,Cc.RAWTEXT)}function Gvn(n,e){n.framesetOk=!1,n._switchToTextParsing(e,Cc.RAWTEXT)}function rRe(n,e){n._switchToTextParsing(e,Cc.RAWTEXT)}function Kvn(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,nn.HTML),n.framesetOk=!1,n.insertionMode=n.insertionMode===Ue.IN_TABLE||n.insertionMode===Ue.IN_CAPTION||n.insertionMode===Ue.IN_TABLE_BODY||n.insertionMode===Ue.IN_ROW||n.insertionMode===Ue.IN_CELL?Ue.IN_SELECT_IN_TABLE:Ue.IN_SELECT}function Yvn(n,e){n.openElements.currentTagId===$.OPTION&&n.openElements.pop(),n._reconstructActiveFormattingElements(),n._insertElement(e,nn.HTML)}function Qvn(n,e){n.openElements.hasInScope($.RUBY)&&n.openElements.generateImpliedEndTags(),n._insertElement(e,nn.HTML)}function Xvn(n,e){n.openElements.hasInScope($.RUBY)&&n.openElements.generateImpliedEndTagsWithExclusion($.RTC),n._insertElement(e,nn.HTML)}function Zvn(n,e){n._reconstructActiveFormattingElements(),SYe(e),Ibe(e),e.selfClosing?n._appendElement(e,nn.MATHML):n._insertElement(e,nn.MATHML),e.ackSelfClosing=!0}function Jvn(n,e){n._reconstructActiveFormattingElements(),EYe(e),Ibe(e),e.selfClosing?n._appendElement(e,nn.SVG):n._insertElement(e,nn.SVG),e.ackSelfClosing=!0}function oRe(n,e){n._reconstructActiveFormattingElements(),n._insertElement(e,nn.HTML)}function _h(n,e){switch(e.tagID){case $.I:case $.S:case $.B:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.SMALL:case $.STRIKE:case $.STRONG:{Fvn(n,e);break}case $.A:{Mvn(n,e);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{Dvn(n,e);break}case $.P:case $.DL:case $.OL:case $.UL:case $.DIV:case $.DIR:case $.NAV:case $.MAIN:case $.MENU:case $.ASIDE:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.DETAILS:case $.ADDRESS:case $.ARTICLE:case $.SECTION:case $.SUMMARY:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{Lvn(n,e);break}case $.LI:case $.DD:case $.DT:{Nvn(n,e);break}case $.BR:case $.IMG:case $.WBR:case $.AREA:case $.EMBED:case $.KEYGEN:{IYe(n,e);break}case $.HR:{zvn(n,e);break}case $.RB:case $.RTC:{Qvn(n,e);break}case $.RT:case $.RP:{Xvn(n,e);break}case $.PRE:case $.LISTING:{Avn(n,e);break}case $.XMP:{qvn(n,e);break}case $.SVG:{Jvn(n,e);break}case $.HTML:{Tvn(n,e);break}case $.BASE:case $.LINK:case $.META:case $.STYLE:case $.TITLE:case $.SCRIPT:case $.BGSOUND:case $.BASEFONT:case $.TEMPLATE:{Lv(n,e);break}case $.BODY:{kvn(n,e);break}case $.FORM:{Rvn(n,e);break}case $.NOBR:{Bvn(n,e);break}case $.MATH:{Zvn(n,e);break}case $.TABLE:{Vvn(n,e);break}case $.INPUT:{Hvn(n,e);break}case $.PARAM:case $.TRACK:case $.SOURCE:{Wvn(n,e);break}case $.IMAGE:{Uvn(n,e);break}case $.BUTTON:{Pvn(n,e);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{$vn(n,e);break}case $.IFRAME:{Gvn(n,e);break}case $.SELECT:{Kvn(n,e);break}case $.OPTION:case $.OPTGROUP:{Yvn(n,e);break}case $.NOEMBED:{rRe(n,e);break}case $.FRAMESET:{Ivn(n,e);break}case $.TEXTAREA:{jvn(n,e);break}case $.NOSCRIPT:{n.options.scriptingEnabled?rRe(n,e):oRe(n,e);break}case $.PLAINTEXT:{Ovn(n,e);break}case $.COL:case $.TH:case $.TD:case $.TR:case $.HEAD:case $.FRAME:case $.TBODY:case $.TFOOT:case $.THEAD:case $.CAPTION:case $.COLGROUP:break;default:oRe(n,e)}}function ebn(n,e){if(n.openElements.hasInScope($.BODY)&&(n.insertionMode=Ue.AFTER_BODY,n.options.sourceCodeLocationInfo)){const t=n.openElements.tryPeekProperlyNestedBodyElement();t&&n._setEndLocation(t,e)}}function tbn(n,e){n.openElements.hasInScope($.BODY)&&(n.insertionMode=Ue.AFTER_BODY,$Ye(n,e))}function nbn(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t))}function ibn(n){const e=n.openElements.tmplCount>0,{formElement:t}=n;e||(n.formElement=null),(t||e)&&n.openElements.hasInScope($.FORM)&&(n.openElements.generateImpliedEndTags(),e?n.openElements.popUntilTagNamePopped($.FORM):t&&n.openElements.remove(t))}function rbn(n){n.openElements.hasInButtonScope($.P)||n._insertFakeElement(_t.P,$.P),n._closePElement()}function obn(n){n.openElements.hasInListItemScope($.LI)&&(n.openElements.generateImpliedEndTagsWithExclusion($.LI),n.openElements.popUntilTagNamePopped($.LI))}function sbn(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTagsWithExclusion(t),n.openElements.popUntilTagNamePopped(t))}function abn(n){n.openElements.hasNumberedHeaderInScope()&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilNumberedHeaderPopped())}function lbn(n,e){const t=e.tagID;n.openElements.hasInScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t),n.activeFormattingElements.clearToLastMarker())}function cbn(n){n._reconstructActiveFormattingElements(),n._insertFakeElement(_t.BR,$.BR),n.openElements.pop(),n.framesetOk=!1}function DYe(n,e){const t=e.tagName,i=e.tagID;for(let r=n.openElements.stackTop;r>0;r--){const o=n.openElements.items[r],s=n.openElements.tagIDs[r];if(i===s&&(i!==$.UNKNOWN||n.treeAdapter.getTagName(o)===t)){n.openElements.generateImpliedEndTagsWithExclusion(i),n.openElements.stackTop>=r&&n.openElements.shortenToLength(r);break}if(n._isSpecialElement(o,s))break}}function jG(n,e){switch(e.tagID){case $.A:case $.B:case $.I:case $.S:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.NOBR:case $.SMALL:case $.STRIKE:case $.STRONG:{Lbe(n,e);break}case $.P:{rbn(n);break}case $.DL:case $.UL:case $.OL:case $.DIR:case $.DIV:case $.NAV:case $.PRE:case $.MAIN:case $.MENU:case $.ASIDE:case $.BUTTON:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.ADDRESS:case $.ARTICLE:case $.DETAILS:case $.SECTION:case $.SUMMARY:case $.LISTING:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{nbn(n,e);break}case $.LI:{obn(n);break}case $.DD:case $.DT:{sbn(n,e);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{abn(n);break}case $.BR:{cbn(n);break}case $.BODY:{ebn(n,e);break}case $.HTML:{tbn(n,e);break}case $.FORM:{ibn(n);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{lbn(n,e);break}case $.TEMPLATE:{Yk(n,e);break}default:DYe(n,e)}}function AYe(n,e){n.tmplInsertionModeStack.length>0?BYe(n,e):Dbe(n,e)}function ubn(n,e){var t;e.tagID===$.SCRIPT&&((t=n.scriptHandler)===null||t===void 0||t.call(n,n.openElements.current)),n.openElements.pop(),n.insertionMode=n.originalInsertionMode}function dbn(n,e){n._err(e,Ut.eofInElementThatCanContainOnlyText),n.openElements.pop(),n.insertionMode=n.originalInsertionMode,n.onEof(e)}function Dee(n,e){if(xYe.has(n.openElements.currentTagId))switch(n.pendingCharacterTokens.length=0,n.hasNonWhitespacePendingCharacterToken=!1,n.originalInsertionMode=n.insertionMode,n.insertionMode=Ue.IN_TABLE_TEXT,e.type){case Do.CHARACTER:{NYe(n,e);break}case Do.WHITESPACE_CHARACTER:{RYe(n,e);break}}else f6(n,e)}function hbn(n,e){n.openElements.clearBackToTableContext(),n.activeFormattingElements.insertMarker(),n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_CAPTION}function fbn(n,e){n.openElements.clearBackToTableContext(),n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_COLUMN_GROUP}function pbn(n,e){n.openElements.clearBackToTableContext(),n._insertFakeElement(_t.COLGROUP,$.COLGROUP),n.insertionMode=Ue.IN_COLUMN_GROUP,Abe(n,e)}function gbn(n,e){n.openElements.clearBackToTableContext(),n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_TABLE_BODY}function mbn(n,e){n.openElements.clearBackToTableContext(),n._insertFakeElement(_t.TBODY,$.TBODY),n.insertionMode=Ue.IN_TABLE_BODY,qG(n,e)}function _bn(n,e){n.openElements.hasInTableScope($.TABLE)&&(n.openElements.popUntilTagNamePopped($.TABLE),n._resetInsertionMode(),n._processStartTag(e))}function vbn(n,e){LYe(e)?n._appendElement(e,nn.HTML):f6(n,e),e.ackSelfClosing=!0}function bbn(n,e){!n.formElement&&n.openElements.tmplCount===0&&(n._insertElement(e,nn.HTML),n.formElement=n.openElements.current,n.openElements.pop())}function hA(n,e){switch(e.tagID){case $.TD:case $.TH:case $.TR:{mbn(n,e);break}case $.STYLE:case $.SCRIPT:case $.TEMPLATE:{Lv(n,e);break}case $.COL:{pbn(n,e);break}case $.FORM:{bbn(n,e);break}case $.TABLE:{_bn(n,e);break}case $.TBODY:case $.TFOOT:case $.THEAD:{gbn(n,e);break}case $.INPUT:{vbn(n,e);break}case $.CAPTION:{hbn(n,e);break}case $.COLGROUP:{fbn(n,e);break}default:f6(n,e)}}function m3(n,e){switch(e.tagID){case $.TABLE:{n.openElements.hasInTableScope($.TABLE)&&(n.openElements.popUntilTagNamePopped($.TABLE),n._resetInsertionMode());break}case $.TEMPLATE:{Yk(n,e);break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TBODY:case $.TD:case $.TFOOT:case $.TH:case $.THEAD:case $.TR:break;default:f6(n,e)}}function f6(n,e){const t=n.fosterParentingEnabled;n.fosterParentingEnabled=!0,UG(n,e),n.fosterParentingEnabled=t}function RYe(n,e){n.pendingCharacterTokens.push(e)}function NYe(n,e){n.pendingCharacterTokens.push(e),n.hasNonWhitespacePendingCharacterToken=!0}function CO(n,e){let t=0;if(n.hasNonWhitespacePendingCharacterToken)for(;t<n.pendingCharacterTokens.length;t++)f6(n,n.pendingCharacterTokens[t]);else for(;t<n.pendingCharacterTokens.length;t++)n._insertCharacters(n.pendingCharacterTokens[t]);n.insertionMode=n.originalInsertionMode,n._processToken(e)}const OYe=new Set([$.CAPTION,$.COL,$.COLGROUP,$.TBODY,$.TD,$.TFOOT,$.TH,$.THEAD,$.TR]);function ybn(n,e){const t=e.tagID;OYe.has(t)?n.openElements.hasInTableScope($.CAPTION)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped($.CAPTION),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=Ue.IN_TABLE,hA(n,e)):_h(n,e)}function Cbn(n,e){const t=e.tagID;switch(t){case $.CAPTION:case $.TABLE:{n.openElements.hasInTableScope($.CAPTION)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped($.CAPTION),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=Ue.IN_TABLE,t===$.TABLE&&m3(n,e));break}case $.BODY:case $.COL:case $.COLGROUP:case $.HTML:case $.TBODY:case $.TD:case $.TFOOT:case $.TH:case $.THEAD:case $.TR:break;default:jG(n,e)}}function Abe(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.COL:{n._appendElement(e,nn.HTML),e.ackSelfClosing=!0;break}case $.TEMPLATE:{Lv(n,e);break}default:MW(n,e)}}function wbn(n,e){switch(e.tagID){case $.COLGROUP:{n.openElements.currentTagId===$.COLGROUP&&(n.openElements.pop(),n.insertionMode=Ue.IN_TABLE);break}case $.TEMPLATE:{Yk(n,e);break}case $.COL:break;default:MW(n,e)}}function MW(n,e){n.openElements.currentTagId===$.COLGROUP&&(n.openElements.pop(),n.insertionMode=Ue.IN_TABLE,n._processToken(e))}function qG(n,e){switch(e.tagID){case $.TR:{n.openElements.clearBackToTableBodyContext(),n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_ROW;break}case $.TH:case $.TD:{n.openElements.clearBackToTableBodyContext(),n._insertFakeElement(_t.TR,$.TR),n.insertionMode=Ue.IN_ROW,GG(n,e);break}case $.CAPTION:case $.COL:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:{n.openElements.hasTableBodyContextInTableScope()&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=Ue.IN_TABLE,hA(n,e));break}default:hA(n,e)}}function Mae(n,e){const t=e.tagID;switch(e.tagID){case $.TBODY:case $.TFOOT:case $.THEAD:{n.openElements.hasInTableScope(t)&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=Ue.IN_TABLE);break}case $.TABLE:{n.openElements.hasTableBodyContextInTableScope()&&(n.openElements.clearBackToTableBodyContext(),n.openElements.pop(),n.insertionMode=Ue.IN_TABLE,m3(n,e));break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TD:case $.TH:case $.TR:break;default:m3(n,e)}}function GG(n,e){switch(e.tagID){case $.TH:case $.TD:{n.openElements.clearBackToTableRowContext(),n._insertElement(e,nn.HTML),n.insertionMode=Ue.IN_CELL,n.activeFormattingElements.insertMarker();break}case $.CAPTION:case $.COL:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:case $.TR:{n.openElements.hasInTableScope($.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=Ue.IN_TABLE_BODY,qG(n,e));break}default:hA(n,e)}}function PYe(n,e){switch(e.tagID){case $.TR:{n.openElements.hasInTableScope($.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=Ue.IN_TABLE_BODY);break}case $.TABLE:{n.openElements.hasInTableScope($.TR)&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=Ue.IN_TABLE_BODY,Mae(n,e));break}case $.TBODY:case $.TFOOT:case $.THEAD:{(n.openElements.hasInTableScope(e.tagID)||n.openElements.hasInTableScope($.TR))&&(n.openElements.clearBackToTableRowContext(),n.openElements.pop(),n.insertionMode=Ue.IN_TABLE_BODY,Mae(n,e));break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TD:case $.TH:break;default:m3(n,e)}}function Sbn(n,e){const t=e.tagID;OYe.has(t)?(n.openElements.hasInTableScope($.TD)||n.openElements.hasInTableScope($.TH))&&(n._closeTableCell(),GG(n,e)):_h(n,e)}function Ebn(n,e){const t=e.tagID;switch(t){case $.TD:case $.TH:{n.openElements.hasInTableScope(t)&&(n.openElements.generateImpliedEndTags(),n.openElements.popUntilTagNamePopped(t),n.activeFormattingElements.clearToLastMarker(),n.insertionMode=Ue.IN_ROW);break}case $.TABLE:case $.TBODY:case $.TFOOT:case $.THEAD:case $.TR:{n.openElements.hasInTableScope(t)&&(n._closeTableCell(),PYe(n,e));break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:break;default:jG(n,e)}}function MYe(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.OPTION:{n.openElements.currentTagId===$.OPTION&&n.openElements.pop(),n._insertElement(e,nn.HTML);break}case $.OPTGROUP:{n.openElements.currentTagId===$.OPTION&&n.openElements.pop(),n.openElements.currentTagId===$.OPTGROUP&&n.openElements.pop(),n._insertElement(e,nn.HTML);break}case $.INPUT:case $.KEYGEN:case $.TEXTAREA:case $.SELECT:{n.openElements.hasInSelectScope($.SELECT)&&(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode(),e.tagID!==$.SELECT&&n._processStartTag(e));break}case $.SCRIPT:case $.TEMPLATE:{Lv(n,e);break}}}function FYe(n,e){switch(e.tagID){case $.OPTGROUP:{n.openElements.stackTop>0&&n.openElements.currentTagId===$.OPTION&&n.openElements.tagIDs[n.openElements.stackTop-1]===$.OPTGROUP&&n.openElements.pop(),n.openElements.currentTagId===$.OPTGROUP&&n.openElements.pop();break}case $.OPTION:{n.openElements.currentTagId===$.OPTION&&n.openElements.pop();break}case $.SELECT:{n.openElements.hasInSelectScope($.SELECT)&&(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode());break}case $.TEMPLATE:{Yk(n,e);break}}}function xbn(n,e){const t=e.tagID;t===$.CAPTION||t===$.TABLE||t===$.TBODY||t===$.TFOOT||t===$.THEAD||t===$.TR||t===$.TD||t===$.TH?(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode(),n._processStartTag(e)):MYe(n,e)}function Tbn(n,e){const t=e.tagID;t===$.CAPTION||t===$.TABLE||t===$.TBODY||t===$.TFOOT||t===$.THEAD||t===$.TR||t===$.TD||t===$.TH?n.openElements.hasInTableScope(t)&&(n.openElements.popUntilTagNamePopped($.SELECT),n._resetInsertionMode(),n.onEndTag(e)):FYe(n,e)}function kbn(n,e){switch(e.tagID){case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{Lv(n,e);break}case $.CAPTION:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:{n.tmplInsertionModeStack[0]=Ue.IN_TABLE,n.insertionMode=Ue.IN_TABLE,hA(n,e);break}case $.COL:{n.tmplInsertionModeStack[0]=Ue.IN_COLUMN_GROUP,n.insertionMode=Ue.IN_COLUMN_GROUP,Abe(n,e);break}case $.TR:{n.tmplInsertionModeStack[0]=Ue.IN_TABLE_BODY,n.insertionMode=Ue.IN_TABLE_BODY,qG(n,e);break}case $.TD:case $.TH:{n.tmplInsertionModeStack[0]=Ue.IN_ROW,n.insertionMode=Ue.IN_ROW,GG(n,e);break}default:n.tmplInsertionModeStack[0]=Ue.IN_BODY,n.insertionMode=Ue.IN_BODY,_h(n,e)}}function Ibn(n,e){e.tagID===$.TEMPLATE&&Yk(n,e)}function BYe(n,e){n.openElements.tmplCount>0?(n.openElements.popUntilTagNamePopped($.TEMPLATE),n.activeFormattingElements.clearToLastMarker(),n.tmplInsertionModeStack.shift(),n._resetInsertionMode(),n.onEof(e)):Dbe(n,e)}function Lbn(n,e){e.tagID===$.HTML?_h(n,e):FW(n,e)}function $Ye(n,e){var t;if(e.tagID===$.HTML){if(n.fragmentContext||(n.insertionMode=Ue.AFTER_AFTER_BODY),n.options.sourceCodeLocationInfo&&n.openElements.tagIDs[0]===$.HTML){n._setEndLocation(n.openElements.items[0],e);const i=n.openElements.items[1];i&&!(!((t=n.treeAdapter.getNodeSourceCodeLocation(i))===null||t===void 0)&&t.endTag)&&n._setEndLocation(i,e)}}else FW(n,e)}function FW(n,e){n.insertionMode=Ue.IN_BODY,UG(n,e)}function Dbn(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.FRAMESET:{n._insertElement(e,nn.HTML);break}case $.FRAME:{n._appendElement(e,nn.HTML),e.ackSelfClosing=!0;break}case $.NOFRAMES:{Lv(n,e);break}}}function Abn(n,e){e.tagID===$.FRAMESET&&!n.openElements.isRootHtmlElementCurrent()&&(n.openElements.pop(),!n.fragmentContext&&n.openElements.currentTagId!==$.FRAMESET&&(n.insertionMode=Ue.AFTER_FRAMESET))}function Rbn(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.NOFRAMES:{Lv(n,e);break}}}function Nbn(n,e){e.tagID===$.HTML&&(n.insertionMode=Ue.AFTER_AFTER_FRAMESET)}function Obn(n,e){e.tagID===$.HTML?_h(n,e):$$(n,e)}function $$(n,e){n.insertionMode=Ue.IN_BODY,UG(n,e)}function Pbn(n,e){switch(e.tagID){case $.HTML:{_h(n,e);break}case $.NOFRAMES:{Lv(n,e);break}}}function Mbn(n,e){e.chars=yl,n._insertCharacters(e)}function Fbn(n,e){n._insertCharacters(e),n.framesetOk=!1}function VYe(n){for(;n.treeAdapter.getNamespaceURI(n.openElements.current)!==nn.HTML&&!n._isIntegrationPoint(n.openElements.currentTagId,n.openElements.current);)n.openElements.pop()}function Bbn(n,e){if(J_n(e))VYe(n),n._startTagOutsideForeignContent(e);else{const t=n._getAdjustedCurrentElement(),i=n.treeAdapter.getNamespaceURI(t);i===nn.MATHML?SYe(e):i===nn.SVG&&(evn(e),EYe(e)),Ibe(e),e.selfClosing?n._appendElement(e,i):n._insertElement(e,i),e.ackSelfClosing=!0}}function $bn(n,e){if(e.tagID===$.P||e.tagID===$.BR){VYe(n),n._endTagOutsideForeignContent(e);return}for(let t=n.openElements.stackTop;t>0;t--){const i=n.openElements.items[t];if(n.treeAdapter.getNamespaceURI(i)===nn.HTML){n._endTagOutsideForeignContent(e);break}const r=n.treeAdapter.getTagName(i);if(r.toLowerCase()===e.tagName){e.tagName=r,n.openElements.shortenToLength(t);break}}}_t.AREA,_t.BASE,_t.BASEFONT,_t.BGSOUND,_t.BR,_t.COL,_t.EMBED,_t.FRAME,_t.HR,_t.IMG,_t.INPUT,_t.KEYGEN,_t.LINK,_t.META,_t.PARAM,_t.SOURCE,_t.TRACK,_t.WBR;const Vbn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),sRe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function HYe(n,e){const t=Qbn(n),i=aYe("type",{handlers:{root:Hbn,element:Wbn,text:zbn,comment:zYe,doctype:Ubn,raw:qbn},unknown:Gbn}),r={parser:t?new iRe(sRe):iRe.getFragmentParser(void 0,sRe),handle(a){i(a,r)},stitches:!1,options:e||{}};i(n,r),XR(r,T0());const o=t?r.parser.document:r.parser.getFragment(),s=Zmn(o,{file:r.options.file});return r.stitches&&Ebe(s,"comment",function(a,l,c){const u=a;if(u.value.stitch&&c&&l!==void 0){const d=c.children;return d[l]=u.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===n.type?s.children[0]:s}function WYe(n,e){let t=-1;if(n)for(;++t<n.length;)e.handle(n[t])}function Hbn(n,e){WYe(n.children,e)}function Wbn(n,e){Kbn(n,e),WYe(n.children,e),Ybn(n,e)}function zbn(n,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const t={type:Do.CHARACTER,chars:n.value,location:p6(n)};XR(e,T0(n)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function Ubn(n,e){const t={type:Do.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:p6(n)};XR(e,T0(n)),e.parser.currentToken=t,e.parser._processToken(e.parser.currentToken)}function jbn(n,e){e.stitches=!0;const t=Xbn(n);if("children"in n&&"children"in t){const i=HYe({type:"root",children:n.children},e.options);t.children=i.children}zYe({type:"comment",value:{stitch:t}},e)}function zYe(n,e){const t=n.value,i={type:Do.COMMENT,data:t,location:p6(n)};XR(e,T0(n)),e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken)}function qbn(n,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,UYe(e,T0(n)),e.parser.tokenizer.write(n.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const t=e.parser.tokenizer._consume();e.parser.tokenizer._callState(t)}}function Gbn(n,e){const t=n;if(e.options.passThrough&&e.options.passThrough.includes(t.type))jbn(t,e);else{let i="";throw Vbn.has(t.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+t.type+"` node"+i)}}function XR(n,e){UYe(n,e);const t=n.parser.tokenizer.currentCharacterToken;t&&t.location&&(t.location.endLine=n.parser.tokenizer.preprocessor.line,t.location.endCol=n.parser.tokenizer.preprocessor.col+1,t.location.endOffset=n.parser.tokenizer.preprocessor.offset+1,n.parser.currentToken=t,n.parser._processToken(n.parser.currentToken)),n.parser.tokenizer.paused=!1,n.parser.tokenizer.inLoop=!1,n.parser.tokenizer.active=!1,n.parser.tokenizer.returnState=Cc.DATA,n.parser.tokenizer.charRefCode=-1,n.parser.tokenizer.consumedAfterSnapshot=-1,n.parser.tokenizer.currentLocation=null,n.parser.tokenizer.currentCharacterToken=null,n.parser.tokenizer.currentToken=null,n.parser.tokenizer.currentAttr={name:"",value:""}}function UYe(n,e){if(e&&e.offset!==void 0){const t={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};n.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,n.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,n.parser.tokenizer.preprocessor.line=e.line,n.parser.tokenizer.currentLocation=t}}function Kbn(n,e){const t=n.tagName.toLowerCase();if(e.parser.tokenizer.state===Cc.PLAINTEXT)return;XR(e,T0(n));const i=e.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Vx.html;r===Vx.html&&t==="svg"&&(r=Vx.svg);const o=i_n({...n,children:[]},{space:r===Vx.svg?"svg":"html"}),s={type:Do.START_TAG,tagName:t,tagID:QR(t),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:p6(n)};e.parser.currentToken=s,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=t}function Ybn(n,e){const t=n.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&d_n.includes(t)||e.parser.tokenizer.state===Cc.PLAINTEXT)return;XR(e,VG(n));const i={type:Do.END_TAG,tagName:t,tagID:QR(t),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:p6(n)};e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken),t===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Cc.RCDATA||e.parser.tokenizer.state===Cc.RAWTEXT||e.parser.tokenizer.state===Cc.SCRIPT_DATA)&&(e.parser.tokenizer.state=Cc.DATA)}function Qbn(n){const e=n.type==="root"?n.children[0]:n;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function p6(n){const e=T0(n)||{line:void 0,column:void 0,offset:void 0},t=VG(n)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:t.line,endCol:t.column,endOffset:t.offset}}function Xbn(n){return"children"in n?dA({...n,children:[]}):dA(n)}function Zbn(n){return function(e,t){return HYe(e,{...n,file:t})}}function Jbn(n){return n.replace(/^<x-next.*$/gm,"").replace(/---[\s\S]*?---/g,"").replace(/!\[.*?\]\((\/[^)]+)\)/g,(e,t)=>{const i=e.match(/!\[(.*?)\]/);return`![${i?i[1]:"An image"}](https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source${t})`}).trim()}function jYe({id:n,url:e}){const{t}=ve(),{data:i}=Ii({queryKey:["help-widget",n,e],queryFn:()=>fetch(e).then(l=>l.text().then(Jbn))}),[,r]=e.split("v5-rework/source"),o=si(),s=w.useRef(null),a=w.useRef(null);return w.useEffect(()=>{const l=new AbortController;return window.addEventListener(`help-widget-${n}:moveToHeading`,c=>{var u;if("detail"in c&&s.current&&a.current){const d=(u=s.current)==null?void 0:u.querySelectorAll("h3");if(d){const h=Array.from(d).findIndex(f=>f.innerText===c.detail);if(h>-1){const f=d[h];f&&a.current.scrollTo({behavior:"smooth",top:f.offsetTop-50})}}}},{signal:l.signal}),()=>l.abort()},[]),op.createPortal(O("div",{id:`help-widget-${n}`,className:"hidden fixed top-0 right-0 w-full md:w-1/2 lg:w-1/3 xl:w-1/4 h-full shadow-xl border rounded-l-lg z-50 overflow-y-auto",style:{backgroundColor:o.$1,color:o.$3,borderColor:o.$4},ref:a,children:[O("div",{className:"flex justify-between items-center sticky px-5 py-3 top-0",style:{backgroundColor:o.$1},children:[p("div",{}),O("div",{className:"flex items-center space-x-2",children:[p("button",{className:"hidden md:block",type:"button",onClick:()=>{const l=document.getElementById(`help-widget-${n}`);l&&(l.classList.toggle("right-0"),l.classList.toggle("left-0"))},children:p(NCt,{size:18})}),p("button",{children:p(qm,{size:20,onClick:()=>Rbe(n)})})]})]}),O("div",{className:"prose-sm p-5",ref:s,children:[p($mn,{rehypePlugins:[Zbn],children:i}),p("div",{className:"flex justify-center",children:O(qi,{to:`https://invoiceninja.github.io/${r.replace(".md","")}`,external:!0,className:"flex items-center space-x-2",children:[p("span",{children:t("view_docs")})," ",p(Z8e,{size:16})]})})]})]}),document.body)}function Rbe(n,e){const t=document.querySelector(`div#help-widget-${n}`);console.log(t),t&&(t.classList.toggle("hidden"),e!=null&&e.moveToHeading&&window.dispatchEvent(new CustomEvent(`help-widget-${n}:moveToHeading`,{detail:e.moveToHeading})))}function qYe(n){const[e]=ve(),t=ml(),i=vKe(n.companyGateway,n.setCompanyGateway),r=BG(n.companyGateway),o="d14dd26a47cecc30fdd65700bfb67b34",s="8fdeed552015b3c7b44ed6c8ebd9e992",a="80af24a6a691230bbec33e930ab40666",l="b9886f9257f0c6ee7c302f1c74475f6c",c=[o,s,a],u=Ti(),[d,h]=w.useState(!1),[f,g]=w.useState(),[m,v]=w.useState(""),_=()=>{d||(he.processing(),h(!0),$e("POST",Ae("/api/v1/company_gateways/:id/test",{id:n.companyGateway.id})).then(()=>g(!0)).catch(C=>{var E,x;v((x=(E=C.response)==null?void 0:E.data)==null?void 0:x.message),g(!1)}).finally(()=>{he.dismiss(),h(!1)}))},b=bKe(),y=Ss();return O(St,{children:[O(tn,{title:e("credentials"),topRight:O("button",{style:{color:y},type:"button",onClick:()=>Rbe("gateways",{moveToHeading:"Credentials"}),className:"inline-flex items-center space-x-1 text-sm",children:[p(Tge,{size:18}),p("span",{children:e("documentation")})]}),children:[n.gateway.site_url&&n.gateway.site_url.length>=1&&p(G,{leftSide:e("help"),children:p(qi,{external:!0,to:n.gateway.site_url,children:e("learn_more")})}),n.gateway&&n.gateway.key===o&&p(fhn,{}),n.gateway&&n.gateway.key===s&&p(phn,{}),n.gateway&&n.gateway.key===a&&p(ghn,{gateway:n.gateway,companyGateway:n.companyGateway,setCompanyGateway:n.setCompanyGateway,errors:n.errors}),n.gateway&&n.gateway.key===l&&qo()&&r("oauth2")===!0&&p(mhn,{companyGateway:n.companyGateway,setCompanyGateway:n.setCompanyGateway}),n.gateway&&!c.includes(n.gateway.key)&&Object.keys(JSON.parse(n.gateway.fields)).map((C,E)=>p(G,{leftSide:mKe(C),children:i(C,JSON.parse(n.gateway.fields)[C],n.errors)},E)),n.gateway&&n.gateway.key===l&&qo()&&r("oauth2")!==!0&&{}.VITE_GOCARDLESS_TESTING_COMPANY===(u==null?void 0:u.id)&&p(G,{leftSide:e("OAuth 2.0"),children:p(un,{behavior:"button",type:"minimal",onClick:b,children:e("connect")})}),p(vi,{}),!t.pathname.includes("/create")&&O(St,{children:[p(vi,{}),p("div",{className:"flex justify-end pr-6",children:p(un,{behavior:"button",onClick:_,disableWithoutIcon:!0,disabled:d||!n.isGatewaySaved,children:e("health_check")})})]})]}),p(Or,{title:e("status"),visible:typeof f<"u",onClose:()=>g(void 0),children:typeof f<"u"&&p("span",{className:"text-center font-medium text-base pb-3",children:e(f?"success":m||"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 e0n(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 js=(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))(js||{});/**
* 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 t0n={[js.CreditCard]:"credit_card",[js.BankTransfer]:"bank_transfer",[js.PayPal]:"paypal",[js.Crypto]:"crypto",[js.Custom]:"custom",[js.Alipay]:"alipay",[js.Sofort]:"sofort",[js.ApplePay]:"apple_pay",[js.SEPA]:"sepa",[js.Credit]:"credit",[js.KBC]:"kbc",[js.Bancontact]:"bancontact",[js.IDeal]:"ideal",[js.Hosted]:"hosted",[js.Giropay]:"giropay",[js.Przelewy24]:"przelewy24",[js.DirectDebit]:"direct_debit",[js.EPS]:"eps",[js.ACSS]:"acss",[js.BECS]:"becs",[js.InstantBankPay]:"instant_bank_pay",[js.KLARNA]:"klarna",[js.BACS]:"bacs",[js.FPX]:"fpx",[js.VENMO]:"venmo",[js.MERCADOPAGO]:"mercadopago",[js.MYBANK]:"mybank",[js.PAYLATER]:"paylater",[js.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 GYe(){const[n]=ve();return e=>n(t0n[e]||"other")}const n0n=Ro(void 0);function KYe(n){var d,h,f,g,m,v,_,b,y,C,E,x,k,L,D,A,N,P,M,B,F,U,H,W,q,V,re,oe,Q,Ne,Ve,Ye;const[e]=ve(),t=Ti(),[i,r]=us(n0n),o=GYe(),s=e0n(n.setCompanyGateway);w.useEffect(()=>{const ye=Object.entries(n.companyGateway.fees_and_limits).filter(([,He])=>He.is_enabled);typeof i<"u"&&ye.length>0||(ye.length>0?r(ye[0][0]):r(void 0))},[n.companyGateway]);const a=ye=>{r(ye.target.value)},l=(ye,He)=>{i&&s(i,ye,He)},c=()=>{var ye,He;if(i){const{fee_tax_name1:Pe,fee_tax_name2:Ge,fee_tax_name3:Fe}=((He=(ye=n.companyGateway)==null?void 0:ye.fees_and_limits)==null?void 0:He[i])||{};if(t.enabled_item_tax_rates===0&&(Pe||Ge||Fe))return!0}return!1},u=Ss();return O(tn,{title:e("limits_and_fees"),topRight:O("button",{style:{color:u},type:"button",onClick:()=>Rbe("gateways",{moveToHeading:"Limits/Fees"}),className:"inline-flex items-center space-x-1 text-sm",children:[p(Tge,{size:18}),p("span",{children:e("documentation")})]}),children:[p(G,{leftSide:e("payment_type"),children:p(En,{onChange:a,errorMessage:(d=n.errors)==null?void 0:d.errors.gatewayTypeId,children:Object.entries(n.companyGateway.fees_and_limits).filter(([,ye])=>ye.is_enabled).map(([ye],He)=>p("option",{value:ye,children:o(ye)},He))})}),i&&O(St,{children:[p(vi,{}),p(G,{leftSide:`${e("min")} ${e("limit")}`,children:O("div",{className:"space-y-4",children:[p(mo,{value:((f=(h=n.companyGateway.fees_and_limits)==null?void 0:h[i])==null?void 0:f.min_limit)||"",onValueChange:ye=>l("min_limit",parseFloat(ye)||-1),disabled:((m=(g=n.companyGateway.fees_and_limits)==null?void 0:g[i])==null?void 0:m.min_limit)===-1,errorMessage:(v=n.errors)==null?void 0:v.errors.min_limit}),p(kt,{checked:((b=(_=n.companyGateway.fees_and_limits)==null?void 0:_[i])==null?void 0:b.min_limit)>=0,label:e("enable_min"),onValueChange:ye=>l("min_limit",ye?0:-1)})]})}),p(G,{leftSide:`${e("max")} ${e("limit")}`,children:O("div",{className:"space-y-4",children:[p(mo,{value:((C=(y=n.companyGateway.fees_and_limits)==null?void 0:y[i])==null?void 0:C.max_limit)||"",onValueChange:ye=>l("max_limit",parseFloat(ye)||-1),disabled:((x=(E=n.companyGateway.fees_and_limits)==null?void 0:E[i])==null?void 0:x.max_limit)===-1,errorMessage:(k=n.errors)==null?void 0:k.errors.max_limit}),p(kt,{checked:((D=(L=n.companyGateway.fees_and_limits)==null?void 0:L[i])==null?void 0:D.max_limit)>=0,label:e("enable_max"),onValueChange:ye=>l("max_limit",ye?0:-1)})]})}),p(vi,{}),p(G,{leftSide:e("fee_percent"),children:p(mo,{value:((N=(A=n.companyGateway.fees_and_limits)==null?void 0:A[i])==null?void 0:N.fee_percent)||"",onValueChange:ye=>l("fee_percent",parseFloat(ye)),errorMessage:(P=n.errors)==null?void 0:P.errors.fee_percent})}),p(G,{leftSide:e("fee_amount"),children:p(mo,{value:((B=(M=n.companyGateway.fees_and_limits)==null?void 0:M[i])==null?void 0:B.fee_amount)||"",onValueChange:ye=>l("fee_amount",parseFloat(ye)),errorMessage:(F=n.errors)==null?void 0:F.errors.fee_amount})}),c()&&O("div",{className:"flex items-center space-x-3 px-6 py-2",children:[p("div",{children:p(nt,{element:Ly,size:20,color:"orange"})}),p("div",{className:"text-sm font-medium",children:EG(e("hidden_taxes_warning"),":link",()=>p(qi,{to:"/settings/tax_settings",children:e("settings")}))})]}),t&&t.enabled_item_tax_rates>0&&p(G,{leftSide:e("tax"),children:p(Aw,{defaultValue:((H=(U=n.companyGateway)==null?void 0:U.fees_and_limits[i])==null?void 0:H.fee_tax_name1)||"",onChange:ye=>{var He,Pe;l("fee_tax_name1",((He=ye.resource)==null?void 0:He.name)||""),l("fee_tax_rate1",((Pe=ye.resource)==null?void 0:Pe.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name1",""),l("fee_tax_rate1",0)},onTaxCreated:ye=>{l("fee_tax_name1",ye.name),l("fee_tax_rate1",ye.rate)}})}),t&&t.enabled_item_tax_rates>1&&p(G,{leftSide:e("tax"),children:p(Aw,{defaultValue:((q=(W=n.companyGateway)==null?void 0:W.fees_and_limits[i])==null?void 0:q.fee_tax_name2)||"",onChange:ye=>{var He,Pe;l("fee_tax_name2",((He=ye.resource)==null?void 0:He.name)||""),l("fee_tax_rate2",((Pe=ye.resource)==null?void 0:Pe.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name2",""),l("fee_tax_rate2",0)},onTaxCreated:ye=>{l("fee_tax_name2",ye.name),l("fee_tax_rate2",ye.rate)}})}),t&&t.enabled_item_tax_rates>2&&p(G,{leftSide:e("tax"),children:p(Aw,{defaultValue:((re=(V=n.companyGateway)==null?void 0:V.fees_and_limits[i])==null?void 0:re.fee_tax_name3)||"",onChange:ye=>{var He,Pe;l("fee_tax_name3",((He=ye.resource)==null?void 0:He.name)||""),l("fee_tax_rate3",((Pe=ye.resource)==null?void 0:Pe.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name3",""),l("fee_tax_rate3",0)},onTaxCreated:ye=>{l("fee_tax_name3",ye.name),l("fee_tax_rate3",ye.rate)}})}),p(G,{leftSide:e("fee_cap"),children:p(mo,{value:((Q=(oe=n.companyGateway.fees_and_limits)==null?void 0:oe[i])==null?void 0:Q.fee_cap)||"",onValueChange:ye=>l("fee_cap",parseFloat(ye)),errorMessage:(Ne=n.errors)==null?void 0:Ne.errors.fee_cap})}),p(G,{leftSide:e("adjust_fee_percent"),children:p(kt,{checked:(Ye=(Ve=n.companyGateway.fees_and_limits)==null?void 0:Ve[i])==null?void 0:Ye.adjust_fee_percent,label:e("adjust_fee_percent_help"),onValueChange:ye=>l("adjust_fee_percent",ye)})})]})]})}function YYe(n){const[e]=ve(),t=(i,r)=>{n.setCompanyGateway(o=>o&&{...o,[i]:r})};return O(tn,{title:e("required_fields"),children:[p(G,{leftSide:e("client_name"),children:p(kt,{checked:n.companyGateway.require_client_name,onChange:i=>t("require_client_name",i)})}),p(G,{leftSide:e("client_phone"),children:p(kt,{checked:n.companyGateway.require_client_phone,onChange:i=>t("require_client_phone",i)})}),p(G,{leftSide:e("contact_name"),children:p(kt,{checked:n.companyGateway.require_contact_name,onChange:i=>t("require_contact_name",i)})}),p(G,{leftSide:e("contact_email"),children:p(kt,{checked:n.companyGateway.require_contact_email,onChange:i=>t("require_contact_email",i)})}),p(G,{leftSide:e("postal_code"),children:p(kt,{checked:n.companyGateway.require_postal_code,onChange:i=>t("require_postal_code",i)})}),p(G,{leftSide:e("cvv"),children:p(kt,{checked:n.companyGateway.require_cvv,onChange:i=>t("require_cvv",i)})}),p(G,{leftSide:e("billing_address"),children:p(kt,{checked:n.companyGateway.require_billing_address,onChange:i=>t("require_billing_address",i)})}),p(G,{leftSide:e("shipping_address"),children:p(kt,{checked:n.companyGateway.require_shipping_address,onChange:i=>t("require_shipping_address",i)})}),p(vi,{}),p(G,{leftSide:e("update_address"),children:p(kt,{label:e("update_address_help"),checked:n.companyGateway.update_details,onChange:i=>t("update_details",i)})}),p(G,{leftSide:e("always_show_required_fields"),children:p(kt,{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 QYe={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 i0n(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]:QYe}})}}function XYe(n){var u,d;const[e]=ve(),[t,i]=w.useState(n.gateway),[r,o]=w.useState([]);w.useEffect(()=>i(n.gateway),[n.gateway]),w.useEffect(()=>{const h=[];for(const f in t.options)h.push({gatewayTypeId:f,...t.options[f]});o([...h])},[t]);const s=GYe(),a=(h,f)=>{n.setCompanyGateway(g=>g&&{...g,[h]:f})},l=i0n(n.companyGateway,n.setCompanyGateway),c=h=>{const f=Object.entries(n.companyGateway.fees_and_limits).find(([m])=>h===m);if(!f)return!1;const[,g]=f;return g.is_enabled};return O(tn,{title:e("settings"),children:[p(G,{leftSide:e("label"),children:p(Ze,{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)&&p(G,{leftSide:e("capture_card"),children:O(En,{value:n.companyGateway.token_billing||"off",onValueChange:h=>a("token_billing",h),errorMessage:(d=n.errors)==null?void 0:d.errors.token_billing,children:[p("option",{value:"always",children:e("enabled")}),p("option",{value:"optout",children:e("auto_bill_help_optout")}),p("option",{value:"optin",children:e("auto_bill_help_optin")}),p("option",{value:"off",children:e("off")})]})}),p(vi,{}),r.map((h,f)=>p(G,{leftSide:s(h.gatewayTypeId),children:p(kt,{checked:c(h.gatewayTypeId),onChange:g=>l(h.gatewayTypeId,g)})},f))]})}/**
* 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 r0n(n,e){const t=ki(),i=Co(),r=Gi(Eu);return o=>{he.processing(),e(void 0),$e("POST",Ae("/api/v1/company_gateways"),n).then(s=>{r&&i.invalidateQueries([r]),In(["company_gateways"]),he.success("created_company_gateway"),t(At("/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&&(he.dismiss(),e(s.response.data))})}}const o0n="/gateway-card-images/visa.png",s0n="/gateway-card-images/authorize-net.png",a0n="/gateway-card-images/american-express.png",l0n="/gateway-card-images/mastercard.png",Aee="/gateway-card-images/paypal.png",c0n="/gateway-card-images/braintree.svg.png",u0n="/gateway-card-images/checkout.jpg",d0n="/gateway-card-images/gocardless.png",h0n="/gateway-card-images/mollie.png",f0n="/gateway-card-images/payfast.png",p0n="/gateway-card-images/paytrace.svg",g0n="/gateway-card-images/razorpay.png",m0n="/gateway-card-images/square.svg.png",_0n="/gateway-card-images/stripe.svg",v0n="/gateway-card-images/eway.png",b0n="/gateway-card-images/forte.png",y0n="/gateway-card-images/wepay.svg",C0n="/gateway-card-images/btcpay.png",w0n=["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 Fae(n){switch(n.name){case"visa":return p("img",{src:o0n,alt:"Visa",style:n.style||{width:30,height:30}});case"american_express":return p("img",{src:a0n,alt:"American Express",style:n.style||{width:30,height:30}});case"mastercard":return p("img",{src:l0n,alt:"Mastercard",style:n.style||{width:30,height:30}});case"paypal_platform":return p("img",{src:Aee,alt:"PayPal",style:n.style||{width:40,height:40}});case"paypal_rest":return p("img",{src:Aee,alt:"PayPal Rest",style:n.style||{width:40,height:40}});case"paypal_ppcp":return p("img",{src:Aee,alt:"PayPal",style:n.style||{width:40,height:40}});case"authorize":return p("img",{src:s0n,alt:"AuthorizeNet",style:n.style||{width:40,height:40}});case"braintree":return p("img",{src:c0n,alt:"Braintree",style:n.style||{width:40,height:40}});case"checkoutcom":return p("img",{src:u0n,alt:"Checkoutcom",style:n.style||{width:40,height:40}});case"gocardless":return p("img",{src:d0n,alt:"GoCardless",style:n.style||{width:40,height:40}});case"mollie":return p("img",{src:h0n,alt:"Mollie",style:n.style||{width:40,height:40}});case"payfast":return p("img",{src:f0n,alt:"Payfast",style:n.style||{width:40,height:40}});case"paytrace":return p("img",{src:p0n,alt:"Paytrace",style:n.style||{width:40,height:40}});case"razorpay":return p("img",{src:g0n,alt:"Razorpay",style:n.style||{width:40,height:40}});case"square":return p("img",{src:m0n,alt:"Square",style:n.style||{width:40,height:40}});case"stripe":return p("img",{src:_0n,alt:"Stripe",style:n.style||{width:40,height:40}});case"eway":return p("img",{src:v0n,alt:"Eway",style:n.style||{width:40,height:40}});case"forte":return p("img",{src:b0n,alt:"Forte",style:n.style||{width:40,height:40}});case"wepay":return p("img",{src:y0n,alt:"Wepay",style:n.style||{width:30,height:30}});case"btcpay":return p("img",{src:C0n,alt:"BTCPay",style:n.style||{width:30,height:30}});default:return p(St,{})}}const S0n=[{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}],E0n=[{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 x0n(){const[n]=ve(),{documentTitle:e}=Mi("add_gateway"),{data:t}=A$t(),[i,r]=w.useState(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState([]),[d,h]=w.useState(!1),[f,g]=w.useState(0),m=gKe(),v=r0n(i,s),_=Ti(),b=(M,B)=>{const F=m.find(U=>U.id===M);if(l(F),(F==null?void 0:F.key)==="80af24a6a691230bbec33e930ab40666")return y();if((F==null?void 0:F.key)==="d14dd26a47cecc30fdd65700bfb67b34")return C();if((F==null?void 0:F.key)==="b9886f9257f0c6ee7c302f1c74475f6c"&&qo()&&{}.VITE_GOCARDLESS_TESTING_COMPANY===(_==null?void 0:_.id))return E();B&&g(1)},y=()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(M=>{var B;return(B=window.open(At("https://invoicing.co/paypal?hash=:hash",{hash:M.data.hash}),"_blank"))==null?void 0:B.focus()})},C=()=>{$e("POST",Ae("/api/v1/one_time_token"),{context:"stripe_connect"}).then(M=>{var B;return(B=window.open(At("https://invoicing.co/stripe/signup/:token",{token:M.data.hash}),"_blank"))==null?void 0:B.focus()})},E=bKe(),x=[n("payment_provider")],k=[n("credentials"),n("settings"),n("required_fields"),n("limits_and_fees")],L=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"},{name:n("add_gateway"),href:"/settings/gateways/create"}],[D,A]=w.useState(x),N=M=>{const B=E0n.find(F=>F.key===M);return(B==null?void 0:B.name)||""},P=M=>{const B=S0n.find(F=>F.name===M);return B?B.width:void 0};return w.useEffect(()=>{if(m){const M=m.findIndex(({key:B})=>B==="80af24a6a691230bbec33e930ab40665");if(M>=0){const B=Hve(m,M,1);u(B)}else u(m)}},[m]),w.useEffect(()=>{t!=null&&t.data.data&&i===void 0&&r(t.data.data)},[t,a]),w.useEffect(()=>{r(F=>F&&a&&{...F,gateway_key:a.key,token_billing:"always"}),(a?Object.entries(a.options):[]).find(([F])=>F==="1")&&r(F=>F&&{...F,fees_and_limits:{...F.fees_and_limits,1:QYe}})},[a]),w.useEffect(()=>{A(a?[...x,...k]:[...x])},[a]),w.useEffect(()=>{d&&(v(1),h(!1))},[i]),O(sr,{title:e,breadcrumbs:L,onSaveClick:()=>v(1),disableSaveButton:!a,children:[p(jYe,{id:"gateways",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/gateways.md"}),O(kv,{tabs:D,defaultTabIndex:f,onTabChange:M=>g(M),children:[p(tn,{title:n("add_gateway"),children:p(G,{leftSide:n("payment_provider"),children:p(En,{onValueChange:M=>b(M,!0),value:a==null?void 0:a.id,errorMessage:o==null?void 0:o.errors.gateway_key,withBlank:!0,children:c.map((M,B)=>p("option",{value:M.id,children:M.name},B))})})}),p("div",{children:a&&i&&p(qYe,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})}),p("div",{children:a&&i&&p(XYe,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})}),p("div",{children:a&&i&&p(YYe,{gateway:a,companyGateway:i,setCompanyGateway:r})}),p("div",{children:a&&i&&p(KYe,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})})]}),!f&&p("div",{className:"flex flex-wrap gap-4",children:c.map((M,B)=>w0n.includes(N(M.key))&&p(tn,{className:"w-52",children:O("div",{className:"flex flex-col items-center justify-between h-52",children:[p("div",{className:"flex justify-center items-center border-b border-b-gray-200 w-full h-28",children:p(Fae,{name:N(M.key),style:{width:P(N(M.key))||150}})}),O("div",{className:zt("flex flex-col pt-4 flex-1",{"justify-between":M.site_url,"justify-end":!M.site_url}),children:[M.site_url&&p(qi,{external:!0,to:M.site_url,children:n("website")}),p(un,{behavior:"button",onClick:()=>{M.key!=="80af24a6a691230bbec33e930ab40666"&&h(!0),b(M.id)},children:n("setup")})]})]})},B))})]})}/**
* 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 T0n(n,e){return()=>{n&&(e(void 0),he.processing(),$e("PUT",Ae("/api/v1/company_gateways/:id",{id:n==null?void 0:n.id}),n).then(()=>{he.success("updated_company_gateway"),In(["company_gateways"])}).catch(t=>{var i;((i=t==null?void 0:t.response)==null?void 0:i.status)===422&&(he.dismiss(),e(t.response.data))}))}}function k0n(){const[n]=ve(),[e,t]=w.useState(!1),i=Wi(ap),r=o=>{he.processing(),$e("post",Ae("/api/v1/stripe/import_customers"),{},{headers:{"X-Api-Password":o}}).then(()=>he.success("imported_customers")).catch(s=>{var a;((a=s.response)==null?void 0:a.status)===412&&(he.error("password_error_incorrect"),i(0))})};return O(St,{children:[p(tn,{title:n("import_customers"),children:p(Nl,{onClick:()=>t(!0),children:n("click_to_continue")})}),p(Tg,{onSave:r,show:e,onClose:t})]})}function I0n(n){const[e]=ve(),t=Ti();return O(tn,{title:e("webhooks"),children:[p(G,{leftSide:e("webhook_url"),children:p(Oc,{className:"break-all",text:`${aF()}/payment_webhook/${t.company_key}/${n.companyGateway.id}`})}),p(G,{leftSide:e("supported_events"),children:p("ul",{className:"list-disc",children:Ja(Object.values(n.gateway.options)).pluck("webhooks").flatten().unique().whereNotNull().all().sort().map((i,r)=>p("li",{children:i},r))})})]})}function L0n(){const[n]=ve(),e=xWe(),t=r=>{he.processing(),$e("POST",Ae("/api/v1/company_gateways/:id/import_customers",{id:r})).then(o=>he.success(o.data.message))};return[r=>p(gt,{onClick:()=>t(r.id),icon:p(nt,{element:GEt}),children:n("import_customers")}),()=>p(vi,{withoutPadding:!0}),r=>Tr(r)===nr.Active&&p(gt,{onClick:()=>e([r.id],"archive"),icon:p(nt,{element:Dc}),children:n("archive")}),r=>(Tr(r)===nr.Archived||Tr(r)===nr.Deleted)&&p(gt,{onClick:()=>e([r.id],"restore"),icon:p(nt,{element:Lc}),children:n("restore")}),r=>(Tr(r)===nr.Active||Tr(r)===nr.Archived)&&p(gt,{onClick:()=>e([r.id],"delete"),icon:p(nt,{element:el}),children:n("delete")})]}function D0n(){const{documentTitle:n}=Mi("edit_gateway"),[e]=ve(),[t]=lF(),{id:i}=il(),r=L0n(),o=gKe(),{data:s}=D$t({id:i}),a=[e("payment_provider")],[l,c]=w.useState(),[u,d]=w.useState(),[h,f]=w.useState(a),[g,m]=w.useState(),v=[e("credentials"),e("settings"),e("required_fields"),e("limits_and_fees")],_=[{name:e("settings"),href:"/settings"},{name:e("online_payments"),href:"/settings/online_payments"},{name:(g==null?void 0:g.label)??"",href:At("/settings/gateways/:id/edit",{id:i})}],b=T0n(g,d);return w.useEffect(()=>{g&&c(o.find(y=>y.key==g.gateway_key))},[g,o]),w.useEffect(()=>{s!=null&&s.data.data&&m(s.data.data)},[s]),w.useEffect(()=>()=>{m(void 0)},[]),w.useEffect(()=>{f(l?[...a,...v]:[...a])},[l]),O(sr,{title:n,breadcrumbs:_,navigationTopRight:g&&p(R1,{resource:g,onSaveClick:b,actions:r}),children:[p(jYe,{id:"gateways",url:"https://raw.githubusercontent.com/invoiceninja/invoiceninja.github.io/refs/heads/v5-rework/source/en/gateways.md"}),O(kv,{tabs:h,defaultTabIndex:Number(t.get("tab"))??0,children:[p("div",{children:g&&O("div",{className:"space-y-4",children:[p(tn,{title:e("edit_gateway"),children:p(G,{leftSide:e("payment_provider"),children:g.label})}),(l==null?void 0:l.key)==="d14dd26a37cecc30fdd65700bfb55b23"?p(k0n,{}):null,l&&Ja(Object.values(l.options)).pluck("webhooks").flatten().unique().whereNotNull().count()>1&&p(I0n,{companyGateway:g,gateway:l})]})}),p("div",{children:l&&g&&p(qYe,{gateway:l,companyGateway:g,setCompanyGateway:m,errors:u,isGatewaySaved:!!(s&&An.isEqual(g,s.data.data))})}),p("div",{children:l&&g&&p(XYe,{gateway:l,companyGateway:g,setCompanyGateway:m,errors:u})}),p("div",{children:l&&g&&p(YYe,{gateway:l,companyGateway:g,setCompanyGateway:m})}),p("div",{children:l&&g&&p(KYe,{gateway:l,companyGateway:g,setCompanyGateway:m,errors: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 Ep(){return({settingsLevel:n})=>Promise.resolve(n===lM.Company)}const A0n=w.lazy(()=>ie(()=>import("./bundle.48f4b61b.js"),["bundle.48f4b61b.js","bundle.16a87326.js","bundle.b6ced983.js"])),R0n=w.lazy(()=>ie(()=>import("./bundle.5126eb3b.js"),["bundle.5126eb3b.js","bundle.7934b7d8.js","bundle.16a87326.js","bundle.9fc05a49.js"])),N0n=w.lazy(()=>ie(()=>import("./bundle.7e1e70ef.js"),["bundle.7e1e70ef.js","bundle.30d594ed.js"])),O0n=w.lazy(()=>ie(()=>import("./bundle.d96225ff.js"),["bundle.d96225ff.js","bundle.1145e4b9.js","bundle.7934b7d8.js","bundle.30d594ed.js"])),P0n=w.lazy(()=>ie(()=>import("./bundle.55a9fcee.js"),["bundle.55a9fcee.js","bundle.a06015f6.js","bundle.30d594ed.js"])),M0n=w.lazy(()=>ie(()=>import("./bundle.0f652829.js"),["bundle.0f652829.js","bundle.a06015f6.js"])),F0n=w.lazy(()=>ie(()=>import("./bundle.dbb0fb48.js"),["bundle.dbb0fb48.js","bundle.a06015f6.js"])),B0n=w.lazy(()=>ie(()=>import("./bundle.c845c11b.js"),["bundle.c845c11b.js","bundle.a06015f6.js"])),$0n=w.lazy(()=>ie(()=>import("./bundle.ccad1613.js"),["bundle.ccad1613.js","bundle.a06015f6.js"])),V0n=w.lazy(()=>ie(()=>import("./bundle.846976fd.js"),["bundle.846976fd.js","bundle.a06015f6.js"])),H0n=w.lazy(()=>ie(()=>import("./bundle.8227055f.js"),["bundle.8227055f.js","bundle.a06015f6.js"])),W0n=w.lazy(()=>ie(()=>import("./bundle.085e632e.js"),["bundle.085e632e.js","bundle.a06015f6.js"])),z0n=w.lazy(()=>ie(()=>import("./bundle.23fb4996.js"),["bundle.23fb4996.js","bundle.a06015f6.js","bundle.9fc05a49.js"])),U0n=w.lazy(()=>ie(()=>import("./bundle.6393ec49.js"),["bundle.6393ec49.js","bundle.a06015f6.js"])),j0n=w.lazy(()=>ie(()=>import("./bundle.65a665f7.js"),["bundle.65a665f7.js","bundle.a06015f6.js"])),q0n=w.lazy(()=>ie(()=>import("./bundle.988758a0.js"),["bundle.988758a0.js","bundle.a06015f6.js"])),G0n=w.lazy(()=>ie(()=>import("./bundle.5763d0cc.js"),["bundle.5763d0cc.js","bundle.7934b7d8.js","bundle.b6ced983.js","bundle.0685a430.js"])),K0n=w.lazy(()=>ie(()=>import("./bundle.b7913d8a.js"),["bundle.b7913d8a.js","bundle.1145e4b9.js","bundle.7934b7d8.js","bundle.0cd901a9.js","bundle.d96225ff.js","bundle.30d594ed.js"])),Y0n=w.lazy(()=>ie(()=>import("./bundle.730afcc7.js"),["bundle.730afcc7.js","bundle.0cd901a9.js"])),Q0n=w.lazy(()=>ie(()=>import("./bundle.f2455346.js"),["bundle.f2455346.js","bundle.0cd901a9.js"])),X0n=w.lazy(()=>ie(()=>import("./bundle.f49e0543.js"),["bundle.f49e0543.js","bundle.0cd901a9.js"])),Z0n=w.lazy(()=>ie(()=>import("./bundle.62967ecd.js"),["bundle.62967ecd.js","bundle.0cd901a9.js"])),J0n=w.lazy(()=>ie(()=>import("./bundle.b1583822.js"),[])),eyn=O(_e,{path:"invoice_design",element:p(A0n,{}),children:[p(_e,{path:"",element:p(R0n,{})}),p(_e,{path:"custom_designs",element:p(N0n,{})}),O(_e,{path:"custom_designs/:id/edit",element:p(zn,{guards:[Ep()],component:p(G0n,{}),type:"subPage"}),children:[p(_e,{path:"",element:p(K0n,{})}),p(_e,{path:"body",element:p(Y0n,{})}),p(_e,{path:"header",element:p(Q0n,{})}),p(_e,{path:"footer",element:p(X0n,{})}),p(_e,{path:"includes",element:p(Z0n,{})}),p(_e,{path:"variables",element:p(J0n,{})})]}),p(_e,{path:"custom_designs/create",element:p(O0n,{})}),p(_e,{path:"client_details",element:p(zn,{guards:[Ep()],component:p(P0n,{}),type:"subPage"})}),p(_e,{path:"company_details",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(M0n,{}),type:"subPage"})}),p(_e,{path:"company_address",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(F0n,{}),type:"subPage"})}),p(_e,{path:"invoice_details",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(B0n,{}),type:"subPage"})}),p(_e,{path:"quote_details",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p($0n,{}),type:"subPage"})}),p(_e,{path:"credit_details",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(V0n,{}),type:"subPage"})}),p(_e,{path:"vendor_details",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(H0n,{}),type:"subPage"})}),p(_e,{path:"purchase_order_details",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(W0n,{}),type:"subPage"})}),p(_e,{path:"product_columns",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(z0n,{}),type:"subPage"})}),p(_e,{path:"quote_product_columns",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(U0n,{}),type:"subPage"})}),p(_e,{path:"task_columns",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(j0n,{}),type:"subPage"})}),p(_e,{path:"total_fields",element:p(zn,{guards:[Ep(),Ai(aa(),aa())],component:p(q0n,{}),type:"subPage"})})]}),tyn=O(_e,{path:"/settings",children:[O(_e,{path:"user_details",element:p(aQt,{}),children:[p(_e,{path:"",element:p(KKt,{})}),p(_e,{path:"password",element:p(XKt,{})}),p(_e,{path:"connect",element:p(OKt,{})}),p(_e,{path:"accent_color",element:p(_qt,{})}),p(_e,{path:"notifications",element:p(QKt,{})}),p(_e,{path:"enable_two_factor",element:p(TYt,{})}),p(_e,{path:"custom_fields",element:p(kYt,{})}),p(_e,{path:"preferences",element:p(oQt,{})})]}),O(_e,{element:p(zn,{guards:[Y2()],component:p(sp,{})}),children:[p(_e,{path:"",element:p(jjt,{})}),O(_e,{path:"company_details",element:p(Qjt,{}),children:[p(_e,{path:"",element:p(qdn,{})}),p(_e,{path:"address",element:p(Udn,{})}),p(_e,{path:"logo",element:p(hKe,{})}),p(_e,{path:"defaults",element:p(jdn,{})}),p(_e,{path:"documents",element:p(zdn,{})}),p(_e,{path:"custom_fields",element:p(Gdn,{})})]}),O(_e,{path:"localization",element:p(dQt,{}),children:[p(_e,{path:"",element:p(cQt,{})}),p(_e,{path:"custom_labels",element:p(lQt,{})})]}),p(_e,{path:"online_payments",element:p(stn,{})}),p(_e,{path:"tax_settings",element:p(vtn,{})}),p(_e,{path:"product_settings",element:p(btn,{})}),p(_e,{path:"task_settings",element:p(ytn,{})}),p(_e,{path:"expense_settings",element:p(Otn,{})}),p(_e,{path:"workflow_settings",element:p(Ftn,{})}),p(_e,{path:"import_export",element:p(Mnn,{})}),O(_e,{path:"account_management",element:p(Bnn,{}),children:[p(_e,{path:"",element:p(x$t,{})}),p(_e,{path:"overview",element:p(E$t,{})}),p(_e,{path:"enabled_modules",element:p(u3t,{})}),p(_e,{path:"integrations",element:p(d3t,{})}),p(_e,{path:"security_settings",element:p(T$t,{})}),p(_e,{path:"referral_program",element:p(I$t,{})}),!d1()&&p(_e,{path:"danger_zone",element:p(k$t,{})})]}),O(_e,{path:"backup_restore",element:p(oln,{}),children:[p(_e,{path:"",element:p(hln,{})}),p(_e,{path:"restore",element:p(dln,{})})]}),O(_e,{path:"custom_fields",element:p($nn,{}),children:[p(_e,{path:"company",element:p(Vnn,{})}),p(_e,{path:"clients",element:p(Hnn,{})}),p(_e,{path:"products",element:p(Wnn,{})}),p(_e,{path:"invoices",element:p(jnn,{})}),p(_e,{path:"payments",element:p(qnn,{})}),p(_e,{path:"projects",element:p(Gnn,{})}),p(_e,{path:"tasks",element:p(Knn,{})}),p(_e,{path:"vendors",element:p(Ynn,{})}),p(_e,{path:"expenses",element:p(Qnn,{})}),p(_e,{path:"users",element:p(Xnn,{})})]}),O(_e,{path:"generated_numbers",element:p(Jnn,{}),children:[p(_e,{path:"",element:p(pin,{})}),p(_e,{path:"clients",element:p(ein,{})}),p(_e,{path:"invoices",element:p(tin,{})}),p(_e,{path:"recurring_invoices",element:p(nin,{})}),p(_e,{path:"payments",element:p(iin,{})}),p(_e,{path:"quotes",element:p(rin,{})}),p(_e,{path:"credits",element:p(oin,{})}),p(_e,{path:"projects",element:p(sin,{})}),p(_e,{path:"tasks",element:p(ain,{})}),p(_e,{path:"vendors",element:p(lin,{})}),p(_e,{path:"purchase_orders",element:p(cin,{})}),p(_e,{path:"expenses",element:p(uin,{})}),p(_e,{path:"recurring_expenses",element:p(din,{})})]}),O(_e,{path:"client_portal",element:p(zin,{}),children:[p(_e,{path:"",element:p(Fin,{})}),p(_e,{path:"authorization",element:p(Bin,{})}),p(_e,{path:"registration",element:p(Hin,{})}),p(_e,{path:"messages",element:p(Vin,{})}),p(_e,{path:"customize",element:p($in,{})})]}),p(_e,{path:"e_invoice",element:p(xin,{})}),p(_e,{path:"email_settings",element:p(Min,{})}),p(_e,{path:"templates_and_reminders",element:p(Gin,{})}),O(_e,{path:"bank_accounts",children:[p(_e,{path:"",element:p(Zin,{})}),p(_e,{path:":id/details",element:p(nrn,{})}),p(_e,{path:"create",element:p(ern,{})}),p(_e,{path:":id/edit",element:p(Jin,{})})]}),O(_e,{path:"group_settings",children:[p(_e,{path:"",element:p(sdn,{})}),p(_e,{path:"create",element:p(ldn,{})}),p(_e,{path:":id/edit",element:p(Edn,{})})]}),O(_e,{path:"subscriptions",children:[p(_e,{path:"",element:p(yrn,{})}),p(_e,{path:"create",element:p(Trn,{})}),p(_e,{path:":id/edit",element:p(Irn,{})})]}),O(_e,{path:"schedules",children:[p(_e,{path:"",element:p(Qan,{})}),p(_e,{path:"create",element:p(tln,{})}),p(_e,{path:":id/edit",element:p(iln,{})})]}),O(_e,{path:"users",children:[p(_e,{path:"",element:p(xdn,{})}),p(_e,{path:"create",element:p(Idn,{})}),p(_e,{path:":id/edit",element:p(zn,{guards:[aa()],component:p(kdn,{})})})]}),p(_e,{path:"/settings/system_logs",children:p(_e,{path:"",element:p(odn,{})})}),O(_e,{path:"payment_terms",children:[p(_e,{path:"",element:p(Mdn,{})}),p(_e,{path:":id/edit",element:p(Pdn,{})}),p(_e,{path:"create",element:p(Ddn,{})})]}),O(_e,{path:"tax_rates",children:[p(_e,{path:"create",element:p(Vdn,{})}),p(_e,{path:":id/edit",element:p(Wdn,{})})]}),O(_e,{path:"task_statuses",children:[p(_e,{path:"create",element:p(Ydn,{})}),p(_e,{path:":id/edit",element:p(Qdn,{})})]}),O(_e,{path:"expense_categories",children:[p(_e,{path:"create",element:p(Atn,{})}),p(_e,{path:":id/edit",element:p(Ntn,{})})]}),O(_e,{path:"integrations",children:[O(_e,{path:"api_tokens",children:[p(_e,{path:"",element:p(zn,{guards:[Ai(aa(),aa()),Y2()],component:p(Xdn,{})})}),p(_e,{path:"create",element:p(zn,{guards:[Ai(aa(),aa()),Y2()],component:p(thn,{})})}),p(_e,{path:":id/edit",element:p(zn,{guards:[Ai(aa(),aa()),Y2()],component:p(ihn,{})})})]}),O(_e,{path:"api_webhooks",children:[p(_e,{path:"",element:p(ohn,{})}),p(_e,{path:"create",element:p(chn,{})}),p(_e,{path:":id/edit",element:p(dhn,{})})]}),p(_e,{path:"analytics",element:p(hhn,{})})]}),O(_e,{path:"gateways",children:[p(_e,{path:"create",element:p(x0n,{})}),p(_e,{path:":id/edit",element:p(D0n,{})})]}),O(_e,{path:"bank_accounts/transaction_rules",children:[p(_e,{path:"",element:p(rrn,{})}),p(_e,{path:"create",element:p(_rn,{})}),p(_e,{path:":id/edit",element:p(vrn,{})})]}),eyn]})]});function nyn(){return p(DT,{to:"/"})}function iyn(){return Jpe()?p(DT,{to:"/dashboard"}):p(sp,{})}/**
* 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 ZYe(){const n=zi();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(_F({type:vR.TOKEN,user:e.data.data[t].user,token:e.data.data[t].token.token})),n(y0(e.data.data)),n(Kj(t))}}const ryn="",oyn="";function syn(){const n=ki(),e=ZYe();return w.useEffect(()=>{if(!d1())return n("/login");$e("POST",Ae("/api/v1/login"),{email:ryn,password:oyn}).then(t=>e(t)).catch(()=>n("/login"))},[]),p("div",{})}const Ree=rl.a`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function ayn(){const n=si();return O("div",{className:"grid grid-cols-3 text-sm border rounded",style:{backgroundColor:n.$1,borderColor:n.$5,color:n.$3},children:[p("div",{className:"col-span-3 md:col-span-1",children:O(Ree,{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:[p(MCt,{size:15}),p("span",{className:"m-1",children:"Check status"})]})}),p("div",{className:"col-span-3 md:col-span-1",children:O(Ree,{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:[p(swt,{size:15}),p("span",{className:"m-1",children:"Applications"})]})}),p("div",{className:"col-span-3 md:col-span-1",children:O(Ree,{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:[p(L1t,{size:15}),p("span",{className:"m-1",children:"Documentation"})]})})]})}const lyn="/invoiceninja-logo@dark-365f6449.png";function Nbe(){const e={backgroundColor:Ss()};return O(St,{children:[p("div",{className:"py-1",style:e}),p("div",{className:"flex justify-center py-8",children:p(qi,{to:"/",children:p("img",{src:lyn,alt:"Invoice Ninja Logo",className:"h-12"})})})]})}function cyn(n){const[e]=ve(),{visible:t,setVisible:i}=n,[r,o]=w.useState(""),[s,a]=w.useState(""),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,f]=w.useState(),[g,m]=w.useState(!1),v=()=>{he.processing(),c(!0),$e("POST",Ae("/api/v1/sms_reset"),{email:r}).then(b=>{he.success(b.data.message),i(!1),m(!0)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(f(b.response.data),he.dismiss())}).finally(()=>c(!1))},_=()=>{he.processing(),d(!0),$e("POST",Ae("/api/v1/sms_reset/confirm"),{email:r,code:s}).then(b=>{he.success(b.data.message),a(""),o(""),m(!1)}).finally(()=>d(!1))};return O(St,{children:[p(Or,{title:e("disable_2fa"),visible:t,onClose:()=>{i(!1),o("")},children:O("div",{className:"flex flex-col space-y-6",children:[p(Ze,{label:e("email"),value:r,onValueChange:b=>{o(b),h&&f(void 0)},errorMessage:h==null?void 0:h.errors.email}),p(un,{className:"self-end",onClick:v,disableWithoutIcon:!0,disabled:!r||l,children:e("send_code")})]})}),p(Or,{title:e("disable_two_factor"),visible:g,onClose:()=>{m(!1),a(""),o("")},children:O("div",{className:"flex flex-col space-y-7 items-center",children:[p(RWe,{onComplete:a}),O("div",{className:"flex self-end space-x-5",children:[p(un,{type:"minimal",onClick:v,disableWithoutIcon:!0,disabled:l||u,children:e("resend_code")}),p(un,{onClick:_,disableWithoutIcon:!0,disabled:l||u||s.length!==6,children:e("verify")})]})]})})]})}const uyn=" Latest Build - 2024-10-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
*/const dyn=`v${uyn}`;function hyn(){Mi("login");const n=Ss(),[e,t]=w.useState(void 0),[i,r]=w.useState(void 0),[o,s]=w.useState(!1),[a]=ve(),[l,c]=w.useState(!1),u=ZYe();function d(f){const g=new FormData(f);t(void 0),r(void 0),s(!0);const m=g.get("secret");$e("POST",Ae("/api/v1/login"),Object.fromEntries(g),{...m&&{headers:{"X-API-SECRET":m}}}).then(v=>u(v)).catch(v=>{var _,b,y;((_=v.response)==null?void 0:_.status)===422?r(v.response.data.errors):((b=v.response)==null?void 0:b.status)===503?he.error("app_maintenance"):t(((y=v.response)==null?void 0:y.data.message)??a("invalid_credentials"))}).finally(()=>s(!1))}const h=si();return O("div",{className:"h-screen",children:[p(Nbe,{}),O("div",{className:"flex flex-col items-center",children:[O("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:h.$1,borderColor:h.$5},children:[p("h2",{className:"text-2xl",style:{color:h.$3},children:a("login")}),O("form",{onSubmit:f=>{f.preventDefault(),d(f.currentTarget)},className:"my-6 space-y-4",children:[p(Ze,{type:"email",autoComplete:"on",label:a("email_address"),errorMessage:i==null?void 0:i.email,name:"email"}),p(Ze,{type:"password",autoComplete:"on",label:a("password"),id:"password",errorMessage:i==null?void 0:i.password,name:"password"}),p("div",{className:"space-y-2",children:O("div",{className:"flex flex-col lg:flex-row items-center justify-between",children:[p(pg,{children:`2FA - ${a("one_time_password")}`}),p(qi,{to:"/recover_password",children:a("forgot_password")})]})}),p(Ze,{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"}),p("div",{className:"space-y-2",children:O("div",{className:zt("flex flex-col lg:flex-row items-center",{"justify-between":fR(),"justify-end":qo()}),children:[p(pg,{children:a("secret")}),p("div",{className:"text-sm hover:underline cursor-pointer",onClick:()=>c(!0),style:{color:n},children:a("disable_2fa")})]})}),p(Ze,{type:"password",autoComplete:"on",placeholder:a("plaid_optional"),name:"secret"}),e&&p(Fs,{className:"mt-4",type:"danger",children:e}),p(un,{disabled:o,className:"mt-4",variant:"block",children:a("login")})]}),p("div",{className:"flex justify-center",children:qo()})]}),qo(),p("p",{className:"mt-4 text-xs",children:dyn})]}),p(cyn,{visible:l,setVisible:c})]})}function fyn(){const n=Co();return w.useEffect(()=>{NBe(),sessionStorage.clear(),n.invalidateQueries(),n.removeQueries(),window.location.href="/"},[]),p(St,{})}function pyn(){var c,u;Mi("recover_password");const[n]=ve(),[e,t]=w.useState(!1),[i,r]=w.useState(void 0),[o,s]=w.useState(void 0),a=Gm({initialValues:{email:""},onSubmit:d=>{t(!0),s(void 0),r(void 0),$e("POST",Ae("/api/v1/reset_password"),d).then(h=>r(h.data)).catch(h=>{var f,g,m;return((f=h.response)==null?void 0:f.status)===422?s((g=h.response)==null?void 0:g.data.errors):r((m=h.response)==null?void 0:m.data)}).finally(()=>t(!1))}}),l=si();return O("div",{className:"h-screen",children:[p(Nbe,{}),O("div",{className:"flex flex-col items-center",children:[O("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:l.$1,borderColor:l.$5},children:[p("h2",{className:"text-2xl",style:{color:l.$3},children:n("recover_password")}),O("form",{onSubmit:a.handleSubmit,className:"my-6",children:[p(Ze,{type:"email",label:n("email_address"),id:"email",onChange:a.handleChange}),((c=o==null?void 0:o.errors)==null?void 0:c.email)&&p(Fs,{className:"mt-2",type:"danger",children:(u=o.errors)==null?void 0:u.email}),i&&p(Fs,{className:"mt-4",type:i.status?"success":"danger",children:i.message}),p(un,{disabled:e,className:"mt-4",variant:"block",children:n("send_email")})]}),p("div",{className:"flex justify-center",children:qo()})]}),qo()]})]})}var KG={},gyn=Po&&Po.__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]}),myn=Po&&Po.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),_yn=Po&&Po.__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)&&gyn(e,n,t);return myn(e,n),e};Object.defineProperty(KG,"__esModule",{value:!0});var JYe=KG.useTurnstile=void 0;const vx=_yn(w),kM=typeof globalThis<"u"?globalThis:window;let Ow=typeof kM.turnstile<"u"?"ready":"unloaded",eQe,Bae;const tQe=new Promise((n,e)=>{Bae={resolve:n,reject:e},Ow==="ready"&&n(void 0)});{const n="cf__reactTurnstileOnLoad",e="https://challenges.cloudflare.com/turnstile/v0/api.js";eQe=()=>{if(Ow==="unloaded"){Ow="loading",kM[n]=()=>{Bae.resolve(),Ow="ready",delete kM[n]};const t=`${e}?onload=${n}&render=explicit`,i=document.createElement("script");i.src=t,i.async=!0,i.addEventListener("error",()=>{Bae.reject("Failed to load Turnstile."),delete kM[n]}),document.head.appendChild(i)}return tQe}}function vyn({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:f,retryInterval:g,refreshExpired:m,appearance:v,execution:_,userRef:b,onVerify:y,onLoad:C,onError:E,onExpire:x,onTimeout:k,onAfterInteractive:L,onBeforeInteractive:D,onUnsupported:A}){const N=(0,vx.useRef)(null),P=(0,vx.useState)({onVerify:y,onLoad:C,onError:E,onExpire:x,onTimeout:k,onAfterInteractive:L,onBeforeInteractive:D,onUnsupported:A})[0],M=b??N;return(0,vx.useEffect)(()=>{if(!M.current)return;let B=!1,F="";return(async()=>{var U,H;if(Ow!=="ready")try{await eQe()}catch(V){(U=P.onError)===null||U===void 0||U.call(P,V);return}if(B||!M.current)return;let W;const q={sitekey:i,action:r,cData:o,theme:s,language:a,tabindex:l,"response-field":c,"response-field-name":u,size:d,retry:f,"retry-interval":g,"refresh-expired":m,appearance:v,execution:_,callback:V=>{var re;return(re=P.onVerify)===null||re===void 0?void 0:re.call(P,V,W)},"error-callback":V=>{var re;return(re=P.onError)===null||re===void 0?void 0:re.call(P,V,W)},"expired-callback":V=>{var re;return(re=P.onExpire)===null||re===void 0?void 0:re.call(P,V,W)},"timeout-callback":()=>{var V;return(V=P.onTimeout)===null||V===void 0?void 0:V.call(P,W)},"after-interactive-callback":()=>{var V;return(V=P.onAfterInteractive)===null||V===void 0?void 0:V.call(P,W)},"before-interactive-callback":()=>{var V;return(V=P.onBeforeInteractive)===null||V===void 0?void 0:V.call(P,W)},"unsupported-callback":()=>{var V;return(V=P.onUnsupported)===null||V===void 0?void 0:V.call(P,W)}};F=window.turnstile.render(M.current,q),W=yyn(F),(H=P.onLoad)===null||H===void 0||H.call(P,F,W)})(),()=>{B=!0,F&&window.turnstile.remove(F)}},[i,r,o,s,a,l,c,u,d,f,g,m,v,_]),(0,vx.useEffect)(()=>{P.onVerify=y,P.onLoad=C,P.onError=E,P.onExpire=x,P.onTimeout=k,P.onAfterInteractive=L,P.onBeforeInteractive=D,P.onUnsupported=A},[y,C,E,x,k,L,D,A]),vx.default.createElement("div",{ref:M,id:n,className:e,style:h?{...t??{},width:d==="compact"?"130px":"300px",height:d==="compact"?"120px":"65px"}:t})}var byn=KG.default=vyn;function yyn(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 Cyn(){const[n,e]=(0,vx.useState)(Ow);return(0,vx.useEffect)(()=>{Ow!=="ready"&&tQe.then(()=>e(Ow))},[]),kM.turnstile}JYe=KG.useTurnstile=Cyn;function wyn(n){const{onVerified:e}=n;return p(byn,{appearance:"interaction-only",sitekey:"",onVerify:i=>e(i)})}function Syn(){Mi("register");const[n]=ve(),e=JYe(),[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=zi(),[f]=lF(),g=Gm({initialValues:{email:"",password:"",password_confirmation:"",terms_of_service:!1,privacy_policy:!1},onSubmit(v){if(d(""),i(void 0),c(!0),v.password!==v.password_confirmation){c(!1),i({password_confirmation:["Password confirmation does not match."]});return}const _=new URL("/api/v1/signup?include=token,user.company_user,company,account",aF());["utm_source","utm_medium","utm_campaign","utm_content","utm_term"].forEach(y=>{f.has(y)&&_.searchParams.append(y,f.get(y))});const b=f.get("rc");b&&_.searchParams.append("rc",b),$e("POST",_.href,{...v,"cf-turnstile":r}).then(y=>{h(o1t({token:y.data.data[0].token.token,user:y.data.data[0].user})),h(y0(y.data.data)),h(Kj(0))}).catch(y=>{var C,E;((C=y.response)==null?void 0:C.status)===422&&i(y.response.data.errors),d((E=y.response)==null?void 0:E.data.message),c(!1)}).finally(()=>{e.reset(),a(!1),o("")})}}),m=si();return w.useEffect(()=>{r&&g.handleSubmit()},[r]),p(St,{children:O("div",{className:"h-screen",children:[p(Nbe,{}),O("div",{className:"flex flex-col items-center",children:[O("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:m.$1,borderColor:m.$5},children:[p("h2",{className:"text-2xl",style:{color:m.$3},children:n("register_label")}),O("div",{className:"space-y-5 my-6",children:[p(Ze,{type:"email",autoComplete:"on",label:n("email_address"),id:"email",onChange:g.handleChange,errorMessage:t==null?void 0:t.email}),p(Ze,{type:"password",autoComplete:"on",label:n("password"),id:"password",onChange:g.handleChange,errorMessage:t==null?void 0:t.password}),p(Ze,{type:"password",autoComplete:"on",label:n("password_confirmation"),id:"password_confirmation",onChange:g.handleChange,errorMessage:t==null?void 0:t.password_confirmation}),u&&p(Fs,{className:"mt-4",type:"danger",children:u}),s&&p("div",{className:"flex justify-center",children:p(wyn,{onVerified:v=>o(v)})}),p(un,{disabled:l,className:"mt-4",variant:"block",onClick:()=>a(!0),children:n("register")})]}),p("div",{className:"flex justify-center",children:qo()})]}),O(St,{children:[p(RKt,{}),p("div",{className:"mx-4 max-w-md w-full rounded md:shadow-lg mt-4",children:p(ayn,{})})]})]})]})})}const Eyn=O(St,{children:[O(_e,{element:p(iyn,{}),children:[p(_e,{path:"/login",element:p(hyn,{})}),p(_e,{path:"/recover_password",element:p(pyn,{})}),p(_e,{element:p(nyn,{}),children:p(_e,{path:"/register",element:p(Syn,{})})}),p(_e,{path:"/demo",element:p(syn,{})})]}),p(_e,{element:p(UWe,{}),children:p(_e,{path:"/logout",element:p(fyn,{})})})]}),xyn=w.lazy(()=>ie(()=>import("./bundle.aeeda793.js"),["bundle.aeeda793.js","bundle.f60c32a7.js","bundle.6f604da1.js","bundle.c64d8b33.js","bundle.1914e891.js","bundle.598e34cb.js","bundle.020ad108.js","bundle.1672f6d5.js","bundle.78dd95c3.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.fbf91320.js","bundle.5513f517.js"])),Tyn=w.lazy(()=>ie(()=>import("./bundle.a23764cf.js"),[])),kyn=w.lazy(()=>ie(()=>import("./bundle.e81e5027.js"),["bundle.e81e5027.js","bundle.fbf91320.js"])),Iyn=w.lazy(()=>ie(()=>import("./bundle.d9890113.js"),["bundle.d9890113.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.1a0bb3fb.js","bundle.2965f621.js"])),Lyn=w.lazy(()=>ie(()=>import("./bundle.4bd60ba9.js"),["bundle.4bd60ba9.js","bundle.ca06b7b6.js","bundle.fbf91320.js"])),Dyn=w.lazy(()=>ie(()=>import("./bundle.59cfb5bb.js"),["bundle.59cfb5bb.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.2965f621.js","bundle.1a0bb3fb.js"])),aRe=w.lazy(()=>ie(()=>import("./bundle.c0b3b633.js"),[])),lRe=w.lazy(()=>ie(()=>import("./bundle.8503fc4a.js"),["bundle.8503fc4a.js","bundle.23e92eea.js","bundle.1145e4b9.js","bundle.7934b7d8.js"])),Ayn=w.lazy(()=>ie(()=>import("./bundle.e09f9131.js"),["bundle.e09f9131.js","bundle.b6ced983.js","bundle.fbf91320.js"])),Ryn=w.lazy(()=>ie(()=>import("./bundle.6235e52a.js"),["bundle.6235e52a.js","bundle.10fc7255.js","bundle.b6ced983.js","bundle.fbf91320.js"])),Nyn=w.lazy(()=>ie(()=>import("./bundle.45db93ae.js"),["bundle.45db93ae.js","bundle.020ad108.js","bundle.1672f6d5.js","bundle.78dd95c3.js","bundle.d1a4d606.js","bundle.756326ba.js"])),Oyn=w.lazy(()=>ie(()=>import("./bundle.d130fdc1.js"),[])),Pyn=w.lazy(()=>ie(()=>import("./bundle.699bc251.js"),["bundle.699bc251.js","bundle.78dd95c3.js"])),Myn=O(_e,{path:"/quotes",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.Quotes),Ai(en("view_quote"),en("create_quote"),en("edit_quote"))],component:p(xyn,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ir(wi.Quotes),Ai(en("create_quote"),en("edit_quote"))],component:p(Tyn,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.Quotes),Ai(en("view_quote"),en("edit_quote"),Ta("/api/v1/quotes/:id"))],component:p(kyn,{})}),children:[p(_e,{path:"edit",element:p(Iyn,{})}),p(_e,{path:"documents",element:p(aRe,{})}),p(_e,{path:"settings",element:p(lRe,{})}),p(_e,{path:"activity",element:p(Nyn,{})}),p(_e,{path:"history",element:p(Oyn,{})}),p(_e,{path:"email_history",element:p(Pyn,{})})]}),O(_e,{path:"create",element:p(zn,{guards:[Ir(wi.Quotes),en("create_quote")],component:p(Lyn,{})}),children:[p(_e,{path:"",element:p(Dyn,{})}),p(_e,{path:"documents",element:p(aRe,{})}),p(_e,{path:"settings",element:p(lRe,{})})]}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.Quotes),Ai(en("edit_quote"),Ta("/api/v1/quotes/:id"))],component:p(sp,{})}),children:[p(_e,{path:"pdf",element:p(Ayn,{})}),p(_e,{path:"email",element:p(Ryn,{})})]})]}),Fyn=w.lazy(()=>ie(()=>import("./bundle.75b2e8dd.js"),["bundle.75b2e8dd.js","bundle.f60c32a7.js","bundle.7f3d0f35.js","bundle.872bfadd.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.556851c1.js","bundle.1914e891.js","bundle.461c2575.js","bundle.4c2c3539.js"])),Byn=w.lazy(()=>ie(()=>import("./bundle.a6592d81.js"),["bundle.a6592d81.js","bundle.ca06b7b6.js","bundle.7f3d0f35.js","bundle.872bfadd.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.d3082ed9.js"])),$yn=w.lazy(()=>ie(()=>import("./bundle.6f946e73.js"),["bundle.6f946e73.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.7f3d0f35.js","bundle.872bfadd.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.f09f52f7.js"])),Vyn=w.lazy(()=>ie(()=>import("./bundle.1260d9e7.js"),["bundle.1260d9e7.js","bundle.d3082ed9.js","bundle.7f3d0f35.js","bundle.872bfadd.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js"])),Hyn=w.lazy(()=>ie(()=>import("./bundle.2785ff5e.js"),["bundle.2785ff5e.js","bundle.1c502bc3.js","bundle.e711acbd.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.f09f52f7.js","bundle.7f3d0f35.js","bundle.872bfadd.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js"])),Wyn=w.lazy(()=>ie(()=>import("./bundle.4cace61b.js"),["bundle.4cace61b.js","bundle.b6ced983.js","bundle.d3082ed9.js"])),zyn=w.lazy(()=>ie(()=>import("./bundle.54d0f56a.js"),["bundle.54d0f56a.js","bundle.10fc7255.js","bundle.b6ced983.js","bundle.d3082ed9.js"])),cRe=w.lazy(()=>ie(()=>import("./bundle.cf53376c.js"),[])),uRe=w.lazy(()=>ie(()=>import("./bundle.b1886831.js"),["bundle.b1886831.js","bundle.7f3d0f35.js","bundle.872bfadd.js","bundle.5d8acd41.js","bundle.d1a4d606.js","bundle.756326ba.js","bundle.1145e4b9.js","bundle.7934b7d8.js","bundle.23e92eea.js"])),Uyn=w.lazy(()=>ie(()=>import("./bundle.37e564a9.js"),[])),jyn=w.lazy(()=>ie(()=>import("./bundle.399b143f.js"),[])),qyn=O(_e,{path:"/credits",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.Credits),Ai(en("view_credit"),en("create_credit"),en("edit_credit"))],component:p(Fyn,{})})}),O(_e,{path:"create",element:p(zn,{guards:[Ir(wi.Credits),en("create_credit")],component:p(Byn,{})}),children:[p(_e,{path:"",element:p($yn,{})}),p(_e,{path:"documents",element:p(cRe,{})}),p(_e,{path:"settings",element:p(uRe,{})})]}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.Credits),Ai(en("edit_credit"),en("view_credit"),Ta("/api/v1/credits/:id"))],component:p(Vyn,{})}),children:[p(_e,{path:"edit",element:p(Hyn,{})}),p(_e,{path:"documents",element:p(cRe,{})}),p(_e,{path:"settings",element:p(uRe,{})}),p(_e,{path:"activity",element:p(Uyn,{})}),p(_e,{path:"history",element:p(jyn,{})})]}),p(_e,{path:":id/pdf",element:p(zn,{guards:[Ir(wi.Credits),Ai(en("edit_credit"),Ta("/api/v1/credits/:id"))],component:p(Wyn,{})})}),p(_e,{path:":id/email",element:p(zn,{guards:[Ir(wi.Credits),Ai(en("edit_credit"),Ta("/api/v1/credits/:id"))],component:p(zyn,{})})})]}),Gyn=w.lazy(()=>ie(()=>import("./bundle.c988134e.js"),["bundle.c988134e.js","bundle.43b5d7b2.js","bundle.5b659923.js","bundle.f60c32a7.js"])),Kyn=w.lazy(()=>ie(()=>import("./bundle.8b6a3950.js"),["bundle.8b6a3950.js","bundle.5b659923.js"])),dRe=w.lazy(()=>ie(()=>import("./bundle.f059cf81.js"),["bundle.f059cf81.js","bundle.43b5d7b2.js","bundle.5b659923.js"])),Yyn=w.lazy(()=>ie(()=>import("./bundle.06412055.js"),["bundle.06412055.js","bundle.e711acbd.js"])),Qyn=w.lazy(()=>ie(()=>import("./bundle.a119d7b1.js"),["bundle.a119d7b1.js","bundle.ef23c84d.js","bundle.43b5d7b2.js","bundle.5b659923.js","bundle.f60c32a7.js","bundle.bd4ee183.js","bundle.e711acbd.js"])),Xyn=w.lazy(()=>ie(()=>import("./bundle.0bae79b6.js"),[])),Zyn=O(_e,{children:[p(_e,{path:"/projects",element:p(zn,{guards:[Ir(wi.Projects),Ai(en("view_project"),en("create_project"),en("edit_project"))],component:p(Gyn,{})})}),p(_e,{path:"/projects/create",element:p(zn,{guards:[Ir(wi.Projects),en("create_project")],component:p(Kyn,{})})}),p(_e,{path:"/projects/:id",element:p(zn,{guards:[Ir(wi.Projects),Ai(en("view_project"),en("edit_project"),Ta("/api/v1/projects/:id"))],component:p(Qyn,{})})}),p(_e,{path:"/projects/:id",element:p(zn,{guards:[Ir(wi.Projects),Ai(en("view_project"),en("edit_project"),Ta("/api/v1/projects/:id"))],component:p(dRe,{})}),children:p(_e,{path:"documents",element:p(Xyn,{})})}),p(_e,{path:"/projects/:id/edit",element:p(zn,{guards:[Ir(wi.Projects),Ai(en("edit_project"),Ta("/api/v1/projects/:id"))],component:p(dRe,{})}),children:p(_e,{path:"",element:p(Yyn,{})})})]});function Jyn(){const{t:n}=ve(),{documentTitle:e}=Mi("import"),t=[{name:n("tasks"),href:"/tasks"},{name:n("import"),href:"/tasks/import"}];return p(MR,{title:e,breadcrumbs:t,children:p("div",{className:"grid grid-cols-12",children:p("div",{className:"col-span-12 xl:col-span-8",children:p(RGe,{entity:"task",onSuccess:!1,type:"csv"})})})})}const e1n=w.lazy(()=>ie(()=>import("./bundle.9651e258.js"),["bundle.9651e258.js","bundle.f60c32a7.js","bundle.bd4ee183.js","bundle.6f604da1.js","bundle.1672f6d5.js","bundle.59c227d7.js","bundle.c49a89fd.js"])),t1n=w.lazy(()=>ie(()=>import("./bundle.6ace3b00.js"),["bundle.6ace3b00.js","bundle.59c227d7.js","bundle.c49a89fd.js","bundle.1672f6d5.js","bundle.23e92eea.js","bundle.38433272.js","bundle.e711acbd.js"])),n1n=w.lazy(()=>ie(()=>import("./bundle.3dc7a40f.js"),["bundle.3dc7a40f.js","bundle.38433272.js","bundle.23e92eea.js","bundle.c49a89fd.js","bundle.e711acbd.js"])),i1n=w.lazy(()=>ie(()=>import("./bundle.4c6fcb15.js"),[])),r1n=w.lazy(()=>ie(()=>import("./bundle.64fad687.js"),["bundle.64fad687.js","bundle.38433272.js","bundle.23e92eea.js","bundle.c49a89fd.js","bundle.e711acbd.js"])),o1n=w.lazy(()=>ie(()=>import("./bundle.3d9cb920.js"),[])),s1n=O(_e,{path:"/tasks",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.Tasks),Ai(en("view_task"),en("create_task"),en("edit_task"))],component:p(e1n,{})})}),p(_e,{path:"kanban",element:p(zn,{guards:[Ir(wi.Tasks),Ai(en("view_task"),en("edit_task"))],component:p(t1n,{})})}),p(_e,{path:"create",element:p(zn,{guards:[Ir(wi.Tasks),en("create_task")],component:p(n1n,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.Tasks),Ai(en("view_task"),en("edit_task"),Ta("/api/v1/tasks/:id"))],component:p(i1n,{})}),children:[p(_e,{path:"edit",element:p(r1n,{})}),p(_e,{path:"documents",element:p(o1n,{})})]}),p(_e,{path:"import",element:p(zn,{guards:[Ir(wi.Tasks),Ai(en("create_task"),en("edit_task"))],component:p(Jyn,{})})})]}),a1n=w.lazy(()=>ie(()=>import("./bundle.53d2337b.js"),["bundle.53d2337b.js","bundle.f60c32a7.js","bundle.6f604da1.js","bundle.07634f4c.js"])),l1n=w.lazy(()=>ie(()=>import("./bundle.b2bf6beb.js"),[])),c1n=w.lazy(()=>ie(()=>import("./bundle.ff6992cb.js"),["bundle.ff6992cb.js","bundle.ef23c84d.js","bundle.07634f4c.js"])),hRe=w.lazy(()=>ie(()=>import("./bundle.040ce73f.js"),["bundle.040ce73f.js","bundle.244fe526.js","bundle.1914e891.js"])),u1n=w.lazy(()=>ie(()=>import("./bundle.4a4f4af1.js"),[])),d1n=w.lazy(()=>ie(()=>import("./bundle.cde734c2.js"),["bundle.cde734c2.js","bundle.04fbea26.js"])),h1n=w.lazy(()=>ie(()=>import("./bundle.7aacb56a.js"),[])),f1n=w.lazy(()=>ie(()=>import("./bundle.ce503381.js"),["bundle.ce503381.js","bundle.07634f4c.js"])),p1n=w.lazy(()=>ie(()=>import("./bundle.0bf4bddc.js"),[])),g1n=O(_e,{path:"vendors",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.Vendors),Ai(en("view_vendor"),en("create_vendor"),en("edit_vendor"))],component:p(a1n,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ir(wi.Vendors),Ai(en("create_vendor"),en("edit_vendor"))],component:p(l1n,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.Vendors),Ai(en("view_vendor"),en("edit_vendor"),Ta("/api/v1/vendors/:id"))],component:p(c1n,{})}),children:[p(_e,{path:"",element:p(hRe,{})}),p(_e,{path:"purchase_orders",element:p(hRe,{})}),p(_e,{path:"expenses",element:p(u1n,{})}),p(_e,{path:"recurring_expenses",element:p(d1n,{})}),p(_e,{path:"documents",element:p(h1n,{})})]}),p(_e,{path:":id/edit",element:p(zn,{guards:[Ir(wi.Vendors),Ai(en("edit_vendor"),Ta("/api/v1/vendors/:id"))],component:p(f1n,{})})}),p(_e,{path:"create",element:p(zn,{guards:[Ir(wi.Vendors),en("create_vendor")],component:p(p1n,{})})})]}),m1n=w.lazy(()=>ie(()=>import("./bundle.eeb98649.js"),["bundle.eeb98649.js","bundle.f60c32a7.js","bundle.6f604da1.js"])),_1n=w.lazy(()=>ie(()=>import("./bundle.4cff9056.js"),[])),v1n=w.lazy(()=>ie(()=>import("./bundle.39a2f863.js"),["bundle.39a2f863.js","bundle.34b7dc24.js","bundle.23e92eea.js","bundle.e711acbd.js","bundle.3cdd56eb.js","bundle.a6dd37f2.js"])),b1n=w.lazy(()=>ie(()=>import("./bundle.a0a24911.js"),["bundle.a0a24911.js","bundle.0685a430.js","bundle.b6ced983.js"])),y1n=w.lazy(()=>ie(()=>import("./bundle.b6ea083a.js"),["bundle.b6ea083a.js","bundle.34b7dc24.js","bundle.23e92eea.js","bundle.e711acbd.js","bundle.3cdd56eb.js","bundle.a6dd37f2.js"])),C1n=w.lazy(()=>ie(()=>import("./bundle.c7ac8da1.js"),[])),w1n=O(_e,{path:"expenses",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.Expenses),Ai(en("view_expense"),en("create_expense"),en("edit_expense"))],component:p(m1n,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ir(wi.Expenses),Ai(en("create_expense"),en("edit_expense"))],component:p(_1n,{})})}),p(_e,{path:"create",element:p(zn,{guards:[Ir(wi.Expenses),en("create_expense")],component:p(v1n,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.Expenses),Ai(en("view_expense"),en("edit_expense"),Ta("/api/v1/expenses/:id"))],component:p(b1n,{})}),children:[p(_e,{path:"edit",element:p(y1n,{})}),p(_e,{path:"documents",element:p(C1n,{})})]})]}),S1n=w.lazy(()=>ie(()=>import("./bundle.d75e8e5b.js"),["bundle.d75e8e5b.js","bundle.f60c32a7.js","bundle.244fe526.js","bundle.1914e891.js"])),E1n=w.lazy(()=>ie(()=>import("./bundle.19c58cbe.js"),["bundle.19c58cbe.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.d3de84e1.js"])),x1n=w.lazy(()=>ie(()=>import("./bundle.b3db04bd.js"),["bundle.b3db04bd.js","bundle.10fc7255.js","bundle.b6ced983.js"])),T1n=w.lazy(()=>ie(()=>import("./bundle.baefad5b.js"),["bundle.baefad5b.js","bundle.b6ced983.js"])),k1n=w.lazy(()=>ie(()=>import("./bundle.37a60604.js"),["bundle.37a60604.js","bundle.ca06b7b6.js","bundle.f426c5c5.js"])),I1n=w.lazy(()=>ie(()=>import("./bundle.269549ab.js"),["bundle.269549ab.js","bundle.f426c5c5.js"])),L1n=w.lazy(()=>ie(()=>import("./bundle.70a1caf3.js"),["bundle.70a1caf3.js","bundle.08fccdc5.js","bundle.b6ced983.js","bundle.d3de84e1.js"])),fRe=w.lazy(()=>ie(()=>import("./bundle.7140561e.js"),[])),pRe=w.lazy(()=>ie(()=>import("./bundle.60530b24.js"),["bundle.60530b24.js","bundle.1145e4b9.js","bundle.7934b7d8.js","bundle.23e92eea.js"])),D1n=w.lazy(()=>ie(()=>import("./bundle.5714385e.js"),[])),A1n=w.lazy(()=>ie(()=>import("./bundle.1df41ea3.js"),[])),R1n=w.lazy(()=>ie(()=>import("./bundle.d6c4f2dc.js"),["bundle.d6c4f2dc.js","bundle.78dd95c3.js"])),N1n=O(_e,{path:"/purchase_orders",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.PurchaseOrders),Ai(en("view_purchase_order"),en("create_purchase_order"),en("edit_purchase_order"))],component:p(S1n,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.PurchaseOrders),Ai(en("view_purchase_order"),en("edit_purchase_order"),Ta("/api/v1/purchase_orders/:id"))],component:p(I1n,{})}),children:[p(_e,{path:"edit",element:p(E1n,{})}),p(_e,{path:"documents",element:p(fRe,{})}),p(_e,{path:"settings",element:p(pRe,{})}),p(_e,{path:"activity",element:p(D1n,{})}),p(_e,{path:"history",element:p(A1n,{})}),p(_e,{path:"email_history",element:p(R1n,{})})]}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.PurchaseOrders),Ai(en("edit_purchase_order"),Ta("/api/v1/purchase_orders/:id"))],component:p(sp,{})}),children:[p(_e,{path:"email",element:p(x1n,{})}),p(_e,{path:"pdf",element:p(T1n,{})})]}),O(_e,{path:"create",element:p(zn,{guards:[Ir(wi.PurchaseOrders),en("create_purchase_order")],component:p(k1n,{})}),children:[p(_e,{path:"",element:p(L1n,{})}),p(_e,{path:"documents",element:p(fRe,{})}),p(_e,{path:"settings",element:p(pRe,{})})]})]}),O1n=w.lazy(()=>ie(()=>Promise.resolve().then(()=>Gan),void 0)),P1n=p(_e,{path:"/reports",element:p(zn,{guards:[en("view_reports")],component:p(O1n,{})})}),M1n=w.lazy(()=>ie(()=>import("./bundle.60697f27.js"),["bundle.60697f27.js","bundle.6f28ea88.js","bundle.539b71d6.js","bundle.6f604da1.js","bundle.461c2575.js","bundle.756326ba.js","bundle.51e1486d.js","bundle.1672f6d5.js"])),F1n=w.lazy(()=>ie(()=>import("./bundle.551df483.js"),["bundle.551df483.js","bundle.6f28ea88.js","bundle.a6dd37f2.js","bundle.a2fa9714.js"])),B1n=w.lazy(()=>ie(()=>import("./bundle.7c194bae.js"),[])),$1n=w.lazy(()=>ie(()=>import("./bundle.2d7ac311.js"),["bundle.2d7ac311.js","bundle.a6dd37f2.js","bundle.a2fa9714.js","bundle.6f28ea88.js","bundle.539b71d6.js"])),V1n=O(St,{children:[p(_e,{path:"bank_transactions",element:p(DT,{to:"/transactions"})}),O(_e,{path:"transactions",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.Transactions),Ai(en("view_bank_transaction"),en("create_bank_transaction"),en("edit_bank_transaction"))],component:p(M1n,{})})}),p(_e,{path:"create",element:p(zn,{guards:[Ir(wi.Transactions),Ai(en("create_bank_transaction"))],component:p(F1n,{})})}),p(_e,{path:"import",element:p(zn,{guards:[Ir(wi.Transactions),Ai(en("create_bank_transaction"),en("edit_bank_transaction"))],component:p(B1n,{})})}),p(_e,{path:":id/edit",element:p(zn,{guards:[Ir(wi.Transactions),Ai(en("view_bank_transaction"),en("edit_bank_transaction"),Ta("/api/v1/bank_transactions/:id"))],component:p($1n,{})})})]})]}),H1n=w.lazy(()=>ie(()=>import("./bundle.f0f4c8f0.js"),["bundle.f0f4c8f0.js","bundle.04fbea26.js"])),W1n=w.lazy(()=>ie(()=>import("./bundle.7362ac99.js"),["bundle.7362ac99.js","bundle.f60c32a7.js","bundle.04fbea26.js"])),z1n=w.lazy(()=>ie(()=>import("./bundle.a3231278.js"),["bundle.a3231278.js","bundle.4683ee8f.js","bundle.23e92eea.js","bundle.04fbea26.js","bundle.e711acbd.js","bundle.3cdd56eb.js","bundle.a6dd37f2.js"])),U1n=w.lazy(()=>ie(()=>import("./bundle.43d71ba7.js"),["bundle.43d71ba7.js","bundle.04fbea26.js","bundle.4683ee8f.js","bundle.23e92eea.js","bundle.e711acbd.js","bundle.3cdd56eb.js","bundle.a6dd37f2.js"])),j1n=w.lazy(()=>ie(()=>import("./bundle.cbaf5de8.js"),[])),q1n=O(_e,{path:"/recurring_expenses",children:[p(_e,{path:"",element:p(zn,{guards:[Ir(wi.RecurringExpenses),Ai(en("view_recurring_expense"),en("create_recurring_expense"),en("edit_recurring_expense"))],component:p(W1n,{})})}),p(_e,{path:"create",element:p(zn,{guards:[Ir(wi.RecurringExpenses),en("create_recurring_expense")],component:p(z1n,{})})}),O(_e,{path:":id",element:p(zn,{guards:[Ir(wi.RecurringExpenses),Ai(en("view_recurring_expense"),en("edit_recurring_expense"),Ta("/api/v1/recurring_expenses/:id"))],component:p(H1n,{})}),children:[p(_e,{path:"edit",element:p(U1n,{})}),p(_e,{path:"documents",element:p(j1n,{})})]})]});function G1n(){return Jpe()?p(DT,{to:"/dashboard"}):p(DT,{to:"/login"})}function K1n(){return p(sp,{})}function Y1n(){const[n]=ve(),[e,t]=w.useState(!1),[i,r]=w.useState("");return p("div",{className:"flex items-center w-full h-full justify-center",children:O("div",{className:"mt-96",children:[p(zqe,{isModalOpen:e,setIsModalOpen:t,onClientCreated:o=>r(o.id)}),p(Mh,{inputOptions:{value:i??null},endpoint:Ae("/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 Q1n=w.lazy(()=>ie(()=>import("./bundle.b809832a.js"),["bundle.b809832a.js","bundle.b6ced983.js"])),X1n=p(_e,{children:p(_e,{path:"/activities/:id",element:p(Q1n,{})})}),Z1n=w.lazy(()=>ie(()=>import("./bundle.ca20abfd.js"),[])),J1n=w.lazy(()=>ie(()=>import("./bundle.e9268d27.js"),[])),eCn=O(D0t,{children:[p(_e,{path:"/",element:p(G1n,{})}),Eyn,O(_e,{element:p(UWe,{}),children:[p(_e,{path:"/dashboard",element:p(zn,{guards:[en("view_dashboard")],component:p(Z1n,{})})}),JUt,_jt,xjt,Mjt,Ujt,Myn,qyn,Zyn,s1n,g1n,N1n,w1n,q1n,P1n,V1n,tyn,X1n,p(_e,{element:p(K1n,{}),children:p(_e,{path:"/testing",element:p(Y1n,{})})})]}),p(_e,{path:"*",element:p(J1n,{})})]});function tCn(){return n=>{switch(n.replace("_","-").toLowerCase()){case"af":return ie(()=>import("./bundle.3b0f998a.js").then(t=>t.a),[]);case"am":return ie(()=>import("./bundle.e8f56fa7.js").then(t=>t.a),[]);case"ar-dz":return ie(()=>import("./bundle.1a806db9.js").then(t=>t.a),[]);case"ar-iq":return ie(()=>import("./bundle.647dd045.js").then(t=>t.a),[]);case"ar-kw":return ie(()=>import("./bundle.560f17d7.js").then(t=>t.a),[]);case"ar-ly":return ie(()=>import("./bundle.f0e4f345.js").then(t=>t.a),[]);case"ar-ma":return ie(()=>import("./bundle.b9ad0da2.js").then(t=>t.a),[]);case"ar-sa":return ie(()=>import("./bundle.f0d63d5a.js").then(t=>t.a),[]);case"ar-tn":return ie(()=>import("./bundle.33c1588d.js").then(t=>t.a),[]);case"ar":return ie(()=>import("./bundle.e9c89bc4.js").then(t=>t.a),[]);case"az":return ie(()=>import("./bundle.4869a778.js").then(t=>t.a),[]);case"be":return ie(()=>import("./bundle.bd66cda9.js").then(t=>t.b),[]);case"bg":return ie(()=>import("./bundle.6e67246c.js").then(t=>t.b),[]);case"bi":return ie(()=>import("./bundle.22d54468.js").then(t=>t.b),[]);case"bm":return ie(()=>import("./bundle.448f7b67.js").then(t=>t.b),[]);case"bn-bd":return ie(()=>import("./bundle.ea7fe879.js").then(t=>t.b),[]);case"bn":return ie(()=>import("./bundle.3bb46f29.js").then(t=>t.b),[]);case"bo":return ie(()=>import("./bundle.f16d6e07.js").then(t=>t.b),[]);case"br":return ie(()=>import("./bundle.ca22cc6d.js").then(t=>t.b),[]);case"bs":return ie(()=>import("./bundle.f0430034.js").then(t=>t.b),[]);case"ca":return ie(()=>import("./bundle.1e18eb70.js").then(t=>t.c),[]);case"cs":return ie(()=>import("./bundle.30a75c04.js").then(t=>t.c),[]);case"cv":return ie(()=>import("./bundle.184a9ac4.js").then(t=>t.c),[]);case"cy":return ie(()=>import("./bundle.a720feac.js").then(t=>t.c),[]);case"da":return ie(()=>import("./bundle.82018c26.js").then(t=>t.d),[]);case"de-at":return ie(()=>import("./bundle.09750d8a.js").then(t=>t.d),[]);case"de-ch":return ie(()=>import("./bundle.f4a18964.js").then(t=>t.d),[]);case"de":return ie(()=>import("./bundle.889401f7.js").then(t=>t.d),[]);case"dv":return ie(()=>import("./bundle.f8b011ae.js").then(t=>t.d),[]);case"el":return ie(()=>import("./bundle.24c7dd43.js").then(t=>t.e),[]);case"en-au":return ie(()=>import("./bundle.dddbb52d.js").then(t=>t.e),[]);case"en-ca":return ie(()=>import("./bundle.8658d200.js").then(t=>t.e),[]);case"en-gb":return ie(()=>import("./bundle.e86ec29d.js").then(t=>t.e),[]);case"en-ie":return ie(()=>import("./bundle.7b742beb.js").then(t=>t.e),[]);case"en-il":return ie(()=>import("./bundle.2c92ed67.js").then(t=>t.e),[]);case"en-in":return ie(()=>import("./bundle.d47d5706.js").then(t=>t.e),[]);case"en-nz":return ie(()=>import("./bundle.c8eb4e92.js").then(t=>t.e),[]);case"en-sg":return ie(()=>import("./bundle.929e1c09.js").then(t=>t.e),[]);case"en-tt":return ie(()=>import("./bundle.4c4176ae.js").then(t=>t.e),[]);case"en":return ie(()=>import("./bundle.e4a33f53.js").then(t=>t.e),[]);case"eo":return ie(()=>import("./bundle.537ff9ba.js").then(t=>t.e),[]);case"es-do":return ie(()=>import("./bundle.5ec8d732.js").then(t=>t.e),[]);case"es-mx":return ie(()=>import("./bundle.31d177cb.js").then(t=>t.e),[]);case"es-pr":return ie(()=>import("./bundle.ad67b8c3.js").then(t=>t.e),[]);case"es-us":return ie(()=>import("./bundle.8a45174e.js").then(t=>t.e),[]);case"es":return ie(()=>import("./bundle.8cafc268.js").then(t=>t.e),[]);case"et":return ie(()=>import("./bundle.98728b2f.js").then(t=>t.e),[]);case"eu":return ie(()=>import("./bundle.cec6d917.js").then(t=>t.e),[]);case"fa":return ie(()=>import("./bundle.3d6b4405.js").then(t=>t.f),[]);case"fi":return ie(()=>import("./bundle.92c283ca.js").then(t=>t.f),[]);case"fo":return ie(()=>import("./bundle.696b759a.js").then(t=>t.f),[]);case"fr-ca":return ie(()=>import("./bundle.73823c0b.js").then(t=>t.f),[]);case"fr-ch":return ie(()=>import("./bundle.539cf28f.js").then(t=>t.f),[]);case"fr":return ie(()=>import("./bundle.55d00bba.js").then(t=>t.f),[]);case"fy":return ie(()=>import("./bundle.d6658588.js").then(t=>t.f),[]);case"ga":return ie(()=>import("./bundle.a8b7f141.js").then(t=>t.g),[]);case"gd":return ie(()=>import("./bundle.510a258a.js").then(t=>t.g),[]);case"gl":return ie(()=>import("./bundle.e26a0e79.js").then(t=>t.g),[]);case"gom-latn":return ie(()=>import("./bundle.d8a152fc.js").then(t=>t.g),[]);case"gu":return ie(()=>import("./bundle.57fa8d91.js").then(t=>t.g),[]);case"he":return ie(()=>import("./bundle.8a2a8c6b.js").then(t=>t.h),[]);case"hi":return ie(()=>import("./bundle.90262b53.js").then(t=>t.h),[]);case"hr":return ie(()=>import("./bundle.a543f083.js").then(t=>t.h),[]);case"hu":return ie(()=>import("./bundle.680878c7.js").then(t=>t.h),[]);case"hy-am":return ie(()=>import("./bundle.512d6d9a.js").then(t=>t.h),[]);case"id":return ie(()=>import("./bundle.08941ed8.js").then(t=>t.i),[]);case"is":return ie(()=>import("./bundle.cf59f853.js").then(t=>t.i),[]);case"it":return ie(()=>import("./bundle.30e16130.js").then(t=>t.i),[]);case"ja":return ie(()=>import("./bundle.9cfecedb.js").then(t=>t.j),[]);case"jv":return ie(()=>import("./bundle.4902c817.js").then(t=>t.j),[]);case"ka":return ie(()=>import("./bundle.e66898c5.js").then(t=>t.k),[]);case"kk":return ie(()=>import("./bundle.12070430.js").then(t=>t.k),[]);case"km":return ie(()=>import("./bundle.61892d6a.js").then(t=>t.k),[]);case"kn":return ie(()=>import("./bundle.62c1984d.js").then(t=>t.k),[]);case"ko":return ie(()=>import("./bundle.18fc509e.js").then(t=>t.k),[]);case"ku":return ie(()=>import("./bundle.95d08725.js").then(t=>t.k),[]);case"ky":return ie(()=>import("./bundle.c5e72e30.js").then(t=>t.k),[]);case"lb":return ie(()=>import("./bundle.84c02285.js").then(t=>t.l),[]);case"lo":return ie(()=>import("./bundle.23aa396b.js").then(t=>t.l),[]);case"lt":return ie(()=>import("./bundle.95ea382b.js").then(t=>t.l),[]);case"lv":return ie(()=>import("./bundle.d43998ef.js").then(t=>t.l),[]);case"me":return ie(()=>import("./bundle.4467be5f.js").then(t=>t.m),[]);case"mi":return ie(()=>import("./bundle.527b3c02.js").then(t=>t.m),[]);case"mk":return ie(()=>import("./bundle.e7268c32.js").then(t=>t.m),[]);case"ml":return ie(()=>import("./bundle.7f6b8f4a.js").then(t=>t.m),[]);case"mn":return ie(()=>import("./bundle.785e013e.js").then(t=>t.m),[]);case"mr":return ie(()=>import("./bundle.fcf15d2f.js").then(t=>t.m),[]);case"ms-my":return ie(()=>import("./bundle.9a7193ff.js").then(t=>t.m),[]);case"ms":return ie(()=>import("./bundle.3b033191.js").then(t=>t.m),[]);case"mt":return ie(()=>import("./bundle.a9b76344.js").then(t=>t.m),[]);case"my":return ie(()=>import("./bundle.9b79a86d.js").then(t=>t.m),[]);case"nb":return ie(()=>import("./bundle.1d6b63c1.js").then(t=>t.n),[]);case"ne":return ie(()=>import("./bundle.05e92a0c.js").then(t=>t.n),[]);case"nl-be":return ie(()=>import("./bundle.2ff65d57.js").then(t=>t.n),[]);case"nl":return ie(()=>import("./bundle.eeea8412.js").then(t=>t.n),[]);case"nn":return ie(()=>import("./bundle.dfe8063f.js").then(t=>t.n),[]);case"oc-lnc":return ie(()=>import("./bundle.56b70d27.js").then(t=>t.o),[]);case"pa-in":return ie(()=>import("./bundle.fead9909.js").then(t=>t.p),[]);case"pl":return ie(()=>import("./bundle.28c6b1b2.js").then(t=>t.p),[]);case"pt-br":return ie(()=>import("./bundle.4316aa62.js").then(t=>t.p),[]);case"pt":return ie(()=>import("./bundle.6cf9411c.js").then(t=>t.p),[]);case"rn":return ie(()=>import("./bundle.fa9594dd.js").then(t=>t.r),[]);case"ro":return ie(()=>import("./bundle.1e6fb1d4.js").then(t=>t.r),[]);case"ru":return ie(()=>import("./bundle.6fed3a25.js").then(t=>t.r),[]);case"rw":return ie(()=>import("./bundle.37ab4a23.js").then(t=>t.r),[]);case"sd":return ie(()=>import("./bundle.570b7650.js").then(t=>t.s),[]);case"se":return ie(()=>import("./bundle.763730d1.js").then(t=>t.s),[]);case"si":return ie(()=>import("./bundle.da4e95df.js").then(t=>t.s),[]);case"sk":return ie(()=>import("./bundle.31385b48.js").then(t=>t.s),[]);case"sl":return ie(()=>import("./bundle.99bdfdc6.js").then(t=>t.s),[]);case"sq":return ie(()=>import("./bundle.cc2a6573.js").then(t=>t.s),[]);case"sr-cyrl":return ie(()=>import("./bundle.abf6403c.js").then(t=>t.s),[]);case"sr":return ie(()=>import("./bundle.02b6e40c.js").then(t=>t.s),[]);case"ss":return ie(()=>import("./bundle.8198e277.js").then(t=>t.s),[]);case"sv-fi":return ie(()=>import("./bundle.9c242fb8.js").then(t=>t.s),[]);case"sv":return ie(()=>import("./bundle.93bbf979.js").then(t=>t.s),[]);case"sw":return ie(()=>import("./bundle.51ef5e9a.js").then(t=>t.s),[]);case"ta":return ie(()=>import("./bundle.ad126548.js").then(t=>t.t),[]);case"te":return ie(()=>import("./bundle.0361d4ee.js").then(t=>t.t),[]);case"tet":return ie(()=>import("./bundle.099c9809.js").then(t=>t.t),[]);case"tg":return ie(()=>import("./bundle.32f74995.js").then(t=>t.t),[]);case"th":return ie(()=>import("./bundle.ecc31be9.js").then(t=>t.t),[]);case"tk":return ie(()=>import("./bundle.14c9b601.js").then(t=>t.t),[]);case"tl-ph":return ie(()=>import("./bundle.02bcf2ca.js").then(t=>t.t),[]);case"tlh":return ie(()=>import("./bundle.05946e50.js").then(t=>t.t),[]);case"tr":return ie(()=>import("./bundle.a24e60b7.js").then(t=>t.t),[]);case"tzl":return ie(()=>import("./bundle.ffac73d6.js").then(t=>t.t),[]);case"tzm-latn":return ie(()=>import("./bundle.ac673d11.js").then(t=>t.t),[]);case"tzm":return ie(()=>import("./bundle.f5766d5b.js").then(t=>t.t),[]);case"ug-cn":return ie(()=>import("./bundle.e70e91e9.js").then(t=>t.u),[]);case"uk":return ie(()=>import("./bundle.4994951c.js").then(t=>t.u),[]);case"ur":return ie(()=>import("./bundle.3949cf44.js").then(t=>t.u),[]);case"uz-latn":return ie(()=>import("./bundle.f1f0e424.js").then(t=>t.u),[]);case"uz":return ie(()=>import("./bundle.b7c61a41.js").then(t=>t.u),[]);case"vi":return ie(()=>import("./bundle.34fc6099.js").then(t=>t.v),[]);case"x-pseudo":return ie(()=>import("./bundle.b23c5f0a.js").then(t=>t.x),[]);case"yo":return ie(()=>import("./bundle.edb900a5.js").then(t=>t.y),[]);case"zh-cn":return ie(()=>import("./bundle.709f3dcb.js").then(t=>t.z),[]);case"zh-hk":return ie(()=>import("./bundle.7b6bd621.js").then(t=>t.z),[]);case"zh-tw":return ie(()=>import("./bundle.3920391b.js").then(t=>t.z),[]);case"zh":return ie(()=>import("./bundle.1f5214d7.js").then(t=>t.z),[]);default:return ie(()=>import("./bundle.e4a33f53.js").then(t=>t.e),[])}}}function nCn(){return n=>{switch(n){case"en":return ie(()=>import("./bundle.79368f3d.js").then(e=>e.e),["bundle.79368f3d.js","bundle.01ffd8a5.js"]);case"it":return ie(()=>import("./bundle.3fb43e9b.js").then(e=>e.i),["bundle.3fb43e9b.js","bundle.01ffd8a5.js"]);case"de":return ie(()=>import("./bundle.8f521ecf.js").then(e=>e.d),["bundle.8f521ecf.js","bundle.01ffd8a5.js"]);case"fr":return ie(()=>import("./bundle.a957e415.js").then(e=>e.f),["bundle.a957e415.js","bundle.01ffd8a5.js"]);case"pt_BR":return ie(()=>import("./bundle.d7485e21.js").then(e=>e.p),["bundle.d7485e21.js","bundle.01ffd8a5.js"]);case"nl":return ie(()=>import("./bundle.592d9742.js").then(e=>e.n),["bundle.592d9742.js","bundle.01ffd8a5.js"]);case"es":return ie(()=>import("./bundle.1b1ba9b4.js").then(e=>e.e),["bundle.1b1ba9b4.js","bundle.01ffd8a5.js"]);case"nb_NO":return ie(()=>import("./bundle.0fbc67b6.js").then(e=>e.n),["bundle.0fbc67b6.js","bundle.01ffd8a5.js"]);case"da":return ie(()=>import("./bundle.b96bd0cc.js").then(e=>e.d),["bundle.b96bd0cc.js","bundle.01ffd8a5.js"]);case"ja":return ie(()=>import("./bundle.f5bb6aca.js").then(e=>e.j),["bundle.f5bb6aca.js","bundle.01ffd8a5.js"]);case"sv":return ie(()=>import("./bundle.0a3e87b3.js").then(e=>e.s),["bundle.0a3e87b3.js","bundle.01ffd8a5.js"]);case"es_ES":return ie(()=>import("./bundle.1b1ba9b4.js").then(e=>e.e),["bundle.1b1ba9b4.js","bundle.01ffd8a5.js"]);case"fr_CA":return ie(()=>import("./bundle.04931bcc.js").then(e=>e.f),["bundle.04931bcc.js","bundle.01ffd8a5.js"]);case"lt":return ie(()=>import("./bundle.096ec302.js").then(e=>e.l),["bundle.096ec302.js","bundle.01ffd8a5.js"]);case"pl":return ie(()=>import("./bundle.1d078d4e.js").then(e=>e.p),["bundle.1d078d4e.js","bundle.01ffd8a5.js"]);case"cs":return ie(()=>import("./bundle.4ef7c0f6.js").then(e=>e.c),["bundle.4ef7c0f6.js","bundle.01ffd8a5.js"]);case"hr":return ie(()=>import("./bundle.3e33e20a.js").then(e=>e.h),["bundle.3e33e20a.js","bundle.01ffd8a5.js"]);case"sq":return ie(()=>import("./bundle.79368f3d.js").then(e=>e.e),["bundle.79368f3d.js","bundle.01ffd8a5.js"]);case"el":return ie(()=>import("./bundle.44affe8e.js").then(e=>e.e),["bundle.44affe8e.js","bundle.01ffd8a5.js"]);case"en_GB":return ie(()=>import("./bundle.9166bc30.js").then(e=>e.e),["bundle.9166bc30.js","bundle.01ffd8a5.js"]);case"pt_PT":return ie(()=>import("./bundle.067cc590.js").then(e=>e.p),["bundle.067cc590.js","bundle.01ffd8a5.js"]);case"sl":return ie(()=>import("./bundle.14a102fa.js").then(e=>e.s),["bundle.14a102fa.js","bundle.01ffd8a5.js"]);case"fi":return ie(()=>import("./bundle.c97727d9.js").then(e=>e.f),["bundle.c97727d9.js","bundle.01ffd8a5.js"]);case"ro":return ie(()=>import("./bundle.7ec870b5.js").then(e=>e.r),["bundle.7ec870b5.js","bundle.01ffd8a5.js"]);case"tr_TR":return ie(()=>import("./bundle.f2a300e7.js").then(e=>e.t),["bundle.f2a300e7.js","bundle.01ffd8a5.js"]);case"th":return ie(()=>import("./bundle.6e2c7fa0.js").then(e=>e.t),["bundle.6e2c7fa0.js","bundle.01ffd8a5.js"]);case"mk_MK":return ie(()=>import("./bundle.c1a3b38e.js").then(e=>e.m),["bundle.c1a3b38e.js","bundle.01ffd8a5.js"]);case"zh_TW":return ie(()=>import("./bundle.188ef40f.js").then(e=>e.z),["bundle.188ef40f.js","bundle.01ffd8a5.js"]);case"ru_RU":return ie(()=>import("./bundle.55c40068.js").then(e=>e.r),["bundle.55c40068.js","bundle.01ffd8a5.js"]);case"ar":return ie(()=>import("./bundle.3e301f01.js").then(e=>e.a),["bundle.3e301f01.js","bundle.01ffd8a5.js"]);case"fa":return ie(()=>import("./bundle.07dfcd65.js").then(e=>e.f),["bundle.07dfcd65.js","bundle.01ffd8a5.js"]);case"lv_LV":return ie(()=>import("./bundle.17d49a71.js").then(e=>e.l),["bundle.17d49a71.js","bundle.01ffd8a5.js"]);case"sr":return ie(()=>import("./bundle.dbda05c8.js").then(e=>e.s),["bundle.dbda05c8.js","bundle.01ffd8a5.js"]);case"sk":return ie(()=>import("./bundle.fe2f02c3.js").then(e=>e.s),["bundle.fe2f02c3.js","bundle.01ffd8a5.js"]);case"et":return ie(()=>import("./bundle.0a6b7252.js").then(e=>e.e),["bundle.0a6b7252.js","bundle.01ffd8a5.js"]);case"bg":return ie(()=>import("./bundle.2b70e892.js").then(e=>e.b),["bundle.2b70e892.js","bundle.01ffd8a5.js"]);case"he":return ie(()=>import("./bundle.9aec5139.js").then(e=>e.h),["bundle.9aec5139.js","bundle.01ffd8a5.js"]);case"km_KH":return ie(()=>import("./bundle.7f5f8f6d.js").then(e=>e.k),["bundle.7f5f8f6d.js","bundle.01ffd8a5.js"]);case"hu":return ie(()=>import("./bundle.97349e0c.js").then(e=>e.h),["bundle.97349e0c.js","bundle.01ffd8a5.js"]);case"fr_CH":return ie(()=>import("./bundle.a957e415.js").then(e=>e.f),["bundle.a957e415.js","bundle.01ffd8a5.js"]);default:return ie(()=>import("./bundle.79368f3d.js").then(e=>e.e),["bundle.79368f3d.js","bundle.01ffd8a5.js"])}}}const gRe=rl.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`;function iCn(n){var b,y,C,E,x;const[e]=ve(),t=ki(),i=zi(),r=si(),o=Ti(),s=Pc(),[a,l]=w.useState(),[c,u]=w.useState(!1),[d,h]=w.useState(0),f=Bo(),g=k=>{f("settings.name",k);const L=k.split("").filter(D=>/[a-zA-Z]/.test(D)).join("").toLowerCase();f("subdomain",L)},m=k=>{$e("PUT",Ae("/api/v1/companies/:id",{id:s==null?void 0:s.id}),s).then(L=>{he.success("updated_company"),k?h(D=>D+1):n.setIsModalOpen(!1),i(US({object:"company",data:L.data.data}))}).catch(L=>{var D;((D=L.response)==null?void 0:D.status)===422&&(l(L.response.data),he.dismiss())}).finally(()=>u(!1))},v=k=>{he.processing(),$e("POST",Ae("/api/v1/one_time_token"),{context:k}).then(L=>{var A;let D="stripe/signup/:token";k==="paypal_ppcp"&&(D="paypal?hash=:token"),(A=window.open(At(`https://invoicing.co/${D}`,{token:L.data.hash}),"_blank"))==null||A.focus(),he.dismiss()})},_=async k=>{if(!c){if(An.isEqual(o,s)){k?h(L=>L+1):n.setIsModalOpen(!1);return}he.processing(),l(void 0),u(!0),s!=null&&s.subdomain&&qo()?$e("POST",Ae("/api/v1/check_subdomain"),{subdomain:s.subdomain}).then(()=>m(k)).finally(()=>u(!1)):m(k)}};return p(Or,{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:O("div",{className:"flex flex-col space-y-6",children:[d===0&&O("div",{className:"flex flex-col space-y-4",children:[p(Ze,{label:e("company_name"),value:(b=s==null?void 0:s.settings)==null?void 0:b.name,onValueChange:k=>g(k),errorMessage:(y=a==null?void 0:a.errors)==null?void 0:y.name,changeOverride:!0}),qo(),p(e6,{label:e("language"),value:((C=s==null?void 0:s.settings)==null?void 0:C.language_id)||"",onChange:k=>f("settings.language_id",k),errorMessage:(E=a==null?void 0:a.errors)==null?void 0:E.language_id}),p(sA,{label:e("currency"),value:((x=s==null?void 0:s.settings)==null?void 0:x.currency_id)||"",onChange:k=>f("settings.currency_id",k)})]}),d===1&&p(hKe,{isSettingsPage:!1}),d===2&&O("div",{className:"flex flex-col items-center",children:[p(gRe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>v("stripe_connect"),children:p(Fae,{name:"stripe",style:{width:"64%"}})}),p(gRe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>v("paypal_ppcp"),children:p(Fae,{name:"paypal_ppcp",style:{width:"38%",transform:"scale(1.7)",pointerEvents:"none"}})}),p(un,{behavior:"button",className:"w-full mt-4",onClick:()=>{n.setIsModalOpen(!1),t("/settings/gateways/create")},children:e("all_payment_gateways")})]}),p("div",{className:"flex justify-end",children:(d!==2||fR())&&p(un,{behavior:"button",onClick:()=>{d===0&&_(qo()),d!==0&&h(k=>k+1)},children:e("save")})})]})})}/**
* 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 nQe=Ro(null),rCn=["public_notes","private_notes","terms","footer"];function Ykr(n){const{id:e}=il();Wi(nQe);const[t,i]=us(n),[r,o]=us(xR),[s,a]=w.useState(),l=!0,c=(d,h="")=>An.flatMapDeep(An.keys(d),f=>{const g=d[f],m=h?`${h}.${f}`:f;return An.isObject(g)?c(g,m):m}),u=(d,h="")=>c(d,h);return w.useEffect(()=>{if(t&&s&&t.id===s.id&&!l){const h=u(t).filter(v=>rCn.some(_=>v.includes(_))),f=An.cloneDeep(t);h.forEach(v=>{v.includes(".")||(delete f[v],delete s[v])});const g=An.isEqual(f,s);r.prevent!==!g&&o(v=>v&&{...v,prevent:!g})}},[t]),YD(()=>{t&&t.id===e&&s&&(a(An.cloneDeep(t)),o(d=>d&&{...d,prevent:!1}))},50,[t==null?void 0:t.updated_at]),YD(()=>{t&&(!e||t.id===e)&&!s&&a(An.cloneDeep(t))},50,[t,s]),w.useEffect(()=>()=>{a(void 0),o(d=>d&&{...d,prevent:!1})},[]),[t,i]}function oCn(){const[n]=ve(),e=ki(),t=ml(),i=!1,r=Gi(nQe),[o,s]=us(L7e),a=Gi(D7e),[l,c]=us(xR),[u,d]=us(Sme),[h,f]=w.useState(!1),{nonPreventedLocations:g}=o,m=()=>{const _=l.actionKey==="browserBack",{url:b,externalLink:y,fn:C}=a||{};y||(s(k=>({...k,lastLocation:""})),c({prevent:!1,actionKey:void 0}));const E=g.length;let x=g[E-1];x=x!==t.pathname?x:g[E-2],_&&x&&e(x),a&&(b&&(y?window.open(b,"_blank"):e(b)),C==null||C()),d(!1)},v=()=>{const _=l.actionKey==="browserBack";c(b=>b&&{...b,actionKey:b.actionKey!=="browserBack"?void 0:"browserBack"}),d(!1),_&&history.pushState(null,document.title,window.location.href)};return w.useEffect(()=>{f(u)},[u]),p(Or,{visible:h,onClose:()=>{},disableClosing:!0,children:O("div",{className:"flex flex-col space-y-8",children:[p("span",{className:"font-medium text-lg text-center",children:n("error_unsaved_changes")}),r&&i&&p("span",{className:"break-words",children:JSON.stringify(r)}),O("div",{className:"flex justify-between",children:[p(un,{type:"secondary",onClick:v,children:n("continue_editing")}),p(un,{onClick:m,children:n("discard_changes")})]})]})})}function sCn(){const[n]=ve(),{isOwner:e}=Fo(),{i18n:t}=ve(),i=Nc(D=>D.settings.darkMode),r=ki(),{id:o}=il(),s=Va(),a=ml(),l=Ti();ZIt();const c=RBe(),u=hs(),d=PBe(),h=nCn(),f=tCn(),g=jWe(),m=Gi(U8e),v=Wi(Uve),_=Wi(vIt),{isCompanySettingsActive:b,isGroupSettingsActive:y}=$s(),[C,E]=w.useState(!1),x=l?d(s!=null&&s.language_id&&s.language_id.length>0?s.language_id:l.settings.language_id):void 0,k=D=>{var A,N;if(!o&&!a.pathname.startsWith("/settings")){const{error:P}=D.detail;if(P.response.data.errors){const M=P.response.data.errors||{},B=(A=Object.keys(M))==null?void 0:A[0],F=(N=M==null?void 0:M[B])==null?void 0:N[0];F&&he.error(F)}}};w.useEffect(()=>{document.body.style.backgroundColor=m.$2,document.body.style.colorScheme=m.$0},[m]),w.useEffect(()=>{x!=null&&x.locale&&(f(x.locale).then(D=>{_(D),Un.locale(D)}),h(x.locale).then(D=>{v(D)}),t.hasResourceBundle(x.locale,"translation")?t.changeLanguage(x.locale):fetch(new URL(Object.assign({"/src/resources/lang/ar/ar.json":nht,"/src/resources/lang/bg/bg.json":iht,"/src/resources/lang/ca/ca.json":rht,"/src/resources/lang/cs/cs.json":oht,"/src/resources/lang/da/da.json":sht,"/src/resources/lang/de/de.json":aht,"/src/resources/lang/el/el.json":lht,"/src/resources/lang/en/en.json":cht,"/src/resources/lang/en_GB/en_GB.json":uht,"/src/resources/lang/es/es.json":dht,"/src/resources/lang/es_ES/es_ES.json":hht,"/src/resources/lang/et/et.json":fht,"/src/resources/lang/fa/fa.json":pht,"/src/resources/lang/fi/fi.json":ght,"/src/resources/lang/fr/fr.json":mht,"/src/resources/lang/fr_CA/fr_CA.json":_ht,"/src/resources/lang/fr_CH/fr_CH.json":vht,"/src/resources/lang/he/he.json":bht,"/src/resources/lang/hr/hr.json":yht,"/src/resources/lang/hu/hu.json":Cht,"/src/resources/lang/it/it.json":wht,"/src/resources/lang/ja/ja.json":Sht,"/src/resources/lang/km_KH/km_KH.json":Eht,"/src/resources/lang/lo_LA/lo_LA.json":xht,"/src/resources/lang/lt/lt.json":Tht,"/src/resources/lang/lv_LV/lv_LV.json":kht,"/src/resources/lang/mk_MK/mk_MK.json":Iht,"/src/resources/lang/nb_NO/nb_NO.json":Lht,"/src/resources/lang/nl/nl.json":Dht,"/src/resources/lang/pl/pl.json":Aht,"/src/resources/lang/pt_BR/pt_BR.json":Rht,"/src/resources/lang/pt_PT/pt_PT.json":Nht,"/src/resources/lang/ro/ro.json":Oht,"/src/resources/lang/ru_RU/ru_RU.json":Pht,"/src/resources/lang/sk/sk.json":Mht,"/src/resources/lang/sl/sl.json":Fht,"/src/resources/lang/sq/sq.json":Bht,"/src/resources/lang/sr/sr.json":$ht,"/src/resources/lang/sv/sv.json":Vht,"/src/resources/lang/th/th.json":Hht,"/src/resources/lang/tr_TR/tr_TR.json":Wht,"/src/resources/lang/vi/vi.json":zht,"/src/resources/lang/zh_TW/zh_TW.json":Uht})[`/src/resources/lang/${x.locale}/${x.locale}.json`],self.location).href).then(D=>D.json()).then(D=>{t.addResources(x.locale,"translation",D),t.changeLanguage(x.locale)}))},[i,x]),w.useEffect(()=>{window.addEventListener("navigate.invalid.page",()=>r("/not_found")),window.addEventListener("refetch",D=>{const{property:A}=D.detail;c(A)})},[]),w.useEffect(()=>(window.removeEventListener("display.error.toaster",k),window.addEventListener("display.error.toaster",k),()=>{window.removeEventListener("display.error.toaster",k)}),[o,a]),w.useEffect(()=>{var A;const D=(A=l==null?void 0:l.settings)==null?void 0:A.name;l&&(!D||D===n("untitled_company"))&&localStorage.getItem("COMPANY-EDIT-OPENED")!=="true"&&(localStorage.setItem("COMPANY-EDIT-OPENED","true"),E(!0))},[l]),w.useEffect(()=>{!a.pathname.startsWith("/settings")&&!b&&g(),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]);const L=yBe();return J_t(),w.useEffect(()=>(l&&L&&(L.connection.bind("disconnected",()=>{console.log("Disconnected from Pusher")}),L.connection.bind("error",()=>{console.error("Error from Pusher")}),L.connect()),()=>{L&&l&&L.disconnect()}),[l==null?void 0:l.company_key]),O(St,{children:[O("div",{className:"App",children:[p(zvt,{position:"top-center"}),eCn]}),p(iCn,{isModalOpen:C&&e,setIsModalOpen:E}),p(oCn,{})]})}const iQe=Object.prototype.toString;function rQe(n){switch(iQe.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return b1(n,Error)}}function ZR(n,e){return iQe.call(n)===`[object ${e}]`}function Obe(n){return ZR(n,"ErrorEvent")}function mRe(n){return ZR(n,"DOMError")}function aCn(n){return ZR(n,"DOMException")}function hS(n){return ZR(n,"String")}function oQe(n){return n===null||typeof n!="object"&&typeof n!="function"}function fA(n){return ZR(n,"Object")}function YG(n){return typeof Event<"u"&&b1(n,Event)}function lCn(n){return typeof Element<"u"&&b1(n,Element)}function cCn(n){return ZR(n,"RegExp")}function Pbe(n){return!!(n&&n.then&&typeof n.then=="function")}function uCn(n){return fA(n)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n}function sQe(n){return typeof n=="number"&&n!==n}function b1(n,e){try{return n instanceof e}catch{return!1}}function aQe(n){return!!(typeof n=="object"&&n!==null&&(n.__isVue||n._isVue))}function KL(n,e=0){return typeof n!="string"||e===0||n.length<=e?n:`${n.slice(0,e)}...`}function _Re(n,e){if(!Array.isArray(n))return"";const t=[];for(let i=0;i<n.length;i++){const r=n[i];try{aQe(r)?t.push("[VueViewModel]"):t.push(String(r))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function dCn(n,e,t=!1){return hS(n)?cCn(e)?e.test(n):hS(e)?t?n===e:n.includes(e):!1:!1}function g6(n,e=[],t=!1){return e.some(i=>dCn(n,i,t))}function hCn(n,e,t=250,i,r,o,s){if(!o.exception||!o.exception.values||!s||!b1(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=fCn($ae(n,e,r,s.originalException,i,o.exception.values,a,0),t))}function $ae(n,e,t,i,r,o,s,a){if(o.length>=t+1)return o;let l=[...o];if(b1(i[r],Error)){vRe(s,a);const c=n(e,i[r]),u=l.length;bRe(c,r,u,a),l=$ae(n,e,t,i[r],r,[c,...l],c,u)}return Array.isArray(i.errors)&&i.errors.forEach((c,u)=>{if(b1(c,Error)){vRe(s,a);const d=n(e,c),h=l.length;bRe(d,`errors[${u}]`,h,a),l=$ae(n,e,t,c,r,[d,...l],d,h)}}),l}function vRe(n,e){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,is_exception_group:!0,exception_id:e}}function bRe(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 fCn(n,e){return n.map(t=>(t.value&&(t.value=KL(t.value,e)),t))}function b9(n){return n&&n.Math==Math?n:void 0}const _u=typeof globalThis=="object"&&b9(globalThis)||typeof window=="object"&&b9(window)||typeof self=="object"&&b9(self)||typeof global=="object"&&b9(global)||function(){return this}()||{};function m6(){return _u}function lQe(n,e,t){const i=t||_u,r=i.__SENTRY__=i.__SENTRY__||{};return r[n]||(r[n]=e())}const V$=m6(),pCn=80;function pA(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||pCn;for(;t&&o++<i&&(c=gCn(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 gCn(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&&hS(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 mCn(){try{return V$.document.location.href}catch{return""}}function _Cn(n){return V$.document&&V$.document.querySelector?V$.document.querySelector(n):null}const vCn="Sentry Logger ",Vae=["debug","info","warn","error","log","assert","trace"],BW={};function cQe(n){if(!("console"in _u))return n();const e=_u.console,t={},i=Object.keys(BW);i.forEach(r=>{const o=BW[r];t[r]=e[r],e[r]=o});try{return n()}finally{i.forEach(r=>{e[r]=t[r]})}}function bCn(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Vae.forEach(t=>{e[t]=(...i)=>{n&&cQe(()=>{_u.console[t](`${vCn}[${t}]:`,...i)})}}):Vae.forEach(t=>{e[t]=()=>{}}),e}const Mn=bCn(),yCn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function CCn(n){return n==="http"||n==="https"}function QG(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 wCn(n){const e=yCn.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 uQe({host:o,pass:r,path:l,projectId:c,port:s,protocol:t,publicKey:i})}function uQe(n){return{protocol:n.protocol,publicKey:n.publicKey||"",pass:n.pass||"",host:n.host,port:n.port||"",path:n.path||"",projectId:n.projectId}}function SCn(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:(Mn.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:t.match(/^\d+$/)?CCn(i)?e&&isNaN(parseInt(e,10))?(Mn.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(Mn.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(Mn.error(`Invalid Sentry Dsn: Invalid projectId ${t}`),!1)}function ECn(n){const e=typeof n=="string"?wCn(n):uQe(n);if(!(!e||!SCn(e)))return e}class _b 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 Ed(n,e,t){if(!(e in n))return;const i=n[e],r=t(i);typeof r=="function"&&dQe(r,i),n[e]=r}function _3(n,e,t){try{Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`Failed to add non-enumerable property "${e}" to object`,n)}}function dQe(n,e){try{const t=e.prototype||{};n.prototype=e.prototype=t,_3(n,"__sentry_original__",e)}catch{}}function Mbe(n){return n.__sentry_original__}function xCn(n){return Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&")}function hQe(n){if(rQe(n))return{message:n.message,name:n.name,stack:n.stack,...CRe(n)};if(YG(n)){const e={type:n.type,target:yRe(n.target),currentTarget:yRe(n.currentTarget),...CRe(n)};return typeof CustomEvent<"u"&&b1(n,CustomEvent)&&(e.detail=n.detail),e}else return n}function yRe(n){try{return lCn(n)?pA(n):Object.prototype.toString.call(n)}catch{return"<unknown>"}}function CRe(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 TCn(n,e=40){const t=Object.keys(hQe(n));if(t.sort(),!t.length)return"[object has no keys]";if(t[0].length>=e)return KL(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:KL(r,e)}return""}function Pw(n){return Hae(n,new Map)}function Hae(n,e){if(fA(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]=Hae(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(Hae(r,e))}),i}return n}function Wh(){const n=_u,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 fQe(n){return n.exception&&n.exception.values?n.exception.values[0]:void 0}function VC(n){const{message:e,event_id:t}=n;if(e)return e;const i=fQe(n);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||t||"<unknown>":t||"<unknown>"}function Wae(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 v3(n,e){const t=fQe(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 wRe(n){if(n&&n.__sentry_captured__)return!0;try{_3(n,"__sentry_captured__",!0)}catch{}return!1}function pQe(n){return Array.isArray(n)?n:[n]}const gQe=50,SRe=/\(error: (.*)\)/,ERe=/captureMessage|captureException/;function mQe(...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=SRe.test(a)?a.replace(SRe,"$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>=gQe)break}}return ICn(r)}}function kCn(n){return Array.isArray(n)?mQe(...n):n}function ICn(n){if(!n.length)return[];const e=Array.from(n);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),ERe.test(e[e.length-1].function||"")&&(e.pop(),ERe.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,gQe).map(t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"}))}const Nee="<anonymous>";function y1(n){try{return!n||typeof n!="function"?Nee:n.name||Nee}catch{return Nee}}const zae=m6();function _Qe(){if(!("fetch"in zae))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Uae(n){return n&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(n.toString())}function LCn(){if(!_Qe())return!1;if(Uae(zae.fetch))return!0;let n=!1;const e=zae.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=Uae(t.contentWindow.fetch)),e.head.removeChild(t)}catch(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return n}const y9=m6();function DCn(){const n=y9.chrome,e=n&&n.app&&n.app.runtime,t="history"in y9&&!!y9.history.pushState&&!!y9.history.replaceState;return!e&&t}const ju=m6(),eL="__sentry_xhr_v2__",IM={},xRe={};function ACn(n){if(!xRe[n])switch(xRe[n]=!0,n){case"console":RCn();break;case"dom":HCn();break;case"xhr":PCn();break;case"fetch":NCn();break;case"history":MCn();break;case"error":WCn();break;case"unhandledrejection":zCn();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn("unknown instrumentation type:",n);return}}function Vp(n,e){IM[n]=IM[n]||[],IM[n].push(e),ACn(n)}function cv(n,e){if(!(!n||!IM[n]))for(const t of IM[n]||[])try{t(e)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.error(`Error while triggering instrumentation handler.
Type: ${n}
Name: ${y1(t)}
Error:`,i)}}function RCn(){"console"in _u&&Vae.forEach(function(n){n in _u.console&&Ed(_u.console,n,function(e){return BW[n]=e,function(...t){cv("console",{args:t,level:n});const i=BW[n];i&&i.apply(_u.console,t)}})})}function NCn(){LCn()&&Ed(_u,"fetch",function(n){return function(...e){const{method:t,url:i}=OCn(e),r={args:e,fetchData:{method:t,url:i},startTimestamp:Date.now()};return cv("fetch",{...r}),n.apply(_u,e).then(o=>(cv("fetch",{...r,endTimestamp:Date.now(),response:o}),o),o=>{throw cv("fetch",{...r,endTimestamp:Date.now(),error:o}),o})}})}function jae(n,e){return!!n&&typeof n=="object"&&!!n[e]}function TRe(n){return typeof n=="string"?n:n?jae(n,"url")?n.url:n.toString?n.toString():"":""}function OCn(n){if(n.length===0)return{method:"GET",url:""};if(n.length===2){const[t,i]=n;return{url:TRe(t),method:jae(i,"method")?String(i.method).toUpperCase():"GET"}}const e=n[0];return{url:TRe(e),method:jae(e,"method")?String(e.method).toUpperCase():"GET"}}function PCn(){if(!ju.XMLHttpRequest)return;const n=XMLHttpRequest.prototype;Ed(n,"open",function(e){return function(...t){const i=Date.now(),r=t[1],o=this[eL]={method:hS(t[0])?t[0].toUpperCase():t[0],url:t[1],request_headers:{}};hS(r)&&o.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const s=()=>{const a=this[eL];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}cv("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:i,xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ed(this,"onreadystatechange",function(a){return function(...l){return s(),a.apply(this,l)}}):this.addEventListener("readystatechange",s),Ed(this,"setRequestHeader",function(a){return function(...l){const[c,u]=l,d=this[eL];return d&&(d.request_headers[c.toLowerCase()]=u),a.apply(this,l)}}),e.apply(this,t)}}),Ed(n,"send",function(e){return function(...t){const i=this[eL];return i&&t[0]!==void 0&&(i.body=t[0]),cv("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}let C9;function MCn(){if(!DCn())return;const n=ju.onpopstate;ju.onpopstate=function(...t){const i=ju.location.href,r=C9;if(C9=i,cv("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=C9,s=String(r);C9=s,cv("history",{from:o,to:s})}return t.apply(this,i)}}Ed(ju.history,"pushState",e),Ed(ju.history,"replaceState",e)}const FCn=1e3;let kRe,qae,Gae;function BCn(n){if(n.type!==qae)return!1;try{if(!n.target||n.target._sentryId!==Gae)return!1}catch{}return!0}function $Cn(n,e){return n!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function VCn(n){try{return n.target}catch{return null}}function IRe(n,e=!1){return t=>{if(!t||t._sentryCaptured)return;const i=VCn(t);if($Cn(t.type,i))return;_3(t,"_sentryCaptured",!0),i&&!i._sentryId&&_3(i,"_sentryId",Wh());const r=t.type==="keypress"?"input":t.type;BCn(t)||(n({event:t,name:r,global:e}),qae=t.type,Gae=i?i._sentryId:void 0),clearTimeout(kRe),kRe=ju.setTimeout(()=>{Gae=void 0,qae=void 0},FCn)}}function HCn(){if(!ju.document)return;const n=cv.bind(null,"dom"),e=IRe(n,!0);ju.document.addEventListener("click",e,!1),ju.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(t=>{const i=ju[t]&&ju[t].prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(Ed(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=IRe(n);u.handler=d,r.call(this,o,d,a)}u.refCount++}catch{}return r.call(this,o,s,a)}}),Ed(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 w9=null;function WCn(){w9=ju.onerror,ju.onerror=function(n,e,t,i,r){return cv("error",{column:i,error:r,line:t,msg:n,url:e}),w9&&!w9.__SENTRY_LOADER__?w9.apply(this,arguments):!1},ju.onerror.__SENTRY_INSTRUMENTED__=!0}let S9=null;function zCn(){S9=ju.onunhandledrejection,ju.onunhandledrejection=function(n){return cv("unhandledrejection",n),S9&&!S9.__SENTRY_LOADER__?S9.apply(this,arguments):!0},ju.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function UCn(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function jCn(){return"npm"}function qCn(){return!UCn()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function GCn(n,e){return n.require(e)}function KCn(){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 AC(n,e=100,t=1/0){try{return Kae("",n,e,t)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function vQe(n,e=3,t=100*1024){const i=AC(n,e);return ZCn(i)>t?vQe(n,e-1,t):i}function Kae(n,e,t=1/0,i=1/0,r=KCn()){const[o,s]=r;if(e==null||["number","boolean","string"].includes(typeof e)&&!sQe(e))return e;const a=YCn(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 f=c.toJSON();return Kae("",f,l-1,i,r)}catch{}const u=Array.isArray(e)?[]:{};let d=0;const h=hQe(e);for(const f in h){if(!Object.prototype.hasOwnProperty.call(h,f))continue;if(d>=i){u[f]="[MaxProperties ~]";break}const g=h[f];u[f]=Kae(f,g,l-1,i,r),d++}return s(e),u}function YCn(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(aQe(e))return"[VueViewModel]";if(uCn(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${y1(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const t=QCn(e);return/^HTML(\w*)Element$/.test(t)?`[HTMLElement: ${t}]`:`[object ${t}]`}catch(t){return`**non-serializable** (${t})`}}function QCn(n){const e=Object.getPrototypeOf(n);return e?e.constructor.name:"null prototype"}function XCn(n){return~-encodeURI(n).split(/%..|./).length}function ZCn(n){return XCn(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 UT(n){return new Mp(e=>{e(n)})}function Fbe(n){return new Mp((e,t)=>{t(n)})}class Mp{constructor(e){Mp.prototype.__init.call(this),Mp.prototype.__init2.call(this),Mp.prototype.__init3.call(this),Mp.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 Mp((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 Mp((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(Pbe(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 JCn(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 Fbe(new _b("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 Mp((a,l)=>{let c=e.length;if(!c)return a(!0);const u=setTimeout(()=>{s&&s>0&&a(!1)},s);e.forEach(d=>{UT(d).then(()=>{--c||(clearTimeout(u),a(!0))},l)})})}return{$:e,add:r,drain:o}}function Oee(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 ewn=["fatal","error","warning","log","info","debug"];function twn(n){return n==="warn"?"warning":ewn.includes(n)?n:"log"}const bQe=m6(),Yae={nowSeconds:()=>Date.now()/1e3};function nwn(){const{performance:n}=bQe;if(!n||!n.now)return;const e=Date.now()-n.now();return{now:()=>n.now(),timeOrigin:e}}function iwn(){try{return GCn(module,"perf_hooks").performance}catch{return}}const Pee=qCn()?iwn():nwn(),LRe=Pee===void 0?Yae:{nowSeconds:()=>(Pee.timeOrigin+Pee.now())/1e3},XG=Yae.nowSeconds.bind(Yae),jT=LRe.nowSeconds.bind(LRe),r0=(()=>{const{performance:n}=bQe;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})(),Qae="baggage",yQe="sentry-",rwn=/^sentry-/,own=8192;function swn(n){if(!hS(n)&&!Array.isArray(n))return;let e={};if(Array.isArray(n))e=n.reduce((i,r)=>{const o=DRe(r);return{...i,...o}},{});else{if(!n)return;e=DRe(n)}const t=Object.entries(e).reduce((i,[r,o])=>{if(r.match(rwn)){const s=r.slice(yQe.length);i[s]=o}return i},{});if(Object.keys(t).length>0)return t}function Xae(n){if(!n)return;const e=Object.entries(n).reduce((t,[i,r])=>(r&&(t[`${yQe}${i}`]=r),t),{});return awn(e)}function DRe(n){return n.split(",").map(e=>e.split("=").map(t=>decodeURIComponent(t.trim()))).reduce((e,[t,i])=>(e[t]=i,e),{})}function awn(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>own?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Not adding key: ${t} with val: ${i} to baggage header due to exceeding baggage size limits.`),e):s},"")}const lwn=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function cwn(n){if(!n)return;const e=n.match(lwn);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 uwn(n,e){const t=cwn(n),i=swn(e),{traceId:r,parentSpanId:o,parentSampled:s}=t||{},a={traceId:r||Wh(),spanId:Wh().substring(16),sampled:s};return o&&(a.parentSpanId=o),i&&(a.dsc=i),{traceparentData:t,dynamicSamplingContext:i,propagationContext:a}}function Bbe(n=Wh(),e=Wh().substring(16),t){let i="";return t!==void 0&&(i=t?"-1":"-0"),`${n}-${e}${i}`}function _6(n,e=[]){return[n,e]}function dwn(n,e){const[t,i]=n;return[t,[...i,e]]}function ARe(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 Zae(n,e){return(e||new TextEncoder).encode(n)}function hwn(n,e){const[t,i]=n;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Zae(r,e),s]:r.push(typeof s=="string"?Zae(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(AC(l))}o(c)}}return typeof r=="string"?r:fwn(r)}function fwn(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 pwn(n,e){const t=typeof n.data=="string"?Zae(n.data,e):n.data;return[Pw({type:"attachment",length:t.length,filename:n.filename,content_type:n.contentType,attachment_type:n.attachmentType}),t]}const gwn={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 RRe(n){return gwn[n]}function CQe(n){if(!n||!n.sdk)return;const{name:e,version:t}=n.sdk;return{name:e,version:t}}function mwn(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:QG(i)},...r&&{trace:Pw({...r})}}}function _wn(n,e,t){const i=[{type:"client_report"},{timestamp:t||XG(),discarded_events:n}];return _6(e?{dsn:e}:{},[i])}const vwn=60*1e3;function bwn(n,e=Date.now()){const t=parseInt(`${n}`,10);if(!isNaN(t))return t*1e3;const i=Date.parse(`${n}`);return isNaN(i)?vwn:i-e}function ywn(n,e){return n[e]||n.all||0}function Cwn(n,e,t=Date.now()){return ywn(n,e)>t}function wwn(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+bwn(s,i):e===429&&(r.all=i+60*1e3);return r}const $be="production";function Vbe(){return lQe("globalEventProcessors",()=>[])}function Swn(n){Vbe().push(n)}function $W(n,e,t,i=0){return new Mp((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&&Mn.log(`Event processor "${s.id}" dropped event`),Pbe(a)?a.then(l=>$W(n,l,t,i+1).then(r)).then(null,o):$W(n,a,t,i+1).then(r).then(null,o)}})}function Ewn(n){const e=jT(),t={sid:Wh(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Twn(t)};return n&&gA(t,n),t}function gA(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||jT(),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:Wh()),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 xwn(n,e){let t={};e?t={status:e}:n.status==="ok"&&(t={status:"exited"}),gA(n,t)}function Twn(n){return Pw({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 kwn=100;class uT{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=NRe()}static clone(e){const t=new uT;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&&gA(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 uT?t:this}return e instanceof uT?(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)):fA(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=NRe(),this}addBreadcrumb(e,t){const i=typeof t=="number"?t:kwn;if(i<=0)return this;const r={timestamp:XG(),...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},$W([...i||[],...Vbe(),...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?pQe(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function NRe(){return{traceId:Wh(),spanId:Wh().substring(16)}}const wQe=4,Iwn=100;class SQe{constructor(e,t=new uT,i=wQe){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=uT.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:Wh(),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:Wh(),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:Wh();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=Iwn}=r.getOptions&&r.getOptions()||{};if(s<=0)return;const l={timestamp:XG(),...e},c=o?cQe(()=>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=ORe(this);try{e(this)}finally{ORe(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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&&xwn(i),this._sendSessionUpdate(),t.setSession()}startSession(e){const{scope:t,client:i}=this.getStackTop(),{release:r,environment:o=$be}=i&&i.getOptions()||{},{userAgent:s}=_u.navigator||{},a=Ewn({release:r,environment:o,user:t.getUser(),...s&&{userAgent:s},...e}),l=t.getSession&&t.getSession();return l&&l.status==="ok"&&gA(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=v6().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function v6(){return _u.__SENTRY__=_u.__SENTRY__||{extensions:{},hub:void 0},_u}function ORe(n){const e=v6(),t=Jae(e);return EQe(e,n),t}function rc(){const n=v6();if(n.__SENTRY__&&n.__SENTRY__.acs){const e=n.__SENTRY__.acs.getCurrentHub();if(e)return e}return Lwn(n)}function Lwn(n=v6()){return(!Dwn(n)||Jae(n).isOlderThan(wQe))&&EQe(n,new SQe),Jae(n)}function Dwn(n){return!!(n&&n.__SENTRY__&&n.__SENTRY__.hub)}function Jae(n){return lQe("hub",()=>new SQe,n)}function EQe(n,e){if(!n)return!1;const t=n.__SENTRY__=n.__SENTRY__||{};return t.hub=e,!0}function b6(n){return(n||rc()).getScope().getTransaction()}let PRe=!1;function Awn(){PRe||(PRe=!0,Vp("error",ele),Vp("unhandledrejection",ele))}function ele(){const n=b6();if(n){const e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Tracing] Transaction: ${e} -> Global error occured`),n.setStatus(e)}}ele.tag="sentry_tracingErrorCallback";class xQe{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class Hbe{constructor(e={}){this.traceId=e.traceId||Wh(),this.spanId=e.spanId||Wh().substring(16),this.startTimestamp=e.startTimestamp||jT(),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 Hbe({...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},Mn.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=Rwn(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&&Mn.log(t.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:jT()}toTraceparent(){return Bbe(this.traceId,this.spanId,this.sampled)}toContext(){return Pw({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 Pw({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 Pw({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 Rwn(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 ZG(n,e,t){const i=e.getOptions(),{publicKey:r}=e.getDsn()||{},{segment:o}=t&&t.getUser()||{},s=Pw({environment:i.environment||$be,release:i.release,user_segment:o,public_key:r,trace_id:n});return e.emit&&e.emit("createDsc",s),s}class TQe extends Hbe{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||rc(),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 xQe(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 Pw({...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||rc(),t=e.getClient();if(!t)return{};const i=e.getScope(),r=ZG(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__)&&Mn.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__)&&Mn.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__)&&Mn.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),o.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),o}}const H$={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Nwn="finishReason",YI=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Own extends xQe{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:jT(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}}class Pwn extends TQe{constructor(e,t,i=H$.idleTimeout,r=H$.finalTimeout,o=H$.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=YI[4],s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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=YI[3],this.finish())},this._finalTimeout)}finish(e=jT()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Nwn,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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__)&&Mn.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||Mn.log("[Tracing] discarding Span since it finished after Transaction final timeout",s):Mn.log("[Tracing] discarding Span since it happened after Transaction was finished",s)}return i&&o}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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 Own(t,i,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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=YI[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=YI[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const t=jT();this._idleTimeoutCanceledPermanently?(this._finishReason=YI[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__)&&Mn.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=YI[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function Wbe(n){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=rc().getClient(),t=n||e&&e.getOptions();return!!t&&(t.enableTracing||"tracesSampleRate"in t||"tracesSampler"in t)}function kQe(n,e,t){if(!Wbe(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})),Mwn(i)?i?(n.sampled=Math.random()<i,n.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Tracing] starting ${n.op} transaction - ${n.name}`),n):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),n)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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__)&&Mn.warn("[Tracing] Discarding transaction because of invalid sample rate."),n.sampled=!1,n)}function Mwn(n){return sQe(n)||!(typeof n=="number"||typeof n=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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__)&&Mn.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${n}.`),!1):!0}function Fwn(){const e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function Bwn(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__)&&Mn.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 TQe(n,this);return s=kQe(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 MRe(n,e,t,i,r,o,s){const a=n.getClient(),l=a&&a.getOptions()||{};let c=new Pwn(e,n,t,i,s,r);return c=kQe(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 $wn(){const n=v6();n.__SENTRY__&&(n.__SENTRY__.extensions=n.__SENTRY__.extensions||{},n.__SENTRY__.extensions.startTransaction||(n.__SENTRY__.extensions.startTransaction=Bwn),n.__SENTRY__.extensions.traceHeaders||(n.__SENTRY__.extensions.traceHeaders=Fwn),Awn())}function Vwn(n,e){return rc().captureException(n,{captureContext:e})}function Hwn(n){rc().withScope(n)}const Wwn="7";function zwn(n){const e=n.protocol?`${n.protocol}:`:"",t=n.port?`:${n.port}`:"";return`${e}//${n.host}${t}${n.path?`/${n.path}`:""}/api/`}function Uwn(n){return`${zwn(n)}${n.projectId}/envelope/`}function jwn(n,e){return xCn({sentry_key:n.publicKey,sentry_version:Wwn,...e&&{sentry_client:`${e.name}/${e.version}`}})}function qwn(n,e={}){const t=typeof e=="string"?e:e.tunnel,i=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return t||`${Uwn(n)}?${jwn(n,i)}`}function Gwn(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 Kwn(n,e,t,i){const r=CQe(t),o={sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&e&&{dsn:QG(e)}},s="aggregates"in n?[{type:"sessions"},n]:[{type:"session"},n.toJSON()];return _6(o,[s])}function Ywn(n,e,t,i){const r=CQe(t),o=n.type&&n.type!=="replay_event"?n.type:"event";Gwn(n,t&&t.sdk);const s=mwn(n,r,i,e);return delete n.sdkProcessingMetadata,_6(s,[[{type:o},n]])}const FRe=[];function Qwn(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 Xwn(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=pQe(t(e)):i=e;const r=Qwn(i),o=Jwn(r,s=>s.name==="Debug");if(o!==-1){const[s]=r.splice(o,1);r.push(s)}return r}function Zwn(n,e){const t={};return e.forEach(i=>{i&&IQe(n,i,t)}),t}function IQe(n,e,t){if(t[e.name]=e,FRe.indexOf(e.name)===-1&&(e.setupOnce(Swn,rc),FRe.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__)&&Mn.log(`Integration installed: ${e.name}`)}function Jwn(n,e){for(let t=0;t<n.length;t++)if(e(n[t])===!0)return t;return-1}function eSn(n,e,t,i,r){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=n,a={...e,event_id:e.event_id||t.event_id||Wh(),timestamp:e.timestamp||XG()},l=t.integrations||n.integrations.map(h=>h.name);tSn(a,n),rSn(a,l),e.type===void 0&&nSn(a,n.stackParser);let c=i;t.captureContext&&(c=uT.clone(c).update(t.captureContext));let u=UT(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=$W([...d,...Vbe()],a,t);return u.then(h=>(h&&iSn(h),typeof o=="number"&&o>0?oSn(h,o,s):h))}function tSn(n,e){const{environment:t,release:i,dist:r,maxValueLength:o=250}=e;"environment"in n||(n.environment="environment"in e?t:$be),n.release===void 0&&i!==void 0&&(n.release=i),n.dist===void 0&&r!==void 0&&(n.dist=r),n.message&&(n.message=KL(n.message,o));const s=n.exception&&n.exception.values&&n.exception.values[0];s&&s.value&&(s.value=KL(s.value,o));const a=n.request;a&&a.url&&(a.url=KL(a.url,o))}const BRe=new WeakMap;function nSn(n,e){const t=_u._sentryDebugIds;if(!t)return;let i;const r=BRe.get(e);r?i=r:(i=new Map,BRe.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 iSn(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 rSn(n,e){e.length>0&&(n.sdk=n.sdk||{},n.sdk.integrations=[...n.sdk.integrations||[],...e])}function oSn(n,e,t){if(!n)return null;const i={...n,...n.breadcrumbs&&{breadcrumbs:n.breadcrumbs.map(r=>({...r,...r.data&&{data:AC(r.data,e,t)}}))},...n.user&&{user:AC(n.user,e,t)},...n.contexts&&{contexts:AC(n.contexts,e,t)},...n.extra&&{extra:AC(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=AC(n.contexts.trace.data,e,t))),n.spans&&(i.spans=n.spans.map(r=>(r.data&&(r.data=AC(r.data,e,t)),r))),i}const $Re="Not capturing exception because it's already been captured.";class sSn{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=ECn(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn("No DSN provided, client will not send events."),this._dsn){const t=qwn(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,i){if(wRe(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log($Re);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=oQe(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&&wRe(t.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log($Re);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__)&&Mn.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),gA(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)):UT(!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=Zwn(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__)&&Mn.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){IQe(this,e,this._integrations)}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let i=Ywn(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of t.attachments||[])i=dwn(i,pwn(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=Kwn(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__)&&Mn.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)&&(gA(e,{...i&&{status:"crashed"},errors:e.errors||Number(r||i)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Mp(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),eSn(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 f=h||ZG(c,this,i);s.sdkProcessingMetadata={dynamicSamplingContext:f,...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"?Mn.log(o.message):Mn.warn(o)}})}_processEvent(e,t,i){const r=this.getOptions(),{sampleRate:o}=r,s=DQe(e),a=LQe(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),Fbe(new _b(`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 _b("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return d;const f=lSn(r,d,t);return aSn(f,c)}).then(d=>{if(d===null)throw this.recordDroppedEvent("before_send",u,e),new _b(`${c} returned \`null\`, will not send event.`,"log");const h=i&&i.getSession();!s&&h&&this._updateSessionFromEvent(h,d);const f=d.transaction_info;if(s&&f&&d.transaction!==e.transaction){const g="custom";d.transaction_info={...f,source:g}}return this.sendEvent(d,t),d}).then(null,d=>{throw d instanceof _b?d:(this.captureException(d,{data:{__sentry__:!0},originalException:d}),new _b(`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__)&&Mn.error("Error while sending event:",t)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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 aSn(n,e){const t=`${e} must return \`null\` or a valid event.`;if(Pbe(n))return n.then(i=>{if(!fA(i)&&i!==null)throw new _b(t);return i},i=>{throw new _b(`${e} rejected with ${i}`)});if(!fA(n)&&n!==null)throw new _b(t);return n}function lSn(n,e,t){const{beforeSend:i,beforeSendTransaction:r}=n;return LQe(e)&&i?i(e,t):DQe(e)&&r?r(e,t):e}function LQe(n){return n.type===void 0}function DQe(n){return n.type==="transaction"}function cSn(n,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Mn.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const t=rc();t.getScope().update(e.initialScope);const r=new n(e);t.bindClient(r)}const uSn=30;function AQe(n,e,t=JCn(n.bufferSize||uSn)){let i={};const r=s=>t.drain(s);function o(s){const a=[];if(ARe(s,(d,h)=>{const f=RRe(h);if(Cwn(i,f)){const g=VRe(d,h);n.recordDroppedEvent("ratelimit_backoff",f,g)}else a.push(d)}),a.length===0)return UT();const l=_6(s[0],a),c=d=>{ARe(l,(h,f)=>{const g=VRe(h,f);n.recordDroppedEvent(d,RRe(f),g)})},u=()=>e({body:hwn(l,n.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),i=wwn(i,d),d),d=>{throw c("network_error"),d});return t.add(u).then(d=>d,d=>{if(d instanceof _b)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.error("Skipped sending event because buffer is full."),c("queue_overflow"),UT();throw d})}return o.__sentry__baseTransport__=!0,{send:o,flush:r}}function VRe(n,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(n)?n[1]:void 0}const VW="7.77.0";let HRe;class JG{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=JG.id}setupOnce(){HRe=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Mbe(this)||this;return HRe.apply(t,e)}}catch{}}}JG.__initStatic();const dSn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],hSn=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/];class eK{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=eK.id,this._options=e}setupOnce(e,t){}processEvent(e,t,i){const r=i.getOptions(),o=fSn(this._options,r);return pSn(e,o)?null:e}}eK.__initStatic();function fSn(n={},e={}){return{allowUrls:[...n.allowUrls||[],...e.allowUrls||[]],denyUrls:[...n.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...n.ignoreErrors||[],...e.ignoreErrors||[],...n.disableErrorDefaults?[]:dSn],ignoreTransactions:[...n.ignoreTransactions||[],...e.ignoreTransactions||[],...n.disableTransactionDefaults?[]:hSn],ignoreInternal:n.ignoreInternal!==void 0?n.ignoreInternal:!0}}function pSn(n,e){return e.ignoreInternal&&ySn(n)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Event dropped due to being internal Sentry Error.
Event: ${VC(n)}`),!0):gSn(n,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${VC(n)}`),!0):mSn(n,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${VC(n)}`),!0):_Sn(n,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${VC(n)}.
Url: ${HW(n)}`),!0):vSn(n,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${VC(n)}.
Url: ${HW(n)}`),!0)}function gSn(n,e){return n.type||!e||!e.length?!1:bSn(n).some(t=>g6(t,e))}function mSn(n,e){if(n.type!=="transaction"||!e||!e.length)return!1;const t=n.transaction;return t?g6(t,e):!1}function _Sn(n,e){if(!e||!e.length)return!1;const t=HW(n);return t?g6(t,e):!1}function vSn(n,e){if(!e||!e.length)return!0;const t=HW(n);return t?g6(t,e):!0}function bSn(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&&Mn.error(`Could not extract message for event ${VC(n)}`),e}function ySn(n){try{return n.exception.values[0].type==="SentryError"}catch{}return!1}function CSn(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 HW(n){try{let e;try{e=n.exception.values[0].stacktrace.frames}catch{}return e?CSn(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.error(`Cannot extract url for event ${VC(n)}`),null}}const Na=_u;let tle=0;function RQe(){return tle>0}function wSn(){tle++,setTimeout(()=>{tle--})}function mA(n,e={},t){if(typeof n!="function")return n;try{const r=n.__sentry_wrapped__;if(r)return r;if(Mbe(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=>mA(s,e));return n.apply(this,o)}catch(o){throw wSn(),Hwn(s=>{s.addEventProcessor(a=>(e.mechanism&&(Wae(a,void 0,void 0),v3(a,e.mechanism)),a.extra={...a.extra,arguments:r},a)),Vwn(o)}),o}};try{for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}catch{}dQe(i,n),_3(n,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get(){return n.name}})}catch{}return i}function NQe(n,e){const t=zbe(n,e),i={type:e&&e.name,value:TSn(e)};return t.length&&(i.stacktrace={frames:t}),i.type===void 0&&i.value===""&&(i.value="Unrecoverable error caught"),i}function SSn(n,e,t,i){const o=rc().getClient(),s=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:YG(e)?e.constructor.name:i?"UnhandledRejection":"Error",value:LSn(e,{isUnhandledRejection:i})}]},extra:{__serialized__:vQe(e,s)}};if(t){const l=zbe(n,t);l.length&&(a.exception.values[0].stacktrace={frames:l})}return a}function Mee(n,e){return{exception:{values:[NQe(n,e)]}}}function zbe(n,e){const t=e.stacktrace||e.stack||"",i=xSn(e);try{return n(t,i)}catch{}return[]}const ESn=/Minified React error #\d+;/i;function xSn(n){if(n){if(typeof n.framesToPop=="number")return n.framesToPop;if(ESn.test(n.message))return 1}return 0}function TSn(n){const e=n&&n.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function kSn(n,e,t,i){const r=t&&t.syntheticException||void 0,o=Ube(n,e,r,i);return v3(o),o.level="error",t&&t.event_id&&(o.event_id=t.event_id),UT(o)}function ISn(n,e,t="info",i,r){const o=i&&i.syntheticException||void 0,s=nle(n,e,o,r);return s.level=t,i&&i.event_id&&(s.event_id=i.event_id),UT(s)}function Ube(n,e,t,i,r){let o;if(Obe(e)&&e.error)return Mee(n,e.error);if(mRe(e)||aCn(e)){const s=e;if("stack"in e)o=Mee(n,e);else{const a=s.name||(mRe(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;o=nle(n,l,t,i),Wae(o,l)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}return rQe(e)?Mee(n,e):fA(e)||YG(e)?(o=SSn(n,e,t,r),v3(o,{synthetic:!0}),o):(o=nle(n,e,t,i),Wae(o,`${e}`,void 0),v3(o,{synthetic:!0}),o)}function nle(n,e,t,i){const r={message:e};if(i&&t){const o=zbe(n,t);o.length&&(r.exception={values:[{value:e,stacktrace:{frames:o}}]})}return r}function LSn(n,{isUnhandledRejection:e}){const t=TCn(n),i=e?"promise rejection":"exception";return Obe(n)?`Event \`ErrorEvent\` captured as ${i} with message \`${n.message}\``:YG(n)?`Event \`${DSn(n)}\` (type=${n.type}) captured as ${i}`:`Object captured as ${i} with keys: ${t}`}function DSn(n){try{const e=Object.getPrototypeOf(n);return e?e.constructor.name:void 0}catch{}}function ASn(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:QG(i)}},o=RSn(n);return _6(r,[o])}function RSn(n){return[{type:"user_report"},n]}class NSn extends sSn{constructor(e){const t=Na.SENTRY_SDK_SOURCE||jCn();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:VW}],version:VW},super(e),e.sendClientReports&&Na.document&&Na.document.addEventListener("visibilitychange",()=>{Na.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return kSn(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",i){return ISn(this._options.stackParser,e,t,i,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn("SDK not enabled, will not capture user feedback.");return}const t=ASn(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__)&&Mn.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("Sending outcomes:",e);const t=_wn(e,this._options.tunnel&&QG(this._dsn));this._sendEnvelope(t)}}let gP;function OSn(){if(gP)return gP;if(Uae(Na.fetch))return gP=Na.fetch.bind(Na);const n=Na.document;let e=Na.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__)&&Mn.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return gP=e.bind(Na)}function PSn(){gP=void 0}function MSn(n,e=OSn()){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 PSn(),t-=s,i--,Fbe(l)}}return AQe(n,r)}const FSn=4;function BSn(n){function e(t){return new Mp((i,r)=>{const o=new XMLHttpRequest;o.onerror=r,o.onreadystatechange=()=>{o.readyState===FSn&&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 AQe(n,e)}const tK="?",$Sn=30,VSn=40,HSn=50;function jbe(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 WSn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zSn=/\((\S*)(?::(\d+))(?::(\d+))\)/,USn=n=>{const e=WSn.exec(n);if(e){if(e[2]&&e[2].indexOf("eval")===0){const o=zSn.exec(e[2]);o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3])}const[i,r]=OQe(e[1]||tK,e[2]);return jbe(r,i,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},jSn=[$Sn,USn],qSn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,GSn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,KSn=n=>{const e=qSn.exec(n);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=GSn.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]||tK;return[r,i]=OQe(r,i),jbe(i,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},YSn=[HSn,KSn],QSn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,XSn=n=>{const e=QSn.exec(n);return e?jbe(e[2],e[1]||tK,+e[3],e[4]?+e[4]:void 0):void 0},ZSn=[VSn,XSn],JSn=[jSn,YSn,ZSn],eEn=mQe(...JSn),OQe=(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]:tK,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[n,e]};class JR{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=JR.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:tEn,onunhandledrejection:nEn}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const t in e){const i=this._installFunc[t];i&&e[t]&&(oEn(t),i(),this._installFunc[t]=void 0)}}}JR.__initStatic();function tEn(){Vp("error",n=>{const[e,t,i]=FQe();if(!e.getIntegration(JR))return;const{msg:r,url:o,line:s,column:a,error:l}=n;if(RQe()||l&&l.__sentry_own_request__)return;const c=l===void 0&&hS(r)?rEn(r,o,s,a):PQe(Ube(t,l||r,void 0,i,!1),o,s,a);c.level="error",MQe(e,l,c,"onerror")})}function nEn(){Vp("unhandledrejection",n=>{const[e,t,i]=FQe();if(!e.getIntegration(JR))return;let r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch{}if(RQe()||r&&r.__sentry_own_request__)return!0;const o=oQe(r)?iEn(r):Ube(t,r,void 0,i,!0);o.level="error",MQe(e,r,o,"onunhandledrejection")})}function iEn(n){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`}]}}}function rEn(n,e,t,i){const r=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Obe(n)?n.message:n,s="Error";const a=o.match(r);return a&&(s=a[1],o=a[2]),PQe({exception:{values:[{type:s,value:o}]}},e,t,i)}function PQe(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=hS(e)&&e.length>0?e:mCn();return l.length===0&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),n}function oEn(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`Global Handler attached: ${n}`)}function MQe(n,e,t,i){v3(t,{handled:!1,type:i}),n.captureEvent(t,{originalException:e})}function FQe(){const n=rc(),e=n.getClient(),t=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[n,t.stackParser,t.attachStacktrace]}const sEn=["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 nK{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=nK.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&Ed(Na,"setTimeout",WRe),this._options.setInterval&&Ed(Na,"setInterval",WRe),this._options.requestAnimationFrame&&Ed(Na,"requestAnimationFrame",aEn),this._options.XMLHttpRequest&&"XMLHttpRequest"in Na&&Ed(XMLHttpRequest.prototype,"send",lEn);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:sEn).forEach(cEn)}}nK.__initStatic();function WRe(n){return function(...e){const t=e[0];return e[0]=mA(t,{mechanism:{data:{function:y1(n)},handled:!1,type:"instrument"}}),n.apply(this,e)}}function aEn(n){return function(e){return n.apply(this,[mA(e,{mechanism:{data:{function:"requestAnimationFrame",handler:y1(n)},handled:!1,type:"instrument"}})])}}function lEn(n){return function(...e){const t=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in t&&typeof t[r]=="function"&&Ed(t,r,function(o){const s={mechanism:{data:{function:r,handler:y1(o)},handled:!1,type:"instrument"}},a=Mbe(o);return a&&(s.mechanism.data.handler=y1(a)),mA(o,s)})}),n.apply(this,e)}}function cEn(n){const e=Na,t=e[n]&&e[n].prototype;!t||!t.hasOwnProperty||!t.hasOwnProperty("addEventListener")||(Ed(t,"addEventListener",function(i){return function(r,o,s){try{typeof o.handleEvent=="function"&&(o.handleEvent=mA(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:y1(o),target:n},handled:!1,type:"instrument"}}))}catch{}return i.apply(this,[r,mA(o,{mechanism:{data:{function:"addEventListener",handler:y1(o),target:n},handled:!1,type:"instrument"}}),s])}}),Ed(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 E9=1024;class iK{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=iK.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&Vp("console",hEn),this.options.dom&&Vp("dom",dEn(this.options.dom)),this.options.xhr&&Vp("xhr",fEn),this.options.fetch&&Vp("fetch",pEn),this.options.history&&Vp("history",gEn),this.options.sentry){const e=rc().getClient();e&&e.on&&e.on("beforeSendEvent",uEn)}}}iK.__initStatic();function uEn(n){rc().addBreadcrumb({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:VC(n)},{event:n})}function dEn(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>E9&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`\`dom.maxStringLength\` cannot exceed ${E9}, but a value of ${o} was configured. Sentry will use ${E9} instead.`),o=E9),typeof r=="string"&&(r=[r]);try{const s=t.event;i=mEn(s)?pA(s.target,{keyAttrs:r,maxStringLength:o}):pA(s,{keyAttrs:r,maxStringLength:o})}catch{i="<unknown>"}i.length!==0&&rc().addBreadcrumb({category:`ui.${t.name}`,message:i},{event:t.event,name:t.name,global:t.global})}return e}function hEn(n){const e={category:"console",data:{arguments:n.args,logger:"console"},level:twn(n.level),message:_Re(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)e.message=`Assertion failed: ${_Re(n.args.slice(1)," ")||"console.assert"}`,e.data.arguments=n.args.slice(1);else return;rc().addBreadcrumb(e,{input:n.args,level:n.level})}function fEn(n){const{startTimestamp:e,endTimestamp:t}=n,i=n.xhr[eL];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};rc().addBreadcrumb({category:"xhr",data:l,type:"http"},c)}function pEn(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};rc().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};rc().addBreadcrumb({category:"fetch",data:i,type:"http"},r)}}function gEn(n){let e=n.from,t=n.to;const i=Oee(Na.location.href);let r=Oee(e);const o=Oee(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),rc().addBreadcrumb({category:"navigation",data:{from:e,to:t}})}function mEn(n){return!!n&&!!n.target}const _En="cause",vEn=5;class rK{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=rK.id,this._key=e.key||_En,this._limit=e.limit||vEn}setupOnce(){}preprocessEvent(e,t,i){const r=i.getOptions();hCn(NQe,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}}rK.__initStatic();class oK{static __initStatic(){this.id="HttpContext"}constructor(){this.name=oK.id}setupOnce(){}preprocessEvent(e){if(!Na.navigator&&!Na.location&&!Na.document)return;const t=e.request&&e.request.url||Na.location&&Na.location.href,{referrer:i}=Na.document||{},{userAgent:r}=Na.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}}oK.__initStatic();class sK{static __initStatic(){this.id="Dedupe"}constructor(){this.name=sK.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(bEn(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}}sK.__initStatic();function bEn(n,e){return e?!!(yEn(n,e)||CEn(n,e)):!1}function yEn(n,e){const t=n.message,i=e.message;return!(!t&&!i||t&&!i||!t&&i||t!==i||!$Qe(n,e)||!BQe(n,e))}function CEn(n,e){const t=zRe(e),i=zRe(n);return!(!t||!i||t.type!==i.type||t.value!==i.value||!$Qe(n,e)||!BQe(n,e))}function BQe(n,e){let t=URe(n),i=URe(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 $Qe(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 zRe(n){return n.exception&&n.exception.values&&n.exception.values[0]}function URe(n){const e=n.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const wEn=[new eK,new JG,new nK,new iK,new JR,new rK,new sK,new oK];function SEn(n={}){n.defaultIntegrations===void 0&&(n.defaultIntegrations=wEn),n.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(n.release=__SENTRY_RELEASE__),Na.SENTRY_RELEASE&&Na.SENTRY_RELEASE.id&&(n.release=Na.SENTRY_RELEASE.id)),n.autoSessionTracking===void 0&&(n.autoSessionTracking=!0),n.sendClientReports===void 0&&(n.sendClientReports=!0);const e={...n,stackParser:kCn(n.stackParser||eEn),integrations:Xwn(n),transport:n.transport||(_Qe()?MSn:BSn)};cSn(NSn,e),n.autoSessionTracking&&EEn()}function jRe(n){n.startSession({ignoreDuration:!0}),n.captureSession()}function EEn(){if(typeof Na.document>"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const n=rc();n.captureSession&&(jRe(n),Vp("history",({from:e,to:t})=>{e===void 0||e===t||jRe(rc())}))}const Fa=_u;function xEn(){Fa&&Fa.document?Fa.document.addEventListener("visibilitychange",()=>{const n=b6();if(Fa.document.hidden&&n){const e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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__)&&Mn.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const qbe=(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)))}},TEn=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,kEn=()=>{const n=Fa.performance.timing,e=Fa.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},VQe=()=>Fa.__WEB_VITALS_POLYFILL__?Fa.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||kEn()):Fa.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],HQe=()=>{const n=VQe();return n&&n.activationStart||0},Gbe=(n,e)=>{const t=VQe();let i="navigate";return t&&(Fa.document.prerendering||HQe()>0?i="prerender":i=t.type.replace(/_/g,"-")),{name:n,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:TEn(),navigationType:i}},aK=(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{}},lK=(n,e)=>{const t=i=>{(i.type==="pagehide"||Fa.document.visibilityState==="hidden")&&(n(i),e&&(removeEventListener("visibilitychange",t,!0),removeEventListener("pagehide",t,!0)))};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},IEn=n=>{const e=Gbe("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=aK("layout-shift",o);if(s){t=qbe(n,e);const a=()=>{o(s.takeRecords()),t(!0)};return lK(a),a}};let W$=-1;const LEn=()=>Fa.document.visibilityState==="hidden"&&!Fa.document.prerendering?0:1/0,DEn=()=>{lK(({timeStamp:n})=>{W$=n},!0)},Kbe=()=>(W$<0&&(W$=LEn(),DEn()),{get firstHiddenTime(){return W$}}),AEn=n=>{const e=Kbe(),t=Gbe("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=aK("first-input",o);i=qbe(n,t),s&&lK(()=>{o(s.takeRecords()),s.disconnect()},!0)},qRe={},REn=n=>{const e=Kbe(),t=Gbe("LCP");let i;const r=s=>{const a=s[s.length-1];if(a){const l=Math.max(a.startTime-HQe(),0);l<e.firstHiddenTime&&(t.value=l,t.entries=[a],i())}},o=aK("largest-contentful-paint",r);if(o){i=qbe(n,t);const s=()=>{qRe[t.id]||(r(o.takeRecords()),o.disconnect(),qRe[t.id]=!0,i(!0))};return["keydown","click"].forEach(a=>{addEventListener(a,s,{once:!0,capture:!0})}),lK(s,!0),s}},LM={},WW={};let WQe,zQe,UQe;function NEn(n){return Qbe("cls",n,MEn,WQe)}function OEn(n){return Qbe("lcp",n,BEn,UQe)}function PEn(n){return Qbe("fid",n,FEn,zQe)}function Ybe(n,e){return jQe(n,e),WW[n]||($En(n),WW[n]=!0),qQe(n,e)}function cK(n,e){const t=LM[n];if(!(!t||!t.length))for(const i of t)try{i(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.error(`Error while triggering instrumentation handler.
Type: ${n}
Name: ${y1(i)}
Error:`,r)}}function MEn(){IEn(n=>{cK("cls",{metric:n}),WQe=n})}function FEn(){AEn(n=>{cK("fid",{metric:n}),zQe=n})}function BEn(){REn(n=>{cK("lcp",{metric:n}),UQe=n})}function Qbe(n,e,t,i){return jQe(n,e),WW[n]||(t(),WW[n]=!0),i&&e({metric:i}),qQe(n,e)}function $En(n){const e={};n==="event"&&(e.durationThreshold=0),aK(n,t=>{cK(n,{entries:t})},e)}function jQe(n,e){LM[n]=LM[n]||[],LM[n].push(e)}function qQe(n,e){return()=>{const t=LM[n];if(!t)return;const i=t.indexOf(e);i!==-1&&t.splice(i,1)}}function Fee(n){return typeof n=="number"&&isFinite(n)}function _A(n,{startTimestamp:e,...t}){return e&&n.startTimestamp>e&&(n.startTimestamp=e),n.startChild({startTimestamp:e,...t})}function du(n){return n/1e3}function GQe(){return Fa&&Fa.addEventListener&&Fa.performance}let GRe=0,jl={},Xv,DM;function VEn(){const n=GQe();if(n&&r0){n.mark&&Fa.performance.mark("sentry-tracing-init");const e=jEn(),t=zEn(),i=UEn();return()=>{e(),t(),i()}}return()=>{}}function HEn(){Ybe("longtask",({entries:n})=>{for(const e of n){const t=b6();if(!t)return;const i=du(r0+e.startTime),r=du(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r})}})}function WEn(){Ybe("event",({entries:n})=>{for(const e of n){const t=b6();if(!t)return;if(e.name==="click"){const i=du(r0+e.startTime),r=du(e.duration);t.startChild({description:pA(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r})}}})}function zEn(){return NEn(({metric:n})=>{const e=n.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding CLS"),jl.cls={value:n.value,unit:""},DM=e)})}function UEn(){return OEn(({metric:n})=>{const e=n.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding LCP"),jl.lcp={value:n.value,unit:"millisecond"},Xv=e)})}function jEn(){return PEn(({metric:n})=>{const e=n.entries.pop();if(!e)return;const t=du(r0),i=du(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding FID"),jl.fid={value:n.value,unit:"millisecond"},jl["mark.fid"]={value:t+i,unit:"second"}})}function qEn(n){const e=GQe();if(!e||!Fa.performance.getEntries||!r0)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Tracing] Adding & adjusting spans using Performance API");const t=du(r0),i=e.getEntries();let r,o;if(i.slice(GRe).forEach(s=>{const a=du(s.startTime),l=du(s.duration);if(!(n.op==="navigation"&&t+a<n.startTimestamp))switch(s.entryType){case"navigation":{KEn(n,s,t),r=t+du(s.responseStart),o=t+du(s.requestStart);break}case"mark":case"paint":case"measure":{GEn(n,s,a,l,t);const c=Kbe(),u=s.startTime<c.firstHiddenTime;s.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding FP"),jl.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding FCP"),jl.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{const c=s.name.replace(Fa.location.origin,"");QEn(n,s,c,a,l,t);break}}}),GRe=Math.max(i.length-1,0),XEn(n),n.op==="pageload"){typeof r=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding TTFB"),jl.ttfb={value:(r-n.startTimestamp)*1e3,unit:"millisecond"},typeof o=="number"&&o<=r&&(jl["ttfb.requestTime"]={value:(r-o)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!jl[a]||t>=n.startTimestamp)return;const l=jl[a].value,c=t+du(l),u=Math.abs((c-n.startTimestamp)*1e3),d=u-l;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Measurements] Normalized ${a} from ${l} to ${u} (${d})`),jl[a].value=u});const s=jl["mark.fid"];s&&jl.fid&&(_A(n,{description:"first input delay",endTimestamp:s.value+du(jl.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:s.value}),delete jl["mark.fid"]),"fcp"in jl||delete jl.cls,Object.keys(jl).forEach(a=>{n.setMeasurement(a,jl[a].value,jl[a].unit)}),ZEn(n)}Xv=void 0,DM=void 0,jl={}}function GEn(n,e,t,i,r){const o=r+t,s=o+i;return _A(n,{description:e.name,endTimestamp:s,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:o}),o}function KEn(n,e,t){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(i=>{x9(n,e,i,t)}),x9(n,e,"secureConnection",t,"TLS/SSL","connectEnd"),x9(n,e,"fetch",t,"cache","domainLookupStart"),x9(n,e,"domainLookup",t,"DNS"),YEn(n,e,t)}function x9(n,e,t,i,r,o){const s=o?e[o]:e[`${t}End`],a=e[`${t}Start`];!a||!s||_A(n,{op:"browser",origin:"auto.browser.browser.metrics",description:r||t,startTimestamp:i+du(a),endTimestamp:i+du(s)})}function YEn(n,e,t){_A(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:t+du(e.requestStart),endTimestamp:t+du(e.responseEnd)}),_A(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:t+du(e.responseStart),endTimestamp:t+du(e.responseEnd)})}function QEn(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;_A(n,{description:t,endTimestamp:l,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:s})}function XEn(n){const e=Fa.navigator;if(!e)return;const t=e.connection;t&&(t.effectiveType&&n.setTag("effectiveConnectionType",t.effectiveType),t.type&&n.setTag("connectionType",t.type),Fee(t.rtt)&&(jl["connection.rtt"]={value:t.rtt,unit:"millisecond"})),Fee(e.deviceMemory)&&n.setTag("deviceMemory",`${e.deviceMemory} GB`),Fee(e.hardwareConcurrency)&&n.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function ZEn(n){Xv&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding LCP Data"),Xv.element&&n.setTag("lcp.element",pA(Xv.element)),Xv.id&&n.setTag("lcp.id",Xv.id),Xv.url&&n.setTag("lcp.url",Xv.url.trim().slice(0,200)),n.setTag("lcp.size",Xv.size)),DM&&DM.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log("[Measurements] Adding CLS Data"),DM.sources.forEach((e,t)=>n.setTag(`cls.source.${t+1}`,pA(e.node))))}const ile=["localhost",/^\/(?!\/)/],rle={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:ile,tracePropagationTargets:ile};function JEn(n){const{traceFetch:e,traceXHR:t,tracePropagationTargets:i,tracingOrigins:r,shouldCreateSpanForRequest:o,enableHTTPTimings:s}={traceFetch:rle.traceFetch,traceXHR:rle.traceXHR,...n},a=typeof o=="function"?o:u=>!0,l=u=>ixn(u,i||r),c={};e&&Vp("fetch",u=>{const d=rxn(u,a,l,c);s&&d&&KRe(d)}),t&&Vp("xhr",u=>{const d=sxn(u,a,l,c);s&&d&&KRe(d)})}function exn(n){return n.entryType==="resource"&&"initiatorType"in n&&typeof n.nextHopProtocol=="string"&&(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest")}function KRe(n){const e=n.data.url;if(!e)return;const t=Ybe("resource",({entries:i})=>{i.forEach(r=>{exn(r)&&r.name.endsWith(e)&&(nxn(r).forEach(s=>n.setData(...s)),setTimeout(t))})})}function txn(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 Wv(n=0){return((r0||performance.timeOrigin)+n)/1e3}function nxn(n){const{name:e,version:t}=txn(n.nextHopProtocol),i=[];return i.push(["network.protocol.version",t],["network.protocol.name",e]),r0?[...i,["http.request.redirect_start",Wv(n.redirectStart)],["http.request.fetch_start",Wv(n.fetchStart)],["http.request.domain_lookup_start",Wv(n.domainLookupStart)],["http.request.domain_lookup_end",Wv(n.domainLookupEnd)],["http.request.connect_start",Wv(n.connectStart)],["http.request.secure_connection_start",Wv(n.secureConnectionStart)],["http.request.connection_end",Wv(n.connectEnd)],["http.request.request_start",Wv(n.requestStart)],["http.request.response_start",Wv(n.responseStart)],["http.request.response_end",Wv(n.responseEnd)]]:i}function ixn(n,e){return g6(n,e||ile)}function rxn(n,e,t,i){if(!Wbe()||!n.fetchData)return;const r=e(n.fetchData.url);if(n.endTimestamp&&r){const h=n.fetchData.__span;if(!h)return;const f=i[h];if(f){if(n.response){f.setHttpStatus(n.response.status);const g=n.response&&n.response.headers&&n.response.headers.get("content-length"),m=parseInt(g);m>0&&f.setData("http.response_content_length",m)}else n.error&&f.setStatus("internal_error");f.finish(),delete i[h]}return}const o=rc(),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 f=n.args[1];f.headers=oxn(h,a,s,f,d)}return d}function oxn(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():Bbe(a,void 0,l),d=s?s.getDynamicSamplingContext():c||ZG(a,e,t),h=Xae(d),f=typeof Request<"u"&&b1(n,Request)?n.headers:i.headers;if(f)if(typeof Headers<"u"&&b1(f,Headers)){const g=new Headers(f);return g.append("sentry-trace",u),h&&g.append(Qae,h),g}else if(Array.isArray(f)){const g=[...f,["sentry-trace",u]];return h&&g.push([Qae,h]),g}else{const g="baggage"in f?f.baggage:void 0,m=[];return Array.isArray(g)?m.push(...g):g&&m.push(g),h&&m.push(h),{...f,"sentry-trace":u,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":u,baggage:h}}function sxn(n,e,t,i){const r=n.xhr,o=r&&r[eL];if(!Wbe()||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=rc(),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(),f=Xae(h);YRe(r,u.toTraceparent(),f)}else{const d=a.getClient(),{traceId:h,sampled:f,dsc:g}=l.getPropagationContext(),m=Bbe(h,void 0,f),v=g||(d?ZG(h,d,l):void 0),_=Xae(v);YRe(r,m,_)}return u}function YRe(n,e,t){try{n.setRequestHeader("sentry-trace",e),t&&n.setRequestHeader(Qae,t)}catch{}}function axn(n,e=!0,t=!0){if(!Fa||!Fa.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn("Could not initialize routing instrumentation due to invalid location");return}let i=Fa.location.href,r;e&&(r=n({name:Fa.location.pathname,startTimestamp:r0?r0/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),t&&Vp("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__)&&Mn.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=n({name:Fa.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const lxn="BrowserTracing",cxn={...H$,markBackgroundTransactions:!0,routingInstrumentation:axn,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...rle};class uxn{constructor(e){this.name=lxn,this._hasSetTracePropagationTargets=!1,$wn(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...cxn,...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=VEn(),this.options.enableLongTask&&HEn(),this.options._experiments.enableInteractions&&WEn()}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:f,_experiments:g}=this.options,m=o&&o.tracePropagationTargets,v=m||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&m&&Mn.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(_=>{const b=this._createRouteTransaction(_);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(b,_,t),b},l,a),c&&xEn(),g.enableInteractions&&this._registerInteractionListener(),JEn({traceFetch:u,traceXHR:d,tracePropagationTargets:v,shouldCreateSpanForRequest:h,enableHTTPTimings:f})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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?QRe("sentry-trace"):"",c=a?QRe("baggage"):"",{traceparentData:u,dynamicSamplingContext:d,propagationContext:h}=uwn(l,c),f={...e,...u,metadata:{...e.metadata,dynamicSamplingContext:u&&!d?{}:d},trimEnd:!0},g=typeof i=="function"?i(f):f,m=g===void 0?{...f,sampled:!1}:g;m.metadata=m.name!==f.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__)&&Mn.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.log(`[Tracing] Starting ${m.op} transaction on scope`);const{location:v}=Fa,_=MRe(t,m,r,o,!0,{location:v},s),b=t.getScope();return a&&u?b.setPropagationContext(h):b.setPropagationContext({traceId:_.traceId,spanId:_.spanId,parentSpanId:_.parentSpanId,sampled:_.sampled}),_.registerBeforeFinishCallback(y=>{this._collectWebVitals(),qEn(y)}),_}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:i,finalTimeout:r,heartbeatInterval:o}=this.options,s="ui.action.click",a=b6();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.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__)&&Mn.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mn.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`);return}const l=this._getCurrentHub(),{location:c}=Fa,u={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=MRe(l,u,i,r,!0,{location:c},o)};["click"].forEach(i=>{addEventListener(i,t,{once:!1,capture:!0})})}}function QRe(n){const e=_Cn(`meta[name=${n}]`);return e?e.getAttribute("content"):void 0}function dxn(n){const e={_metadata:{},...n};e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:VW}],version:VW},SEn(e)}function hxn(n){const e=ml();return w.useEffect(()=>{window.scrollTo(0,0)},[e]),p(St,{children:n.children})}var KQe,XRe=op;KQe=XRe.createRoot,XRe.hydrateRoot;const fxn="Organization",pxn="Name",gxn="Website",mxn="Phone",_xn="Address",vxn="Street",bxn="Apt/Suite",yxn="City",Cxn="State/Province",wxn="Postal Code",Sxn="Country",Exn="Contacts",xxn="First Name",Txn="Last Name",kxn="Phone",Ixn="Email",Lxn="Additional Info",Dxn="Payment Terms",Axn="Currency",Rxn="Company Size",Nxn="Industry",Oxn="Private Notes",Pxn="Invoice",Mxn="Client",Fxn="Invoice Date",Bxn="Due Date",$xn="Invoice Number",Vxn="Invoice #",Hxn="PO Number",Wxn="PO #",zxn="How Often",Uxn="Discount",jxn="Taxes",qxn="Tax",Gxn="Item",Kxn="Description",Yxn="Unit Cost",Qxn="Quantity",Xxn="Line Total",Zxn="Subtotal",Jxn="Net",eTn="Paid to Date",tTn="Balance Due",nTn="Design",iTn="Terms",rTn="Your Invoice",oTn="Remove contact",sTn="Add contact",aTn="Create new client",lTn="Edit client details",cTn="Enable",uTn="Learn more",dTn="Manage rates",hTn="Note to Client",fTn="Invoice Terms",pTn="Save as default terms",gTn="Download PDF",mTn="Pay Now",_Tn="Save Invoice",vTn="Clone To Invoice",bTn="Archive Invoice",yTn="Delete Invoice",CTn="Email Invoice",wTn="Enter Payment",STn="Tax Rates",ETn="Rate",xTn="Settings",TTn="Enable specifying an <b>invoice tax</b>",kTn="Enable specifying <b>line item taxes</b>",ITn="Dashboard",LTn='Note: add a :link named ":name" to show the totals using a single base currency.',DTn="Clients",ATn="Invoices",RTn="Payments",NTn="Credits",OTn="History",PTn="Search",MTn="Sign Up",FTn="Guest",BTn="Company Details",$Tn="Online Payments",VTn="Notifications",HTn="Import | Export",WTn="Done",zTn="Save",UTn="Create",jTn="Upload",qTn="Download",GTn="Cancel",KTn="Close",YTn="Please provide a valid email address",QTn="Powered by",XTn="No items",ZTn="Recurring Invoices",JTn=`<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>`,ekn="Recurring Quotes",tkn="in total revenue",nkn="billed client",ikn="billed clients",rkn="active client",okn="active clients",skn="Invoices Past Due",akn="Upcoming Invoices",lkn="Average Invoice",ckn="Archive",ukn="Archive Client",dkn="Delete Client",hkn="Archive Payment",fkn="Delete Payment",pkn="Archive Credit",gkn="Delete Credit",mkn="Show archived/deleted",_kn="Filter",vkn="New Client",bkn="New Invoice",ykn="Enter Payment",Ckn="Enter Credit",wkn="Contact",Skn="Date Created",Ekn="Last Login",xkn="Balance",Tkn="Action",kkn="Status",Ikn="Invoice Total",Lkn="Frequency",Dkn="Range",Akn="Start Date",Rkn="End Date",Nkn="Transaction Reference",Okn="Method",Pkn="Payment Amount",Mkn="Payment Date",Fkn="Credit Amount",Bkn="Credit Balance",$kn="Credit Date",Vkn="No data available in table",Hkn="Select",Wkn="Edit Client",zkn="Edit Invoice",Ukn="Create Invoice",jkn="Enter Credit",qkn="Last logged in",Gkn="Details",Kkn="Standing",Ykn="Credit",Qkn="Activity",Xkn="Date",Zkn="Message",Jkn="Adjustment",eIn="Are you sure?",tIn="Payment Type",nIn="Amount",iIn="Email",rIn="Language",oIn="Timezone",sIn="Date Format",aIn="Date/Time Format",lIn="Users",cIn="Localization",uIn="Remove logo",dIn="Supported: JPEG, GIF and PNG",hIn="Payment Gateway",fIn="Gateway",pIn="Email Notifications",gIn="Email me when an invoice is <b>viewed</b>",mIn="Email me when an invoice is <b>paid</b>",_In="Site Updates",vIn="Custom Messages",bIn="Set default <b>email signature</b>",yIn="Please select a file",CIn="Use first row as headers",wIn="Column",SIn="Sample",EIn="Import to",xIn="client will be created",TIn="clients will be created",kIn="Email Settings",IIn="Client View Styling",LIn="Attach PDF",DIn="Custom CSS",AIn="Import Client Data",RIn="CSV file",NIn="Export Client Data",OIn="Successfully created client",PIn="Successfully created :count client(s)",MIn="Successfully updated settings",FIn="Successfully removed logo",BIn="Successfully sent message",$In="Please make sure to select a client and correct any errors",VIn="You've hit the :count client limit on Free accounts. Congrats on your success!",HIn="There was an error processing your payment. Please try again later.",WIn="Registration Required",zIn="Please confirm your email address, :link to resend the confirmation email.",UIn="Successfully updated client",jIn="Successfully archived client",qIn="Successfully archived :count clients",GIn="Successfully deleted client",KIn="Successfully deleted :count clients",YIn="Successfully updated invoice",QIn="Successfully created invoice",XIn="Successfully cloned invoice",ZIn="Successfully emailed invoice",JIn="and created client",e2n="Successfully archived invoice",t2n="Successfully archived :count invoices",n2n="Successfully deleted invoice",i2n="Successfully deleted :count invoices",r2n="Successfully created payment",o2n="Successfully created :count payment(s)",s2n="Successfully archived payment",a2n="Successfully archived :count payments",l2n="Successfully deleted payment",c2n="Successfully deleted :count payments",u2n="Successfully applied payment",d2n="Successfully created credit",h2n="Successfully archived credit",f2n="Successfully archived :count credits",p2n="Successfully deleted credit",g2n="Successfully deleted :count credits",m2n="Successfully imported file",_2n="Successfully updated vendor",v2n="Successfully created vendor",b2n="Successfully archived vendor",y2n="Successfully archived :count vendors",C2n="Successfully deleted vendor",w2n="Successfully deleted :count vendors",S2n="Account Confirmation",E2n="Account Confirmation",x2n="Please access the link below to confirm your account.",T2n="New invoice :number from :account",k2n="To view your invoice for :amount, click the link below.",I2n="Payment Received",L2n="Thank you for your payment of :amount.",D2n="Dear :name,",A2n="Regards,",R2n="The Invoice Ninja Team",N2n="To view the invoice click the link below:",O2n="Invoice :invoice was paid by :client",P2n="Invoice :invoice was sent to :client",M2n="Invoice :invoice was viewed by :client",F2n="A payment of :amount was made by client :client towards Invoice :invoice.",B2n="The following client :client was emailed Invoice :invoice for :amount.",$2n="The following client :client viewed Invoice :invoice for :amount.",V2n="Invoice :invoicenumber for :amount for client :client",H2n="Payment with no invoice for amount :amount for client :client",W2n="You can reset your account password by clicking the following button:",z2n="Secure Payment",U2n="Card Number",j2n="Expiration Month",q2n="Expiration Year",G2n="CVV",K2n="Log Out",Y2n="Sign up to save your work",Q2n="I agree to the :terms",X2n="Terms of Service",Z2n="The email address is already registered",J2n="Working",eLn="Success",tLn="You have successfully registered! Please visit the link in the account confirmation email to verify your email address.",nLn="Your account is not registered, this will permanently erase your data.",iLn="Password",rLn="Pro Plan",oLn="You have unsaved changes",sLn="Custom Fields",aLn="Company Fields",lLn="Client Fields",cLn="Field Label",uLn="Field Value",dLn="Edit",hLn="Set your company name",fLn="View as recipient",pLn="Product Library",gLn="Product",mLn="Products",_Ln="Auto-fill products",vLn="Selecting a product will automatically <b>fill in the description and cost</b>",bLn="Auto-update products",yLn="Updating an invoice will automatically <b>update the product library</b>",CLn="Add Product",wLn="Edit Product",SLn="Archive Product",ELn="Successfully updated product",xLn="Successfully created product",TLn="Successfully archived product",kLn=":link to enable custom fields by joining the Pro Plan",ILn="Advanced Settings",LLn=":link to enable the advanced settings by joining the Pro Plan",DLn="Invoice Design",ALn="Specify colors",RLn="Select the colors used in the invoice",NLn="Chart Builder",OLn="Created by :site | Create. Send. Get Paid.",PLn="Go Pro",MLn="Quote",FLn="Quotes",BLn="Quote Number",$Ln="Quote #",VLn="Quote Date",HLn="Quote Total",WLn="Your Quote",zLn="Total",ULn="Clone",jLn="New Quote",qLn="Create Quote",GLn="Edit Quote",KLn="Archive Quote",YLn="Delete Quote",QLn="Save Quote",XLn="Email Quote",ZLn="Clone To Quote",JLn="Convert to Invoice",eDn="View Invoice",tDn="View Client",nDn="View Quote",iDn="Successfully updated quote",rDn="Successfully created quote",oDn="Successfully cloned quote",sDn="Successfully emailed quote",aDn="Successfully archived quote",lDn="Successfully archived :count quotes",cDn="Successfully deleted quote",uDn="Successfully deleted :count quotes",dDn="Successfully converted quote to invoice",hDn="New quote :number from :account",fDn="To view your quote for :amount, click the link below.",pDn="To view your client quote click the link below:",gDn="Quote :invoice was sent to :client",mDn="Quote :invoice was viewed by :client",_Dn="The following client :client was emailed Quote :invoice for :amount.",vDn="The following client :client viewed Quote :invoice for :amount.",bDn="Your session has expired.",yDn="Invoice Fields",CDn="Invoice Options",wDn="Hide Paid to Date",SDn='Only display the "Paid to Date" area on your invoices once a payment has been received.',EDn="Charge taxes",xDn="User Management",TDn="Add User",kDn="Send Invitation",IDn="Successfully sent invitation",LDn="Successfully updated user",DDn="You've been invited by :invitor. ",ADn="Please sign up to add a user",RDn="State",NDn="Edit User",ODn="Delete User",PDn="Active",MDn="Pending",FDn="Successfully deleted user",BDn="Are you sure you want to email this invoice?",$Dn="Are you sure you want to email this quote?",VDn="Are you sure you want this invoice emailed?",HDn="Are you sure you want to start the recurrence?",WDn="Delete Account",zDn="Warning: This will permanently delete your account, there is no undo.",UDn="Go Back",jDn="Data Visualizations",qDn="Sample data shown",GDn="Hide",KDn="A new version of :releases_link is available. You're running v:user_version, the latest is v:latest_version",YDn="Invoice Settings",QDn="Invoice Number Prefix",XDn="Invoice Number Counter",ZDn="Quote Number Prefix",JDn="Quote Number Counter",eAn="Share invoice counter",tAn="Invoice issued to",nAn="To prevent a possible conflict please set either an invoice or quote number prefix",iAn="Mark Sent",rAn="More designs",oAn="Additional Invoice Designs",sAn="Go Pro for more invoice designs",aAn="",lAn="",cAn="Buy",uAn="Successfully added additional invoice designs",dAn="Sent",hAn="VAT Number",fAn="Enter Your Billing Address and Credit Card information",pAn="*This is the 3-4 digit number on the back of your card",gAn="*Billing address must match address associated with credit card.",mAn='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',_An="ID Number",vAn="White label",bAn="White Label",yAn="Successfully enabled white label license",CAn="White labeled",wAn="Restore",SAn="Restore Invoice",EAn="Restore Quote",xAn="Restore Client",TAn="Restore Credit",kAn="Restore Payment",IAn="Successfully restored invoice",LAn="Successfully restored quote",DAn="Successfully restored client",AAn="Successfully restored payment",RAn="Successfully restored credit",NAn="Help us improve our site by telling us why you're leaving.",OAn="Percent",PAn="Amount",MAn="Invoice History",FAn="Quote History",BAn="Current version",$An="Select version",VAn="View History",HAn="Edit Payment",WAn="Successfully updated payment",zAn="Deleted",UAn="Restore User",jAn="Successfully restored user",qAn="Show deleted users",GAn="Email Templates",KAn="Invoice Email",YAn="Payment Email",QAn="Quote Email",XAn="Reset All",ZAn="Approve",JAn="Token Billing",eRn="Disabled",tRn="Opt-in - checkbox is shown but not selected",nRn="Opt-out - checkbox is shown and selected",iRn="Always",rRn="Store credit card details",oRn="View in :gateway",sRn="Use Card on File",aRn="Edit payment details",lRn="Save card details",cRn="The data is stored securely by :link",uRn="Support",dRn="Contact Information",hRn="Amount due",fRn="Billing Address",pRn="Billing Method",gRn="Order overview",mRn="*Address must match address associated with credit card.",_Rn='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',vRn="Invoice Footer",bRn="Save as default footer",yRn="Token Management",CRn="Tokens",wRn="Add Token",SRn="Show deleted tokens",ERn="Successfully deleted token",xRn="Successfully created token",TRn="Successfully updated token",kRn="Edit Token",IRn="Delete Token",LRn="Token",DRn="Add Payment Gateway",ARn="Delete Payment Gateway",RRn="Edit Payment Gateway",NRn="Successfully updated gateway",ORn="Successfully created gateway",PRn="Successfully deleted gateway",MRn="PayPal",FRn="Credit Card",BRn="Change password",$Rn="Current password",VRn="New password",HRn="Confirm password",WRn="The current password is incorrect.",zRn="The new password is invalid.",URn="Successfully updated password",jRn="API Tokens",qRn="Users & Tokens",GRn="Account Login",KRn="Recover your password",YRn="Forgot your password?",QRn="Email address",XRn="Let's go",ZRn="Password Recovery",JRn="Send Email",eNn="Set Password",tNn="Converted",nNn="Email me when a quote is <b>approved</b>",iNn="Quote :invoice was approved by :client",rNn="The following client :client approved Quote :invoice for :amount.",oNn="Resend confirmation email",sNn="The confirmation email was resent",aNn="Credit Card",lNn="PayPal",cNn="Bitcoin",uNn="GoCardless",dNn="Knowledge Base",hNn="Partial/Deposit",fNn=":partial of :balance",pNn="More Fields",gNn="Less Fields",mNn="Client Name",_Nn="PDF Settings",vNn="Product Settings",bNn="Auto Line Wrap",yNn="Warning: the previous page was submitted twice. The second submission had been ignored.",CNn="View Documentation",wNn="Free Online Invoicing",SNn="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.",ENn="rows",xNn="www",TNn="Logo",kNn="Subdomain",INn="Please provide a name or email",LNn="Charts & Reports",DNn="Chart",ANn="Report",RNn="Group by",NNn="Paid",ONn="Report",PNn="Chart",MNn="Totals",FNn="Run",BNn="Documentation",$Nn="Zapier",VNn="Recurring",HNn="Last invoice sent :date",WNn="Successfully completed update",zNn="Tasks",UNn="New Task",jNn="Start Time",qNn="Successfully created task",GNn="Successfully updated task",KNn="Edit Task",YNn="Clone Task",QNn="Archive Task",XNn="Restore Task",ZNn="Delete Task",JNn="Stop Task",eOn="Time",tOn="Start",nOn="Stop",iOn="Now",rOn="Timer",oOn="Manual",sOn="Date & Time",aOn="Second",lOn="Seconds",cOn="Minute",uOn="Minutes",dOn="Hour",hOn="Hours",fOn="Task Details",pOn="Duration",gOn="Time Log",mOn="End Time",_On="End",vOn="Invoiced",bOn="Logged",yOn="Running",COn="The tasks can't belong to different clients",wOn="Please stop running tasks first",SOn="Tasks have already been invoiced",EOn="Successfully restored task",xOn="Successfully archived task",TOn="Successfully archived :count tasks",kOn="Successfully deleted task",IOn="Successfully deleted :count tasks",LOn="Create Task",DOn="Successfully stopped task",AOn="Invoice Task",ROn="Invoice Labels",NOn="Prefix",OOn="Counter",POn="Dwolla",MOn="Must be greater than zero and less than the total",FOn="More Actions",BOn="NINJA PRO",$On="Upgrade Now!",VOn="Create Unlimited Clients",HOn="Access to 10 Beautiful Invoice Designs",WOn='Custom URLs - "YourBrand.InvoiceNinja.com"',zOn='Remove "Created by Invoice Ninja"',UOn="Multi-user Access & Activity Tracking",jOn="Create Quotes & Pro-forma Invoices",qOn="Customize Invoice Field Titles & Numbering",GOn="Option to Attach PDFs to Client Emails",KOn="Resume",YOn="Break",QOn="Edit Details",XOn="Work",ZOn="Please :link to set your timezone",JOn="click here",ePn="Email payment receipt to the client",tPn="Successfully created payment and emailed client",nPn="Add Company",iPn="Untitled",rPn="New Company",oPn="Successfully linked accounts",sPn="Successfully unlinked accounts",aPn="Login",lPn="or",cPn="There was a problem sending the email",uPn="Note: emails are sent at the start of the hour.",dPn="Note: invoices are created at the start of the hour.",hPn="Unlink Account",fPn="Unlink",pPn="Show Address",gPn="Require client to provide their billing address",mPn="Update Address",_Pn="Update client's address with provided details",vPn="Times",bPn="Set to now",yPn="Dark Mode",CPn="Use a dark background for the sidebars",wPn="Add to invoice :invoice",SPn="Create new invoice",EPn="Please correct any overlapping times",xPn="From",TPn="To",kPn="Font Size",IPn="Primary Color",LPn="Secondary Color",DPn="Customize Design",APn="Content",RPn="Styles",NPn="Defaults",OPn="Margins",PPn="Header",MPn="Footer",FPn="Custom",BPn="Invoice to",$Pn="Invoice No.",VPn="Quote No.",HPn="Recent Payments",WPn="Outstanding",zPn="Manage Companies",UPn="Total Revenue",jPn="Current User",qPn="New Recurring Invoice",GPn="Recurring Invoice",KPn="New Recurring Quote",YPn="Recurring Quote",QPn="Created by :invoice",XPn="Primary User",ZPn="Help",JPn="playground",eMn="Support Forums",tMn="Due Date",nMn="Valid Until",iMn="Valid Until",rMn="Reset terms",oMn="Reset footer",sMn=":count invoice sent",aMn=":count invoices sent",lMn="Draft",cMn="Sent",uMn="Viewed",dMn="Partial",hMn="Paid",fMn="Unpaid",pMn="All",gMn="Display <b>line item taxes inline</b>",mMn="Auto Bill",_Mn="24 Hour Time",vMn="Last Sent",bMn="Reminder Emails",yMn="Quote Reminder Emails",CMn="Templates & Reminders",wMn="Subject",SMn="Body",EMn="First Reminder",xMn="Second Reminder",TMn="Third Reminder",kMn="Days after due date",IMn="Reminder: Invoice :invoice from :account",LMn="Reset",DMn="The requested invoice is not available",AMn="Referral Program",RMn="Referral URL",NMn="Sent Last: :date",OMn="This page will expire soon, :click_here to keep working",PMn="Upcoming Quotes",MMn="Expired Quotes",FMn="Sign up using",BMn="These credentials do not match our records",$Mn="Show all options",VMn="User Details",HMn="Connected Account",WMn="Disable",zMn="Invoice and Quote Numbers",UMn="Invoice Surcharges",jMn="We were unable to deliver Invoice :invoice to :contact. <br><br> :error",qMn="Unable to deliver Invoice :invoice",GMn="We were unable to deliver Quote :invoice to :contact. <br><br> :error",KMn="Unable to deliver Quote :invoice",YMn="Custom Invoice Link",QMn="Total Invoiced",XMn="Open Balance",ZMn="Please visit the link in the account confirmation email to verify your email address.",JMn="Basic Settings",e4n="Pro",t4n="Payment Gateways",n4n="Send Next: :date",i4n="This invoice is not scheduled to run",r4n="General Settings",o4n="Customize",s4n="Connect an account to login without a password",a4n="Earn money by sharing our app online",l4n="Enable | Requires Stripe",c4n="Tax Settings",u4n="Add Tax Rate",d4n="Successfully updated tax rate",h4n="Successfully created tax rate",f4n="Edit tax rate",p4n="Archive Tax Rate",g4n="Successfully archived the tax rate",m4n="Default Tax Rate",_4n="Tax Rate",v4n="Recurring Hour",b4n="Pattern",y4n="Pattern Help",C4n="Create custom numbers by specifying a pattern",w4n="Available variables:",S4n="For example, :example would be converted to :value",E4n="See options",x4n="Invoice Counter",T4n="Quote Counter",k4n="Type",I4n=":user created client :client",L4n=":user archived client :client",D4n=":user deleted client :client",A4n=":user created invoice :invoice",R4n=":user updated invoice :invoice",N4n=":user emailed invoice :invoice for :client to :contact",O4n=":contact viewed invoice :invoice for :client",P4n=":user archived invoice :invoice",M4n=":user deleted invoice :invoice",F4n=":user entered payment :payment for :payment_amount on invoice :invoice for :client",B4n=":user updated payment :payment",$4n=":user archived payment :payment",V4n=":user deleted payment :payment",H4n=":user entered :credit credit",W4n=":user updated :credit credit",z4n=":user archived :credit credit",U4n=":user deleted :credit credit",j4n=":user created quote :quote",q4n=":user updated quote :quote",G4n=":user emailed quote :quote for :client to :contact",K4n=":contact viewed quote :quote",Y4n=":user archived quote :quote",Q4n=":user deleted quote :quote",X4n=":user restored quote :quote",Z4n=":user restored invoice :invoice",J4n=":user restored client :client",e3n=":user restored payment :payment",t3n=":user restored :credit credit",n3n=":contact approved quote :quote for :client",i3n=":user created vendor :vendor",r3n=":user archived vendor :vendor",o3n=":user deleted vendor :vendor",s3n=":user restored vendor :vendor",a3n=":user created expense :expense",l3n=":user archived expense :expense",c3n=":user deleted expense :expense",u3n=":user restored expense :expense",d3n=":user created task :task",h3n=":user updated task :task",f3n=":user archived task :task",p3n=":user deleted task :task",g3n=":user restored task :task",m3n=":user updated expense :expense",_3n=":user created user :user",v3n=":user updated user :user",b3n=":user archived user :user",y3n=":user deleted user :user",C3n=":user restored user :user",w3n=":user marked sent :invoice",S3n=":user paid invoice :invoice",E3n=":contact replied ticket :ticket",x3n=":user viewed ticket :ticket",T3n="Payment",k3n="System",I3n="Email Signature",L3n="Default Messages",D3n="Quote Terms",A3n="Default Quote Terms",R3n="Default Invoice Terms",N3n="Default Invoice Footer",O3n="Quote Footer",P3n="Free",M3n="Successfully approved",F3n="Apply Credit",B3n="System Settings",$3n="Archive Token",V3n="Successfully archived token",H3n="Archive User",W3n="Successfully archived user",z3n="Delete Gateway",U3n="Successfully archived gateway",j3n="Archive Recurring Invoice",q3n="Successfully archived recurring invoice",G3n="Delete Recurring Invoice",K3n="Successfully deleted recurring invoice",Y3n="Restore Recurring Invoice",Q3n="Successfully restored recurring invoice",X3n="Archive Recurring Quote",Z3n="Successfully archived recurring quote",J3n="Delete Recurring Quote",e5n="Successfully deleted recurring quote",t5n="Restore Recurring Quote",n5n="Successfully restored recurring quote",i5n="Archived",r5n="Untitled Company",o5n="Before",s5n="After",a5n="Reset to the default account terms",l5n="Reset to the default account footer",c5n="Export Data",u5n="User",d5n="Country",h5n="Include",f5n="Your logo is :size, for better PDF performance we suggest uploading an image file less than 200KB",p5n="Import From FreshBooks",g5n="Import Data",m5n="Source",_5n="CSV",v5n="Client File",b5n="Invoice File",y5n="Task File",C5n="No valid mapping for file",w5n="Invalid CSV Header",S5n="Client Portal",E5n="Admin",x5n="Disabled",T5n="Show archived users",k5n="Notes",I5n="invoice will be created",L5n="invoices will be created",D5n="The following records failed to import, they either already exist or are missing required fields.",A5n="Publishable Key",R5n="Secret Key",N5n="Set your Stripe publishable key for an improved checkout process",O5n="Email Design",P5n="Due by :date",M5n="Enable Markup",F5n="Make it easier for your clients to pay you by adding schema.org markup to your emails.",B5n="Templates Help",$5n="Available variables:",V5n="Email Style",H5n="Make your emails look more professional with HTML layouts.",W5n="Plain",z5n="Light",U5n="Dark",j5n="Used to provide comparisons against the averages of companies of similar size and industry.",q5n="Set the subdomain or display the invoice on your own website.",G5n="Display the invoice in an iFrame on your own website",K5n="Specify a prefix or use a custom pattern to dynamically set the invoice number.",Y5n="Specify a prefix or use a custom pattern to dynamically set the quote number.",Q5n="Add a field when creating a client and optionally display the label and value on the PDF.",X5n="Add a label and value to the company details section of the PDF.",Z5n="Add a field when creating an invoice and optionally display the label and value on the PDF.",J5n="Add a field when creating an invoice and include the charge in the invoice subtotals.",eFn="Validation token was expired. Please try again.",tFn="Invoice Link",nFn="Confirm your email.",iFn="Confirm",rFn="Email Preferences",oFn="Successfully created :count invoice(s)",sFn="The next invoice number is :number.",aFn="The next quote number is :number.",lFn="days before the",cFn="days after the",uFn="due date",dFn="invoice date",hFn="Schedule",fFn="Email Designs",pFn="Assigned when sent",gFn="Purchase a white label license",mFn="Expense",_Fn="Expenses",vFn="Enter Expense",bFn="New Vendor",yFn="Net",CFn="Vendor",wFn="Edit Vendor",SFn="Archive Vendor",EFn="Delete Vendor",xFn="View Vendor",TFn="Successfully deleted expense",kFn="Successfully archived expense",IFn="Successfully deleted expenses",LFn="Successfully archived expenses",DFn="Expense Amount",AFn="Expense Balance",RFn="Expense Date",NFn="Should this expense be invoiced?",OFn="Public Notes",PFn="Invoice Amount",MFn="Exchange Rate",FFn="Yes",BFn="No",$Fn="Should be invoiced",VFn="View expense # :expense",HFn="Edit Expense",WFn="Archive Expense",zFn="Delete Expense",UFn="Expense # :expense",jFn="Successfully updated expense",qFn="Successfully created expense",GFn="Enter Expense",KFn="View",YFn="Restore Expense",QFn="Invoice Expense",XFn="The expenses can't belong to different clients",ZFn="Expense has already been invoiced",JFn="Convert currency",e6n="Number of Days",t6n="Create Payment Term",n6n="Edit Payment Term",i6n="Edit Payment Term",r6n="Archive Payment Term",o6n="Recurring Invoice Due Dates",s6n=`<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>`,a6n="Due",l6n="Due Next: :date",c6n="Use client terms",u6n=":ordinal day of month",d6n="Last day of month",h6n=":ordinal :day after",f6n="Sunday",p6n="Monday",g6n="Tuesday",m6n="Wednesday",_6n="Thursday",v6n="Friday",b6n="Saturday",y6n="Header Font",C6n="Body Font",w6n="Note: the primary color and fonts are also used in the client portal and custom email designs.",S6n="Live Preview",E6n="Unable to send email, please check that the mail settings are correct.",x6n="To view your invoice for :amount, click the button below.",T6n="To view your quote for :amount, click the button below.",k6n="Thank you for your payment of :amount.",I6n="Direct Debit",L6n="Credit Cards & Banks",D6n="Add Bank Account",A6n="Setup Account",R6n="Import Expenses",N6n="Bank",O6n="Integration Type",P6n="Successfully updated bank account",M6n="Edit Bank Account",F6n="Archive Bank Account",B6n="Successfully archived bank account",$6n="Successfully created bank account",V6n="Validate Bank Account",H6n="Note: your password is transmitted securely and never stored on our servers.",W6n="Warning: your password may be transmitted in plain text, consider enabling HTTPS.",z6n="Username",U6n="Account Number",j6n="Account Name",q6n="Failed to retrieve account details, please check your credentials.",G6n="Approved",K6n="Quote Settings",Y6n="Auto Convert",Q6n="Automatically convert a quote to an invoice when approved.",X6n="Validate",Z6n="Info",J6n="Successfully created :count_vendors vendor(s) and :count_expenses expense(s)",eBn="Note: if you plan on accepting credit cards details we strongly recommend enabling HTTPS on your site.",tBn="The expenses can't have different currencies.",nBn="The client's currency does not match the expense currency.",iBn="Trello Roadmap",rBn="Header/Footer",oBn="First page",sBn="All pages",aBn="Last page",lBn="Show Header on",cBn="Show Footer on",uBn="Invoice Currency",dBn="We strongly recommend using HTTPS to accept credit card details online.",hBn="Quote issued to",fBn="Currency Code",pBn="Your account has been upgraded to the pro plan for one year at no cost.",gBn="Your account will receive a free two week trial of our pro plan.",mBn="Your free pro plan trial lasts :count more days, :link to upgrade now.",_Bn="This is the last day of your free pro plan trial, :link to upgrade now.",vBn="Start Free Trial",bBn="Successfully enabled two week free pro plan trial",yBn="Overdue",CBn="Purchase a ONE YEAR white label license for $:price to remove the Invoice Ninja branding from the invoice and client portal.",wBn="To adjust your email notification settings please visit :link",SBn="If you did not request this password reset please email our support: :email",EBn="Sorry, this will exceed the limit of :limit users",xBn="Get 6 more invoice designs for just $:price",TBn="Please use a :link",kBn="newer browser",IBn=":link for $:price to enable custom styling and help support our project.",LBn=":link to remove the Invoice Ninja logo by joining the Pro Plan",DBn="Click here",ABn="Sent",RBn="Opened",NBn="Viewed",OBn="Emails can not be sent to inactive clients",PBn="Emails can not be sent to inactive contacts",MBn="Emails can not be sent to inactive invoices",FBn="Emails can not be sent to inactive proposals",BBn="Please register your account to send emails",$Bn="Please confirm your account to send emails",VBn="Invalid contact email",HBn="Navigation",WBn="List Invoices",zBn="List Clients",UBn="List Quotes",jBn="List Tasks",qBn="List Expenses",GBn="List Recurring Invoices",KBn="List Payments",YBn="List Credits",QBn="Tax Name",XBn="Report Settings",ZBn="New User",JBn="New Product",e8n="New Tax Rate",t8n="Invoiced Amount",n8n="Invoice Item Fields",i8n="Add a field when creating an invoice item and display the label and value on the PDF.",r8n="Recurring Number",o8n="Specify a prefix to be added to the invoice number for recurring invoices.",s8n="Password Protect Invoices",a8n="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.",l8n="Generate Automatically",c8n="If no password is set, one will be generated and sent with the first invoice.",u8n="Expired",d8n="The credit card number is not valid.",h8n="The expiration date is not valid.",f8n="The CVV is not valid.",p8n="Cost",g8n="Note: create your first invoice to see a preview here.",m8n="Owner",_8n="Administrator",v8n="Allow user to manage users, change settings and modify all records",b8n="Create clients, invoices, etc.",y8n="View all clients, invoices, etc.",C8n="Edit all clients, invoices, etc.",w8n="Partial Due",S8n="Restore Vendor",E8n="Successfully restored vendor",x8n="Successfully restored expense",T8n="Permissions",k8n="Allow user to create and modify records",I8n="Allow user to view records they didn't create",L8n="Allow user to modify records they didn't create",D8n="View Payment",A8n="January",R8n="February",N8n="March",O8n="April",P8n="May",M8n="June",F8n="July",B8n="August",$8n="September",V8n="October",H8n="November",W8n="December",z8n="Documents:",U8n="Documents:",j8n="Widgets Receipt.pdf",q8n="Final Deliverable.zip",G8n="Quote Documents",K8n="Invoice Documents",Y8n="Expense Documents",Q8n="Embed Documents",X8n="Include attached images in the invoice.",Z8n="Attach Documents",J8n="Attach UBL/E-Invoice",e9n="Download Documents (:size)",t9n="From Expenses:",n9n="Drop files or click to upload",i9n="Uploads disabled",r9n="Your browser does not support drag'n'drop file uploads.",o9n="Please use the fallback form below to upload your files like in the olden days.",s9n="File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",a9n="You can't upload files of this type.",l9n="Server responded with {{statusCode}} code.",c9n="Cancel upload",u9n="Are you sure you want to cancel this upload?",d9n="Remove file",h9n="Documents",f9n="Document Date",p9n="Size",g9n="Client Portal",m9n="Show/hide the client portal.",_9n="Dashboard",v9n="Show/hide the dashboard page in the client portal.",b9n="Account Management",y9n="Plan Status",C9n="Upgrade",w9n="Manage Plan",S9n="Changes To",E9n=":plan on :date",x9n=":plan (:term) on :date",T9n="Cancel Change",k9n="Plan",I9n="Expires",L9n="Renews",D9n=":plan Plan Expired",A9n=":plan Plan Trial Ended",R9n="Never",N9n="Free",O9n="Pro",P9n="Enterprise",M9n="Self Hosted (White labeled)",F9n="Self Hosted (Free)",B9n="Trial",$9n="Term",V9n="Monthly",H9n="Yearly",W9n="Month",z9n="Year",U9n="$:price/Month",j9n="$:price/Year",q9n="Updated plan settings",G9n="Term Started",K9n="Plan Started",Y9n="Plan Expires",Q9n="Purchase White Label",X9n="One year enrollment in the Invoice Ninja Pro Plan.",Z9n="One month enrollment in the Invoice Ninja Pro Plan.",J9n="Enterprise Plan",e7n="One year enrollment in the Invoice Ninja Enterprise Plan.",t7n="One month enrollment in the Invoice Ninja Enterprise Plan.",n7n="Credit",i7n="Credit for unused time",r7n="Will switch to monthly on :date",o7n="A refund has been issued.",s7n="Page Size",a7n="Live preview has been disabled to support selected font",l7n="Padding",c7n="Preview",u7n="List Vendors",d7n="Upgrade to the Enterprise Plan to add additional users to your account.",h7n="The Enterprise Plan adds support for multiple users and file attachments, :link to see the full list of features.",f7n="Return To App",p7n="Refund Payment",g7n="Max:",m7n="Refund",_7n="Refund selected payments?",v7n="Pending",b7n="Completed",y7n="Failed",C7n="Partially Refunded",w7n=":amount Refunded",S7n="Refunded",E7n="Cancelled",x7n="Refunded Payment",T7n=":user cancelled a :payment_amount payment :payment",k7n=":user refunded :adjustment of a :payment_amount payment :payment",I7n="Exp:&nbsp:expires",L7n="Unknown",D7n="American Express",A7n="Carte Blanche",R7n="UnionPay",N7n="Diners Club",O7n="Discover",P7n="JCB",M7n="Laser",F7n="Maestro",B7n="MasterCard",$7n="Solo",V7n="Switch",H7n="Visa",W7n="ACH",z7n="Stripe",U7n="ACH",j7n="Accept US bank transfers",q7n="ACH support must also be enabled in :link.",G7n="Another gateway is already configured for direct debit.",K7n="Plaid",Y7n="Client Id",Q7n="Secret",X7n="Public Key",Z7n="(optional)",J7n="When a Stripe test key is given, Plaid's development environment (tartan) will be used.",e$n="Other Providers",t$n="That country is not supported.",n$n="The routing number is not valid.",i$n="The account number is not valid.",r$n="The account numbers do not match.",o$n="Please select an individual or company account.",s$n="Please enter the account holder's name.",a$n="Routing Number",l$n="Confirm Account Number",c$n="Individual Account",u$n="Company Account",d$n="Account Holder Name",h$n="Add Account",f$n="Payment Methods",p$n="Complete Verification",g$n="Amount 1",m$n="Amount 2",_$n="Verification completed successfully",v$n="Verification Failed",b$n="Remove Payment Method",y$n="Are you sure you want to remove this payment method?",C$n="Remove",w$n="Removed payment method.",S$n='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.',E$n=`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.`,x$n="Unknown Bank",T$n="You will be able to use the account after completing verification. Verification usually takes 1-2 business days.",k$n="Add Credit Card",I$n="Added payment method.",L$n="Use For Autobill",D$n="Autobill Payment Method",A$n="Set Autobill payment method.",R$n=":payment_amount payment (:payment) failed",N$n="Webhook URL",O$n="You must :link.",P$n="add this URL as an endpoint at Stripe",M$n="add this URL as an endpoint in GoCardless",F$n="There was an error adding your payment methd. Please try again later.",B$n="Payment failed for Invoice :invoice",$$n="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.",V$n="Link Account Instantly with Plaid",H$n="Link Manually",W$n="Secured by Plaid",z$n="Your bank account at :bank",U$n="Add Payment Method",j$n="Account Holder Type",q$n="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.",G$n="You must consent to ACH transactions.",K$n="Off",Y$n="Opt-in",Q$n="Opt-out",X$n="Always",Z$n="Opted out",J$n="Opted in",eVn="Manage Auto-bill",tVn="Enabled",nVn="PayPal",iVn="Enable PayPal payments through BrainTree",rVn="The PayPal gateway is processing PayPal payments",oVn="You must also :link.",sVn="link PayPal to your BrainTree account",aVn="Save payment details",lVn="Add PayPal Account",cVn="No payment method specified",uVn="Chart Type",dVn="Format",hVn="Import OFX",fVn="OFX File",pVn="Failed to parse OFX file",gVn="WePay",mVn="Sign up with WePay",_Vn="Use another provider",vVn="Company Name",bVn="This will appear on client's credit card statements.",yVn="The purpose of this account.",CVn="I agree to the :link.",wVn="WePay Terms of Service",SVn="Resend Confirmation Email",EVn="Manage Account",xVn="Action Required",TVn="Finish Setup",kVn="Please check your email and confirm your email address with WePay.",IVn="Switch to WePay",LVn="Restore Gateway",DVn="Successfully restored gateway",AVn="United States",RVn="Canada",NVn="Accept Debit Cards",OVn="Debit Cards",PVn="The next invoice will be sent on the new start date.",MVn="The next invoice will be created on the new start date.",FVn="Original start date",BVn="New start date",$Vn="Security",VVn="See what's new in v:version",HVn="Please wait for the document upload to complete.",WVn="Upgrade to our Enterprise Plan to enable permissions.",zVn="Enable specifying a <b>second tax rate</b>",UVn="Payment File",jVn="Expense File",qVn="Product File",GVn="Import Products",KVn="products will be created",YVn="Product",QVn="Successfully created/updated :count product(s)",XVn="Use JSON if you plan to import the data into Invoice Ninja.<br/>The file includes clients, products, invoices, quotes and payments.",ZVn="<br/>We recommend using mysqldump to create a full backup.",JVn="JSON File",eHn="View Dashboard",tHn="Session Expired",nHn="Your session has expired. Please click the link in your email again.",iHn="This invoice will automatically be billed to your :payment_method on file on :due_date.",rHn="bank account",oHn="credit card",sHn="PayPal account",aHn="This invoice will automatically be billed to your credit card on file on the due date.",lHn="Payment Settings",cHn="On send date",uHn="On due date",dHn="ACH will always auto bill on the due date.",hHn="Due to NACHA rules, changes to this invoice may prevent ACH auto bill.",fHn="Bank Account",pHn="ACH payments will be processed using WePay.",gHn="Privacy Policy",mHn="Please enter your email address:",_Hn="Verification Pending",vHn="Please force refresh the page to update the font cache.",bHn="More options",yHn="Credit Card",CHn="Bank Transfer",wHn="We did not receive a payment transaction reference from the gateway.",SHn="Use Bank on File",EHn="This invoice will automatically be billed to the payment method on file on the due date.",xHn="Bitcoin",THn="GoCardless",kHn="Added :date",IHn="Failed to remove the payment method",LHn="This gateway already exists",DHn="Manual entry",AHn="First Day of the Week",RHn="Inactive",NHn="Daily",OHn="Weekly",PHn="Biweekly",MHn="Two weeks",FHn="Four weeks",BHn="Monthly",$Hn="Three months",VHn="Four months",HHn="Six months",WHn="Annually",zHn="Two years",UHn="Cash",jHn="Debit",qHn="ACH",GHn="MasterCard",KHn="EuroCard",YHn="Nova",QHn="PayPal",XHn="Check",ZHn="UnionPay",JHn="JCB",eWn="Laser",tWn="Maestro",nWn="Solo",iWn="Switch",rWn="iZettle",oWn="Swish",sWn="Alipay",aWn="Sofort",lWn="SEPA Direct Debit",cWn="Bitcoin",uWn="GoCardless",dWn="Zelle",hWn="Afghanistan",fWn="Albania",pWn="Antarctica",gWn="Algeria",mWn="Andorra",_Wn="Angola",vWn="Azerbaijan",bWn="Argentina",yWn="Australia",CWn="Austria",wWn="Bahamas",SWn="Bahrain",EWn="Bangladesh",xWn="Armenia",TWn="Barbados",kWn="Belgium",IWn="Bermuda",LWn="Bhutan",DWn="Botswana",AWn="Brazil",RWn="Belize",NWn="Bulgaria",OWn="Myanmar",PWn="Burundi",MWn="Belarus",FWn="Cambodia",BWn="Cameroon",$Wn="Canada",VWn="Chad",HWn="Chile",WWn="China",zWn="Colombia",UWn="Comoros",jWn="Mayotte",qWn="Congo",GWn="Croatia",KWn="Cuba",YWn="Cyprus",QWn="Benin",XWn="Denmark",ZWn="Dominica",JWn="Ecuador",ezn="Ethiopia",tzn="Eritrea",nzn="Estonia",izn="Fiji",rzn="Finland",ozn="France",szn="Djibouti",azn="Gabon",lzn="Georgia",czn="Gambia",uzn="Germany",dzn="Ghana",hzn="Gibraltar",fzn="Kiribati",pzn="Greece",gzn="Greenland",mzn="Grenada",_zn="Guadeloupe",vzn="Guam",bzn="Guatemala",yzn="Guinea",Czn="Guyana",wzn="Haiti",Szn="Honduras",Ezn="Hungary",xzn="Iceland",Tzn="India",kzn="Indonesia",Izn="Iraq",Lzn="Ireland",Dzn="Israel",Azn="Italy",Rzn="Jamaica",Nzn="Japan",Ozn="Kazakhstan",Pzn="Jordan",Mzn="Kenya",Fzn="Kuwait",Bzn="Kyrgyzstan",$zn="Lebanon",Vzn="Lesotho",Hzn="Latvia",Wzn="Liberia",zzn="Libya",Uzn="Liechtenstein",jzn="Lithuania",qzn="Luxembourg",Gzn="Macao",Kzn="Madagascar",Yzn="Malawi",Qzn="Malaysia",Xzn="Maldives",Zzn="Mali",Jzn="Malta",eUn="Martinique",tUn="Mauritania",nUn="Mauritius",iUn="Mexico",rUn="Monaco",oUn="Mongolia",sUn="Montenegro",aUn="Montserrat",lUn="Morocco",cUn="Mozambique",uUn="Oman",dUn="Namibia",hUn="Nauru",fUn="Nepal",pUn="Netherlands",gUn="Aruba",mUn="Vanuatu",_Un="Nicaragua",vUn="Niger",bUn="Nigeria",yUn="Niue",CUn="Norway",wUn="Palau",SUn="Pakistan",EUn="Panama",xUn="Paraguay",TUn="Peru",kUn="Philippines",IUn="Pitcairn",LUn="Poland",DUn="Portugal",AUn="Qatar",RUn="Romania",NUn="Rwanda",OUn="Anguilla",PUn="Senegal",MUn="Serbia",FUn="Seychelles",BUn="Singapore",$Un="Slovakia",VUn="Slovenia",HUn="Somalia",WUn="Zimbabwe",zUn="Spain",UUn="Sudan",jUn="Suriname",qUn="Swaziland",GUn="Sweden",KUn="Switzerland",YUn="Tajikistan",QUn="Thailand",XUn="Togo",ZUn="Tokelau",JUn="Tonga",ejn="Tunisia",tjn="Turkey",njn="Turkmenistan",ijn="Tuvalu",rjn="Uganda",ojn="Ukraine",sjn="Egypt",ajn="Guernsey",ljn="Jersey",cjn="Uruguay",ujn="Uzbekistan",djn="Samoa",hjn="Yemen",fjn="Zambia",pjn="Croatian",gjn="Czech",mjn="Danish",_jn="Dutch",vjn="English",bjn="French",yjn="German",Cjn="Italian",wjn="Japanese",Sjn="Lithuanian",Ejn="Norwegian",xjn="Polish",Tjn="Spanish",kjn="Swedish",Ijn="Albanian",Ljn="Greek",Djn="Slovenian",Ajn="Finnish",Rjn="Romanian",Njn="Thai",Ojn="Macedonian",Pjn="Serbian",Mjn="Bulgarian",Fjn="Advertising",Bjn="Aerospace",$jn="Agriculture",Vjn="Automotive",Hjn="Biotechnology",Wjn="Broadcasting",zjn="Communications",Ujn="Defense",jjn="Energy",qjn="Entertainment",Gjn="Government",Kjn="Insurance",Yjn="Manufacturing",Qjn="Marketing",Xjn="Media",Zjn="Pharmaceuticals",Jjn="Sports",eqn="Transportation",tqn="Other",nqn="Photography",iqn="View client portal",rqn="View Portal",oqn="Vendor Contacts",sqn="All",aqn="Selected",lqn="Category",cqn="Categories",uqn="New Expense Category",dqn="Edit Category",hqn="Archive Category",fqn="Expense Categories",pqn="List Expense Categories",gqn="Successfully updated expense category",mqn="Successfully created expense category",_qn="Successfully archived expense category",vqn="Successfully archived :count expense category",bqn="Restore expense category",yqn="Successfully restored expense category",Cqn="Apply taxes",wqn=":min to :max users",Sqn="The maximum number of users has been reached.",Eqn="Buy Now Buttons",xqn="Landing Page",Tqn="Payment Type",kqn="Form",Iqn="Link",Lqn="Fields",Dqn="Dwolla",Aqn="Note: the client and invoice are created even if the transaction isn't completed.",Rqn="This feature requires that a product is created and a payment gateway is configured.",Nqn="Enable support for buy now buttons",Oqn="Note: changes take effect immediately",Pqn="Payment gateway for Invoice Ninja",Mqn="There was an error processing your payment [:code]. Please try again later.",Fqn="Fee: 2.9%/1.2% [Credit Card/Bank Transfer] + $0.30 per successful charge.",Bqn="Data needs to be imported in batches of :count rows or less",$qn="Something went wrong",Vqn="If you'd like help please email us at :mailaddress",Hqn="Warning: this can't be undone.",Wqn="Please select a contact",zqn="Please select a client",Uqn="It may help to set new passwords or generate new API keys.",jqn=":type on file",qqn="Invoice :invoice for :client",Gqn="Sorry, I'm not sure what you're asking.",Kqn="Sorry, I'm not able to do that.",Yqn="I wasn't able to find the client",Qqn="Sorry, you don't have the needed permissions",Xqn="Your invoice has been sent.",Zqn="I'll email you when it's viewed.",Jqn="I'll email you when it's paid.",eGn="Add 1 :product",tGn="You are not authorized",nGn="I wasn't able to find an available account for :email",iGn="The code is not correct",rGn="List Products",oGn="Include <b>line item taxes in line total</b>",sGn="Successfully created :count quotes(s)",aGn="Warning",lGn="Update Invoice Ninja",cGn="Before start upgrading Invoice Ninja create a backup of your database and files!",uGn="A new version of Invoice Ninja is available.",dGn="No new version of Invoice Ninja available.",hGn="Update now",fGn="Download :version",pGn="Create New",gGn="Toggle Navigation",mGn="Toggle History",_Gn="Unassigned",vGn="Task",bGn="Contact Name",yGn="City/State/Postal",CGn="Postal/City",wGn="Custom Field",SGn="Company Fields",EGn="Facebook and Twitter",xGn="Follow our feeds to help support our project",TGn="Note: the white-label license is intended for personal use, please email us at :email if you'd like to resell the app.",kGn="Unnamed Client",IGn="Day",LGn="Week",DGn="Month",AGn="You have been logged out due to inactivity",RGn="Reports",NGn="Total Profit",OGn="Total Expenses",PGn="Quote to",MGn="Limit",FGn="Min: :min",BGn="Max: :max",$Gn="No Limits",VGn="Set :gateway_type Limits",HGn="Enable min",WGn="Enable max",zGn="Min",UGn="Max",jGn="This invoice does not meet the limits for that payment type.",qGn="Date Range",GGn="Raw",KGn="Raw HTML",YGn="Update",QGn="Drag and drop fields to change their order and location",XGn="New Category",ZGn="Restore Product",JGn="Blank",eKn="There was an error saving your invoice",tKn="Enable Recurring",nKn="Disable Recurring",iKn="Text",rKn="expense will be created",oKn="expenses will be created",sKn="Successfully created :count expense(s)",aKn="Help improve our translations with :link",lKn="Expense Category",cKn="Go Ninja Pro!",uKn="Go Enterprise!",dKn="Upgrade For More Features",hKn="Pay annually for 10 months + 2 free!",fKn="Ninja Pro",pKn="YourBrand.InvoiceNinja.com",gKn="Customize every aspect of your invoice!",mKn="Set permissions for multiple-users",_Kn="Attach 3rd party files to invoices & expenses",vKn="Much More!",bKn="Plus all pro features!",yKn="Symbol",CKn="Code",wKn="Buy License",SKn="Apply License",EKn="Submit",xKn="License Key",TKn="The white label license is not valid",kKn="Created by :name",IKn="Modules",LKn="First Month of the Year",DKn="Authentication",AKn="Checkbox",RKn="Signature",NKn="Invoice Terms Checkbox",OKn="Require client to confirm that they accept the invoice terms.",PKn="Quote Terms Checkbox",MKn="Require client to confirm that they accept the quote terms.",FKn="Invoice Signature",BKn="Require client to provide their signature.",$Kn="Quote Signature",VKn="Require client to provide their signature.",HKn="I Agree To The Terms",WKn="Please sign here:",zKn="Use the mouse or your touchpad to trace your signature.",UKn="Authorization",jKn="Signed",qKn="Vendor",GKn="State",KKn="Date Created",YKn="There was a problem sending the email through Postmark: :link",QKn="Project",XKn="Projects",ZKn="New Project",JKn="Edit Project",eYn="Archive Project",tYn="List Projects",nYn="Successfully updated project",iYn="Successfully created project",rYn="Successfully archived project",oYn="Successfully archived :count projects",sYn="Restore Project",aYn="Successfully restored project",lYn="Delete Project",cYn="Successfully deleted project",uYn="Successfully deleted :count projects",dYn="Delete category",hYn="Successfully deleted category",fYn="Delete Product",pYn="Successfully deleted product",gYn="Successfully deleted :count products",mYn="Successfully restored product",_Yn="Update Credit",vYn="Successfully updated credit",bYn="Edit Credit",yYn="Realtime Preview",CYn="Realtime refresh PDF preview on the invoice page when editing invoice.<br/>Disable this to improve performance when editing invoices.",wYn="Display a live PDF preview on the invoice page.",SYn="Replace the built-in PDF viewer in :chrome_link and :firefox_link.<br/>Enable this if your browser is automatically downloading the PDF.",EYn="Prevent Download",xYn="Redirect URL",TYn="Optionally specify a URL to redirect to after a payment is entered.",kYn="Save Draft",IYn="Refunded credit payment",LYn="Keyboard Shortcuts",DYn="Toggle Menu",AYn="Date Created",RYn="Contact Us",NYn="User Guide",OYn="Upgrade before :expires and get :amount OFF your first year of our Pro or Enterprise packages.",PYn=":amount off expires :expires",MYn="Mark Paid",FYn="Successfully marked invoice sent",BYn="Successfully marked invoices sent",$Yn="Invoice",VYn="product will be created",HYn="Thank you for your message! We'll try to respond as soon as possible.",WYn="Last 7 Days",zYn="Last 30 Days",UYn="This Month",jYn="Last Month",qYn="Current Quarter",GYn="Last Quarter",KYn="Last Year",YYn="All Time",QYn="Custom Range",XYn="URL",ZYn="Debug",JYn="HTTPS",eQn="Require",tQn="Note: Your license will expire in :count days, :link to renew it.",nQn="Your email address has been confirmed.",iQn="Your white label license has expired, please consider renewing it to help support our project.",rQn="Renew License",oQn="Consider downloading our :link",sQn="iPhone app",aQn="Android app",lQn="Logged In",cQn="Switch to your primary company (:name) to manage your plan.",uQn="Inclusive",dQn="Exclusive",hQn="Postal/City/State",fQn="In certain cases the app uses :link_phantom to generate the PDF, install :link_docs to generate it locally.",pQn="Using local PhantomJS",gQn="Client Number",mQn="Specify a prefix or use a custom pattern to dynamically set the client number.",_Qn="The next client number is :number.",vQn="Generated Numbers",bQn="First Reminder",yQn="Second Reminder",CQn="Third Reminder",wQn="Reminder",SQn="BCC Email",EQn="Tax Quote",xQn="Tax Invoice",TQn="Successfully emailed invoices",kQn="Successfully emailed quotes",IQn="Website URL",LQn="Domain",DQn="Used in the client portal and when sending emails.",AQn="Used when sending emails.",RQn="Import Invoices",NQn="New Report",OQn="Edit Report",PQn="Columns",MQn="Filters",FQn="Sort By",BQn="Draft",$Qn="Unpaid",VQn="Aging",HQn="Age",WQn="Days",zQn="0 - 30 Days",UQn="30 - 60 Days",jQn="60 - 90 Days",qQn="90 - 120 Days",GQn="120+ Days",KQn="Invoice Details",YQn="Quantity",QQn="Profit and Loss",XQn="Revenue",ZQn="Profit",JQn="Group Sort",eXn="Group Dates By",tXn="Year",nXn="View Statement",iXn="Statement",rXn="Statement Date",oXn="Mark Active",sXn="Send Automatically",aXn="Initial Email",lXn="This invoice hasn't been emailed.",cXn="This quote hasn't been emailed.",uXn="Sent by :user",dXn="Recipients",hXn="Save as default",fXn="Used by <b>date</b> selectors",pXn="Used by <b>date range</b> selectors",gXn="Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.",mXn="This Year",_Xn="Create. Send. Get Paid.",vXn="Or login with a connected account.",bXn="Sign Up Now",yXn="Not a member yet?",CXn="Create an Account!",wXn="Invoices From:",SXn="Full Name",EXn="MONTH/YEAR",xXn="Valid\\nthru",TXn="Product Fields",kXn="Add a field when creating a product or invoice and display the label and value on the PDF.",IXn="Two months",LXn="Annually",DXn="Profile",AXn="Construction",RXn="Your Statement",NXn="Statement issued to",OXn="Statement to",PXn="Customize options",MXn="Successfully created payment term",FXn="Successfully updated payment term",BXn="Successfully archived payment term",$Xn="Resend Invitation",VXn="Credit created by payment :transaction_reference",HXn="Successfully created payment and credit",WXn="Successfully created payment and credit, and emailed client",zXn="Create project",UXn="Create vendor",jXn="Create category",qXn=":link to enable reports by joining the Pro Plan",GXn="Mark Ready",KXn="Limits",YXn="Fees",QXn="Fee",XXn="Set :gateway_type Limits/Fees",ZXn="Enable line item taxes to set the fee tax rates.",JXn="The fee for a :amount invoice would be :total.",eZn="The discount for a :amount invoice would be :total.",tZn="No Fees",nZn="Warning: not all states/payment gateways allow adding fees, please review local laws/terms of service.",iZn="Percent",rZn="Location",oZn="Line Item",sZn="Surcharge",aZn="Enabled - First surcharge",lZn="Enabled - Second surcharge",cZn="Enabled - Line item",uZn="Online Payment Surcharge",dZn="Gateway Fees",hZn="Fees are disabled",fZn="Automatically add an online payment surcharge/discount.",pZn="Gateway",gZn="If there are unpaid invoices with fees they need to be updated manually.",mZn="Customize surcharge :link.",_Zn="label and taxes",vZn="Billable",bZn="The image file is too large.",yZn="Warning: To support gifs the fileinfo PHP extension needs to be enabled.",CZn="There was a problem reading the image file, please try a different format.",wZn="An error occurred, please refresh the page and try again.",SZn="Data",EZn="Successfully imported settings",xZn="Reset Counter",TZn="Next Reset",kZn="Automatically reset the invoice and quote counters.",IZn="Auto-billing for invoice :invoice_number failed",LZn="Online Payment Discount",DZn="Successfully created new company",AZn="Fees are disabled for this gateway.",RZn="Log Out/Delete Account",NZn="Inclusive tax rates adjust the line item cost when selected.<br/>Only exclusive tax rates can be used as a default.",OZn="Credit Note",PZn="Credit issued to",MZn="Credit to",FZn="Your Credit",BZn="Credit Number",$Zn="Create Credit Note",VZn="Menu",HZn="Error: The gateways table has incorrect ids.",WZn="Purge Data",zZn="Delete Data",UZn="Permanently delete all data but keep the account and settings.",jZn="Permanently delete the account along with all data and setting.",qZn="Successfully purged company data",GZn="Forbidden",KZn="Warning: This will permanently erase your data, there is no undo.",YZn="Contact Phone",QZn="Contact Email",XZn="Reply-To Email",ZZn="Specify the reply-to address for client emails.",JZn="Privately include this address with client emails.",eJn="Your import has successfully completed.",tJn="Please confirm your account to import data.",nJn="Your import has started, we'll send you an email once it completes.",iJn="Venmo",rJn="Successfully archived :count products",oJn="We recommend <b>enabling</b> this setting.",sJn="We recommend <b>disabling</b> this setting.",aJn="Auto-billed",lJn="Surcharge Label",cJn="Contact Fields",uJn="Add a field when creating a contact and optionally display the label and value on the PDF.",dJn="Showing :start to :end of :total entries",hJn="Credit Total",fJn="Mark billable",pJn="Billed",gJn="Company Variables",mJn="Client Variables",_Jn="Invoice Variables",vJn="Navigation Variables",bJn="Custom Variables",yJn="Invalid file type",CJn="Add Documents to Invoice",wJn="Mark paid",SJn="Failed to validate the license, either expired or excessive activations. Email contact@invoiceninja.com for more information.",EJn="Plan Price",xJn="Incorrect confirmation code",TJn="The account is already registered",kJn="Successfully emailed payment",IJn="Email Payment",LJn="Use :link to migrate your data from InvoicePlane.",DJn="Warning: This :link may be a duplicate",AJn="expense",RJn="Resume Task",NJn="Successfully resumed task",OJn="Quote Design",PJn="Standard Design",MJn="Custom Design 1",FJn="Custom Design 2",BJn="Custom Design 3",$Jn="Empty",VJn="Load Design",HJn="Accepted Card Logos",WJn="Google Analytics",zJn="Analytics Key",UJn="Track payments using :link",jJn="The start date is required",qJn="Application Settings",GJn="Database Connection",KJn="Driver",YJn="Host",QJn="Database",XJn="Test connection",ZJn="From Name",JJn="From Address",eei="Port",tei="Encryption",nei="Mailgun Domain",iei="Mailgun Private Key",rei="Brevo Domain",oei="Brevo Private Key",sei="Send Test Email",aei="Select Label",lei="Label",cei="Service",uei="Update payment details",dei="Successfully updated payment details",hei="Update Credit Card",fei="Recurring Expenses",pei="Recurring Expense",gei="New Recurring Expense",mei="Edit Recurring Expense",_ei="Archive Recurring Expense",vei="List Recurring Expenses",bei="Successfully updated recurring expense",yei="Successfully created recurring expense",Cei="Successfully archived recurring expense",wei="Restore Recurring Expense",Sei="Successfully restored recurring expense",Eei="Delete Recurring Expense",xei="Successfully deleted recurring expense",Tei="View Recurring Expense",kei="Taxes and fees",Iei="Import Failed",Lei="Recurring Prefix",Dei="Options",Aei="Specify a prefix or use a custom pattern to dynamically set the credit number for negative invoices.",Rei="The next credit number is :number.",Nei="The number of zero's to pad the number.",Oei="Warning: The date format appears to be invalid.",Pei="Product Notes",Mei="App Version",Fei="OFX Version",Bei="Charge Late Fee",$ei="Late Fee Amount",Vei="Late Fee Percent",Hei="Late fee added on :date",Wei="Download Invoice",zei="Download Quote",Uei="Your invoice PDFs are attached.",jei="An email will be sent with the invoice PDF",qei="An email will be sent with the quote PDF",Gei="An email will be sent with the invoice PDFs",Kei="An email will be sent with the quote PDFs",Yei="Clone Expense",Qei="Default Documents",Xei="Send email to the client",Zei="Refund Processed",Jei="You have been processed a refund of :amount for invoice :invoice_number.",eti="US Dollar",tti="British Pound",nti="Euro",iti="South African Rand",rti="Danish Krone",oti="Israeli Shekel",sti="Swedish Krona",ati="Kenyan Shilling",lti="Canadian Dollar",cti="Philippine Peso",uti="Indian Rupee",dti="Australian Dollar",hti="Singapore Dollar",fti="Norske Kroner",pti="New Zealand Dollar",gti="Vietnamese Dong",mti="Swiss Franc",_ti="Guatemalan Quetzal",vti="Malaysian Ringgit",bti="Brazilian Real",yti="Thai Baht",Cti="Nigerian Naira",wti="Argentine Peso",Sti="Bangladeshi Taka",Eti="United Arab Emirates Dirham",xti="Hong Kong Dollar",Tti="Indonesian Rupiah",kti="Mexican Peso",Iti="Egyptian Pound",Lti="Colombian Peso",Dti="West African Franc",Ati="Chinese Renminbi",Rti="Rwandan Franc",Nti="Tanzanian Shilling",Oti="Netherlands Antillean Guilder",Pti="Trinidad and Tobago Dollar",Mti="East Caribbean Dollar",Fti="Ghanaian Cedi",Bti="Bulgarian Lev",$ti="Aruban Florin",Vti="Turkish Lira",Hti="Romanian New Leu",Wti="Croatian Kuna",zti="Saudi Riyal",Uti="Japanese Yen",jti="Maldivian Rufiyaa",qti="Costa Rican Colón",Gti="Pakistani Rupee",Kti="Polish Zloty",Yti="Sri Lankan Rupee",Qti="Czech Koruna",Xti="Uruguayan Peso",Zti="Namibian Dollar",Jti="Tunisian Dinar",eni="Russian Ruble",tni="Mozambican Metical",nni="Omani Rial",ini="Ukrainian Hryvnia",rni="Macanese Pataca",oni="Taiwan New Dollar",sni="Dominican Peso",ani="Chilean Peso",lni="Icelandic Króna",cni="Papua New Guinean Kina",uni="Jordanian Dinar",dni="Myanmar Kyat",hni="Peruvian Sol",fni="Botswana Pula",pni="Hungarian Forint",gni="Ugandan Shilling",mni="Barbadian Dollar",_ni="Brunei Dollar",vni="Georgian Lari",bni="Qatari Riyal",yni="Honduran Lempira",Cni="Surinamese Dollar",wni="Bahraini Dinar",Sni="Venezuelan Bolivars",Eni="South Korean Won",xni="Moroccan Dirham",Tni="Jamaican Dollar",kni="Angolan Kwanza",Ini="Haitian Gourde",Lni="Zambian Kwacha",Dni="Nepalese Rupee",Ani="CFP Franc",Rni="Mauritian Rupee",Nni="Cape Verdean Escudo",Oni="Kuwaiti Dinar",Pni="Algerian Dinar",Mni="Macedonian Denar",Fni="Fijian Dollar",Bni="Bolivian Boliviano",$ni="Albanian Lek",Vni="Serbian Dinar",Hni="Lebanese Pound",Wni="Armenian Dram",zni="Azerbaijan Manat",Uni="Bosnia and Herzegovina Convertible Mark",jni="Belarusian Ruble",qni="Moldovan Leu",Gni="Kazakhstani Tenge",Kni="Gibraltar Pound",Yni="Gambia Dalasi",Qni="Paraguayan Guarani",Xni="Malawi Kwacha",Zni="Zimbabwean Dollar",Jni="Cambodian Riel",eii="Vanuatu Vatu",tii="Cuban Peso",nii="BZ Dollar",iii="Libyan Dinar",rii="Silver Troy Ounce",oii="Gold Troy Ounce",sii="Malagasy ariary",aii="Tongan Pa'anga",lii="We hope you're enjoying using the app.<br/>If you'd consider :link we'd greatly appreciate it!",cii="writing a review",uii="First Tax",dii="Second Tax",hii="Gateway fees are the costs charged for access to the financial networks that handle the processing of online payments.",fii="Exporting format",pii="First Custom",gii="Second Custom",mii="Contact First Name",_ii="Contact Last Name",vii="Contact First Custom",bii="Contact Second Custom",yii="Currency",Cii="To troubleshoot check for comments on :ofxhome_link and test with :ofxget_link.",wii="comments",Sii="Item Product",Eii="Item Notes",xii="Item Cost",Tii="Item Quantity",kii="Item Tax Rate",Iii="Item Tax Name",Lii="Item Tax1",Dii="Item Tax2",Aii="Delete Company",Rii="Permanently delete the company along with all data and setting.",Nii="Warning: This will permanently delete your company, there is no undo.",Oii="The coupon has been applied, the plan price has been reduced by :discount%.",Pii="The coupon has been applied, your account has been upgraded to pro for one year.",Mii="If you're reporting an error please include any relevant logs from storage/logs/laravel-error.log",Fii="Include Errors",Bii="Include :link from storage/logs/laravel-error.log",$ii="recent errors",Vii="Customer",Hii="Customers",Wii="Successfully created customer",zii="Successfully created :count customers",Uii="The data in your company (:account) has been successfully purged.",jii="Successfully deleted company",qii="Successfully canceled account",Gii="Your company (:account) has been successfully deleted.",Kii="Your account (:account) has been successfully deleted.",Yii="Alipay",Qii="Sofort",Xii="SEPA Direct Debit",Zii="Please enter a name with only the letters a-z and whitespaces",Jii="Accept Alipay",eri="Accept EU bank transfers",tri="These gateways also need to be activated in :link.",nri="Calendar",iri=":link to enable the calendar by joining the Pro Plan",rri="What are you working on?",ori="Time Tracker",sri="Refresh",ari="Filter/Sort",lri="No Description",cri="Time Tracker Login",uri="Save or discard your changes",dri="Discard Changes",hri="Tasks are not enabled.",fri="Successfully started task",pri="Create Client",gri="Download the desktop app",mri="Download the iPhone app",_ri="Download the Android app",vri="Double tap a task to select it",bri="Stopped",yri="Ascending",Cri="Descending",wri="Sort By",Sri="Direction",Eri="Discard",xri="AM",Tri="PM",kri="mins",Iri="hr",Lri="hrs",Dri="Clear",Ari="Note: accepting online payments requires a payment gateway, :link to add one.",Rri="Task Rate",Nri="Set the default rate for invoiced tasks.",Ori="Past Due",Pri="Document",Mri="Invoice/Expense",Fri="Invoice PDFs",Bri="Accept SEPA",$ri="Accept Bitcoin",Vri="IBAN",Hri="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.",Wri="Recover License",zri="Purchase",Uri="Recover",jri="Apply",qri="Recover White Label License",Gri="Apply White Label License",Kri="Videos",Yri="Video",Qri="Return to Invoice",Xri="Partial Due Date",Zri="Task Fields",Jri="Drag and drop fields to change their order",eoi="Custom Value 1",toi="Custom Value 2",noi="Two-Factor Authentication",ioi="Use your phone to confirm your identity when logging in",roi="Two-Factor Setup",ooi="Scan the bar code with a :link compatible app.",soi="One Time Password",aoi="Set your mobile phone number as a backup to enable.",loi="Successfully enabled Two-Factor Authentication",coi="Add Product",uoi="Note: the email will be sent on :date.",doi="Invoice Product",hoi="Self-Host Login",foi="Self-Host URL",poi="Error: local storage is not available.",goi="Your Password Reset Link",moi="The subdomain is already in use",_oi="The inbound mailbox is already in use",voi="The inbound mailbox does not match the required schema",boi="Client Login",yoi="Converted Amount",Coi="Shipping Address",woi="Billing Address",Soi="Billing Street",Eoi="Billing Apt/Suite",xoi="Billing City",Toi="Billing State/Province",koi="Billing Postal Code",Ioi="Billing Country",Loi="Shipping Street",Doi="Shipping Apt/Suite",Aoi="Shipping City",Roi="Shipping State/Province",Noi="Shipping Postal Code",Ooi="Shipping Country",Poi="Classify",Moi="Require client to provide their shipping address",Foi="Ship to billing address",Boi="Delivery Note",$oi="Show tasks in the client portal",Voi="Cancel Schedule",Hoi="Scheduled Report",Woi="Email the :report report as :format to :email",zoi="Successfully scheduled report",Uoi="Successfully canceled scheduled report",joi="Your scheduled :type report is attached.",qoi="Failed to create schedule report",Goi="Invalid one time password",Koi="Apple/Google Pay",Yoi="Accept Apple Pay and Pay with Google",Qoi="This payment type requires that a :link.",Xoi="subdomain is set",Zoi="Verification File",Joi="The verification file is needed to accept payments.",esi="Use <code>:domain</code> as the domain in :link.",tsi="Sorry, Apple/Google Pay isn't supported by your browser",nsi="Optional Payment Methods",isi="Add Subscription",rsi="Target",osi="When the selected event occurs the app will post the entity to the target URL.",ssi="Event",asi="Created Client",lsi="Created Invoice",csi="Created Quote",usi="Created Payment",dsi="Created Vendor",hsi="Updated Quote",fsi="Deleted Quote",psi="Updated Invoice",gsi="Deleted Invoice",msi="Updated Client",_si="Deleted Client",vsi="Deleted Payment",bsi="Updated Vendor",ysi="Deleted Vendor",Csi="Created Expense",wsi="Updated Expense",Ssi="Deleted Expense",Esi="Created Task",xsi="Updated Task",Tsi="Deleted Task",ksi="Approved Quote",Isi="Subscriptions",Lsi="Successfully updated subscription",Dsi="Successfully created subscription",Asi="Edit Subscription",Rsi="Archive Subscription",Nsi="Successfully archived subscription",Osi="The projects can't belong to different clients",Psi="Invoice Project",Msi="Recurring Invoices",Fsi="Credits",Bsi="Quotes & Proposals",$si="Tasks & Projects",Vsi="Expenses & Vendors",Hsi="Tickets",Wsi="Reminders",zsi="Send email reminders",Usi="Tasks are visible in the portal",jsi="Reminders are not sent",qsi="Your promotion will expire soon, :link to upgrade now.",Gsi="Note: to delete this company first delete all linked companies.",Ksi="Please register your account",Ysi="Processing request",Qsi="Warning: Mcrypt is deprecated, run :command to update your cipher.",Xsi="Edit Times",Zsi="Include <b>taxes in the cost</b>",Jsi="This setting can not be changed once an invoice has been created.",eai="Warning: existing invoices will need to be resaved",tai="Copy Shipping",nai="Copy Billing",iai="The quote has expired, please contact the merchant.",rai="Showing 0 to 0 of 0 entries",oai="Do not remember this device",sai="Trust for 30 days",aai="Trust forever",lai="Kanban",cai="Backlog",uai="Ready to do",dai="In progress",hai="Add status",fai="Archive Status",pai="New Status",gai="Convert Products",mai="Automatically convert product prices to the client's currency",_ai="Set a subdomain to shorten the client portal link.",vai="Budgeted Hours",bai="Progress",yai="View Project",Cai="Summary",wai="Endless Reminder",Sai="Add the following code to show your client's signature on the PDF.",Eai="Show on PDF",xai="Show the client signature on the invoice/quote PDF.",Tai="The white label license has expired",kai="Return to Login",Iai='Note: add a :link named ":name" to see the exchange rate.',Lai="The amount is greater than the invoice balance, a credit will be created with the remaining amount.",Dai="Use <code>Label|Option1,Option2</code> to show a select box.",Aai="Client Information",Rai="Successfully updated client details",Nai="Auto",Oai="Tax Amount",Pai="Tax Paid",Mai="None",Fai="To view your proposal for :amount, click the button below.",Bai="Proposal",$ai="Proposals",Vai="List Proposals",Hai="New Proposal",Wai="Edit Proposal",zai="Archive Proposal",Uai="Delete Proposal",jai="Successfully created proposal",qai="Successfully updated proposal",Gai="Successfully archived proposal",Kai="Successfully archived proposal",Yai="Successfully archived :count proposals",Qai="Successfully archived :count proposals",Xai="Successfully restored proposal",Zai="Restore Proposal",Jai="Snippet",eli="Snippets",tli="Snippet",nli="Snippets",ili="New Snippet",rli="Edit Snippet",oli="Archive Snippet",sli="Delete Snippet",ali="Successfully created snippet",lli="Successfully updated snippet",cli="Successfully archived snippet",uli="Successfully archived snippet",dli="Successfully archived :count snippets",hli="Successfully archived :count snippets",fli="Successfully restored snippet",pli="Restore Snippet",gli="Template",mli="Templates",_li="Template",vli="Templates",bli="New Template",yli="Edit Template",Cli="Archive Template",wli="Delete Template",Sli="Successfully created template",Eli="Successfully updated template",xli="Successfully archived template",Tli="Successfully archived template",kli="Successfully archived :count templates",Ili="Successfully archived :count templates",Lli="Successfully restored template",Dli="Restore Template",Ali="Category",Rli="Categories",Nli="New Category",Oli="Edit Category",Pli="Archive Category",Mli="Delete Category",Fli="Successfully created category",Bli="Successfully updated category",$li="Successfully archived category",Vli="Successfully archived category",Hli="Successfully archived :count categories",Wli="Successfully archived :count categories",zli="Successfully restored category",Uli="Restore Category",jli="Delete Status",qli="Standard",Gli="Icon",Kli="The requested proposal is not available",Yli="Create category",Qli="Clone Template",Xli="Proposal Email",Zli="New proposal :number from :account",Jli="To view your proposal for :amount, click the link below.",eci="Successfully emailed proposal",tci="Load Template",nci="No images, drag to upload",ici="Add Image",rci="Select Image",oci="Upgrade to the Enterprise Plan to upload files & images",sci="Delete Image",aci="Warning: deleting the image will remove it from all proposals.",lci="Note: the invoice $amount field will use the partial/deposit field if set otherwise it will use the invoice balance.",cci="Note: Inclusive taxes have been enabled.",uci="Note: Inclusive taxes are not enabled.",dci="Changing this setting requires :link the account data.",hci="purging",fci="The refund will be recorded in the app but will NOT be processed by the payment gateway.",pci="Email address has been changed",gci="The email address for your account has been changed from :old_email to :new_email.",mci="Test",_ci="Beta",vci="Email History",bci="Loading",yci="No messages found",Cci="Processing",wci="Reactivate",Sci="The email address has been reactivated",Eci="Emails",xci="Opened",Tci="Bounced",kci="Total Sent",Ici="Total Opened",Lci="Total Bounced",Dci="Total Spam",Aci="Platforms",Rci="Email Clients",Nci="Mobile",Oci="Desktop",Pci="Webmail",Mci="Group",Fci="Subgroup",Bci="Unset",$ci="You've received a new payment!",Vci="Receive payment notifications using :link.",Hci="Slack incoming webhooks",Wci="Accept",zci="Successfully accepted the latest terms of service",Uci="Invalid URL",jci="Workflow Settings",qci="Auto Email",Gci="Automatically email recurring invoices when created.",Kci="Auto Archive",Yci="Automatically archive invoices when paid.",Qci="Auto Archive",Xci="Automatically archive quotes when converted to invoice.",Zci="Require approve quote",Jci="Require clients to approve quotes.",eui="Allow approve expired quote",tui="Allow clients to approve expired quotes.",nui="Invoice Workflow",iui="Quote Workflow",rui="Error: the client must be active",oui="Purge Client",sui="Successfully purged client",aui="All related records (invoices, tasks, expenses, documents, etc) will also be deleted.",lui="Clone Product",cui="Item Details",uui="Send line item details to the payment gateway.",dui="View Proposal",hui="View in Portal",fui="This website uses cookies to ensure you get the best experience on our website.",pui="Got it!",gui="vendor will be created",mui="vendors will be created",_ui="Successfully created :count vendor(s)",vui="Import Vendors",bui="Company",yui="Client Field",Cui="Contact Field",wui="Product Field",Sui="Task Field",Eui="Project Field",xui="Expense Field",Tui="Vendor Field",kui="Company Field",Iui="Invoice Field",Lui="Invoice Surcharge",Dui="Add a field when creating a task.",Aui="Add a field when creating a project.",Rui="Add a field when creating an expense.",Nui="Add a field when creating a vendor.",Oui="Messages",Pui="Unpaid Invoice",Mui="Paid Invoice",Fui="Unapproved Quote",Bui="Unapproved Proposal",$ui="Auto-fills city/state",Vui="No match found",Hui="Password Strength",Wui="Weak",zui="Good",Uui="Strong",jui="Mark",qui="Successfully update task status",Gui="Background Image",Kui="Use the :link to manage your images, we recommend using a small file.",Yui="proposal editor",Qui="Background",Xui="Guide",Zui="Gateway Fee Item",Jui="Gateway Fee Surcharge",edi="Gateway Fee Discount",tdi="Show Payments",ndi="Show Aging",idi="Reference",rdi="Amount Paid",odi="Send Notifications For",sdi="All Invoices",adi="My Invoices",ldi="Payment Reference",cdi="Maximum",udi="Sort",ddi="Refresh Complete",hdi="Please enter your email",fdi="Please enter your password",pdi="Please enter your URL",gdi="Please enter a product key",mdi="An error occurred",_di="Overview",vdi="Copied :value to the clipboard",bdi="Error",ydi="Could not launch",Cdi="Additional",wdi="Ok",Sdi="Email is invalid",Edi="Items",xdi="Partial/Deposit",Tdi="Add Item",kdi="Total Amount",Idi="PDF",Ldi="Invoice Status",Ddi="Click + to add an item",Adi=":count selected",Rdi="Dismiss",Ndi="Please select a date",Odi="Please select a client",Pdi="Language",Mdi="Updated",Fdi="Please enter an invoice number",Bdi="Please enter a quote number",$di=":client's invoices",Vdi="Viewed",Hdi="Approved",Wdi="Draft",zdi="Sent",Udi="Viewed",jdi="Approved",qdi="Partial",Gdi="Paid",Kdi="Successfully marked invoice as sent",Ydi="Please enter a client or contact name",Qdi="Restart the app to apply the change",Xdi="Refresh Data",Zdi="Blank Contact",Jdi="No records found",ehi="Industry",thi="Size",nhi="Net",ihi="Show tasks",rhi="Email Reminders",ohi="First Reminder",shi="Second Reminder",ahi="Third Reminder",lhi="Send",chi="Auto billing",uhi="Button",dhi="More",hhi="Edit Recurring Invoice",fhi="Edit Recurring Quote",phi="Quote Status",ghi="Please select an invoice",mhi="Filtered by",_hi="Payment Status",vhi="Pending",bhi="Voided",yhi="Failed",Chi="Completed",whi="Partially Refunded",Shi="Refunded",Ehi="Send receipt to the client",xhi="Refunded",Thi="Successfully marked quote as sent",khi="Custom Module Settings",Ihi="Open",Lhi="Closed",Dhi="Reopened",Ahi="Priority",Rhi="Last Updated",Nhi="Comments",Ohi="Tags",Phi="Linked Objects",Mhi="Low",Fhi="Medium",Bhi="High",$hi="No due date set",Vhi="Assigned to",Hhi="Reply",Whi="Awaiting reply",zhi="Mark as Spam",Uhi="Local Part",jhi="Name taken",qhi="Name available",Ghi="Invalid name (alpha numeric only, no spaces",Khi="Customize the local part of your inbound support email, ie. YOUR_NAME@support.invoiceninja.com",Yhi="From name is the recognizable sender which is displayed instead of the email address, ie Support Center",Qhi="YOUR_NAME",Xhi="Support Center",Zhi="Attachments",Jhi="Client uploads",efi="Allow clients to upload documents/attachments",tfi="Maximum file size (KB) is limited by your post_max_size and upload_max_filesize variables as set in your PHP.INI",nfi="Maximum file size",ifi="Mime types",rfi=".pdf , .docx, .jpg",ofi="Comma separated list of allowed mime types, leave blank for all",sfi="Ticket number must be greater than the current ticket number",afi="New ticket",lfi="Selecting a template will send an auto response to a client/contact when a new ticket is created",cfi="Updated ticket",ufi="Selecting a template will send an auto response to a client/contact when a ticket is updated",dfi="Closed ticket",hfi="Selecting a template will send an auto response to a client/contact when a ticket is closed",ffi="Default priority",pfi="New comment",gfi="Additional new comment notifications",mfi="admin@example.com, supervisor@example.com",_fi="Default Agent",vfi="If selected will automatically be assigned to all inbound tickets",bfi="Show agent details on responses",yfi="Avatar",Cfi="Remove avatar",wfi="Add Template",Sfi="Archive Template",Efi="Restore Template",xfi="Successfully archived template",Tfi="Successfully restored template",kfi="Please enter a message to update the ticket",Ifi="Show / Hide all",Lfi="Subject required",Dfi="If you're using the mobile app you may need to do a full refresh.",Afi="Merge",Rfi="Merged",Nfi="Agent",Ofi="Include in filter",Pfi=":VALUE",Mfi=":VALUE",Ffi="Compare",Bfi="Hosted Login",$fi="Selfhost Login",Vfi="Google Login",Hfi="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",Wfi="legacy mobile app",zfi="Today",Ufi="Current",jfi="Previous",qfi="Current Period",Gfi="Comparison Period",Kfi="Previous Period",Yfi="Previous Year",Qfi="Compare to",Xfi="Last Week",Zfi="Clone to Invoice",Jfi="Clone to Quote",epi="Convert",tpi="Last 7 Days",npi="Last 30 Days",ipi="Custom JS",rpi="Adjust percent to account for fee",opi="Show product details",spi="Include the <b>description and cost</b> in the product dropdown",api="Important",lpi="Thank you for using our app!",cpi="If you like it please",upi="to rate it.",dpi="Average",hpi="Unapproved",fpi="Please authenticate to change this setting",ppi="Locked",gpi="Authenticate",mpi="Please authenticate",_pi="Biometric Authentication",vpi="Auto Start Tasks",bpi="Budgeted",ypi="Please enter a name",Cpi="Click + to add time",wpi="Design",Spi="Password is too short",Epi="Failed to find record",xpi="Valid Until",Tpi="Automatically sets the <b>Valid Until</b> value on quotes to this many days in the future. Leave blank to disable.",kpi="Days",Ipi="Requires an Enterprise Plan",Lpi="Take Picture",Dpi="Upload File",Api="New Document",Rpi="Edit Document",Npi="Successfully uploaded document",Opi="Successfully updated document",Ppi="Successfully archived document",Mpi="Successfully deleted document",Fpi="Successfully restored document",Bpi="No History",$pi="Logged",Vpi="Pending",Hpi="Invoiced",Wpi="No record selected",zpi="Please save or cancel your changes",Upi="Thank you for your purchase!",jpi="Redeem",qpi="Back",Gpi="Past Purchases",Kpi="Annual Subscription",Ypi="Pro Plan",Qpi="Enterprise Plan",Xpi=":count users",Zpi="Upgrade",Jpi="Please enter a first name",egi="Please enter a last name",tgi="Please agree to the terms of service and privacy policy to create an account.",ngi="I agree to the",igi="terms of service",rgi="privacy policy",ogi="View Website",sgi="Create Account",agi="Email Login",lgi="Late Fees",cgi="Payment Number",ugi="Before the due date",dgi="After the due date",hgi="After the invoice date",fgi="Filtered by User",pgi="Successfully created user",ggi="Primary Font",mgi="Secondary Font",_gi="Number Padding",vgi="General",bgi="Surcharge Field",ygi="Company Value",Cgi="Credit Field",wgi="Payment Field",Sgi="Group Field",Egi="Number Counter",xgi="Number Pattern",Tgi="Custom JavaScript",kgi="Portal Mode",Igi="Attach PDF",Lgi="Attach Documents",Dgi="Attach UBL/E-Invoice",Agi="Email Style",Rgi="Processed",Ngi="Fee Amount",Ogi="Fee Percent",Pgi="Fee Cap",Mgi="Limits/Fees",Fgi="Credentials",Bgi="Require client to provide their billing address",$gi="Require client to provide their shipping address",Vgi="Successfully deleted tax rate",Hgi="Successfully restored tax rate",Wgi="Provider",zgi="Payment Gateway",Ugi="Payment Gateways",jgi="New Gateway",qgi="Edit Gateway",Ggi="Successfully created gateway",Kgi="Successfully updated gateway",Ygi="Successfully archived gateway",Qgi="Successfully deleted gateway",Xgi="Successfully restored gateway",Zgi="Continue Editing",Jgi="Default value",emi="Currency Format",tmi="First Day of the Week",nmi="First Month of the Year",imi="Symbol",rmi="Code",omi="Date Format",smi="Datetime Format",ami="Send Reminders",lmi="Timezone",cmi="Filtered by Group",umi="Filtered by Invoice",dmi="Filtered by Client",hmi="Filtered by Vendor",fmi="Group Settings",pmi="Groups",gmi="New Group",mmi="Edit Group",_mi="Successfully created group",vmi="Successfully updated group",bmi="Successfully archived group",ymi="Successfully deleted group",Cmi="Successfully restored group",wmi="Upload Your Company Logo",Smi="Successfully uploaded logo",Emi="Successfully saved settings",xmi="Device Settings",Tmi="Credit Cards & Banks",kmi="Price",Imi="Email Sign Up",Lmi="Google Sign Up",Dmi="Sign Up With Google",Ami="Long-press Multiselect",Rmi="Migrate to the next version of Invoice Ninja",Nmi="We've been working on next version of Invoice Ninja. Click the button bellow to start the migration.",Omi="Start the migration",Pmi="Migration",Mmi="Welcome to the new version of Invoice Ninja",Fmi="At the next step, we'll let you download your data for the migration.",Bmi="Press button below to download the data.",$mi="Custom Company 1",Vmi="Custom Company 2",Hmi="Custom Company 3",Wmi="Custom Company 4",zmi="Custom Product 1",Umi="Custom Product 2",jmi="Custom Product 3",qmi="Custom Product 4",Gmi="Custom Client 1",Kmi="Custom Client 2",Ymi="Custom Client 3",Qmi="Custom Client 4",Xmi="Custom Contact 1",Zmi="Custom Contact 2",Jmi="Custom Contact 3",e_i="Custom Contact 4",t_i="Custom Task 1",n_i="Custom Task 2",i_i="Custom Task 3",r_i="Custom Task 4",o_i="Custom Project 1",s_i="Custom Project 2",a_i="Custom Project 3",l_i="Custom Project 4",c_i="Custom Expense 1",u_i="Custom Expense 2",d_i="Custom Expense 3",h_i="Custom Expense 4",f_i="Custom Vendor 1",p_i="Custom Vendor 2",g_i="Custom Vendor 3",m_i="Custom Vendor 4",__i="Custom Invoice 1",v_i="Custom Invoice 2",b_i="Custom Invoice 3",y_i="Custom Invoice 4",C_i="Custom Payment 1",w_i="Custom Payment 2",S_i="Custom Payment 3",E_i="Custom Payment 4",x_i="Custom Surcharge 1",T_i="Custom Surcharge 2",k_i="Custom Surcharge 3",I_i="Custom Surcharge 4",L_i="Custom Group 1",D_i="Custom Group 2",A_i="Custom Group 3",R_i="Custom Group 4",N_i="Number",O_i="Count",P_i="Is Active",M_i="Contact Last Login",F_i="Contact Full Name",B_i="Contact Custom Value 1",$_i="Contact Custom Value 2",V_i="Contact Custom Value 3",H_i="Contact Custom Value 4",W_i="Assigned To Id",z_i="Created By Id",U_i="Add Column",j_i="Edit Columns",q_i="to learn about Google Fonts",G_i="Refund Date",K_i="Multiselect",Y_i="Verify Password",Q_i="Applied",X_i="Include recent errors from the logs",Z_i="We have received your message and will try to respond promptly.",J_i="Show Product Details",evi="Include the description and cost in the product dropdown",tvi="The PDF renderer requires :version",nvi="Adjust Fee Percent",ivi="Configure Settings",rvi="About",ovi="Credit Email",svi="Domain URL",avi="Password must contain an upper case character and a number",lvi="Client Portal Tasks",cvi="Client Portal Dashboard",uvi="Please enter a value",dvi="Successfully deleted logo",hvi="Generate Number",fvi="When Saved",pvi="When Sent",gvi="Select Company",mvi="Float",_vi="Collapse",vvi="Show/hide",bvi="Menu Sidebar",yvi="History Sidebar",Cvi="Tablet",wvi="Layout",Svi="Module",Evi="First Custom",xvi="Second Custom",Tvi="Third Custom",kvi="Show Cost",Ivi="Display a product cost field to track the markup/profit",Lvi="Show Product Quantity",Dvi="Display a product quantity field, otherwise default to one",Avi="Show Invoice Quantity",Rvi="Display a line item quantity field, otherwise default to one",Nvi="Default Quantity",Ovi="Automatically set the line item quantity to one",Pvi="One Tax Rate",Mvi="Two Tax Rates",Fvi="Three Tax Rates",Bvi="Default Tax Rate",$vi="Invoice Tax",Vvi="Line Item Tax",Hvi="Inclusive Taxes",Wvi="Invoice Tax Rates",zvi="Item Tax Rates",Uvi="Configure rates",jvi="Tax Rates",qvi="Accent Color",Gvi="Comma separated list",Kvi="Single-line text",Yvi="Multi-line text",Qvi="Dropdown",Xvi="Field Type",Zvi="A password recovery email has been sent",Jvi="Successfully removed user",ebi="Three Years",tbi="24 Hour Display",nbi="Click here",ibi="Successfully marked invoice as paid",rbi="Successfully marked invoices as sent",obi="Successfully marked invoices as paid",sbi="System failed to email invoice :invoice",abi="Custom Value 3",lbi="Custom Value 4",cbi="Custom Email Style",ubi="Custom Dashboard Message",dbi="Custom Unpaid Invoice Message",hbi="Custom Paid Invoice Message",fbi="Custom Unapproved Quote Message",pbi="Lock Sent Invoices",gbi="Translations",mbi="Task Number Pattern",_bi="Task Number Counter",vbi="Expense Number Pattern",bbi="Expense Number Counter",ybi="Vendor Number Pattern",Cbi="Vendor Number Counter",wbi="Ticket Number Pattern",Sbi="Ticket Number Counter",Ebi="Payment Number Pattern",xbi="Payment Number Counter",Tbi="Invoice Number Pattern",kbi="Quote Number Pattern",Ibi="Credit Number Pattern",Lbi="Credit Number Counter",Dbi="Credit Number Pattern",Abi="Credit Number Counter",Rbi="Reset Counter Date",Nbi="Counter Padding",Obi="Share Invoice/Quote Counter",Pbi="Default Tax Name 1",Mbi="Default Tax Rate 1",Fbi="Default Tax Name 2",Bbi="Default Tax Rate 2",$bi="Default Tax Name 3",Vbi="Default Tax Rate 3",Hbi="Email Invoice Subject",Wbi="Email Quote Subject",zbi="Email Payment Subject",Ubi="Switch List Table",jbi="Client City",qbi="Client State",Gbi="Client Country",Kbi="Client is Active",Ybi="Client Balance",Qbi="Client Street",Xbi="Client Apt/Suite",Zbi="Client Shipping Street",Jbi="Client Shipping Apt/Suite",e0i="Tax Rate 1",t0i="Tax Rate 2",n0i="Tax Rate 3",i0i="Archived At",r0i="Has Expenses",o0i="Custom Taxes 1",s0i="Custom Taxes 2",a0i="Custom Taxes 3",l0i="Custom Taxes 4",c0i="Custom Surcharge 1",u0i="Custom Surcharge 2",d0i="Custom Surcharge 3",h0i="Custom Surcharge 4",f0i="Is Deleted",p0i="Vendor City",g0i="Vendor State",m0i="Vendor Country",_0i="Credit Footer",v0i="Credit Terms",b0i="Untitled Company",y0i="Successfully added company",C0i="Supported Events",w0i="Third Custom",S0i="Fourth Custom",E0i="Optional",x0i="License",T0i="Invoice Balance",k0i="Successfully saved design",I0i="Client Details",L0i="Company Address",D0i="Quote Details",A0i="Credit Details",R0i="Product Columns",N0i="Task Columns",O0i="Add Field",P0i="All Events",M0i="Owned",F0i="Payment Success",B0i="Payment Failure",$0i="Quote Sent",V0i="Credit Sent",H0i="Invoice Viewed",W0i="Quote Viewed",z0i="Credit Viewed",U0i="Quote Approved",j0i="Receive All Notifications",q0i="Purchase License",G0i="Enable Modules",K0i="Successfully converted quote",Y0i="Credit Design",Q0i="Includes",X0i="CSS Framework",Z0i="Custom Designs",J0i="Designs",eyi="New Design",tyi="Edit Design",nyi="Successfully created design",iyi="Successfully updated design",ryi="Successfully archived design",oyi="Successfully deleted design",syi="Successfully removed design",ayi="Successfully restored design",lyi="Recurring Tasks",cyi="Successfully removed credit",uyi="Latest Version",dyi="Update Now",hyi="A new version of the web app is available",fyi="Update Available",pyi="Update successfully completed",gyi="Integrations",myi="Tracking Id",_yi="Slack Webhook URL",vyi="Partial Payment",byi="Partial Payment Email",yyi="Clone to Credit",Cyi="Successfully emailed credit",wyi="Successfully marked credit as sent",Syi="Email Partial Payment Subject",Eyi="Is Approved",xyi="Oops, something went wrong! Please make sure you have setup an Invoice Ninja v5 instance before starting the migration.",Tyi='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>',kyi="Email Credit",Iyi="Client does not have an email address set",Lyi="Ledger",Dyi="View PDF",Ayi="All records",Ryi="Owned by user",Nyi="Credit Remaining",Oyi="Use default",Pyi="Endless Reminders",Myi="Number of days",Fyi="Configure Payment Terms",Byi="Payment Term",$yi="New Payment Term",Vyi="Successfully deleted payment term",Hyi="Successfully removed payment term",Wyi="Successfully restored payment term",zyi="Full Width Editor",Uyi="Full Height Filter",jyi="Sign in with email",qyi="Change",Gyi="Change to the mobile layout?",Kyi="Change to the desktop layout?",Yyi="Send from Gmail",Qyi="Reversed",Xyi="Cancelled",Zyi="Quote Amount",Jyi="Hosted",e1i="Self-Hosted",t1i="Hide Menu",n1i="Show Menu",i1i="Partially Refunded",r1i="Search Documents",o1i="Search Designs",s1i="Search Invoices",a1i="Search Clients",l1i="Search Products",c1i="Search Quotes",u1i="Search Credits",d1i="Search Vendors",h1i="Search Users",f1i="Search Tax Rates",p1i="Search Tasks",g1i="Search Settings",m1i="Search Projects",_1i="Search Expenses",v1i="Search Payments",b1i="Search Groups",y1i="Search Company",C1i="Successfully cancelled invoice",w1i="Successfully cancelled invoices",S1i="Successfully reversed invoice",E1i="Successfully reversed invoices",x1i="Reverse",T1i="Filtered by Project",k1i="Sign in with Google",I1i=":user reversed invoice :invoice",L1i=":user cancelled invoice :invoice",D1i="Reconciliation Failure",A1i="Reconciliation Success",R1i="Gateway Success",N1i="Gateway Failure",O1i="Gateway Error",P1i="Email Send",M1i="Email Retry Queue",F1i="Failure",B1i="Quota Exceeded",$1i="Upstream Failure",V1i="System Logs",H1i="Copy Link",W1i="Welcome to Invoice Ninja",z1i="Opt-In",U1i="Opt-Out",j1i="Auto Convert",q1i="Reminder 1 Sent",G1i="Reminder 2 Sent",K1i="Reminder 3 Sent",Y1i="Reminder Last Sent",Q1i="Page :current of :total",X1i="Successfully emailed credits",Z1i="View in Stripe",J1i="Rows Per Page",eCi="Apply Payment",tCi="Unapplied",nCi="Custom Labels",iCi="Record Type",rCi="Record Name",oCi="File Type",sCi="Height",aCi="Width",lCi="Health Check",cCi="Last Login At",uCi="Company Key",dCi="Storefront",hCi="Enable third-party apps to create invoices",fCi=":count records selected",pCi=":count record selected",gCi="Client Created",mCi="Online Payment Email",_Ci="Manual Payment Email",vCi="Completed",bCi="Gross",yCi="Net Amount",CCi="Net Balance",wCi="Client Settings",SCi="Selected Invoices",ECi="Selected Payments",xCi="Selected Quotes",TCi="Selected Tasks",kCi="Selected Expenses",ICi="Past Due Invoices",LCi="Create Payment",DCi="Update Quote",ACi="Update Invoice",RCi="Update Client",NCi="Update Vendor",OCi="Create Expense",PCi="Update Expense",MCi="Update Task",FCi="Approve Quote",BCi="When Paid",$Ci="Expires On",VCi="Show Sidebar",HCi="Hide Sidebar",WCi="Event Type",zCi="Copy",UCi="Please restart the app once connected to the internet",jCi="The crons need to be enabled",qCi="API Webhooks",GCi="Search :count Webhooks",KCi="Search 1 Webhook",YCi="Webhook",QCi="Webhooks",XCi="New Webhook",ZCi="Edit Webhook",JCi="Successfully created webhook",ewi="Successfully updated webhook",twi="Successfully archived webhook",nwi="Successfully deleted webhook",iwi="Successfully removed webhook",rwi="Successfully restored webhook",owi="Search :count Tokens",swi="Search 1 Token",awi="New Token",lwi="Successfully removed token",cwi="Successfully restored token",uwi="Client Registration",dwi="Enable clients to self register in the portal",hwi="Customize & Preview",fwi="Search 1 Document",pwi="Search 1 Design",gwi="Search 1 Invoice",mwi="Search 1 Client",_wi="Search 1 Product",vwi="Search 1 Quote",bwi="Search 1 Credit",ywi="Search 1 Vendor",Cwi="Search 1 User",wwi="Search 1 Tax Rate",Swi="Search 1 Tasks",Ewi="Search 1 Project",xwi="Search 1 Expense",Twi="Search 1 Payment",kwi="Search 1 Group",Iwi="Created On",Lwi="Lock Invoices",Dwi="Show Table",Awi="Show List",Rwi="View Changes",Nwi="Force Update",Owi="You are running the latest version but there may be pending fixes available.",Pwi="Track the expense has been paid",Mwi="Enable the expense to be invoiced",Fwi="Make the documents visible to client",Bwi="Set an exchange rate",$wi="Expense Settings",Vwi="Clone to Recurring",Hwi="Crypto",Wwi="User Field",zwi="Variables",Uwi="Show Password",jwi="Hide Password",qwi="Copy Error",Gwi="Capture Card",Kwi="Auto Bill Enabled",Ywi="Total Taxes",Qwi="Line Taxes",Xwi="Total Fields",Zwi="Successfully stopped recurring invoice",Jwi="Successfully started recurring invoice",eSi="Successfully resumed recurring invoice",tSi="Gateway Refund",nSi="Process the refund with the payment gateway",iSi="Due Date",rSi="Paused",oSi="Day :count",sSi="First Day of the Month",aSi="Last Day of the Month",lSi="Use Payment Terms",cSi="Endless",uSi="Next Send Date",dSi="Remaining Cycles",hSi="Successfully created recurring invoice",fSi="Successfully updated recurring invoice",pSi="Successfully removed recurring invoice",gSi="Search 1 Recurring Invoice",mSi="Search :count Recurring Invoices",_Si="Send Date",vSi="Auto Bill On",bSi="Minimum Under Payment Amount",ySi="Allow Overpayment",CSi="Support paying extra to accept tips",wSi="Allow Underpayment",SSi="Support paying at minimum the partial/deposit amount",ESi="Test Mode",xSi="Calculated Rate",TSi="Default Task Rate",kSi="Clear Cache",ISi="Sort Order",LSi="Status",DSi="Task Statuses",ASi="New Task Status",RSi="Edit Task Status",NSi="Successfully created task status",OSi="Successfully archived task status",PSi="Successfully deleted task status",MSi="Successfully removed task status",FSi="Successfully restored task status",BSi="Search 1 Task Status",$Si="Search :count Task Statuses",VSi="Show Tasks Table",HSi="Always show the tasks section when creating invoices",WSi="Invoice Task Timelog",zSi="Add time details to the invoice line items",USi="Start tasks before saving",jSi="Configure Statuses",qSi="Task Settings",GSi="Configure Categories",KSi="Edit Expense Category",YSi="Successfully removed expense category",QSi="Search 1 Expense Category",XSi="Search :count Expense Categories",ZSi="Use Available Credits",JSi="Show Option",eEi="The credit amount cannot exceed the payment amount",tEi="Enable the expense to be invoiced",nEi="Configure Gateways",iEi="Partial Payment",rEi="Is Running",oEi="Invoice Currency ID",sEi="Tax Name 1",aEi="Tax Name 2",lEi="Transaction ID",cEi="Invoice Late",uEi="Quote Expired",dEi="Invoice Total",hEi="Actions",fEi="Expense Number",pEi="Task Number",gEi="Project Number",mEi="View Settings",_Ei="Warning: this company has not yet been activated",vEi="Late Invoice",bEi="Expired Quote",yEi="Remind Invoice",CEi="Client Phone",wEi="Required Fields",SEi="Enabled Modules",EEi=":contact viewed quote :quote",xEi=":user updated client :client",TEi=":user updated vendor :vendor",kEi=":user emailed first reminder for invoice :invoice to :contact",IEi=":user emailed second reminder for invoice :invoice to :contact",LEi=":user emailed third reminder for invoice :invoice to :contact",DEi=":user emailed endless reminder for invoice :invoice to :contact",AEi="Expense Category ID",REi="View Licenses",NEi="Fullscreen Editor",OEi="Sidebar Editor",PEi='Please type ":value" to confirm',MEi="Purge",FEi="Clone To",BEi="Clone to Other",$Ei="Labels",VEi="Add Custom",HEi="Payment Tax",WEi="White Label",zEi="Sent invoices are locked",UEi="Paid invoices are locked",jEi="Source Code",qEi="App Platforms",GEi="Successfully archived :value task statuses",KEi="Successfully deleted :value task statuses",YEi="Successfully restored :value task statuses",QEi="Successfully deleted expense :value categories",XEi="Successfully restored expense :value categories",ZEi="Successfully archived recurring :value invoices",JEi="Successfully deleted recurring :value invoices",exi="Successfully restored recurring :value invoices",txi="Successfully archived :value webhooks",nxi="Successfully deleted :value webhooks",ixi="Successfully removed :value webhooks",rxi="Successfully restored :value webhooks",oxi="API Docs",sxi="Successfully archived :value tokens",axi="Successfully deleted :value tokens",lxi="Successfully restored :value tokens",cxi="Successfully archived :value payment terms",uxi="Successfully deleted :value payment terms",dxi="Successfully restored :value payment terms",hxi="Successfully archived :value designs",fxi="Successfully deleted :value designs",pxi="Successfully restored :value designs",gxi="Successfully restored :value credits",mxi="Successfully archived :value users",_xi="Successfully deleted :value users",vxi="Successfully removed :value users",bxi="Successfully restored :value users",yxi="Successfully archived :value tax rates",Cxi="Successfully deleted :value tax rates",wxi="Successfully restored :value tax rates",Sxi="Successfully archived :value gateways",Exi="Successfully deleted :value gateways",xxi="Successfully restored :value gateways",Txi="Successfully archived :value groups",kxi="Successfully deleted :value groups",Ixi="Successfully restored :value groups",Lxi="Successfully archived :value documents",Dxi="Successfully deleted :value documents",Axi="Successfully restored :value documents",Rxi="Successfully restored :value vendors",Nxi="Successfully restored :value expenses",Oxi="Successfully restored :value tasks",Pxi="Successfully restored :value projects",Mxi="Successfully restored :value products",Fxi="Successfully restored :value clients",Bxi="Successfully restored :value invoices",$xi="Successfully restored :value payments",Vxi="Successfully restored :value quotes",Hxi="Update App",Wxi="Successfully started import",zxi="Duplicate column mapping",Uxi="Uses Inclusive Taxes",jxi="Is Amount Discount",qxi="Map To",Gxi="Use first row as column names",Kxi="No File Selected",Yxi="Import Type",Qxi="Draft Mode",Xxi="Preview updates faster but is less accurate",Zxi="Show Product Discount",Jxi="Display a line item discount field",eTi="Tax Name 3",tTi="Debug mode is enabled",nTi="Warning: it is intended for use on local machines, it can leak credentials. Click to learn more.",iTi="Running Tasks",rTi="Recent Tasks",oTi="Recent Expenses",sTi="Upcoming Expenses",aTi="Search 1 Payment Term",lTi="Search :count Payment Terms",cTi="Save and Preview",uTi="Save and Email",dTi="Converted Balance",hTi="Is Sent",fTi="Document Upload",pTi="Enable clients to upload documents",gTi="Expense Total",mTi="Enter Taxes",_Ti="By Rate",vTi="By Amount",bTi="Enter Amount",yTi="Before Taxes",CTi="After Taxes",wTi="Color",STi="Show",ETi="Empty Columns",xTi="Project Name",TTi="To use :client_counter please add either :client_number or :client_id_number to prevent conflicts",kTi="This Quarter",ITi="To update run",LTi="Registration URL",DTi="Show Product Cost",ATi="Complete",RTi="Next",NTi="Next step",OTi="Credit :invoice was sent to :client",PTi="Credit :invoice was viewed by :client",MTi="The following client :client was emailed Credit :invoice for :amount.",FTi="The following client :client viewed Credit :credit for :amount.",BTi="Enter your email to reset your password.",$Ti="Password reset",VTi="Welcome! Glad to see you.",HTi="Request cancellation",WTi="Delete Payment Method",zTi="You are about to delete the payment method.",UTi="Action can't be reversed",jTi="The profile has been updated successfully.",qTi="Ethiopian Birr",GTi="Use a permanent address where you can receive mail.",KTi="Invoice Status",YTi="This email is already linked to an account",QTi="Locations",XTi="Indefinitely",ZTi="Cycles remaining",JTi="I understand, delete",eki="Download Files",tki="Use this link to download your files, the link will expire in 1 hour.",nki="New Signup",iki="A new account has been created by :user - :email - from IP address: :ip",rki="Payment was made by :client",oki="Partial payment was made by :client",ski="A payment of :amount was made by client :client towards :invoice",aki="A partial payment of :amount was made by client :client towards :invoice",lki="Notification Bot",cki="Invoice # :invoice",uki=":entity # :entity_number",dki="If the button above isn't working for you, please click on the link",hki="Display Log",fki="Report errors to help improve the app",pki="Setup",gki="Quick overview & statistics",mki="Update your personal information",_ki="Name, website & logo",vki="Make sure you use full link to your site",bki="Personal address",yki="Enter your personal address",Cki="Enter your shipping address",wki="List of invoices",Ski="With selected",Eki="This invoice is still not paid. Click the button to complete the payment",xki="List of recurring invoices",Tki="Here are some details about recurring invoice",kki="Cancellation",Iki="In case you want to stop the recurring invoice, please click to request the cancellation.",Lki="Warning! You are requesting a cancellation of this service. Your service may be cancelled with no further notification to you.",Dki="Cancellation pending, we'll be in touch!",Aki="List of payments",Rki="Details of the payment",Nki="Associate invoices",Oki="List of payment methods",Pki="Details of payment method",Mki="Permanently remove this payment method.",Fki="Warning! This action can not be reversed!",Bki="Confirmation",$ki="Quotes",Vki="Waiting for approval",Hki="This quote is still not approved",Wki="Credits",zki="Required extensions",Uki="PHP version",jki="Writable .env file",qki=".env file is not writable by the current user.",Gki="Minimum PHP version",Kki="Make sure all requirements are satisfied.",Yki="Oops, something does not look right!",Qki="Open in new tab",Xki="Complete payment",Zki="Authorize payment method for future use",Jki="Page",eIi="Per page",tIi="Of",nIi="View Credit",iIi="To view the :entity you need to enter password.",rIi="Showing :first to :last out of :total results",oIi="No results found.",sIi="Payment failed for Client :client",aIi="A payment made by client :client failed with message :message",lIi="Register",cIi="Create your account in seconds",uIi="Confirm your password",dIi="Verification",hIi="Before using a bank account it must be verified.",fIi="Checkout.com",pIi="Copyright © :year :company.",gIi="Provided credit card number is not valid.",mIi="Provided month is not valid.",_Ii="Provided year is not valid.",vIi="HTTPS is required, form will fail",bIi="If you need help you can post to our",yIi="After updating password, your account will be confirmed.",CIi="To pay with a bank account, first you have to add it as payment method.",wIi="Let's store basic information about your Invoice Ninja!",SIi="Highly recommended in production",EIi="Enable only for development",xIi="Test PDF",TIi=`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.`,kIi=`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.`,IIi="Node status",LIi="NPM status",DIi="I could not find Node anywhere. Is it installed?",AIi="I could not find NPM anywhere. Is it installed?",RIi="This invoice is locked and unable to be modified",NIi="Downloads",OIi="Resource",PIi="Details about the document",MIi="Hash",FIi="Resources",BIi="Allowed file types:",$Ii="Common codes and their meanings",VIi="20087: Bad Track Data (invalid CVV and/or expiry date)",HIi="Download selected",WIi="To pay invoices, you have to",zIi="add payment method",UIi="No items selected.",jIi="Payment due",qIi="Account Balance",GIi="Thanks",KIi="Minimum required payment is :amount",YIi="Company doesn't support underpayments.",QIi="Company doesn't support overpayments.",XIi="Saved at :time",ZIi="Credit applied to Invoice :invoice_number",JIi="New credit :number from :account",e2i="To view your credit for :amount, click the link below.",t2i="Cryptocurrency",n2i="Credit",i2i="Store for future use",r2i="Pay with credit",o2i="Payment method can't be saved for future use.",s2i="Pay with",a2i='By clicking "Next" you accept terms.',l2i="Not specified",c2i="Before proceeding with payment, you have to fill following fields",u2i="After completing, go back to previous page.",d2i="Pay",h2i="Instructions",f2i="Reminder 1 for Invoice :invoice was sent to :client",p2i="Reminder 2 for Invoice :invoice was sent to :client",g2i="Reminder 3 for Invoice :invoice was sent to :client",m2i="Custom reminder for Invoice :invoice was sent to :client",_2i="Endless reminder for Invoice :invoice was sent to :client",v2i="Assigned User",b2i="To proceed to next step, make sure you test each section.",y2i="Note about Phantom JS. Read more.",C2i="Minimum Payment",w2i="No action provided. If you believe this is wrong, please contact the support.",S2i="No payable invoices selected. Make sure you are not trying to pay draft invoice or invoice with zero balance due.",E2i="Required payment details",x2i="To complete a payment we need more details about you.",T2i="We will save this, so you don't have to enter it next time.",k2i="We were unable to deliver Credit :invoice to :contact. \\n :error",I2i="Unable to deliver Credit :invoice",L2i="Save payment method details",D2i="New card",A2i="Add Bank Account",R2i="Limit of :limit companies per account.",N2i="Total credits applied cannot be MORE than total of invoices",O2i="Credit number already taken",P2i="Credit not found",M2i="Selected invoices are not from a single client",F2i="Duplicate credits submitted.",B2i="Duplicate invoices submitted.",$2i="You must have an invoice set when using a credit in a payment",V2i="Client id is required",H2i="Expense number already taken",W2i="Invoice number already taken",z2i="Payment `id` required.",U2i="Unable to retrieve specified payment",j2i="Invoice id :invoice is not related to this payment",q2i="Credit id :credit is not related to this payment",G2i="Attempting to refund more than allowed for invoice id :invoice, maximum refundable amount is :amount",K2i="Attempting to refund a payment with invoices attached, please specify valid invoice/s to be refunded.",Y2i="Attempting to refund a payment with credits attached, please specify valid credits/s to be refunded.",Q2i="Attempting to refund more than allowed for credit :credit, maximum refundable amount is :amount",X2i="Project client does not match entity client",Z2i="Quote number already taken",J2i="Recurring Invoice number :number already taken",eLi="User not associated with this account",tLi="Amounts do not balance correctly.",nLi="Insufficient applied amount remaining to cover payment.",iLi="Insufficient balance on credit.",rLi="One or more of these invoices have been paid",oLi="Invoice id :number cannot be refunded",sLi="Attempting to refund :amount only :refundable_amount available for refund",aLi="This user is unable to be attached to this company. Perhaps they have already registered a user on another account?",lLi="Migration completed",cLi="Your migration has completed, please review your data after logging in.",uLi="404 | Nothing to see here!",dLi="Cannot load a large account without a updated_at parameter",hLi="No backup exists for this activity",fLi="Company User record not found",pLi="No credits found.",gLi="The requested action :action is not available.",mLi="No Documents Found",_Li="No group settings found",vLi="Insufficient privileges to access/modify this resource",bLi="Invoice cannot be marked as paid",yLi="Invalid license, or invalid environment :environment",CLi="Route not available",wLi="Invalid custom design object",SLi="Quote/s not found",ELi="Unable to approve this quote as it has expired.",xLi="Scheduler has run",TLi="Scheduler has never run",kLi="Self update not available on this system.",ILi="User detached from company",LLi="Failed to create Webhook",DLi="Thank you for your payment of :amount for :invoice",ALi="Note: Online payments are supported only if amount is larger than $1 or currency equivalent.",RLi="Payment token not found, please try again. If an issue still persist, try with another payment method",NLi="Vendor Street",OLi="Vendor Apt/Suite",PLi="Partially Unapplied",MLi="Please select a user authenticated with Gmail",FLi="List Long Press",BLi="Show Actions",$Li="Start Multiselect",VLi="An email has been sent to confirm the email address",HLi="Converted Paid to Date",WLi="Converted Credit Balance",zLi="Converted Total",ULi="Reply-To Name",jLi="Color Theme",qLi="Start Migration",GLi="Request for recurring invoice cancellation from :contact",KLi=":contact from Client :client requested to cancel Recurring Invoice :invoice",YLi="Hello",QLi="Group documents",XLi="Are you sure you want to approve this quote?",ZLi="Select companies to migrate",JLi="Force migration",eDi="Require Password with Social Login",tDi="Stay Logged In",nDi="Warning: Your session is about to expire",iDi=":count Hours",rDi="1 Day",oDi=":count Days",sDi="Web Session Timeout",aDi="Security Settings",lDi="Resend Email",cDi="Please confirm your email address",uDi="FreshBooks",dDi="Invoice2go",hDi="Invoicely",fDi="Wave Accounting",pDi="Zoho",gDi="Accounting",mDi="Please provide all CSVs.",_Di="Let's continue by authenticating.",vDi="API secret",bDi="You can find API_SECRET in the .env file or Invoice Ninja v5. If property is missing, leave field blank.",yDi="Your discount will be applied on the checkout.",CDi="Use last email",wDi="Activate Company",SDi="Enable emails, recurring invoices and notifications",EDi="An error occurred, please try again",xDi="Please first set a password",TDi="Warning: Changing your phone number will disable 2FA",kDi="Help Translate",IDi="Please select a country",LDi="Successfully disabled 2FA",DDi="Successfully connected account",ADi="Successfully disconnected account",RDi="Delivered",NDi="Spam",ODi="View Docs",PDi="Please provide a mobile phone number to enable two factor authentication",MDi="Send SMS",FDi="SMS Code",BDi="Connect Google",$Di="Disconnect Google",VDi="Disable Two Factor",HDi="Invoice Task Datelog",WDi="Add date details to the invoice line items",zDi="Promo code",UDi="Recurring invoice issued to",jDi="Subscription",qDi="New Subscription",GDi="Successfully deleted subscription",KDi="Successfully removed subscription",YDi="Successfully restored subscription",QDi="Search 1 Subscription",XDi="Search :count Subscriptions",ZDi="Subdomain is not available",JDi="Connect Gmail",eAi="Disconnect Gmail",tAi="Successfully connected Gmail",nAi="Successfully disconnected Gmail",iAi="Changes to the codebase may be blocking the update, you can run this command to discard the changes:",rAi="Client ID Number",oAi=":count Minutes",sAi="Password Timeout",aAi="Share Invoice/Credit Counter",lAi=":user created subscription :subscription",cAi=":user updated subscription :subscription",uAi=":user archived subscription :subscription",dAi=":user deleted subscription :subscription",hAi=":user restored subscription :subscription",fAi="The amount is greater than the invoice balance. You cannot overpay an invoice.",pAi="Click to continue",gAi="The following invoice :invoice was created for client :client for :amount.",mAi="Invoice :invoice was created for :client",_Ai="The following quote :invoice was created for client :client for :amount.",vAi="Quote :invoice was created for :client",bAi="The following credit :invoice was created for client :client for :amount.",yAi="Credit :invoice was created for :client",CAi="Maximum companies migrated",wAi="You have reached your maximum number of companies. Delete existing companies to migrate new ones.",SAi="Company already migrated",EAi="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.",xAi=`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.`,TAi="New account",kAi=":user created recurring invoice :recurring_invoice",IAi=":user updated recurring invoice :recurring_invoice",LAi=":user archived recurring invoice :recurring_invoice",DAi=":user deleted recurring invoice :recurring_invoice",AAi=":user restored recurring invoice :recurring_invoice",RAi="New login detected for your account.",NAi="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",OAi="Contact Details",PAi="Your company backup is ready for download",MAi="Account passwordless login",FAi="Cannot add the same user to the same company",BAi="User exists but cannot be crossed linked to multiple accounts",$Ai="ACH verification",VAi="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.",HAi="Login link requested",WAi="There was a request to login using link. If you did not request this, it's safe to ignore it.",zAi="Your invoices are ready for download",UAi="Migration failed",jAi="Looks like something went wrong with the migration for the following company:",qAi="If you have any questions please contact us, we're here to help!",GAi="Quote was approved",KAi="We would like to inform you that quote was approved.",YAi="Error importing :company",QAi="There was an error importing the company data, the error message was:",XAi="Due Date",ZAi="Amount in pennies,pence or cents. ie for $0.10 please enter 10",JAi="Default Payment Method",eRi="Make this your preferred way of paying.",tRi="This is your preferred way of paying.",nRi="Auto Bill Disabled",iRi="Select a payment method:",rRi="Log in without password",oRi="Email me when an invoice is <b>sent</b>",sRi="One time purchases",aRi="Recurring purchases",lRi="You might be interested in the following",cRi='Only quotes with "Sent" status can be approved. Expired quotes cannot be approved.',uRi="No quotes available for download.",dRi="Copyright",hRi=":user created :created_user at :time",fRi="Company deleted",pRi="Company [ :company ] was deleted by :user",gRi="Back to :url",mRi="Connect your Stripe Account",_Ri="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!",vRi="Account email quota exceeded.",bRi="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.",yRi="Opt in or out of having this invoice automatically charged.",CRi="Arabic",wRi="Persian",SRi="Latvian",ERi="Expiry date",xRi="Card holder name",TRi="Recurring Quote number :number already taken",kRi="Account type",IRi="Locality",LRi="Checking",DRi="Savings",ARi="Unable to verify payment method.",RRi="Gateway configuration error. Please check your credentials.",NRi="My documents",ORi="This payment method cannot be preauthorized.",PRi="KBC/CBC",MRi="Bancontact",FRi="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.",BRi="iDEAL",$Ri="Bank Account Holder",VRi="All-in-one checkout",HRi="Przelewy24",WRi="I declare that I have familiarized myself with the regulations and information obligation of the Przelewy24 service.",zRi="GiroPay",URi="By entering your Customer information (such as name, sort code and account number) you (the Customer) agree that this information is given voluntarily.",jRi="Klarna",qRi="EPS",GRi="BECS Direct Debit",KRi="BACS Direct Debit",YRi="BACS Direct Debit",QRi="Please add a payment method first, before trying to pay.",XRi='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.',ZRi="You need to accept the terms before proceeding.",JRi="Direct Debit",eNi="Clone to Expense",tNi="Checkout",nNi="ACSS Debit",iNi="Invalid amount. Number/Decimal values only.",rNi="Payment for Invoice :invoice for amount :amount failed.",oNi="Google Pay, Apple Pay, Microsoft Pay",sNi=`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>`,aNi="Payment mandate is not ready. Please try again later.",lNi="Instant Bank Pay",cNi="iDEAL",uNi="Przelewy24",dNi="GiroPay",hNi="EPS",fNi="Bancontact",pNi="BECS",gNi="ACSS",mNi="Gross Line Total",_Ni="Slovak",vNi="Normal",bNi="Large",yNi="Extra Large",CNi="Show PDF Preview",wNi="Display PDF preview while editing invoices",SNi="Print PDF",ENi="Remind Me",xNi="Instant Bank Pay",TNi="Click Selected",kNi="Hide Preview",INi="Edit Record",LNi="The credit amount can not be more than the invoice amount",DNi="Please set an account password",ANi="We recommend using the desktop app for the best performance",RNi="We recommend using the mobile app for the best performance",NNi="Successfully disconnected gateway",ONi="Disconnect",PNi="Add to Invoices",MNi="Download",FNi="Save data locally to enable the app to start faster, disabling may improve performance in large accounts",BNi="Persist UI",$Ni="Save UI state locally to enable the app to start at the last location, disabling may improve performance",VNi="Client Postal Code",HNi="Client VAT Number",WNi="Has Tasks",zNi="Registration",UNi="Please authorize Stripe to accept online payments.",jNi="Update all records",qNi="Set Default Company",GNi="Successfully updated company",KNi="KBC",YNi="Help us improve by telling us why (optional)",QNi="Webhook Success",XNi="Tasks must all belong to the same client",ZNi="Expenses must all belong to the same client",JNi="App",eOi="For the best performance download the :app app",tOi="Email Invoice",nOi="Email Quote",iOi="Email Credit",rOi="Successfully removed recurring expense",oOi="Search Recurring Expense",sOi="Search Recurring Expenses",aOi="Last Sent Date",lOi="Include Drafts",cOi="Include draft records in reports",uOi="Is Invoiced",dOi="Manage Plan",hOi="Persist Data",fOi="Customer Count",pOi="Verify Customers",gOi="Google Analytics Tracking ID",mOi="Decimal Comma",_Oi="Use comma as decimal place in forms",vOi="Select Method",bOi="Select Platform",yOi="Please use the web app to connect to Gmail",COi="Item tax rates are disabled",wOi="Enable Markdown",SOi="Convert markdown to HTML on the PDF",EOi="Add Second Contact",xOi="Previous Page",TOi="Next Page",kOi="Export Colors",IOi="Import Colors",LOi="Clear All",DOi="Contrast",AOi="Custom Colors",ROi="Colors",NOi="Sidebar Active Background Color",OOi="Sidebar Active Font Color",POi="Sidebar Inactive Background Color",MOi="Sidebar Inactive Font Color",FOi="Table Alternate Row Background Color",BOi="Invoice Header Background Color",$Oi="Invoice Header Font Color",VOi="Review App",HOi="Check Status",WOi="Free Trial",zOi="All accounts receive a two week trial of the Pro plan, once the trial ends your account will automatically change to the free plan.",UOi="The Pro plan trial ends in :count days, click to upgrade.",jOi="Today is the last day of the Pro plan trial, click to upgrade.",qOi="Change Email",GOi="Optionally configure a separate client portal domain",KOi="Tasks Shown in Portal",YOi="Uninvoiced",QOi="The subdomain is used in the client portal to personalize links to match your brand. ie, https://your-brand.invoicing.co",XOi="Send Time",ZOi="Import Settings",JOi="Please provide the JSON file",ePi="Please select to import the settings and/or data",tPi="JSON",nPi="No payment types enabled",iPi="Please wait for the data to finish loading",rPi="Net Total",oPi="Has Taxes",sPi="Import Customers",aPi="Successfully started importing customers",lPi="Successful Login",cPi="Failed Login",uPi="Once the file is ready you'll receive an email with a download link",dPi="Include Deleted Clients",hPi="Load records belonging to deleted clients",fPi="Step 1: Sign In",pPi="Step 2: Authorize",gPi="Account ID",mPi="The migration has not yet completed",_Pi="Show Task End Date",vPi="Enable specifying the task end date",bPi="Gateway Setup",yPi="Preview Sidebar",CPi="Years Data Shown",wPi="Successfully ended all sessions",SPi="End All Sessions",EPi="1 Session",xPi=":count Sessions",TPi="Invoice Created",kPi="Quote Created",IPi="Credit Created",LPi="Enterprise",DPi="Invoice Item",APi="Quote Item",RPi="Order",NPi="Search Kanban",OPi="Search Kanban",PPi="Move Top",MPi="Move Up",FPi="Move Down",BPi="Move Bottom",$Pi="Error: the custom email must include a :body variable",VPi="Make sure to include a :body variable",HPi="View Date Formats",WPi="Is Viewed",zPi="Letter",UPi="Legal",jPi="Page Layout",qPi="Portrait",GPi="Landscape",KPi="The account owner can upgrade to a paid plan to enable the advanced advanced settings",YPi="Upgrade to a paid plan to enable the advanced settings",QPi="Invoice Payment Terms",XPi="Quote Valid Until",ZPi="No Headers",JPi="Add Header",eMi="Remove Header",tMi="Return URL",nMi="REST Method",iMi="Header Key",rMi="Header Value",oMi="Recurring Products",sMi="Promo Discount",aMi="Allow Cancellation",lMi="Per Seat Enabled",cMi="Max Seats Limit",uMi="Trial Enabled",dMi="Trial Duration",hMi="Allow Query Overrides",fMi="Allow Plan Changes",pMi="Plan Map",gMi="Refund Period",mMi="Webhook Configuration",_Mi="Purchase Page",vMi="Email Bounced",bMi="Spam Complaint",yMi="Email Delivery",CMi="Webhook Response",wMi="PDF Response",SMi="Authentication Failure",EMi="PDF Failed",xMi="PDF Success",TMi="Modified",kMi="HTML Mode",IMi="Preview updates faster but is less accurate",LMi="Status Color Theme",DMi="Load Color Theme",AMi="Estonian",RMi="Successfully marked credit as paid",NMi="Successfully marked credits as paid",OMi="Data loading - please wait for it to complete",PMi="Data saving - please wait for it to complete",MMi="Note: changes made here are only previewed, they must be applied in the tabs above to be saved",FMi="Remaining",BMi="Invoice Paid",$Mi=":user created recurring expense :recurring_expense",VMi=":user updated recurring expense :recurring_expense",HMi=":user archived recurring expense :recurring_expense",WMi=":user deleted recurring expense :recurring_expense",zMi=":user restored recurring expense :recurring_expense",UMi="FPX",jMi="To view the :entity you need to set a password.",qMi="Unsubscribe",GMi="Unsubscribed",KMi="You have been removed from notifications for this document",YMi="Client Shipping State",QMi="Client Shipping City",XMi="Client Shipping Postal Code",ZMi="Client Shipping Country",JMi="Load PDF",e4i="Start Free Trial",t4i="Start your FREE 14 day trial of the Pro Plan",n4i="Due on Receipt",i4i="Is Paid",r4i="Paid",o4i="Id",s4i="Convert To",a4i="Client Currency",l4i="Company Currency",c4i="To prevent spam we require upgrading to a paid account to customize the email",u4i="Upgrade your plan to add companies",d4i="The file has been saved in the downloads folder",h4i="Small",f4i="Your quotes are ready for download",p4i="Your credits are ready for download",g4i="Your documents are ready for download",m4i="Reminder for invoice :number for :balance",_4i="Send with GMail invalid credentials",v4i="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",b4i="Total Fields",y4i="View Task",C4i="Cancel",w4i="Successfully changed task status",S4i="Change Status",E4i="Enable Touch Events",x4i="Support drag events to scroll",T4i="After Saving",k4i="View Record",I4i="Enable Email Markdown",L4i="Use visual markdown editor for emails",D4i="Enable PDF Markdown",A4i="Note: JSON files generated by the v4 app are not supported",R4i="Release Notes",N4i="Upgrade your plan to view reports",O4i="Successfully started :value tasks",P4i="Successfully stopped :value tasks",M4i="Successfully apporved quote",F4i="Successfully :value approved quotes",B4i="Client Website",$4i="Invalid Time",V4i="Signed in as",H4i="Total results",W4i="Restore gateway",z4i="Archive gateway",U4i="Delete gateway",j4i="Exchange currency",q4i="Tax Amount 1",G4i="Tax Amount 2",K4i="Tax Amount 3",Y4i="Update Project",Q4i="Auto Archive Cancelled Invoice",X4i="Automatically archive invoices when cancelled",Z4i="No invoices found",J4i="Successfully created record",e3i="Auto Archive Paid",t3i="Automatically archive invoices when they are paid.",n3i="Auto Archive Cancelled",i3i="Automatically archive invoices when cancelled.",r3i="Alternate PDF Viewer",o3i="Improve scrolling over the PDF preview [BETA]",s3i="Cayman Island Dollar",a3i="Please see attached file to check your report.",l3i="Left",c3i="Right",u3i="Center",d3i="Page Numbering",h3i="Page Numbering Alignment",f3i="Invoice Sent",p3i="Show Product Description",g3i="Include the description in the product dropdown",m3i="Invoice Items",_3i="Quote Items",v3i="Profit and Loss",b3i="Import Format",y3i="Export Format",C3i="Export Type",w3i="Stop On Unpaid",S3i="Stop creating recurring invoices if the last invoice is unpaid.",E3i="Use Quote Terms",x3i="When converting a quote to an invoice",T3i="Add Country",k3i="Enable Tooltips",I3i="Show tooltips when hovering the mouse",L3i="Error: records belong to more than one client",D3i="Login to an existing account",A3i="Purchase Order",R3i="Purchase Order Number",N3i="Purchase Order #",O3i="Inventory threshold notification for product: :product",P3i="Threshold of :amount has been reached for product: :product",M3i=":user created purchase order :purchase_order",F3i=":user updated purchase order :purchase_order",B3i=":user archived purchase order :purchase_order",$3i=":user deleted purchase order :purchase_order",V3i=":user restored purchase order :purchase_order",H3i=":user emailed purchase order :purchase_order",W3i=":contact viewed purchase order :purchase_order",z3i="New Purchase Order :number from :account",U3i="To view your purchase order for :amount, click the link below.",j3i="View Purchase Order",q3i="Your purchase orders are ready for download",G3i="Purchase Order :invoice was viewed by :client",K3i="The following vendor :client viewed Purchase Order :invoice for :amount.",Y3i="Purchase Order Date",Q3i="Purchase Orders",X3i="Purchase Order # :purchase_order",Z3i="Accepted",J3i=":contact accepted purchase order :purchase_order",e5i="Vendor Information",t5i="Purchase Order :purchase_order was accepted by :vendor",n5i="The following vendor :vendor accepted Purchase Order :purchase_order for :amount.",i5i="Amount received",r5i="Already converted to an expense.",o5i="Convert to Expense",s5i="Add to Inventory",a5i="Successfully added purchase order to inventory",l5i="Successfully added purchase orders to inventory",c5i="Client Document Upload",u5i="Vendor Document Upload",d5i="Enable vendors to upload documents",h5i="Are you enjoying the app?",f5i="Yes, it's great!",p5i="Not so much",g5i="Great to hear! Would you like to rate it?",m5i="Sorry to hear it! Would you like to tell us more?",_5i="Sure, happy to",v5i="No, not now",b5i="Add",y5i="Last Sent Template",C5i="Enable Flexible Search",w5i='Match non-contiguous characters, ie. "ct" matches "cat"',S5i="Vendor Details",E5i="Purchase Order Details",x5i="QR IBAN",T5i="BESR ID",k5i="Clone to PO",I5i="Vendor does not have an email address set",L5i="Send Email",D5i="Successfully marked purchase order as sent",A5i="Successfully marked purchase orders as sent",R5i="Successfully accepted purchase order",N5i="Successfully accepted purchase orders",O5i="Successfully cancelled purchase order",P5i="Successfully cancelled purchase orders",M5i="Please select a vendor",F5i="Purchase Order Total",B5i="Email Purchase Order",$5i="Email Purchase Order",V5i="Successfully disconnected email",H5i="Connect Email",W5i="Disconnect Email",z5i="Please use the web app to connect to Microsoft",U5i="Email Provider",j5i="Connect Microsoft",q5i="Disconnect Microsoft",G5i="Successfully connected Microsoft",K5i="Successfully disconnected Microsoft",Y5i="Login with Microsoft",Q5i="Sign up with Microsoft",X5i="Successfully queued purchase order to be sent",Z5i="Successfully queued purchase orders to be sent",J5i="Change to the React web app",eFi="Purchase Order Design",tFi="Purchase Order Terms",nFi="Purchase Order Footer",iFi="Purchase Order Signature",rFi="Require vendor to provide their signature.",oFi="New Purchase Order",sFi="Edit Purchase Order",aFi="Successfully created purchase order",lFi="Successfully updated purchase order",cFi="Successfully archived purchase order",uFi="Successfully deleted purchase order",dFi="Successfully removed purchase order",hFi="Successfully restored purchase order",fFi="Search Purchase Order",pFi="Search Purchase Orders",gFi="Login URL",mFi="Manual Overpayments",_Fi="Support adding an overpayment amount manually on a payment",vFi="Stock Quantity",bFi="Notification Threshold",yFi="Track Inventory",CFi="Display a product stock field and update when invoices are sent",wFi="Stock Notifications",SFi="Send an email when the stock reaches the threshold",EFi="VAT",xFi="View Map",TFi="Set Default Design",kFi="Purchase Order issued to",IFi="Archive Task Status",LFi="Delete Task Status",DFi="Restore Task Status",AFi="Hebrew",RFi="Price change accepted",NFi="Price change failed with code",OFi="Restore Purchases",PFi="Activate",MFi="Connect Apple",FFi="Disconnect Apple",BFi="Successfully disconnected Apple",$Fi="Send Now",VFi="Received",HFi="Successfully converted to expense",WFi="Successfully converted to expenses",zFi="This document has been removed, please contact the vendor for further information",UFi="Document no longer available",jFi="Field",qFi="Period",GFi="Fields Per Row",KFi="Active Invoices",YFi="Outstanding Invoices",QFi="Completed Payments",XFi="Refunded Payments",ZFi="Active Quotes",JFi="Approved Quotes",e6i="Unapproved Quotes",t6i="Logged Tasks",n6i="Invoiced Tasks",i6i="Paid Tasks",r6i="Logged Expenses",o6i="Pending Expenses",s6i="Invoiced Expenses",a6i="Invoice Paid Expenses",l6i="Vendor Portal",c6i="Send Code",u6i="Save the record to upload documents",d6i="Expense Tax Rates",h6i="Invoice Item Tax Rates",f6i="Successfully verified phone number",p6i="A code has been sent via SMS",g6i="Resend",m6i="Verify",_6i="Please provide a phone number",v6i="Invalid phone number",b6i="Verify Phone Number",y6i="Please verify your phone number to send emails",C6i="Successfully merged clients",w6i="Merge Into",S6i="Note: v5.5 requires PHP 8.1",E6i="Email Purchase Orders",x6i="Email Invoices",T6i="Email Quotes",k6i="Email Credits",I6i="Archive Purchase Order",L6i="Restore Purchase Order",D6i="Delete Purchase Order",A6i="Connect",R6i="Mark Paid Payment Email",N6i="Convert to Project",O6i="Client Email",P6i="Invoice Task Project",M6i="Add the project to the invoice line items",F6i="Bulk Action",B6i="This mobile (cell) phone number is not valid, please enter in E.164 format",$6i="Transaction",V6i="Disable 2FA",H6i="Change Number",W6i="Resend Code",z6i="Base Type",U6i="Category Type",j6i="Transaction",q6i="Print PDF",G6i="Vendor Postal Code",K6i="Preview Location",Y6i="Bottom",Q6i="Side",X6i="PDF Preview",Z6i="Long Press to Select",J6i="Purchase Order Item",eBi="Would you like to rate the app?",tBi="Include Deleted",nBi="Include deleted records in reports",iBi="Due On",rBi="Use Browser PDF Viewer",oBi="Warning: Prevents interacting with app over the PDF",sBi="Successfully converted transactions",aBi="Default Category",lBi="Connect Accounts",cBi="Manage Rules",uBi="Search 1 Category",dBi="Search :count Categories",hBi="Min Amount",fBi="Max Amount",pBi="Successfully converted transaction",gBi="Convert to Payment",mBi="Deposit",_Bi="Withdrawal",vBi="Deposits",bBi="Withdrawals",yBi="Matched",CBi="Unmatched",wBi="Create Credit",SBi="Transactions",EBi="New Transaction",xBi="Edit Transaction",TBi="Successfully created transaction",kBi="Successfully updated transaction",IBi="Successfully archived transaction",LBi="Successfully deleted transaction",DBi="Successfully removed transaction",ABi="Successfully restored transaction",RBi="Search Transaction",NBi="Search :count Transactions",OBi="Successfully deleted bank account",PBi="Successfully removed bank account",MBi="Successfully restored bank account",FBi="Search Bank Account",BBi="Search :count Bank Accounts",$Bi="A code has been sent via SMS to :number",VBi="Please verify your phone number for 2FA backup",HBi="Enable Applying Payments Later",WBi="Line Item Tax Rates",zBi="Show Tasks in Client Portal",UBi="Quote :invoice has expired for :client",jBi="The following Quote :invoice for client :client and :amount has now expired.",qBi="Auto Sync",GBi="Refresh Accounts",KBi="Upgrade to Enterprise to connect your bank account",YBi="Click here to connect your bank account",QBi="Include tax",XBi="E-mail template body can be changed on",ZBi="Insufficient permissions, or task may be locked",JBi="Accrual accounting",e8i="Turn on for accrual reporting, turn off for cash basis reporting.",t8i="Expensed reporting",n8i="Turn on for reporting all expenses, turn off for reporting only paid expenses",i8i="Send an email when an online payment is made",r8i="Send an email when manually entering a payment",o8i="Send an email when marking an invoice as paid",s8i="Successfully linked transaction",a8i="Link Payment",l8i="Link Expense",c8i="Lock Invoiced Tasks",u8i="Prevent tasks from being edited once invoiced",d8i="Require clients to register",h8i="Use Inventory Management",f8i="Require products to be in stock",p8i="Optional Products",g8i="Optional Recurring Products",m8i="Convert",_8i="Successfully queued invoice to be auto-billed",v8i="Successfully queued invoices to be auto-billed",b8i="Operator",y8i="Value",C8i="Is",w8i="Contains",S8i="Starts with",E8i="Is empty",x8i="Add Rule",T8i="Match All Rules",k8i="All criteria needs to match for the rule to be applied",I8i="Automatically convert matched transactions to expenses",L8i="Rules",D8i="Transaction Rule",A8i="Transaction Rules",R8i="New Transaction Rule",N8i="Edit Transaction Rule",O8i="Successfully created rule",P8i="Successfully updated transaction rule",M8i="Successfully archived transaction rule",F8i="Successfully deleted transaction rule",B8i="Successfully removed transaction rule",$8i="Successfully restored transaction rule",V8i="Search Transaction Rule",H8i="Search Transaction Rules",W8i="Delete Bank Account",z8i="Archive Transaction",U8i="Delete Transaction",j8i="We have sent a code to :email enter this code to proceed.",q8i="Your one time passcode code",G8i="Your one time passcode is :code",K8i="Delete Tax Rate",Y8i="Restore Tax Rate",Q8i="Select company backup file",X8i="Please upload the .zip file used to create this backup.",Z8i="Backup | Restore",J8i="Create company backup",e9i="Backup",t9i="The following purchase_order :purchase_order was created for vendor :vendor for :amount.",n9i="Purchase Order :purchase_order was created for :vendor",i9i="Purchase Order :purchase_order was sent to :vendor",r9i="The following vendor :vendor was emailed Purchase Order :purchase_order for :amount.",o9i="This product is a restricted item, please contact the vendor for further information.",s9i="Product not available.",a9i="Purchase Order Created",l9i="Purchase Order Sent",c9i="Purchase Order Viewed",u9i="Purchase Order Accepted",d9i="The credit amount can not be greater than the payment amount",h9i="Set an exchange rate when entering a manual payment",f9i="Set an exchange rate when creating an expense",p9i="Matomo URL",g9i="Matomo Id",m9i="Add To Invoice",_9i="Danger Zone",v9i="Import completed",b9i="Your statement from :start_date to :end_date is attached.",y9i="Email queued",C9i="Clone to Recurring Invoice",w9i="Inventory Threshold",S9i="Successfully queued statement to be sent",E9i="Show Email Footer",x9i="Invoice Task Hours",T9i="Add the hours to the invoice line items",k9i="Auto Bill Standard Invoices",I9i="Auto Bill Recurring Invoices",L9i="Email Alignment",D9i="PDF Preview Location",A9i="Mailgun",R9i="Brevo",N9i="Postmark",O9i="Microsoft",P9i="Click + to create a record",M9i="Last 365 Days",F9i="Import Design",B9i="Successfully imported design",$9i="The design is invalid, the :value section is missing",V9i="Would you like to upload your logo?",H9i="Installed Version",W9i="Notify Vendor When Paid",z9i="Send an email to the vendor when the expense is marked as paid",U9i="Update Payment",j9i="Markup",q9i="Unlock Pro",G9i="Upgrade to a paid plan to create schedules",K9i="Next Run",Y9i="All Clients",Q9i="Show Aging Table",X9i="Show Payments Table",Z9i="Only Clients with Invoices",J9i="Email Statement",e7i="Once",t7i="Schedules",n7i="New Schedule",i7i="Edit Schedule",r7i="Successfully created schedule",o7i="Successfully updated schedule",s7i="Successfully archived schedule",a7i="Successfully deleted schedule",l7i="Successfully removed schedule",c7i="Successfully restored schedule",u7i="Search Schedule",d7i="Search Schedules",h7i="Update Product",f7i="Create Purchase Order",p7i="Update Purchase Order",g7i="Sent Invoice",m7i="Sent Quote",_7i="Sent Credit",v7i="Sent Purchase Order",b7i="Image URL",y7i="Max Quantity",C7i="Test URL",w7i="Option is not shown",S7i="Option is shown but not selected",E7i="Option is shown and selected",x7i="Option is not shown",T7i="View All",k7i="Edit All",I7i="Accept Purchase Order Number",L7i="Enable clients to provide a PO number when approving a quote",D7i="From Email",A7i="Show Preview",R7i="Show Paid Stamp",N7i="Show Shipping Address",O7i="There are no documents in the selected records to download",P7i="Pixels",M7i="Logo Size",F7i="Failed",B7i="Client Contacts",$7i="Sync From",V7i="Invoices: :invoices for :amount for client :client",H7i="Payment with no invoice for amount :amount for client :client",W7i="Click here to see all variables.",z7i="Ship to",U7i="Please transfer into the nominated bank account above.",j7i="Branch Name",q7i="Branch Code",G7i="Bank Name",K7i="Bank Code",Y7i="BIC",Q7i="Upgrade or downgrade your current plan.",X7i="Add Logo",Z7i="Add Stripe",J7i="Invalid Coupon",e$i="No billable tasks for this project",t$i="Insufficient permissions to perform this action",n$i="Please verify your account to send emails.",i$i="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",r$i="Klarna",o$i="Payable within :payeddue days net until :paydate",s$i="No buyer's reference given",a$i="The invoice needs to be paid online via the provided link",l$i="Pre Payment",c$i="Number of payments",u$i="The number of times this payment will be made",d$i="Continue until cancelled",h$i="Payment :payment was emailed to :client",f$i="Payment :payment was emailed",p$i="Record not found",g$i="Minimum Payment Amount",m$i="Client Initiated Payments",_$i="Support making a payment in the client portal without an invoice",v$i="Share Invoice/Quote Columns",b$i="CC Email",y$i="Payment Balance",C$i="Allow user to access the reports, data is limited to available permissions",w$i="Payment :payment was emailed to :client",S$i="One-Time Products",E$i="Optional One-Time Products",x$i="Required",T$i="Hidden",k$i="Payment Links",I$i="Payment Link",L$i="New Payment Link",D$i="Edit Payment Link",A$i="Successfully created payment link",R$i="Successfully updated payment link",N$i="Successfully archived payment link",O$i="Successfully deleted payment link",P$i="Successfully removed payment link",M$i="Successfully restored payment link",F$i="Search 1 Payment Link",B$i="Search :count Payment Links",$$i="Increase Prices",V$i="Update Prices",H$i="Successfully queued prices to be increased",W$i="Successfully queued prices to be updated",z$i="API Token",U$i="API Key",j$i="Endpoint",q$i="Not Billable",G$i="Allow Billable Task Items",K$i="Enable configuring which task items are billed",Y$i="Show Task Item Description",Q$i="Enable specifying task item descriptions",X$i="Email Record",Z$i="Invoice Product Columns",J$i="Quote Product Columns",eVi="Vendors",tVi="Product Sales",nVi="User sales report for client/s :client from :start_date to :end_date",iVi="Customer balance report",rVi="Customer sales report",oVi="User sales report",sVi="Aged Receivable Detailed Report",aVi="Aged Receivable Summary Report",lVi="Taxable Amount",cVi="Tax Summary",uVi="OAuth / Mail",dVi="Preferences",hVi="Analytics",fVi="Reduced Rate",pVi="Tax All",gVi="Tax Selected",mVi="version",_Vi="Seller Subregion",vVi="Calculate Taxes",bVi="Automatically calculate taxes when saving invoices",yVi="Link Expenses",CVi="Converted Client Balance",wVi="Converted Payment Balance",SVi="Total Hours",EVi="Use +days to set the date in the future",xVi="More information ",TVi="here",kVi="Show Credits Table",IVi="Payment Manual",LVi="Tax Summary Report",DVi="Tax Category",AVi="Physical Goods",RVi="Digital Products",NVi="Services",OVi="Shipping",PVi="Tax Exempt",MVi="Late fee for invoice :invoice added on :date",FVi="Khmer",BVi="Routing ID",$Vi="Enable E-Invoice",VVi="E-Invoice Type",HVi="Reduced Tax",WVi="Override Tax",zVi="Zero Rated",UVi="Reverse Tax",jVi="Successfully updated the tax category",qVi="Successfully updated the tax categories",GVi="Set Tax Category",KVi="Payment Manual",YVi="Expense Payment Type",QVi="Rename",XVi="Successfully renamed document",ZVi="E-Invoice",JVi="Light/Dark Mode",eHi="Activities",tHi="Here are your company's most recent transactions:",nHi="Palestine",iHi="Taiwan",rHi="Duties",oHi="Order Number",sHi="Order",aHi="Total Invoices Outstanding",lHi="Recent Activity",cHi="Enable auto billing",uHi="Email :count invoices",dHi="Invoice Task Item Description",hHi="Add the item description to the invoice line items",fHi="Next Send Time",pHi="Successfully uploaded certificate",gHi="Certificate set",mHi="Certificate not set",_Hi="Passphrase set",vHi="Passphrase not set",bHi="Upload Certificate",yHi="Certificate Passphrase",CHi="Valid VAT Number",wHi="React Notification Links",SHi="Admin emails will contain links to the react application",EHi="Show Task Billable",xHi="Credit Item",THi="Drop file here",kHi="Files",IHi="Camera",LHi="Gallery",DHi="Project Location",AHi="Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments",RHi="Hungarian",NHi="Use your phone subscription settings to manage your plan",OHi="Item Tax3",PHi="Item Tax Rate 1",MHi="Item Tax Rate 2",FHi="Item Tax Rate 3",BHi="Buy Price",$Hi="Macedonia",VHi="Admin Initiated Payments",HHi="Support entering a payment in the admin portal without an invoice",WHi="Paid Date",zHi="An email will be sent with the PDFs",UHi="Swazi Lilangeni",jHi="Income",qHi="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.",GHi="Vendor Phone",KHi="Mercado Pago",YHi="MyBank",QHi="Pay in 4",XHi="District",ZHi="Region",JHi="County",eWi="Tax Details",tWi=":contact made payment :payment for invoice :invoice for :client",nWi=":user entered payment :payment for invoice :invoice for :client",iWi="Default Payment Type",rWi="Number precision",oWi="Controls the number of decimals supported in the interface",sWi="Tax Exempt",aWi="Drop files here",lWi="Upload Files",cWi="Download E-Invoice",uWi="Download E-Credit",dWi="Download E-Quote",hWi="Intra-community triangular transaction",fWi="Tax-free intra-community delivery",pWi="Please note that this supply is subject to reverse charge",gWi="Nicaraguan Córdoba",mWi="Image",_Wi="Other",vWi="Linked To",bWi="The file has been saved in :path",yWi="Successfully unlinked :count transactions",CWi="Successfully unlinked transaction",wWi="Allow user to access the dashboard, data is limited to available permissions",SWi="Successfully marked credits sent",EWi="Show Document Preview",xWi="Cash accounting",TWi="Click or drop files here",kWi="Set public",IWi="Set private",LWi="Individual",DWi="Business",AWi="Partnership",RWi="Trust",NWi="Charity",OWi="Government",PWi="Stock quantity",MWi="Vendor Contact",FWi="Unpaid",BWi="Paid",$Wi="Note: this feature requires a Zip-Tax API key to lookup US sales tax by address",VWi="Cache Data",HWi="Unknown",WWi="Webhook Failure",zWi="Email Opened",UWi="Email Delivered",jWi="Log",qWi="Classification",GWi="Stock :quantity",KWi="Upcoming",YWi="Client Contact",QWi="Uncategorized",XWi="Login Notification",ZWi="Sends an email notifying that a login has taken place.",JWi="Payment Refund Receipt # :number",ezi="Payment Receipt # :number",tzi="The template will be applied to following:",nzi="Run Template",izi="Statement Design",rzi="Delivery Note Design",ozi="Payment Receipt Design",szi="Payment Refund Design",azi="Add the Chrome extension to manage your tasks",lzi="Watch Video",czi="View Extension",uzi="Reactivate Email",dzi="Successfully reactivated email",hzi="Enable using the design as a template",fzi="Quarter",pzi="Item Description",gzi="Task Item",mzi="Record State",_zi="Save files to this folder",vzi="Downloads Folder",bzi="Invoiced Quotes",yzi="Invoice Paid Quotes",Czi="The downloads folder does not exist :value",wzi="User Logged in Notification",Szi="Send an email when logging in from a new location",Ezi="Payment Email To All Contacts",xzi="Sends the payment email to all contacts when enabled",Tzi="Add Line",kzi="Expense :expense notification sent to :contact",Izi="Confirmation of payment :amount sent to :vendor",Lzi="Payment processed for :amount dated :payment_date. <br>[Transaction Reference: :transaction_reference]",Dzi="Receipt",Azi="Charges",Rzi="Email Report",Nzi="Payment Type Credit",Ozi="Payment Type Debit",Pzi="Send Emails To",Mzi="Primary Contact",Fzi="All Contacts",Bzi="Insert Below",$zi="Bank account authentication. Selecting your institution to complete the request with your account credentials.",Vzi="An error has occurred",Hzi="An unknown error has occurred! Reason:",Wzi="Invalid Token",zzi="The provided token was invalid. Contact support for help, if this issue persists.",Uzi="Missing Credentials",jzi="Invalid or missing credentials for Gocardless Bank Account Data. Contact support for help, if this issue persists.",qzi="Not Available",Gzi="Feature unavailable, Enterprise Plan only.",Kzi="Invalid Institution",Yzi="The provided institution-id is invalid or no longer valid.",Qzi="Invalid Reference",Xzi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",Zzi="Invalid Requisition",Jzi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",eUi="Not Ready",tUi="You called this site too early. Please finish authorization and refresh this page. Contact support for help, if this issue persists.",nUi="No Accounts selected",iUi="The service has not returned any valid accounts. Consider restarting the flow.",rUi="Restart flow.",oUi="Return to application.",sUi="Lao",aUi="Lao kip",lUi="Regions: USA, UK, Australia & India",cUi="Regions: Europe & UK",uUi="Select Provider",dUi="Requisition expired, please reauthenticate.",hUi="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.",fUi="Participant",pUi="Participant name",gUi="Client unsubscribed from emails.",mUi="Client :client has unsubscribed from your e-mails. The client needs to consent to receive future emails from you.",_Ui="Resubscribe",vUi="Subscribe",bUi="You are currently subscribed and will continue to receive email communications.",yUi="You are currently not subscribed, and therefore, will not receive emails at this time.",CUi="We were unable to deliver Purchase Order :invoice to :contact. <br><br> :error",wUi="Unable to deliver Purchase Order :invoice",SUi="Display HTML version of entity when viewing on mobile",EUi="For improved visualization, displays a HTML version of the invoice/quote when viewing on mobile.",xUi="Please select an invoice or credit",TUi="Mobile Version",kUi="Venmo",IUi="MyBank",LUi="Pay Later",DUi="Local Domain",AUi="Verify Peer",RUi="Note: connecting an account requires a GoCardless/Nordigen API key",NUi="Accounts Receivable Detailed",OUi="Accounts Receivable Summary",PUi="Client Sales",MUi="User Sales",FUi="iFrame URL",BUi="User unsubscribed from emails :link",$Ui="Out of stock",VUi=`Component ":step" requires at least one of it's dependencies (":dependencies") in the list.`,HUi='Component ":step" depends on ":dependency". Make component(s) order is correct.',WUi="You must include at least one of authentication methods.",zUi="Cart",UUi="Methods",jUi="Required fields form",qUi="Add step",GUi="Steps",KUi="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.",YUi="Other steps",QUi="Use Available Payments",XUi="Successfully sent email",ZUi="Gateway Type",JUi="Would you like to save this import mapping as a template for future use?",eji="Save Template Mapping",tji="Checkout is enabled only for existing customers. Please login with existing account to checkout.",nji="Checkout is enabled only for new customers. Please register a new account to checkout.",iji="Auto bill standard invoices on the due date",rji="Auto bill on send date OR due date (recurring invoices)",oji="Apply any credit balances to payments prior to charging a payment method",sji="Use unapplied payments",aji="Apply any payment balances prior to charging a payment method",lji="The number of days after the invoice date that payment is due",cji="The default payment type to be used for payments",uji="The number of days that the quote is valid for",dji="The default expense payment type to be used",hji="Pay in 4",fji="Payment Provider",pji="Set your email as the sending user",gji="Purchase Order Items",mji="No data found in this CSV file",_ji="Accept Payments Online",vji="View all payment gateways",bji="Product cost",yji="Duration in words",Cji="Upcoming Recurring Invoices",wji="Shipping Country",Sji="Show table footer",Eji="Displays the totals in the footer of the table",xji="Total Invoices",Tji="Add to group",kji="Check Credentials",Iji="Credentials are valid",Lji="E-Quote",Dji="E-Credit",Aji="E-Purchase Order",Rji="E-Quote Type",Nji="Please upgrade to unlock unlimited clients!",Oji="Download E-Purchase Order",Pji="We recommend using the new web app or the desktop app for the best performance",Mji="Rappen Rounding",Fji="Round amount to 5 cents",Bji="Assign group",$ji="Advanced Card Payments",Vji="EHLO domain (optional)",Hji="ie. 25,587,465",Wji="ie. smtp.gmail.com",zji="Always show required fields form",Uji="Displays the required fields form always at checkout",jji="Advanced Cards",qji="Statement sent to :client",Gji="Invoice Net Amount",Kji="Round To Minutes",Yji="Task Rounding Direction",Qji="Round task times up or down.",Xji="Direction",Zji="Round Up",Jji="Round Down",eqi="Round To Nearest",tqi="The interval to round the task to.",nqi="Successfully updated data",iqi="Bulk Update",rqi="Calculate",oqi="Sum",sqi="Money",aqi="Web App",lqi="Desktop App",cqi="Disconnected",uqi="Reconnect",dqi="E-Invoice Settings",hqi="Refund of your invoice via BTCPay",fqi="A refund intended for you has been issued. To claim it via BTCPay, please click on this link:",pqi="Mauritanian Ouguiya",gqi="Bhutan Ngultrum",mqi="End Of Month",_qi="Merge E-Invoice and PDF",vqi="New task assignment [Task :task] [ :date ]",bqi="You have been assigned task :task <br><br> Description: :description <br><br> Client: :client",yqi="User :user entered note: :notes",Cqi="Reminder: Quote :quote from :company",wqi="Reminder for quote :number for :amount",Sqi="First Quote Reminder",Eqi="Before the valid until date",xqi="After the valid until date",Tqi="After the quote date",kqi="Remind Quote",Iqi="Tax currency is different from invoice currency",Lqi="The invoice has already been imported on :date",Dqi="Before the valid until",Aqi="After the valid until",Rqi="Task Assigned Notification",Nqi="Send an email when a task is assigned",Oqi="Invoices are locked at the end of the month",Pqi="Referral URL",Mqi="Add Comment",Fqi="Successfully saved comment",Bqi="Tickets",$qi="Successfully assigned group",Vqi="Merge to PDF",Hqi="Note: the latest version requires PHP :version",Wqi="Automatically expand products table notes",zqi="Automatically expands the notes section within the products table to display more lines.",Uqi="Institution Number",jqi="Transit Number",qqi="Personal",Gqi="Address Information",Kqi="Enter the Information for the Bank Account",Yqi="Account Holder Information",Qqi="Enter Information for the Account Holder",Xqi="Customer Type",Zqi="Process Date",Jqi="Forever Free",eGi="Comments Only",tGi="Payment Balance On File",nGi="For more e-invoice settings please navigate :here",iGi="You need to stop the task before adding a new item.",rGi="XML File",oGi="One-Page Checkout",sGi="Enable the new single page payment flow",aGi="Applies To",lGi="Accept Purchase Order",cGi="Round To Seconds",uGi="Quote :number reminder 1 sent",dGi="Auto Bill succeeded for invoice :invoice",hGi="Auto Bill failed for invoice :invoice. :notes",fGi="EInvoice :invoice for :client was e-delivered. :notes",pGi="Payment Failed",gGi="SSL Host Override",mGi="Upload Logo",_Gi="Melilla",vGi="Ceuta",bGi="Vietnamese",yGi="Please note that the status of your invoice has been updated. We recommend refreshing the page to view the most current version.",CGi="Youre all caught up! No new notifications.",wGi="How to import data",SGi="Download example file",EGi="Inbound e-mail address",xGi="The inbound email address which accepts expense documents. ie. expense@invoiceninja.com",TGi="Expense Mailbox",kGi="Enables processing of documents such as receipts for expense reporting",IGi="Allow Company Senders",LGi="Allows users within the company to send expense documents.",DGi="Allow Vendor Senders",AGi="Allows company vendors to send expense documents",RGi="Allow Client Senders",NGi="Allows clients to send expense documents",OGi="Inbound sender allow list",PGi="Comma separated list of emails that should be allowed to send emails for processing",MGi="Inbound sender banned list",FGi="Comma separate list of emails that are disallowed to send emails for processing",BGi="Allow All Senders",$Gi="Allow anyone to send an expense email for processing",VGi="Quick Actions",HGi="Logs out all users and requires all active users to reauthenticate.",WGi="Updated Records",zGi="Seller not VAT registered",UGi="No disclosure of sales tax in accordance with § 19 UStG",jGi="Time log duration in words",qGi="Time log duration",GGi="Successfully merged vendors",KGi="Somes taxes are hidden due to current tax settings. :link",YGi={organization:fxn,name:pxn,website:gxn,work_phone:mxn,address:_xn,address1:vxn,address2:bxn,city:yxn,state:Cxn,postal_code:wxn,country_id:Sxn,contacts:Exn,first_name:xxn,last_name:Txn,phone:kxn,email:Ixn,additional_info:Lxn,payment_terms:Dxn,currency_id:Axn,size_id:Rxn,industry_id:Nxn,private_notes:Oxn,invoice:Pxn,client:Mxn,invoice_date:Fxn,due_date:Bxn,invoice_number:$xn,invoice_number_short:Vxn,po_number:Hxn,po_number_short:Wxn,frequency_id:zxn,discount:Uxn,taxes:jxn,tax:qxn,item:Gxn,description:Kxn,unit_cost:Yxn,quantity:Qxn,line_total:Xxn,subtotal:Zxn,net_subtotal:Jxn,paid_to_date:eTn,balance_due:tTn,invoice_design_id:nTn,terms:iTn,your_invoice:rTn,remove_contact:oTn,add_contact:sTn,create_new_client:aTn,edit_client_details:lTn,enable:cTn,learn_more:uTn,manage_rates:dTn,note_to_client:hTn,invoice_terms:fTn,save_as_default_terms:pTn,download_pdf:gTn,pay_now:mTn,save_invoice:_Tn,clone_invoice:vTn,archive_invoice:bTn,delete_invoice:yTn,email_invoice:CTn,enter_payment:wTn,tax_rates:STn,rate:ETn,settings:xTn,enable_invoice_tax:TTn,enable_line_item_tax:kTn,dashboard:ITn,dashboard_totals_in_all_currencies_help:LTn,clients:DTn,invoices:ATn,payments:RTn,credits:NTn,history:OTn,search:PTn,sign_up:MTn,guest:FTn,company_details:BTn,online_payments:$Tn,notifications:VTn,import_export:HTn,done:WTn,save:zTn,create:UTn,upload:jTn,import:"Import",download:qTn,cancel:GTn,close:KTn,provide_email:YTn,powered_by:QTn,no_items:XTn,recurring_invoices:ZTn,recurring_help:JTn,recurring_quotes:ekn,in_total_revenue:tkn,billed_client:nkn,billed_clients:ikn,active_client:rkn,active_clients:okn,invoices_past_due:skn,upcoming_invoices:akn,average_invoice:lkn,archive:ckn,delete:"Delete",archive_client:ukn,delete_client:dkn,archive_payment:hkn,delete_payment:fkn,archive_credit:pkn,delete_credit:gkn,show_archived_deleted:mkn,filter:_kn,new_client:vkn,new_invoice:bkn,new_payment:ykn,new_credit:Ckn,contact:wkn,date_created:Skn,last_login:Ekn,balance:xkn,action:Tkn,status:kkn,invoice_total:Ikn,frequency:Lkn,range:Dkn,start_date:Akn,end_date:Rkn,transaction_reference:Nkn,method:Okn,payment_amount:Pkn,payment_date:Mkn,credit_amount:Fkn,credit_balance:Bkn,credit_date:$kn,empty_table:Vkn,select:Hkn,edit_client:Wkn,edit_invoice:zkn,create_invoice:Ukn,enter_credit:jkn,last_logged_in:qkn,details:Gkn,standing:Kkn,credit:Ykn,activity:Qkn,date:Xkn,message:Zkn,adjustment:Jkn,are_you_sure:eIn,payment_type_id:tIn,amount:nIn,work_email:iIn,language_id:rIn,timezone_id:oIn,date_format_id:sIn,datetime_format_id:aIn,users:lIn,localization:cIn,remove_logo:uIn,logo_help:dIn,payment_gateway:hIn,gateway_id:fIn,email_notifications:pIn,email_viewed:gIn,email_paid:mIn,site_updates:_In,custom_messages:vIn,default_email_footer:bIn,select_file:yIn,first_row_headers:CIn,column:wIn,sample:SIn,import_to:EIn,client_will_create:xIn,clients_will_create:TIn,email_settings:kIn,client_view_styling:IIn,pdf_email_attachment:LIn,custom_css:DIn,import_clients:AIn,csv_file:RIn,export_clients:NIn,created_client:OIn,created_clients:PIn,updated_settings:MIn,removed_logo:FIn,sent_message:BIn,invoice_error:$In,limit_clients:VIn,payment_error:HIn,registration_required:WIn,confirmation_required:zIn,updated_client:UIn,archived_client:jIn,archived_clients:qIn,deleted_client:GIn,deleted_clients:KIn,updated_invoice:YIn,created_invoice:QIn,cloned_invoice:XIn,emailed_invoice:ZIn,and_created_client:JIn,archived_invoice:e2n,archived_invoices:t2n,deleted_invoice:n2n,deleted_invoices:i2n,created_payment:r2n,created_payments:o2n,archived_payment:s2n,archived_payments:a2n,deleted_payment:l2n,deleted_payments:c2n,applied_payment:u2n,created_credit:d2n,archived_credit:h2n,archived_credits:f2n,deleted_credit:p2n,deleted_credits:g2n,imported_file:m2n,updated_vendor:_2n,created_vendor:v2n,archived_vendor:b2n,archived_vendors:y2n,deleted_vendor:C2n,deleted_vendors:w2n,confirmation_subject:S2n,confirmation_header:E2n,confirmation_message:x2n,invoice_subject:T2n,invoice_message:k2n,payment_subject:I2n,payment_message:L2n,email_salutation:D2n,email_signature:A2n,email_from:R2n,invoice_link_message:N2n,notification_invoice_paid_subject:O2n,notification_invoice_sent_subject:P2n,notification_invoice_viewed_subject:M2n,notification_invoice_paid:F2n,notification_invoice_sent:B2n,notification_invoice_viewed:$2n,stripe_payment_text:V2n,stripe_payment_text_without_invoice:H2n,reset_password:W2n,secure_payment:z2n,card_number:U2n,expiration_month:j2n,expiration_year:q2n,cvv:G2n,logout:K2n,sign_up_to_save:Y2n,agree_to_terms:Q2n,terms_of_service:X2n,email_taken:Z2n,working:J2n,success:eLn,success_message:tLn,erase_data:nLn,password:iLn,pro_plan_product:rLn,unsaved_changes:oLn,custom_fields:sLn,company_fields:aLn,client_fields:lLn,field_label:cLn,field_value:uLn,edit:dLn,set_name:hLn,view_as_recipient:fLn,product_library:pLn,product:gLn,products:mLn,fill_products:_Ln,fill_products_help:vLn,update_products:bLn,update_products_help:yLn,create_product:CLn,edit_product:wLn,archive_product:SLn,updated_product:ELn,created_product:xLn,archived_product:TLn,pro_plan_custom_fields:kLn,advanced_settings:ILn,pro_plan_advanced_settings:LLn,invoice_design:DLn,specify_colors:ALn,specify_colors_label:RLn,chart_builder:NLn,ninja_email_footer:OLn,go_pro:PLn,quote:MLn,quotes:FLn,quote_number:BLn,quote_number_short:$Ln,quote_date:VLn,quote_total:HLn,your_quote:WLn,total:zLn,clone:ULn,new_quote:jLn,create_quote:qLn,edit_quote:GLn,archive_quote:KLn,delete_quote:YLn,save_quote:QLn,email_quote:XLn,clone_quote:ZLn,convert_to_invoice:JLn,view_invoice:eDn,view_client:tDn,view_quote:nDn,updated_quote:iDn,created_quote:rDn,cloned_quote:oDn,emailed_quote:sDn,archived_quote:aDn,archived_quotes:lDn,deleted_quote:cDn,deleted_quotes:uDn,converted_to_invoice:dDn,quote_subject:hDn,quote_message:fDn,quote_link_message:pDn,notification_quote_sent_subject:gDn,notification_quote_viewed_subject:mDn,notification_quote_sent:_Dn,notification_quote_viewed:vDn,session_expired:bDn,invoice_fields:yDn,invoice_options:CDn,hide_paid_to_date:wDn,hide_paid_to_date_help:SDn,charge_taxes:EDn,user_management:xDn,add_user:TDn,send_invite:kDn,sent_invite:IDn,updated_user:LDn,invitation_message:DDn,register_to_add_user:ADn,user_state:RDn,edit_user:NDn,delete_user:ODn,active:PDn,pending:MDn,deleted_user:FDn,confirm_email_invoice:BDn,confirm_email_quote:$Dn,confirm_recurring_email_invoice:VDn,confirm_recurring_email_invoice_not_sent:HDn,cancel_account:WDn,cancel_account_message:zDn,go_back:UDn,data_visualizations:jDn,sample_data:qDn,hide:GDn,new_version_available:KDn,invoice_settings:YDn,invoice_number_prefix:QDn,invoice_number_counter:XDn,quote_number_prefix:ZDn,quote_number_counter:JDn,share_invoice_counter:eAn,invoice_issued_to:tAn,invalid_counter:nAn,mark_sent:iAn,more_designs:rAn,more_designs_title:oAn,more_designs_cloud_header:sAn,more_designs_cloud_text:aAn,more_designs_self_host_text:lAn,buy:cAn,bought_designs:uAn,sent:dAn,vat_number:hAn,payment_title:fAn,payment_cvv:pAn,payment_footer1:gAn,payment_footer2:mAn,id_number:_An,white_label_link:vAn,white_label_header:bAn,bought_white_label:yAn,white_labeled:CAn,restore:wAn,restore_invoice:SAn,restore_quote:EAn,restore_client:xAn,restore_credit:TAn,restore_payment:kAn,restored_invoice:IAn,restored_quote:LAn,restored_client:DAn,restored_payment:AAn,restored_credit:RAn,reason_for_canceling:NAn,discount_percent:OAn,discount_amount:PAn,invoice_history:MAn,quote_history:FAn,current_version:BAn,select_version:$An,view_history:VAn,edit_payment:HAn,updated_payment:WAn,deleted:zAn,restore_user:UAn,restored_user:jAn,show_deleted_users:qAn,email_templates:GAn,invoice_email:KAn,payment_email:YAn,quote_email:QAn,reset_all:XAn,approve:ZAn,token_billing_type_id:JAn,token_billing_1:eRn,token_billing_2:tRn,token_billing_3:nRn,token_billing_4:iRn,token_billing_checkbox:rRn,view_in_gateway:oRn,use_card_on_file:sRn,edit_payment_details:aRn,token_billing:lRn,token_billing_secure:cRn,support:uRn,contact_information:dRn,"256_encryption":"256-Bit Encryption",amount_due:hRn,billing_address:fRn,billing_method:pRn,order_overview:gRn,match_address:mRn,click_once:_Rn,invoice_footer:vRn,save_as_default_footer:bRn,token_management:yRn,tokens:CRn,add_token:wRn,show_deleted_tokens:SRn,deleted_token:ERn,created_token:xRn,updated_token:TRn,edit_token:kRn,delete_token:IRn,token:LRn,add_gateway:DRn,delete_gateway:ARn,edit_gateway:RRn,updated_gateway:NRn,created_gateway:ORn,deleted_gateway:PRn,pay_with_paypal:MRn,pay_with_card:FRn,change_password:BRn,current_password:$Rn,new_password:VRn,confirm_password:HRn,password_error_incorrect:WRn,password_error_invalid:zRn,updated_password:URn,api_tokens:jRn,users_and_tokens:qRn,account_login:GRn,recover_password:KRn,forgot_password:YRn,email_address:QRn,lets_go:XRn,password_recovery:ZRn,send_email:JRn,set_password:eNn,converted:tNn,email_approved:nNn,notification_quote_approved_subject:iNn,notification_quote_approved:rNn,resend_confirmation:oNn,confirmation_resent:sNn,payment_type_credit_card:aNn,payment_type_paypal:lNn,payment_type_bitcoin:cNn,payment_type_gocardless:uNn,knowledge_base:dNn,partial:hNn,partial_remaining:fNn,more_fields:pNn,less_fields:gNn,client_name:mNn,pdf_settings:_Nn,product_settings:vNn,auto_wrap:bNn,duplicate_post:yNn,view_documentation:CNn,app_title:wNn,app_description:SNn,rows:ENn,www:xNn,logo:TNn,subdomain:kNn,provide_name_or_email:INn,charts_and_reports:LNn,chart:DNn,report:ANn,group_by:RNn,paid:NNn,enable_report:ONn,enable_chart:PNn,totals:MNn,run:FNn,export:"Export",documentation:BNn,zapier:$Nn,recurring:VNn,last_invoice_sent:HNn,processed_updates:WNn,tasks:zNn,new_task:UNn,start_time:jNn,created_task:qNn,updated_task:GNn,edit_task:KNn,clone_task:YNn,archive_task:QNn,restore_task:XNn,delete_task:ZNn,stop_task:JNn,time:eOn,start:tOn,stop:nOn,now:iOn,timer:rOn,manual:oOn,date_and_time:sOn,second:aOn,seconds:lOn,minute:cOn,minutes:uOn,hour:dOn,hours:hOn,task_details:fOn,duration:pOn,time_log:gOn,end_time:mOn,end:_On,invoiced:vOn,logged:bOn,running:yOn,task_error_multiple_clients:COn,task_error_running:wOn,task_error_invoiced:SOn,restored_task:EOn,archived_task:xOn,archived_tasks:TOn,deleted_task:kOn,deleted_tasks:IOn,create_task:LOn,stopped_task:DOn,invoice_task:AOn,invoice_labels:ROn,prefix:NOn,counter:OOn,payment_type_dwolla:POn,partial_value:MOn,more_actions:FOn,pro_plan_title:BOn,pro_plan_call_to_action:$On,pro_plan_feature1:VOn,pro_plan_feature2:HOn,pro_plan_feature3:WOn,pro_plan_feature4:zOn,pro_plan_feature5:UOn,pro_plan_feature6:jOn,pro_plan_feature7:qOn,pro_plan_feature8:GOn,resume:KOn,break_duration:YOn,edit_details:QOn,work:XOn,timezone_unset:ZOn,click_here:JOn,email_receipt:ePn,created_payment_emailed_client:tPn,add_company:nPn,untitled:iPn,new_company:rPn,associated_accounts:oPn,unlinked_account:sPn,login:aPn,or:lPn,email_error:cPn,confirm_recurring_timing:uPn,confirm_recurring_timing_not_sent:dPn,unlink_account:hPn,unlink:fPn,show_address:pPn,show_address_help:gPn,update_address:mPn,update_address_help:_Pn,times:vPn,set_now:bPn,dark_mode:yPn,dark_mode_help:CPn,add_to_invoice:wPn,create_new_invoice:SPn,task_errors:EPn,from:xPn,to:TPn,font_size:kPn,primary_color:IPn,secondary_color:LPn,customize_design:DPn,content:APn,styles:RPn,defaults:NPn,margins:OPn,header:PPn,footer:MPn,custom:FPn,invoice_to:BPn,invoice_no:$Pn,quote_no:VPn,recent_payments:HPn,outstanding:WPn,manage_companies:zPn,total_revenue:UPn,current_user:jPn,new_recurring_invoice:qPn,recurring_invoice:GPn,new_recurring_quote:KPn,recurring_quote:YPn,created_by_invoice:QPn,primary_user:XPn,help:ZPn,playground:JPn,support_forum:eMn,invoice_due_date:tMn,quote_due_date:nMn,valid_until:iMn,reset_terms:rMn,reset_footer:oMn,invoice_sent:sMn,invoices_sent:aMn,status_draft:lMn,status_sent:cMn,status_viewed:uMn,status_partial:dMn,status_paid:hMn,status_unpaid:fMn,status_all:pMn,show_line_item_tax:gMn,auto_bill:mMn,military_time:_Mn,last_sent:vMn,reminder_emails:bMn,quote_reminder_emails:yMn,templates_and_reminders:CMn,subject:wMn,body:SMn,first_reminder:EMn,second_reminder:xMn,third_reminder:TMn,num_days_reminder:kMn,reminder_subject:IMn,reset:LMn,invoice_not_found:DMn,referral_program:AMn,referral_code:RMn,last_sent_on:NMn,page_expire:OMn,upcoming_quotes:PMn,expired_quotes:MMn,sign_up_using:FMn,invalid_credentials:BMn,show_all_options:$Mn,user_details:VMn,oneclick_login:HMn,disable:WMn,invoice_quote_number:zMn,invoice_charges:UMn,notification_invoice_bounced:jMn,notification_invoice_bounced_subject:qMn,notification_quote_bounced:GMn,notification_quote_bounced_subject:KMn,custom_invoice_link:YMn,total_invoiced:QMn,open_balance:XMn,verify_email:ZMn,basic_settings:JMn,pro:e4n,gateways:t4n,next_send_on:n4n,no_longer_running:i4n,general_settings:r4n,customize:o4n,oneclick_login_help:s4n,referral_code_help:a4n,enable_with_stripe:l4n,tax_settings:c4n,create_tax_rate:u4n,updated_tax_rate:d4n,created_tax_rate:h4n,edit_tax_rate:f4n,archive_tax_rate:p4n,archived_tax_rate:g4n,default_tax_rate_id:m4n,tax_rate:_4n,recurring_hour:v4n,pattern:b4n,pattern_help_title:y4n,pattern_help_1:C4n,pattern_help_2:w4n,pattern_help_3:S4n,see_options:E4n,invoice_counter:x4n,quote_counter:T4n,type:k4n,activity_1:I4n,activity_2:L4n,activity_3:D4n,activity_4:A4n,activity_5:R4n,activity_6:N4n,activity_7:O4n,activity_8:P4n,activity_9:M4n,activity_10:F4n,activity_11:B4n,activity_12:$4n,activity_13:V4n,activity_14:H4n,activity_15:W4n,activity_16:z4n,activity_17:U4n,activity_18:j4n,activity_19:q4n,activity_20:G4n,activity_21:K4n,activity_22:Y4n,activity_23:Q4n,activity_24:X4n,activity_25:Z4n,activity_26:J4n,activity_27:e3n,activity_28:t3n,activity_29:n3n,activity_30:i3n,activity_31:r3n,activity_32:o3n,activity_33:s3n,activity_34:a3n,activity_35:l3n,activity_36:c3n,activity_37:u3n,activity_42:d3n,activity_43:h3n,activity_44:f3n,activity_45:p3n,activity_46:g3n,activity_47:m3n,activity_48:_3n,activity_49:v3n,activity_50:b3n,activity_51:y3n,activity_52:C3n,activity_53:w3n,activity_54:S3n,activity_55:E3n,activity_56:x3n,payment:T3n,system:k3n,signature:I3n,default_messages:L3n,quote_terms:D3n,default_quote_terms:A3n,default_invoice_terms:R3n,default_invoice_footer:N3n,quote_footer:O3n,free:P3n,quote_is_approved:M3n,apply_credit:F3n,system_settings:B3n,archive_token:$3n,archived_token:V3n,archive_user:H3n,archived_user:W3n,archive_account_gateway:z3n,archived_account_gateway:U3n,archive_recurring_invoice:j3n,archived_recurring_invoice:q3n,delete_recurring_invoice:G3n,deleted_recurring_invoice:K3n,restore_recurring_invoice:Y3n,restored_recurring_invoice:Q3n,archive_recurring_quote:X3n,archived_recurring_quote:Z3n,delete_recurring_quote:J3n,deleted_recurring_quote:e5n,restore_recurring_quote:t5n,restored_recurring_quote:n5n,archived:i5n,untitled_account:r5n,before:o5n,after:s5n,reset_terms_help:a5n,reset_footer_help:l5n,export_data:c5n,user:u5n,country:d5n,include:h5n,logo_too_large:f5n,import_freshbooks:p5n,import_data:g5n,source:m5n,csv:_5n,client_file:v5n,invoice_file:b5n,task_file:y5n,no_mapper:C5n,invalid_csv_header:w5n,client_portal:S5n,admin:E5n,disabled:x5n,show_archived_users:T5n,notes:k5n,invoice_will_create:I5n,invoices_will_create:L5n,failed_to_import:D5n,publishable_key:A5n,secret_key:R5n,missing_publishable_key:N5n,email_design:O5n,due_by:P5n,enable_email_markup:M5n,enable_email_markup_help:F5n,template_help_title:B5n,template_help_1:$5n,email_design_id:V5n,email_design_help:H5n,plain:W5n,light:z5n,dark:U5n,industry_help:j5n,subdomain_help:q5n,website_help:G5n,invoice_number_help:K5n,quote_number_help:Y5n,custom_client_fields_helps:Q5n,custom_account_fields_helps:X5n,custom_invoice_fields_helps:Z5n,custom_invoice_charges_helps:J5n,token_expired:eFn,invoice_link:tFn,button_confirmation_message:nFn,confirm:iFn,email_preferences:rFn,created_invoices:oFn,next_invoice_number:sFn,next_quote_number:aFn,days_before:lFn,days_after:cFn,field_due_date:uFn,field_invoice_date:dFn,schedule:hFn,email_designs:fFn,assigned_when_sent:pFn,white_label_purchase_link:gFn,expense:mFn,expenses:_Fn,new_expense:vFn,new_vendor:bFn,payment_terms_net:yFn,vendor:CFn,edit_vendor:wFn,archive_vendor:SFn,delete_vendor:EFn,view_vendor:xFn,deleted_expense:TFn,archived_expense:kFn,deleted_expenses:IFn,archived_expenses:LFn,expense_amount:DFn,expense_balance:AFn,expense_date:RFn,expense_should_be_invoiced:NFn,public_notes:OFn,invoice_amount:PFn,exchange_rate:MFn,yes:FFn,no:BFn,should_be_invoiced:$Fn,view_expense:VFn,edit_expense:HFn,archive_expense:WFn,delete_expense:zFn,view_expense_num:UFn,updated_expense:jFn,created_expense:qFn,enter_expense:GFn,view:KFn,restore_expense:YFn,invoice_expense:QFn,expense_error_multiple_clients:XFn,expense_error_invoiced:ZFn,convert_currency:JFn,num_days:e6n,create_payment_term:t6n,edit_payment_terms:n6n,edit_payment_term:i6n,archive_payment_term:r6n,recurring_due_dates:o6n,recurring_due_date_help:s6n,due:a6n,next_due_on:l6n,use_client_terms:c6n,day_of_month:u6n,last_day_of_month:d6n,day_of_week_after:h6n,sunday:f6n,monday:p6n,tuesday:g6n,wednesday:m6n,thursday:_6n,friday:v6n,saturday:b6n,header_font_id:y6n,body_font_id:C6n,color_font_help:w6n,live_preview:S6n,invalid_mail_config:E6n,invoice_message_button:x6n,quote_message_button:T6n,payment_message_button:k6n,payment_type_direct_debit:I6n,bank_accounts:L6n,add_bank_account:D6n,setup_account:A6n,import_expenses:R6n,bank_id:N6n,integration_type:O6n,updated_bank_account:P6n,edit_bank_account:M6n,archive_bank_account:F6n,archived_bank_account:B6n,created_bank_account:$6n,validate_bank_account:V6n,bank_password_help:H6n,bank_password_warning:W6n,username:z6n,account_number:U6n,account_name:j6n,bank_account_error:q6n,status_approved:G6n,quote_settings:K6n,auto_convert_quote:Y6n,auto_convert_quote_help:Q6n,validate:X6n,info:Z6n,imported_expenses:J6n,iframe_url_help3:eBn,expense_error_multiple_currencies:tBn,expense_error_mismatch_currencies:nBn,trello_roadmap:iBn,header_footer:rBn,first_page:oBn,all_pages:sBn,last_page:aBn,all_pages_header:lBn,all_pages_footer:cBn,invoice_currency:uBn,enable_https:dBn,quote_issued_to:hBn,show_currency_code:fBn,free_year_message:pBn,trial_message:gBn,trial_footer:mBn,trial_footer_last_day:_Bn,trial_call_to_action:vBn,trial_success:bBn,overdue:yBn,white_label_text:CBn,user_email_footer:wBn,reset_password_footer:SBn,limit_users:EBn,more_designs_self_host_header:xBn,old_browser:TBn,newer_browser:kBn,white_label_custom_css:IBn,pro_plan_remove_logo:LBn,pro_plan_remove_logo_link:DBn,invitation_status_sent:ABn,invitation_status_opened:RBn,invitation_status_viewed:NBn,email_error_inactive_client:OBn,email_error_inactive_contact:PBn,email_error_inactive_invoice:MBn,email_error_inactive_proposal:FBn,email_error_user_unregistered:BBn,email_error_user_unconfirmed:$Bn,email_error_invalid_contact_email:VBn,navigation:HBn,list_invoices:WBn,list_clients:zBn,list_quotes:UBn,list_tasks:jBn,list_expenses:qBn,list_recurring_invoices:GBn,list_payments:KBn,list_credits:YBn,tax_name:QBn,report_settings:XBn,new_user:ZBn,new_product:JBn,new_tax_rate:e8n,invoiced_amount:t8n,invoice_item_fields:n8n,custom_invoice_item_fields_help:i8n,recurring_invoice_number:r8n,recurring_invoice_number_prefix_help:o8n,enable_portal_password:s8n,enable_portal_password_help:a8n,send_portal_password:l8n,send_portal_password_help:c8n,expired:u8n,invalid_card_number:d8n,invalid_expiry:h8n,invalid_cvv:f8n,cost:p8n,create_invoice_for_sample:g8n,owner:m8n,administrator:_8n,administrator_help:v8n,user_create_all:b8n,user_view_all:y8n,user_edit_all:C8n,partial_due:w8n,restore_vendor:S8n,restored_vendor:E8n,restored_expense:x8n,permissions:T8n,create_all_help:k8n,view_all_help:I8n,edit_all_help:L8n,view_payment:D8n,january:A8n,february:R8n,march:N8n,april:O8n,may:P8n,june:M8n,july:F8n,august:B8n,september:$8n,october:V8n,november:H8n,december:W8n,documents_header:z8n,email_documents_header:U8n,email_documents_example_1:j8n,email_documents_example_2:q8n,quote_documents:G8n,invoice_documents:K8n,expense_documents:Y8n,invoice_embed_documents:Q8n,invoice_embed_documents_help:X8n,document_email_attachment:Z8n,ubl_email_attachment:J8n,download_documents:e9n,documents_from_expenses:t9n,dropzone_default_message:n9n,dropzone_default_message_disabled:i9n,dropzone_fallback_message:r9n,dropzone_fallback_text:o9n,dropzone_file_too_big:s9n,dropzone_invalid_file_type:a9n,dropzone_response_error:l9n,dropzone_cancel_upload:c9n,dropzone_cancel_upload_confirmation:u9n,dropzone_remove_file:d9n,documents:h9n,document_date:f9n,document_size:p9n,enable_client_portal:g9n,enable_client_portal_help:m9n,enable_client_portal_dashboard:_9n,enable_client_portal_dashboard_help:v9n,account_management:b9n,plan_status:y9n,plan_upgrade:C9n,plan_change:w9n,pending_change_to:S9n,plan_changes_to:E9n,plan_term_changes_to:x9n,cancel_plan_change:T9n,plan:k9n,expires:I9n,renews:L9n,plan_expired:D9n,trial_expired:A9n,never:R9n,plan_free:N9n,plan_pro:O9n,plan_enterprise:P9n,plan_white_label:M9n,plan_free_self_hosted:F9n,plan_trial:B9n,plan_term:$9n,plan_term_monthly:V9n,plan_term_yearly:H9n,plan_term_month:W9n,plan_term_year:z9n,plan_price_monthly:U9n,plan_price_yearly:j9n,updated_plan:q9n,plan_paid:G9n,plan_started:K9n,plan_expires:Y9n,white_label_button:Q9n,pro_plan_year_description:X9n,pro_plan_month_description:Z9n,enterprise_plan_product:J9n,enterprise_plan_year_description:e7n,enterprise_plan_month_description:t7n,plan_credit_product:n7n,plan_credit_description:i7n,plan_pending_monthly:r7n,plan_refunded:o7n,page_size:s7n,live_preview_disabled:a7n,invoice_number_padding:l7n,preview:c7n,list_vendors:u7n,add_users_not_supported:d7n,enterprise_plan_features:h7n,return_to_app:f7n,refund_payment:p7n,refund_max:g7n,refund:m7n,are_you_sure_refund:_7n,status_pending:v7n,status_completed:b7n,status_failed:y7n,status_partially_refunded:C7n,status_partially_refunded_amount:w7n,status_refunded:S7n,status_voided:E7n,refunded_payment:x7n,activity_39:T7n,activity_40:k7n,card_expiration:I7n,card_creditcardother:L7n,card_americanexpress:D7n,card_carteblanche:A7n,card_unionpay:R7n,card_diners:N7n,card_discover:O7n,card_jcb:P7n,card_laser:M7n,card_maestro:F7n,card_mastercard:B7n,card_solo:$7n,card_switch:V7n,card_visacard:H7n,card_ach:W7n,payment_type_stripe:z7n,ach:U7n,enable_ach:j7n,stripe_ach_help:q7n,ach_disabled:G7n,plaid:K7n,client_id:Y7n,secret:Q7n,public_key:X7n,plaid_optional:Z7n,plaid_environment_help:J7n,other_providers:e$n,country_not_supported:t$n,invalid_routing_number:n$n,invalid_account_number:i$n,account_number_mismatch:r$n,missing_account_holder_type:o$n,missing_account_holder_name:s$n,routing_number:a$n,confirm_account_number:l$n,individual_account:c$n,company_account:u$n,account_holder_name:d$n,add_account:h$n,payment_methods:f$n,complete_verification:p$n,verification_amount1:g$n,verification_amount2:m$n,payment_method_verified:_$n,verification_failed:v$n,remove_payment_method:b$n,confirm_remove_payment_method:y$n,remove:C$n,payment_method_removed:w$n,bank_account_verification_help:S$n,bank_account_verification_next_steps:E$n,unknown_bank:x$n,ach_verification_delay_help:T$n,add_credit_card:k$n,payment_method_added:I$n,use_for_auto_bill:L$n,used_for_auto_bill:D$n,payment_method_set_as_default:A$n,activity_41:R$n,webhook_url:N$n,stripe_webhook_help:O$n,stripe_webhook_help_link_text:P$n,gocardless_webhook_help_link_text:M$n,payment_method_error:F$n,notification_invoice_payment_failed_subject:B$n,notification_invoice_payment_failed:$$n,link_with_plaid:V$n,link_manually:H$n,secured_by_plaid:W$n,plaid_linked_status:z$n,add_payment_method:U$n,account_holder_type:j$n,ach_authorization:q$n,ach_authorization_required:G$n,off:K$n,opt_in:Y$n,opt_out:Q$n,always:X$n,opted_out:Z$n,opted_in:J$n,manage_auto_bill:eVn,enabled:tVn,paypal:nVn,braintree_enable_paypal:iVn,braintree_paypal_disabled_help:rVn,braintree_paypal_help:oVn,braintree_paypal_help_link_text:sVn,token_billing_braintree_paypal:aVn,add_paypal_account:lVn,no_payment_method_specified:cVn,chart_type:uVn,format:dVn,import_ofx:hVn,ofx_file:fVn,ofx_parse_failed:pVn,wepay:gVn,sign_up_with_wepay:mVn,use_another_provider:_Vn,company_name:vVn,wepay_company_name_help:bVn,wepay_description_help:yVn,wepay_tos_agree:CVn,wepay_tos_link_text:wVn,resend_confirmation_email:SVn,manage_account:EVn,action_required:xVn,finish_setup:TVn,created_wepay_confirmation_required:kVn,switch_to_wepay:IVn,switch:"Switch",restore_account_gateway:LVn,restored_account_gateway:DVn,united_states:AVn,canada:RVn,accept_debit_cards:NVn,debit_cards:OVn,warn_start_date_changed:PVn,warn_start_date_changed_not_sent:MVn,original_start_date:FVn,new_start_date:BVn,security:$Vn,see_whats_new:VVn,wait_for_upload:HVn,upgrade_for_permissions:WVn,enable_second_tax_rate:zVn,payment_file:UVn,expense_file:jVn,product_file:qVn,import_products:GVn,products_will_create:KVn,product_key:YVn,created_products:QVn,export_help:XVn,selfhost_export_help:ZVn,JSON_file:JVn,view_dashboard:eHn,client_session_expired:tHn,client_session_expired_message:nHn,auto_bill_notification:iHn,auto_bill_payment_method_bank_transfer:rHn,auto_bill_payment_method_credit_card:oHn,auto_bill_payment_method_paypal:sHn,auto_bill_notification_placeholder:aHn,payment_settings:lHn,on_send_date:cHn,on_due_date:uHn,auto_bill_ach_date_help:dHn,warn_change_auto_bill:hHn,bank_account:fHn,payment_processed_through_wepay:pHn,privacy_policy:gHn,ach_email_prompt:mHn,verification_pending:_Hn,update_font_cache:vHn,more_options:bHn,credit_card:yHn,bank_transfer:CHn,no_transaction_reference:wHn,use_bank_on_file:SHn,auto_bill_email_message:EHn,bitcoin:xHn,gocardless:THn,added_on:kHn,failed_remove_payment_method:IHn,gateway_exists:LHn,manual_entry:DHn,start_of_week:AHn,freq_inactive:RHn,freq_daily:NHn,freq_weekly:OHn,freq_biweekly:PHn,freq_two_weeks:MHn,freq_four_weeks:FHn,freq_monthly:BHn,freq_three_months:$Hn,freq_four_months:VHn,freq_six_months:HHn,freq_annually:WHn,freq_two_years:zHn,"payment_type_Apply Credit":"Apply Credit","payment_type_Bank Transfer":"Bank Transfer",payment_type_Cash:UHn,payment_type_Debit:jHn,payment_type_ACH:qHn,"payment_type_Visa Card":"Visa Card",payment_type_MasterCard:GHn,"payment_type_American Express":"American Express","payment_type_Discover Card":"Discover Card","payment_type_Diners Card":"Diners Card",payment_type_EuroCard:KHn,payment_type_Nova:YHn,"payment_type_Credit Card Other":"Credit Card Other",payment_type_PayPal:QHn,"payment_type_Google Wallet":"Google Wallet",payment_type_Check:XHn,"payment_type_Carte Blanche":"Carte Blanche",payment_type_UnionPay:ZHn,payment_type_JCB:JHn,payment_type_Laser:eWn,payment_type_Maestro:tWn,payment_type_Solo:nWn,payment_type_Switch:iWn,payment_type_iZettle:rWn,payment_type_Swish:oWn,payment_type_Alipay:sWn,payment_type_Sofort:aWn,payment_type_SEPA:lWn,payment_type_Bitcoin:cWn,payment_type_GoCardless:uWn,payment_type_Zelle:dWn,country_Afghanistan:hWn,country_Albania:fWn,country_Antarctica:pWn,country_Algeria:gWn,"country_American Samoa":"American Samoa",country_Andorra:mWn,country_Angola:_Wn,"country_Antigua and Barbuda":"Antigua and Barbuda",country_Azerbaijan:vWn,country_Argentina:bWn,country_Australia:yWn,country_Austria:CWn,country_Bahamas:wWn,country_Bahrain:SWn,country_Bangladesh:EWn,country_Armenia:xWn,country_Barbados:TWn,country_Belgium:kWn,country_Bermuda:IWn,country_Bhutan:LWn,"country_Bolivia, Plurinational State of":"Bolivia, Plurinational State of","country_Bosnia and Herzegovina":"Bosnia and Herzegovina",country_Botswana:DWn,"country_Bouvet Island":"Bouvet Island",country_Brazil:AWn,country_Belize:RWn,"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:NWn,country_Myanmar:OWn,country_Burundi:PWn,country_Belarus:MWn,country_Cambodia:FWn,country_Cameroon:BWn,country_Canada:$Wn,"country_Cape Verde":"Cape Verde","country_Cayman Islands":"Cayman Islands","country_Central African Republic":"Central African Republic","country_Sri Lanka":"Sri Lanka",country_Chad:VWn,country_Chile:HWn,country_China:WWn,"country_Taiwan, Province of China":"Taiwan, Province of China","country_Christmas Island":"Christmas Island","country_Cocos (Keeling) Islands":"Cocos (Keeling) Islands",country_Colombia:zWn,country_Comoros:UWn,country_Mayotte:jWn,country_Congo:qWn,"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:GWn,country_Cuba:KWn,country_Cyprus:YWn,"country_Czech Republic":"Czech Republic",country_Benin:QWn,country_Denmark:XWn,country_Dominica:ZWn,"country_Dominican Republic":"Dominican Republic",country_Ecuador:JWn,"country_El Salvador":"El Salvador","country_Equatorial Guinea":"Equatorial Guinea",country_Ethiopia:ezn,country_Eritrea:tzn,country_Estonia:nzn,"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:izn,country_Finland:rzn,"country_Åland Islands":"Åland Islands",country_France:ozn,"country_French Guiana":"French Guiana","country_French Polynesia":"French Polynesia","country_French Southern Territories":"French Southern Territories",country_Djibouti:szn,country_Gabon:azn,country_Georgia:lzn,country_Gambia:czn,"country_Palestinian Territory, Occupied":"Palestinian Territory, Occupied",country_Germany:uzn,country_Ghana:dzn,country_Gibraltar:hzn,country_Kiribati:fzn,country_Greece:pzn,country_Greenland:gzn,country_Grenada:mzn,country_Guadeloupe:_zn,country_Guam:vzn,country_Guatemala:bzn,country_Guinea:yzn,country_Guyana:Czn,country_Haiti:wzn,"country_Heard Island and McDonald Islands":"Heard Island and McDonald Islands","country_Holy See (Vatican City State)":"Holy See (Vatican City State)",country_Honduras:Szn,"country_Hong Kong":"Hong Kong",country_Hungary:Ezn,country_Iceland:xzn,country_India:Tzn,country_Indonesia:kzn,"country_Iran, Islamic Republic of":"Iran, Islamic Republic of",country_Iraq:Izn,country_Ireland:Lzn,country_Israel:Dzn,country_Italy:Azn,"country_Côte d'Ivoire":"Côte d'Ivoire",country_Jamaica:Rzn,country_Japan:Nzn,country_Kazakhstan:Ozn,country_Jordan:Pzn,country_Kenya:Mzn,"country_Korea, Democratic People's Republic of":"Korea, Democratic People's Republic of","country_Korea, Republic of":"Korea, Republic of",country_Kuwait:Fzn,country_Kyrgyzstan:Bzn,"country_Lao People's Democratic Republic":"Lao People's Democratic Republic",country_Lebanon:$zn,country_Lesotho:Vzn,country_Latvia:Hzn,country_Liberia:Wzn,country_Libya:zzn,country_Liechtenstein:Uzn,country_Lithuania:jzn,country_Luxembourg:qzn,country_Macao:Gzn,country_Madagascar:Kzn,country_Malawi:Yzn,country_Malaysia:Qzn,country_Maldives:Xzn,country_Mali:Zzn,country_Malta:Jzn,country_Martinique:eUn,country_Mauritania:tUn,country_Mauritius:nUn,country_Mexico:iUn,country_Monaco:rUn,country_Mongolia:oUn,"country_Moldova, Republic of":"Moldova, Republic of",country_Montenegro:sUn,country_Montserrat:aUn,country_Morocco:lUn,country_Mozambique:cUn,country_Oman:uUn,country_Namibia:dUn,country_Nauru:hUn,country_Nepal:fUn,country_Netherlands:pUn,country_Curaçao:"Curaçao",country_Aruba:gUn,"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:mUn,"country_New Zealand":"New Zealand",country_Nicaragua:_Un,country_Niger:vUn,country_Nigeria:bUn,country_Niue:yUn,"country_Norfolk Island":"Norfolk Island",country_Norway:CUn,"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:wUn,country_Pakistan:SUn,country_Panama:EUn,"country_Papua New Guinea":"Papua New Guinea",country_Paraguay:xUn,country_Peru:TUn,country_Philippines:kUn,country_Pitcairn:IUn,country_Poland:LUn,country_Portugal:DUn,"country_Guinea-Bissau":"Guinea-Bissau","country_Timor-Leste":"Timor-Leste","country_Puerto Rico":"Puerto Rico",country_Qatar:AUn,country_Réunion:"Réunion",country_Romania:RUn,"country_Russian Federation":"Russian Federation",country_Rwanda:NUn,"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:OUn,"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:PUn,country_Serbia:MUn,country_Seychelles:FUn,"country_Sierra Leone":"Sierra Leone",country_Singapore:BUn,country_Slovakia:$Un,"country_Viet Nam":"Viet Nam",country_Slovenia:VUn,country_Somalia:HUn,"country_South Africa":"South Africa",country_Zimbabwe:WUn,country_Spain:zUn,"country_South Sudan":"South Sudan",country_Sudan:UUn,"country_Western Sahara":"Western Sahara",country_Suriname:jUn,"country_Svalbard and Jan Mayen":"Svalbard and Jan Mayen",country_Swaziland:qUn,country_Sweden:GUn,country_Switzerland:KUn,"country_Syrian Arab Republic":"Syrian Arab Republic",country_Tajikistan:YUn,country_Thailand:QUn,country_Togo:XUn,country_Tokelau:ZUn,country_Tonga:JUn,"country_Trinidad and Tobago":"Trinidad and Tobago","country_United Arab Emirates":"United Arab Emirates",country_Tunisia:ejn,country_Turkey:tjn,country_Turkmenistan:njn,"country_Turks and Caicos Islands":"Turks and Caicos Islands",country_Tuvalu:ijn,country_Uganda:rjn,country_Ukraine:ojn,"country_Macedonia, the former Yugoslav Republic of":"Macedonia, the former Yugoslav Republic of",country_Egypt:sjn,"country_United Kingdom":"United Kingdom",country_Guernsey:ajn,country_Jersey:ljn,"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:cjn,country_Uzbekistan:ujn,"country_Venezuela, Bolivarian Republic of":"Venezuela, Bolivarian Republic of","country_Wallis and Futuna":"Wallis and Futuna",country_Samoa:djn,country_Yemen:hjn,country_Zambia:fjn,"lang_Brazilian Portuguese":"Brazilian Portuguese",lang_Croatian:pjn,lang_Czech:gjn,lang_Danish:mjn,lang_Dutch:_jn,lang_English:vjn,"lang_English - United States":"English",lang_French:bjn,"lang_French - Canada":"French - Canada",lang_German:yjn,lang_Italian:Cjn,lang_Japanese:wjn,lang_Lithuanian:Sjn,lang_Norwegian:Ejn,lang_Polish:xjn,lang_Spanish:Tjn,"lang_Spanish - Spain":"Spanish - Spain",lang_Swedish:kjn,lang_Albanian:Ijn,lang_Greek:Ljn,"lang_English - United Kingdom":"English - United Kingdom","lang_English - Australia":"English - Australia",lang_Slovenian:Djn,lang_Finnish:Ajn,lang_Romanian:Rjn,"lang_Turkish - Turkey":"Turkish - Turkey","lang_Portuguese - Brazilian":"Portuguese - Brazilian","lang_Portuguese - Portugal":"Portuguese - Portugal",lang_Thai:Njn,lang_Macedonian:Ojn,"lang_Chinese - Taiwan":"Chinese - Taiwan",lang_Serbian:Pjn,lang_Bulgarian:Mjn,"lang_Russian (Russia)":"Russian (Russia)","industry_Accounting & Legal":"Accounting & Legal",industry_Advertising:Fjn,industry_Aerospace:Bjn,industry_Agriculture:$jn,industry_Automotive:Vjn,"industry_Banking & Finance":"Banking & Finance",industry_Biotechnology:Hjn,industry_Broadcasting:Wjn,"industry_Business Services":"Business Services","industry_Commodities & Chemicals":"Commodities & Chemicals",industry_Communications:zjn,"industry_Computers & Hightech":"Computers & Hightech",industry_Defense:Ujn,industry_Energy:jjn,industry_Entertainment:qjn,industry_Government:Gjn,"industry_Healthcare & Life Sciences":"Healthcare & Life Sciences",industry_Insurance:Kjn,industry_Manufacturing:Yjn,industry_Marketing:Qjn,industry_Media:Xjn,"industry_Nonprofit & Higher Ed":"Nonprofit & Higher Ed",industry_Pharmaceuticals:Zjn,"industry_Professional Services & Consulting":"Professional Services & Consulting","industry_Real Estate":"Real Estate","industry_Retail & Wholesale":"Retail & Wholesale",industry_Sports:Jjn,industry_Transportation:eqn,"industry_Travel & Luxury":"Travel & Luxury",industry_Other:tqn,industry_Photography:nqn,view_client_portal:iqn,view_portal:rqn,vendor_contacts:oqn,all:sqn,selected:aqn,category:lqn,categories:cqn,new_expense_category:uqn,edit_category:dqn,archive_expense_category:hqn,expense_categories:fqn,list_expense_categories:pqn,updated_expense_category:gqn,created_expense_category:mqn,archived_expense_category:_qn,archived_expense_categories:vqn,restore_expense_category:bqn,restored_expense_category:yqn,apply_taxes:Cqn,min_to_max_users:wqn,max_users_reached:Sqn,buy_now_buttons:Eqn,landing_page:xqn,payment_type:Tqn,form:kqn,link:Iqn,fields:Lqn,dwolla:Dqn,buy_now_buttons_warning:Aqn,buy_now_buttons_disabled:Rqn,enable_buy_now_buttons_help:Nqn,changes_take_effect_immediately:Oqn,wepay_account_description:Pqn,payment_error_code:Mqn,standard_fees_apply:Fqn,limit_import_rows:Bqn,error_title:$qn,error_contact_text:Vqn,no_undo:Hqn,no_contact_selected:Wqn,no_client_selected:zqn,gateway_config_error:Uqn,payment_type_on_file:jqn,invoice_for_client:qqn,intent_not_found:Gqn,intent_not_supported:Kqn,client_not_found:Yqn,not_allowed:Qqn,bot_emailed_invoice:Xqn,bot_emailed_notify_viewed:Zqn,bot_emailed_notify_paid:Jqn,add_product_to_invoice:eGn,not_authorized:tGn,email_not_found:nGn,invalid_code:iGn,list_products:rGn,include_item_taxes_inline:oGn,created_quotes:sGn,warning:aGn,"self-update":"Update",update_invoiceninja_title:lGn,update_invoiceninja_warning:cGn,update_invoiceninja_available:uGn,update_invoiceninja_unavailable:dGn,update_invoiceninja_update_start:hGn,update_invoiceninja_download_start:fGn,create_new:pGn,toggle_navigation:gGn,toggle_history:mGn,unassigned:_Gn,task:vGn,contact_name:bGn,city_state_postal:yGn,postal_city:CGn,custom_field:wGn,account_fields:SGn,facebook_and_twitter:EGn,facebook_and_twitter_help:xGn,reseller_text:TGn,unnamed_client:kGn,day:IGn,week:LGn,month:DGn,inactive_logout:AGn,reports:RGn,total_profit:NGn,total_expenses:OGn,quote_to:PGn,limit:MGn,min_limit:FGn,max_limit:BGn,no_limit:$Gn,set_limits:VGn,enable_min:HGn,enable_max:WGn,min:zGn,max:UGn,limits_not_met:jGn,date_range:qGn,raw:GGn,raw_html:KGn,update:YGn,invoice_fields_help:QGn,new_category:XGn,restore_product:ZGn,blank:JGn,invoice_save_error:eKn,enable_recurring:tKn,disable_recurring:nKn,text:iKn,expense_will_create:rKn,expenses_will_create:oKn,created_expenses:sKn,translate_app:aKn,expense_category:lKn,go_ninja_pro:cKn,go_enterprise:uKn,upgrade_for_features:dKn,pay_annually_discount:hKn,pro_upgrade_title:fKn,pro_upgrade_feature1:pKn,pro_upgrade_feature2:gKn,enterprise_upgrade_feature1:mKn,enterprise_upgrade_feature2:_Kn,much_more:vKn,all_pro_fetaures:bKn,currency_symbol:yKn,currency_code:CKn,buy_license:wKn,apply_license:SKn,submit:EKn,white_label_license_key:xKn,invalid_white_label_license:TKn,created_by:kKn,modules:IKn,financial_year_start:LKn,authentication:DKn,checkbox:AKn,invoice_signature:RKn,show_accept_invoice_terms:NKn,show_accept_invoice_terms_help:OKn,show_accept_quote_terms:PKn,show_accept_quote_terms_help:MKn,require_invoice_signature:FKn,require_invoice_signature_help:BKn,require_quote_signature:$Kn,require_quote_signature_help:VKn,i_agree:HKn,sign_here:WKn,sign_here_ux_tip:zKn,authorization:UKn,signed:jKn,vendor_name:qKn,entity_state:GKn,client_created_at:KKn,postmark_error:YKn,project:QKn,projects:XKn,new_project:ZKn,edit_project:JKn,archive_project:eYn,list_projects:tYn,updated_project:nYn,created_project:iYn,archived_project:rYn,archived_projects:oYn,restore_project:sYn,restored_project:aYn,delete_project:lYn,deleted_project:cYn,deleted_projects:uYn,delete_expense_category:dYn,deleted_expense_category:hYn,delete_product:fYn,deleted_product:pYn,deleted_products:gYn,restored_product:mYn,update_credit:_Yn,updated_credit:vYn,edit_credit:bYn,realtime_preview:yYn,realtime_preview_help:CYn,live_preview_help:wYn,force_pdfjs_help:SYn,force_pdfjs:EYn,redirect_url:xYn,redirect_url_help:TYn,save_draft:kYn,refunded_credit_payment:IYn,keyboard_shortcuts:LYn,toggle_menu:DYn,"new_...":"New ...","list_...":"List ...",created_at:AYn,contact_us:RYn,user_guide:NYn,promo_message:OYn,discount_message:PYn,mark_paid:MYn,marked_sent_invoice:FYn,marked_sent_invoices:BYn,invoice_name:$Yn,product_will_create:VYn,contact_us_response:HYn,last_7_days:WYn,last_30_days:zYn,this_month:UYn,last_month:jYn,current_quarter:qYn,last_quarter:GYn,last_year:KYn,all_time:YYn,custom_range:QYn,url:XYn,debug:ZYn,https:JYn,require:eQn,license_expiring:tQn,security_confirmation:nQn,white_label_expired:iQn,renew_license:rQn,iphone_app_message:oQn,iphone_app:sQn,android_app:aQn,logged_in:lQn,switch_to_primary:cQn,inclusive:uQn,exclusive:dQn,postal_city_state:hQn,phantomjs_help:fQn,phantomjs_local:pQn,client_number:gQn,client_number_help:mQn,next_client_number:_Qn,generated_numbers:vQn,notes_reminder1:bQn,notes_reminder2:yQn,notes_reminder3:CQn,notes_reminder4:wQn,bcc_email:SQn,tax_quote:EQn,tax_invoice:xQn,emailed_invoices:TQn,emailed_quotes:kQn,website_url:IQn,domain:LQn,domain_help:DQn,domain_help_website:AQn,import_invoices:RQn,new_report:NQn,edit_report:OQn,columns:PQn,filters:MQn,sort_by:FQn,draft:BQn,unpaid:$Qn,aging:VQn,age:HQn,days:WQn,age_group_0:zQn,age_group_30:UQn,age_group_60:jQn,age_group_90:qQn,age_group_120:GQn,invoice_details:KQn,qty:YQn,profit_and_loss:QQn,revenue:XQn,profit:ZQn,group_when_sorted:JQn,group_dates_by:eXn,year:tXn,view_statement:nXn,statement:iXn,statement_date:rXn,mark_active:oXn,send_automatically:sXn,initial_email:aXn,invoice_not_emailed:lXn,quote_not_emailed:cXn,sent_by:uXn,recipients:dXn,save_as_default:hXn,start_of_week_help:fXn,financial_year_start_help:pXn,reports_help:gXn,this_year:mXn,ninja_tagline:_Xn,login_or_existing:vXn,sign_up_now:bXn,not_a_member_yet:yXn,login_create_an_account:CXn,invoice_from:wXn,full_name:SXn,month_year:EXn,valid_thru:xXn,product_fields:TXn,custom_product_fields_help:kXn,freq_two_months:IXn,freq_yearly:LXn,profile:DXn,industry_Construction:AXn,your_statement:RXn,statement_issued_to:NXn,statement_to:OXn,customize_options:PXn,created_payment_term:MXn,updated_payment_term:FXn,archived_payment_term:BXn,resend_invite:$Xn,credit_created_by:VXn,created_payment_and_credit:HXn,created_payment_and_credit_emailed_client:WXn,create_project:zXn,create_vendor:UXn,create_expense_category:jXn,pro_plan_reports:qXn,mark_ready:GXn,limits:KXn,fees:YXn,fee:QXn,set_limits_fees:XXn,fees_tax_help:ZXn,fees_sample:JXn,discount_sample:eZn,no_fees:tZn,gateway_fees_disclaimer:nZn,percent:iZn,location:rZn,line_item:oZn,surcharge:sZn,location_first_surcharge:aZn,location_second_surcharge:lZn,location_line_item:cZn,online_payment_surcharge:uZn,gateway_fees:dZn,fees_disabled:hZn,gateway_fees_help:fZn,gateway:pZn,gateway_fee_change_warning:gZn,fees_surcharge_help:mZn,label_and_taxes:_Zn,billable:vZn,logo_warning_too_large:bZn,logo_warning_fileinfo:yZn,logo_warning_invalid:CZn,error_refresh_page:wZn,data:SZn,imported_settings:EZn,reset_counter:xZn,next_reset:TZn,reset_counter_help:kZn,auto_bill_failed:IZn,online_payment_discount:LZn,created_new_company:DZn,fees_disabled_for_gateway:AZn,logout_and_delete:RZn,tax_rate_type_help:NZn,credit_note:OZn,credit_issued_to:PZn,credit_to:MZn,your_credit:FZn,credit_number:BZn,create_credit_note:$Zn,menu:VZn,error_incorrect_gateway_ids:HZn,purge_data:WZn,delete_data:zZn,purge_data_help:UZn,cancel_account_help:jZn,purge_successful:qZn,forbidden:GZn,purge_data_message:KZn,contact_phone:YZn,contact_email:QZn,reply_to_email:XZn,reply_to_email_help:ZZn,bcc_email_help:JZn,import_complete:eJn,confirm_account_to_import:tJn,import_started:nJn,payment_type_Venmo:iJn,"payment_type_Money Order":"Money Order",archived_products:rJn,recommend_on:oJn,recommend_off:sJn,notes_auto_billed:aJn,surcharge_label:lJn,contact_fields:cJn,custom_contact_fields_help:uJn,datatable_info:dJn,credit_total:hJn,mark_billable:fJn,billed:pJn,company_variables:gJn,client_variables:mJn,invoice_variables:_Jn,navigation_variables:vJn,custom_variables:bJn,invalid_file:yJn,add_documents_to_invoice:CJn,mark_expense_paid:wJn,white_label_license_error:SJn,plan_price:EJn,wrong_confirmation:xJn,oauth_taken:TJn,emailed_payment:kJn,email_payment:IJn,invoiceplane_import:LJn,duplicate_expense_warning:DJn,expense_link:AJn,resume_task:RJn,resumed_task:NJn,quote_design:OJn,default_design:PJn,custom_design1:MJn,custom_design2:FJn,custom_design3:BJn,empty:$Jn,load_design:VJn,accepted_card_logos:HJn,google_analytics:WJn,analytics_key:zJn,analytics_key_help:UJn,start_date_required:jJn,application_settings:qJn,database_connection:GJn,driver:KJn,host:YJn,database:QJn,test_connection:XJn,from_name:ZJn,from_address:JJn,port:eei,encryption:tei,mailgun_domain:nei,mailgun_private_key:iei,brevo_domain:rei,brevo_private_key:oei,send_test_email:sei,select_label:aei,label:lei,service:cei,update_payment_details:uei,updated_payment_details:dei,update_credit_card:hei,recurring_expenses:fei,recurring_expense:pei,new_recurring_expense:gei,edit_recurring_expense:mei,archive_recurring_expense:_ei,list_recurring_expense:vei,updated_recurring_expense:bei,created_recurring_expense:yei,archived_recurring_expense:Cei,restore_recurring_expense:wei,restored_recurring_expense:Sei,delete_recurring_expense:Eei,deleted_recurring_expense:xei,view_recurring_expense:Tei,taxes_and_fees:kei,import_failed:Iei,recurring_prefix:Lei,options:Dei,credit_number_help:Aei,next_credit_number:Rei,padding_help:Nei,import_warning_invalid_date:Oei,product_notes:Pei,app_version:Mei,ofx_version:Fei,charge_late_fee:Bei,late_fee_amount:$ei,late_fee_percent:Vei,late_fee_added:Hei,download_invoice:Wei,download_quote:zei,invoices_are_attached:Uei,downloaded_invoice:jei,downloaded_quote:qei,downloaded_invoices:Gei,downloaded_quotes:Kei,clone_expense:Yei,default_documents:Qei,send_email_to_client:Xei,refund_subject:Zei,refund_body:Jei,currency_us_dollar:eti,currency_british_pound:tti,currency_euro:nti,currency_south_african_rand:iti,currency_danish_krone:rti,currency_israeli_shekel:oti,currency_swedish_krona:sti,currency_kenyan_shilling:ati,currency_canadian_dollar:lti,currency_philippine_peso:cti,currency_indian_rupee:uti,currency_australian_dollar:dti,currency_singapore_dollar:hti,currency_norske_kroner:fti,currency_new_zealand_dollar:pti,currency_vietnamese_dong:gti,currency_swiss_franc:mti,currency_guatemalan_quetzal:_ti,currency_malaysian_ringgit:vti,currency_brazilian_real:bti,currency_thai_baht:yti,currency_nigerian_naira:Cti,currency_argentine_peso:wti,currency_bangladeshi_taka:Sti,currency_united_arab_emirates_dirham:Eti,currency_hong_kong_dollar:xti,currency_indonesian_rupiah:Tti,currency_mexican_peso:kti,currency_egyptian_pound:Iti,currency_colombian_peso:Lti,currency_west_african_franc:Dti,currency_chinese_renminbi:Ati,currency_rwandan_franc:Rti,currency_tanzanian_shilling:Nti,currency_netherlands_antillean_guilder:Oti,currency_trinidad_and_tobago_dollar:Pti,currency_east_caribbean_dollar:Mti,currency_ghanaian_cedi:Fti,currency_bulgarian_lev:Bti,currency_aruban_florin:$ti,currency_turkish_lira:Vti,currency_romanian_new_leu:Hti,currency_croatian_kuna:Wti,currency_saudi_riyal:zti,currency_japanese_yen:Uti,currency_maldivian_rufiyaa:jti,currency_costa_rican_colon:qti,currency_pakistani_rupee:Gti,currency_polish_zloty:Kti,currency_sri_lankan_rupee:Yti,currency_czech_koruna:Qti,currency_uruguayan_peso:Xti,currency_namibian_dollar:Zti,currency_tunisian_dinar:Jti,currency_russian_ruble:eni,currency_mozambican_metical:tni,currency_omani_rial:nni,currency_ukrainian_hryvnia:ini,currency_macanese_pataca:rni,currency_taiwan_new_dollar:oni,currency_dominican_peso:sni,currency_chilean_peso:ani,currency_icelandic_krona:lni,currency_papua_new_guinean_kina:cni,currency_jordanian_dinar:uni,currency_myanmar_kyat:dni,currency_peruvian_sol:hni,currency_botswana_pula:fni,currency_hungarian_forint:pni,currency_ugandan_shilling:gni,currency_barbadian_dollar:mni,currency_brunei_dollar:_ni,currency_georgian_lari:vni,currency_qatari_riyal:bni,currency_honduran_lempira:yni,currency_surinamese_dollar:Cni,currency_bahraini_dinar:wni,currency_venezuelan_bolivars:Sni,currency_south_korean_won:Eni,currency_moroccan_dirham:xni,currency_jamaican_dollar:Tni,currency_angolan_kwanza:kni,currency_haitian_gourde:Ini,currency_zambian_kwacha:Lni,currency_nepalese_rupee:Dni,currency_cfp_franc:Ani,currency_mauritian_rupee:Rni,currency_cape_verdean_escudo:Nni,currency_kuwaiti_dinar:Oni,currency_algerian_dinar:Pni,currency_macedonian_denar:Mni,currency_fijian_dollar:Fni,currency_bolivian_boliviano:Bni,currency_albanian_lek:$ni,currency_serbian_dinar:Vni,currency_lebanese_pound:Hni,currency_armenian_dram:Wni,currency_azerbaijan_manat:zni,currency_bosnia_and_herzegovina_convertible_mark:Uni,currency_belarusian_ruble:jni,currency_moldovan_leu:qni,currency_kazakhstani_tenge:Gni,currency_gibraltar_pound:Kni,currency_gambia_dalasi:Yni,currency_paraguayan_guarani:Qni,currency_malawi_kwacha:Xni,currency_zimbabwean_dollar:Zni,currency_cambodian_riel:Jni,currency_vanuatu_vatu:eii,currency_cuban_peso:tii,currency_bz_dollar:nii,currency_libyan_dinar:iii,currency_silver_troy_ounce:rii,currency_gold_troy_ounce:oii,currency_nicaraguan_córdoba:"Nicaraguan Córdoba",currency_malagasy_ariary:sii,currency_tongan_pa_anga:aii,review_app_help:lii,writing_a_review:cii,tax1:uii,tax2:dii,fee_help:hii,format_export:fii,custom1:pii,custom2:gii,contact_first_name:mii,contact_last_name:_ii,contact_custom1:vii,contact_custom2:bii,currency:yii,ofx_help:Cii,comments:wii,item_product:Sii,item_notes:Eii,item_cost:xii,item_quantity:Tii,item_tax_rate:kii,item_tax_name:Iii,item_tax1:Lii,item_tax2:Dii,delete_company:Aii,delete_company_help:Rii,delete_company_message:Nii,applied_discount:Oii,applied_free_year:Pii,contact_us_help:Mii,include_errors:Fii,include_errors_help:Bii,recent_errors:$ii,customer:Vii,customers:Hii,created_customer:Wii,created_customers:zii,purge_details:Uii,deleted_company:jii,deleted_account:qii,deleted_company_details:Gii,deleted_account_details:Kii,alipay:Yii,sofort:Qii,sepa:Xii,name_without_special_characters:Zii,enable_alipay:Jii,enable_sofort:eri,stripe_alipay_help:tri,calendar:nri,pro_plan_calendar:iri,what_are_you_working_on:rri,time_tracker:ori,refresh:sri,filter_sort:ari,no_description:lri,time_tracker_login:cri,save_or_discard:uri,discard_changes:dri,tasks_not_enabled:hri,started_task:fri,create_client:pri,download_desktop_app:gri,download_iphone_app:mri,download_android_app:_ri,time_tracker_mobile_help:vri,stopped:bri,ascending:yri,descending:Cri,sort_field:wri,sort_direction:Sri,discard:Eri,time_am:xri,time_pm:Tri,time_mins:kri,time_hr:Iri,time_hrs:Lri,clear:Dri,warn_payment_gateway:Ari,task_rate:Rri,task_rate_help:Nri,past_due:Ori,document:Pri,invoice_or_expense:Mri,invoice_pdfs:Fri,enable_sepa:Bri,enable_bitcoin:$ri,iban:Vri,sepa_authorization:Hri,recover_license:Wri,purchase:zri,recover:Uri,apply:jri,recover_white_label_header:qri,apply_white_label_header:Gri,videos:Kri,video:Yri,return_to_invoice:Qri,partial_due_date:Xri,task_fields:Zri,product_fields_help:Jri,custom_value1:eoi,custom_value2:toi,enable_two_factor:noi,enable_two_factor_help:ioi,two_factor_setup:roi,two_factor_setup_help:ooi,one_time_password:soi,set_phone_for_two_factor:aoi,enabled_two_factor:loi,add_product:coi,email_will_be_sent_on:uoi,invoice_product:doi,self_host_login:hoi,set_self_hoat_url:foi,local_storage_required:poi,your_password_reset_link:goi,subdomain_taken:moi,expense_mailbox_taken:_oi,expense_mailbox_invalid:voi,client_login:boi,converted_amount:yoi,default:"Default",shipping_address:Coi,bllling_address:woi,billing_address1:Soi,billing_address2:Eoi,billing_city:xoi,billing_state:Toi,billing_postal_code:koi,billing_country:Ioi,shipping_address1:Loi,shipping_address2:Doi,shipping_city:Aoi,shipping_state:Roi,shipping_postal_code:Noi,shipping_country:Ooi,classify:Poi,show_shipping_address_help:Moi,ship_to_billing_address:Foi,delivery_note:Boi,show_tasks_in_portal:$oi,cancel_schedule:Voi,scheduled_report:Hoi,scheduled_report_help:Woi,created_scheduled_report:zoi,deleted_scheduled_report:Uoi,scheduled_report_attached:joi,scheduled_report_error:qoi,invalid_one_time_password:Goi,apple_pay:Koi,enable_apple_pay:Yoi,requires_subdomain:Qoi,subdomain_is_set:Xoi,verification_file:Zoi,verification_file_missing:Joi,apple_pay_domain:esi,apple_pay_not_supported:tsi,optional_payment_methods:nsi,add_subscription:isi,target_url:rsi,target_url_help:osi,event:ssi,subscription_event_1:asi,subscription_event_2:lsi,subscription_event_3:csi,subscription_event_4:usi,subscription_event_5:dsi,subscription_event_6:hsi,subscription_event_7:fsi,subscription_event_8:psi,subscription_event_9:gsi,subscription_event_10:msi,subscription_event_11:_si,subscription_event_12:vsi,subscription_event_13:bsi,subscription_event_14:ysi,subscription_event_15:Csi,subscription_event_16:wsi,subscription_event_17:Ssi,subscription_event_18:Esi,subscription_event_19:xsi,subscription_event_20:Tsi,subscription_event_21:ksi,subscriptions:Isi,updated_subscription:Lsi,created_subscription:Dsi,edit_subscription:Asi,archive_subscription:Rsi,archived_subscription:Nsi,project_error_multiple_clients:Osi,invoice_project:Psi,module_recurring_invoice:Msi,module_credit:Fsi,module_quote:Bsi,module_task:$si,module_expense:Vsi,module_ticket:Hsi,reminders:Wsi,send_client_reminders:zsi,can_view_tasks:Usi,is_not_sent_reminders:jsi,promotion_footer:qsi,unable_to_delete_primary:Gsi,please_register:Ksi,processing_request:Ysi,mcrypt_warning:Qsi,edit_times:Xsi,inclusive_taxes_help:Zsi,inclusive_taxes_notice:Jsi,inclusive_taxes_warning:eai,copy_shipping:tai,copy_billing:nai,quote_has_expired:iai,empty_table_footer:rai,do_not_trust:oai,trust_for_30_days:sai,trust_forever:aai,kanban:lai,backlog:cai,ready_to_do:uai,in_progress:dai,add_status:hai,archive_status:fai,new_status:pai,convert_products:gai,convert_products_help:mai,improve_client_portal_link:_ai,budgeted_hours:vai,progress:bai,view_project:yai,summary:Cai,endless_reminder:wai,signature_on_invoice_help:Sai,signature_on_pdf:Eai,signature_on_pdf_help:xai,expired_white_label:Tai,return_to_login:kai,convert_products_tip:Iai,amount_greater_than_balance:Lai,custom_fields_tip:Dai,client_information:Aai,updated_client_details:Rai,auto:Nai,tax_amount:Oai,tax_paid:Pai,none:Mai,proposal_message_button:Fai,proposal:Bai,proposals:$ai,list_proposals:Vai,new_proposal:Hai,edit_proposal:Wai,archive_proposal:zai,delete_proposal:Uai,created_proposal:jai,updated_proposal:qai,archived_proposal:Gai,deleted_proposal:Kai,archived_proposals:Yai,deleted_proposals:Qai,restored_proposal:Xai,restore_proposal:Zai,snippet:Jai,snippets:eli,proposal_snippet:tli,proposal_snippets:nli,new_proposal_snippet:ili,edit_proposal_snippet:rli,archive_proposal_snippet:oli,delete_proposal_snippet:sli,created_proposal_snippet:ali,updated_proposal_snippet:lli,archived_proposal_snippet:cli,deleted_proposal_snippet:uli,archived_proposal_snippets:dli,deleted_proposal_snippets:hli,restored_proposal_snippet:fli,restore_proposal_snippet:pli,template:gli,templates:mli,proposal_template:_li,proposal_templates:vli,new_proposal_template:bli,edit_proposal_template:yli,archive_proposal_template:Cli,delete_proposal_template:wli,created_proposal_template:Sli,updated_proposal_template:Eli,archived_proposal_template:xli,deleted_proposal_template:Tli,archived_proposal_templates:kli,deleted_proposal_templates:Ili,restored_proposal_template:Lli,restore_proposal_template:Dli,proposal_category:Ali,proposal_categories:Rli,new_proposal_category:Nli,edit_proposal_category:Oli,archive_proposal_category:Pli,delete_proposal_category:Mli,created_proposal_category:Fli,updated_proposal_category:Bli,archived_proposal_category:$li,deleted_proposal_category:Vli,archived_proposal_categories:Hli,deleted_proposal_categories:Wli,restored_proposal_category:zli,restore_proposal_category:Uli,delete_status:jli,standard:qli,icon:Gli,proposal_not_found:Kli,create_proposal_category:Yli,clone_proposal_template:Qli,proposal_email:Xli,proposal_subject:Zli,proposal_message:Jli,emailed_proposal:eci,load_template:tci,no_assets:nci,add_image:ici,select_image:rci,upgrade_to_upload_images:oci,delete_image:sci,delete_image_help:aci,amount_variable_help:lci,taxes_are_included_help:cci,taxes_are_not_included_help:uci,change_requires_purge:dci,purging:hci,warning_local_refund:fci,email_address_changed:pci,email_address_changed_message:gci,test:mci,beta:_ci,email_history:vci,loading:bci,no_messages_found:yci,processing:Cci,reactivate:wci,reactivated_email:Sci,emails:Eci,opened:xci,bounced:Tci,total_sent:kci,total_opened:Ici,total_bounced:Lci,total_spam:Dci,platforms:Aci,email_clients:Rci,mobile:Nci,desktop:Oci,webmail:Pci,group:Mci,subgroup:Fci,unset:Bci,received_new_payment:$ci,slack_webhook_help:Vci,slack_incoming_webhooks:Hci,accept:Wci,accepted_terms:zci,invalid_url:Uci,workflow_settings:jci,auto_email_invoice:qci,auto_email_invoice_help:Gci,auto_archive_invoice:Kci,auto_archive_invoice_help:Yci,auto_archive_quote:Qci,auto_archive_quote_help:Xci,require_approve_quote:Zci,require_approve_quote_help:Jci,allow_approve_expired_quote:eui,allow_approve_expired_quote_help:tui,invoice_workflow:nui,quote_workflow:iui,client_must_be_active:rui,purge_client:oui,purged_client:sui,purge_client_warning:aui,clone_product:lui,item_details:cui,send_item_details_help:uui,view_proposal:dui,view_in_portal:hui,cookie_message:fui,got_it:pui,vendor_will_create:gui,vendors_will_create:mui,created_vendors:_ui,import_vendors:vui,company:bui,client_field:yui,contact_field:Cui,product_field:wui,task_field:Sui,project_field:Eui,expense_field:xui,vendor_field:Tui,company_field:kui,invoice_field:Iui,invoice_surcharge:Lui,custom_task_fields_help:Dui,custom_project_fields_help:Aui,custom_expense_fields_help:Rui,custom_vendor_fields_help:Nui,messages:Oui,unpaid_invoice:Pui,paid_invoice:Mui,unapproved_quote:Fui,unapproved_proposal:Bui,autofills_city_state:$ui,no_match_found:Vui,password_strength:Hui,strength_weak:Wui,strength_good:zui,strength_strong:Uui,mark:jui,updated_task_status:qui,background_image:Gui,background_image_help:Kui,proposal_editor:Yui,background:Qui,guide:Xui,gateway_fee_item:Zui,gateway_fee_description:Jui,gateway_fee_discount_description:edi,show_payments:tdi,show_aging:ndi,reference:idi,amount_paid:rdi,send_notifications_for:odi,all_invoices:sdi,my_invoices:adi,payment_reference:ldi,maximum:cdi,sort:udi,refresh_complete:ddi,please_enter_your_email:hdi,please_enter_your_password:fdi,please_enter_your_url:pdi,please_enter_a_product_key:gdi,an_error_occurred:mdi,overview:_di,copied_to_clipboard:vdi,error:bdi,could_not_launch:ydi,additional:Cdi,ok:wdi,email_is_invalid:Sdi,items:Edi,partial_deposit:xdi,add_item:Tdi,total_amount:kdi,pdf:Idi,invoice_status_id:Ldi,click_plus_to_add_item:Ddi,count_selected:Adi,dismiss:Rdi,please_select_a_date:Ndi,please_select_a_client:Odi,language:Pdi,updated_at:Mdi,please_enter_an_invoice_number:Fdi,please_enter_a_quote_number:Bdi,clients_invoices:$di,viewed:Vdi,approved:Hdi,invoice_status_1:Wdi,invoice_status_2:zdi,invoice_status_3:Udi,invoice_status_4:jdi,invoice_status_5:qdi,invoice_status_6:Gdi,marked_invoice_as_sent:Kdi,please_enter_a_client_or_contact_name:Ydi,restart_app_to_apply_change:Qdi,refresh_data:Xdi,blank_contact:Zdi,no_records_found:Jdi,industry:ehi,size:thi,net:nhi,show_tasks:ihi,email_reminders:rhi,reminder1:ohi,reminder2:shi,reminder3:ahi,send:lhi,auto_billing:chi,button:uhi,more:dhi,edit_recurring_invoice:hhi,edit_recurring_quote:fhi,quote_status:phi,please_select_an_invoice:ghi,filtered_by:mhi,payment_status:_hi,payment_status_1:vhi,payment_status_2:bhi,payment_status_3:yhi,payment_status_4:Chi,payment_status_5:whi,payment_status_6:Shi,send_receipt_to_client:Ehi,refunded:xhi,marked_quote_as_sent:Thi,custom_module_settings:khi,open:Ihi,new:"New",closed:Lhi,reopened:Dhi,priority:Ahi,last_updated:Rhi,comment:Nhi,tags:Ohi,linked_objects:Phi,low:Mhi,medium:Fhi,high:Bhi,no_due_date:$hi,assigned_to:Vhi,reply:Hhi,awaiting_reply:Whi,mark_spam:zhi,local_part:Uhi,local_part_unavailable:jhi,local_part_available:qhi,local_part_invalid:Ghi,local_part_help:Khi,from_name_help:Yhi,local_part_placeholder:Qhi,from_name_placeholder:Xhi,attachments:Zhi,client_upload:Jhi,enable_client_upload_help:efi,max_file_size_help:tfi,max_file_size:nfi,mime_types:ifi,mime_types_placeholder:rfi,mime_types_help:ofi,ticket_number_start_help:sfi,new_ticket_template_id:afi,new_ticket_autoresponder_help:lfi,update_ticket_template_id:cfi,update_ticket_autoresponder_help:ufi,close_ticket_template_id:dfi,close_ticket_autoresponder_help:hfi,default_priority:ffi,alert_new_comment_id:pfi,update_ticket_notification_list:gfi,comma_separated_values:mfi,default_agent:_fi,default_agent_help:vfi,show_agent_details:bfi,avatar:yfi,remove_avatar:Cfi,add_template:wfi,archive_ticket_template:Sfi,restore_ticket_template:Efi,archived_ticket_template:xfi,restored_ticket_template:Tfi,enter_ticket_message:kfi,show_hide_all:Ifi,subject_required:Lfi,mobile_refresh_warning:Dfi,merge:Afi,merged:Rfi,agent:Nfi,include_in_filter:Ofi,custom_client1:Pfi,custom_client2:Mfi,compare:Ffi,hosted_login:Bfi,selfhost_login:$fi,google_login:Vfi,thanks_for_patience:Hfi,legacy_mobile_app:Wfi,today:zfi,current:Ufi,previous:jfi,current_period:qfi,comparison_period:Gfi,previous_period:Kfi,previous_year:Yfi,compare_to:Qfi,last_week:Xfi,clone_to_invoice:Zfi,clone_to_quote:Jfi,convert:epi,last7_days:tpi,last30_days:npi,custom_js:ipi,adjust_fee_percent_help:rpi,show_product_notes:opi,show_product_notes_help:spi,important:api,thank_you_for_using_our_app:lpi,if_you_like_it:cpi,to_rate_it:upi,average:dpi,unapproved:hpi,authenticate_to_change_setting:fpi,locked:ppi,authenticate:gpi,please_authenticate:mpi,biometric_authentication:_pi,auto_start_tasks:vpi,budgeted:bpi,please_enter_a_name:ypi,click_plus_to_add_time:Cpi,design:wpi,password_is_too_short:Spi,failed_to_find_record:Epi,valid_until_days:xpi,valid_until_days_help:Tpi,usually_pays_in_days:kpi,requires_an_enterprise_plan:Ipi,take_picture:Lpi,upload_file:Dpi,new_document:Api,edit_document:Rpi,uploaded_document:Npi,updated_document:Opi,archived_document:Ppi,deleted_document:Mpi,restored_document:Fpi,no_history:Bpi,expense_status_1:$pi,expense_status_2:Vpi,expense_status_3:Hpi,no_record_selected:Wpi,error_unsaved_changes:zpi,thank_you_for_your_purchase:Upi,redeem:jpi,back:qpi,past_purchases:Gpi,annual_subscription:Kpi,pro_plan:Ypi,enterprise_plan:Qpi,count_users:Xpi,upgrade:Zpi,please_enter_a_first_name:Jpi,please_enter_a_last_name:egi,please_agree_to_terms_and_privacy:tgi,i_agree_to_the:ngi,terms_of_service_link:igi,privacy_policy_link:rgi,view_website:ogi,create_account:sgi,email_login:agi,late_fees:lgi,payment_number:cgi,before_due_date:ugi,after_due_date:dgi,after_invoice_date:hgi,filtered_by_user:fgi,created_user:pgi,primary_font:ggi,secondary_font:mgi,number_padding:_gi,general:vgi,surcharge_field:bgi,company_value:ygi,credit_field:Cgi,payment_field:wgi,group_field:Sgi,number_counter:Egi,number_pattern:xgi,custom_javascript:Tgi,portal_mode:kgi,attach_pdf:Igi,attach_documents:Lgi,attach_ubl:Dgi,email_style:Agi,processed:Rgi,fee_amount:Ngi,fee_percent:Ogi,fee_cap:Pgi,limits_and_fees:Mgi,credentials:Fgi,require_billing_address_help:Bgi,require_shipping_address_help:$gi,deleted_tax_rate:Vgi,restored_tax_rate:Hgi,provider:Wgi,company_gateway:zgi,company_gateways:Ugi,new_company_gateway:jgi,edit_company_gateway:qgi,created_company_gateway:Ggi,updated_company_gateway:Kgi,archived_company_gateway:Ygi,deleted_company_gateway:Qgi,restored_company_gateway:Xgi,continue_editing:Zgi,default_value:Jgi,currency_format:emi,first_day_of_the_week:tmi,first_month_of_the_year:nmi,symbol:imi,ocde:rmi,date_format:omi,datetime_format:smi,send_reminders:ami,timezone:lmi,filtered_by_group:cmi,filtered_by_invoice:umi,filtered_by_client:dmi,filtered_by_vendor:hmi,group_settings:fmi,groups:pmi,new_group:gmi,edit_group:mmi,created_group:_mi,updated_group:vmi,archived_group:bmi,deleted_group:ymi,restored_group:Cmi,upload_logo:wmi,uploaded_logo:Smi,saved_settings:Emi,device_settings:xmi,credit_cards_and_banks:Tmi,price:kmi,email_sign_up:Imi,google_sign_up:Lmi,sign_up_with_google:Dmi,long_press_multiselect:Ami,migrate_to_next_version:Rmi,migrate_intro_text:Nmi,start_the_migration:Omi,migration:Pmi,welcome_to_the_new_version:Mmi,next_step_data_download:Fmi,download_data:Bmi,continue:"Continue",company1:$mi,company2:Vmi,company3:Hmi,company4:Wmi,product1:zmi,product2:Umi,product3:jmi,product4:qmi,client1:Gmi,client2:Kmi,client3:Ymi,client4:Qmi,contact1:Xmi,contact2:Zmi,contact3:Jmi,contact4:e_i,task1:t_i,task2:n_i,task3:i_i,task4:r_i,project1:o_i,project2:s_i,project3:a_i,project4:l_i,expense1:c_i,expense2:u_i,expense3:d_i,expense4:h_i,vendor1:f_i,vendor2:p_i,vendor3:g_i,vendor4:m_i,invoice1:__i,invoice2:v_i,invoice3:b_i,invoice4:y_i,payment1:C_i,payment2:w_i,payment3:S_i,payment4:E_i,surcharge1:x_i,surcharge2:T_i,surcharge3:k_i,surcharge4:I_i,group1:L_i,group2:D_i,group3:A_i,group4:R_i,number:N_i,count:O_i,is_active:P_i,contact_last_login:M_i,contact_full_name:F_i,contact_custom_value1:B_i,contact_custom_value2:$_i,contact_custom_value3:V_i,contact_custom_value4:H_i,assigned_to_id:W_i,created_by_id:z_i,add_column:U_i,edit_columns:j_i,to_learn_about_gogle_fonts:q_i,refund_date:G_i,multiselect:K_i,verify_password:Y_i,applied:Q_i,include_recent_errors:X_i,your_message_has_been_received:Z_i,show_product_details:J_i,show_product_details_help:evi,pdf_min_requirements:tvi,adjust_fee_percent:nvi,configure_settings:ivi,about:rvi,credit_email:ovi,domain_url:svi,password_is_too_easy:avi,client_portal_tasks:lvi,client_portal_dashboard:cvi,please_enter_a_value:uvi,deleted_logo:dvi,generate_number:hvi,when_saved:fvi,when_sent:pvi,select_company:gvi,float:mvi,collapse:_vi,show_or_hide:vvi,menu_sidebar:bvi,history_sidebar:yvi,tablet:Cvi,layout:wvi,module:Svi,first_custom:Evi,second_custom:xvi,third_custom:Tvi,show_cost:kvi,show_cost_help:Ivi,show_product_quantity:Lvi,show_product_quantity_help:Dvi,show_invoice_quantity:Avi,show_invoice_quantity_help:Rvi,default_quantity:Nvi,default_quantity_help:Ovi,one_tax_rate:Pvi,two_tax_rates:Mvi,three_tax_rates:Fvi,default_tax_rate:Bvi,invoice_tax:$vi,line_item_tax:Vvi,inclusive_taxes:Hvi,invoice_tax_rates:Wvi,item_tax_rates:zvi,configure_rates:Uvi,tax_settings_rates:jvi,accent_color:qvi,comma_sparated_list:Gvi,single_line_text:Kvi,multi_line_text:Yvi,dropdown:Qvi,field_type:Xvi,recover_password_email_sent:Zvi,removed_user:Jvi,freq_three_years:ebi,military_time_help:tbi,click_here_capital:nbi,marked_invoice_as_paid:ibi,marked_invoices_as_sent:rbi,marked_invoices_as_paid:obi,activity_57:sbi,custom_value3:abi,custom_value4:lbi,email_style_custom:cbi,custom_message_dashboard:ubi,custom_message_unpaid_invoice:dbi,custom_message_paid_invoice:hbi,custom_message_unapproved_quote:fbi,lock_sent_invoices:pbi,translations:gbi,task_number_pattern:mbi,task_number_counter:_bi,expense_number_pattern:vbi,expense_number_counter:bbi,vendor_number_pattern:ybi,vendor_number_counter:Cbi,ticket_number_pattern:wbi,ticket_number_counter:Sbi,payment_number_pattern:Ebi,payment_number_counter:xbi,invoice_number_pattern:Tbi,quote_number_pattern:kbi,client_number_pattern:Ibi,client_number_counter:Lbi,credit_number_pattern:Dbi,credit_number_counter:Abi,reset_counter_date:Rbi,counter_padding:Nbi,shared_invoice_quote_counter:Obi,default_tax_name_1:Pbi,default_tax_rate_1:Mbi,default_tax_name_2:Fbi,default_tax_rate_2:Bbi,default_tax_name_3:$bi,default_tax_rate_3:Vbi,email_subject_invoice:Hbi,email_subject_quote:Wbi,email_subject_payment:zbi,switch_list_table:Ubi,client_city:jbi,client_state:qbi,client_country:Gbi,client_is_active:Kbi,client_balance:Ybi,client_address1:Qbi,client_address2:Xbi,client_shipping_address1:Zbi,client_shipping_address2:Jbi,tax_rate1:e0i,tax_rate2:t0i,tax_rate3:n0i,archived_at:i0i,has_expenses:r0i,custom_taxes1:o0i,custom_taxes2:s0i,custom_taxes3:a0i,custom_taxes4:l0i,custom_surcharge1:c0i,custom_surcharge2:u0i,custom_surcharge3:d0i,custom_surcharge4:h0i,is_deleted:f0i,vendor_city:p0i,vendor_state:g0i,vendor_country:m0i,credit_footer:_0i,credit_terms:v0i,untitled_company:b0i,added_company:y0i,supported_events:C0i,custom3:w0i,custom4:S0i,optional:E0i,license:x0i,invoice_balance:T0i,saved_design:k0i,client_details:I0i,company_address:L0i,quote_details:D0i,credit_details:A0i,product_columns:R0i,task_columns:N0i,add_field:O0i,all_events:P0i,owned:M0i,payment_success:F0i,payment_failure:B0i,quote_sent:$0i,credit_sent:V0i,invoice_viewed:H0i,quote_viewed:W0i,credit_viewed:z0i,quote_approved:U0i,receive_all_notifications:j0i,purchase_license:q0i,enable_modules:G0i,converted_quote:K0i,credit_design:Y0i,includes:Q0i,css_framework:X0i,custom_designs:Z0i,designs:J0i,new_design:eyi,edit_design:tyi,created_design:nyi,updated_design:iyi,archived_design:ryi,deleted_design:oyi,removed_design:syi,restored_design:ayi,recurring_tasks:lyi,removed_credit:cyi,latest_version:uyi,update_now:dyi,a_new_version_is_available:hyi,update_available:fyi,app_updated:pyi,integrations:gyi,tracking_id:myi,slack_webhook_url:_yi,partial_payment:vyi,partial_payment_email:byi,clone_to_credit:yyi,emailed_credit:Cyi,marked_credit_as_sent:wyi,email_subject_payment_partial:Syi,is_approved:Eyi,migration_went_wrong:xyi,cross_migration_message:Tyi,email_credit:kyi,client_email_not_set:Iyi,ledger:Lyi,view_pdf:Dyi,all_records:Ayi,owned_by_user:Ryi,credit_remaining:Nyi,use_default:Oyi,reminder_endless:Pyi,number_of_days:Myi,configure_payment_terms:Fyi,payment_term:Byi,new_payment_term:$yi,deleted_payment_term:Vyi,removed_payment_term:Hyi,restored_payment_term:Wyi,full_width_editor:zyi,full_height_filter:Uyi,email_sign_in:jyi,change:qyi,change_to_mobile_layout:Gyi,change_to_desktop_layout:Kyi,send_from_gmail:Yyi,reversed:Qyi,cancelled:Xyi,quote_amount:Zyi,hosted:Jyi,selfhosted:e1i,hide_menu:t1i,show_menu:n1i,partially_refunded:i1i,search_documents:r1i,search_designs:o1i,search_invoices:s1i,search_clients:a1i,search_products:l1i,search_quotes:c1i,search_credits:u1i,search_vendors:d1i,search_users:h1i,search_tax_rates:f1i,search_tasks:p1i,search_settings:g1i,search_projects:m1i,search_expenses:_1i,search_payments:v1i,search_groups:b1i,search_company:y1i,cancelled_invoice:C1i,cancelled_invoices:w1i,reversed_invoice:S1i,reversed_invoices:E1i,reverse:x1i,filtered_by_project:T1i,google_sign_in:k1i,activity_58:I1i,activity_59:L1i,payment_reconciliation_failure:D1i,payment_reconciliation_success:A1i,gateway_success:R1i,gateway_failure:N1i,gateway_error:O1i,email_send:P1i,email_retry_queue:M1i,failure:F1i,quota_exceeded:B1i,upstream_failure:$1i,system_logs:V1i,copy_link:H1i,welcome_to_invoice_ninja:W1i,optin:z1i,optout:U1i,auto_convert:j1i,reminder1_sent:q1i,reminder2_sent:G1i,reminder3_sent:K1i,reminder_last_sent:Y1i,pdf_page_info:Q1i,emailed_credits:X1i,view_in_stripe:Z1i,rows_per_page:J1i,apply_payment:eCi,unapplied:tCi,custom_labels:nCi,record_type:iCi,record_name:rCi,file_type:oCi,height:sCi,width:aCi,health_check:lCi,last_login_at:cCi,company_key:uCi,storefront:dCi,storefront_help:hCi,count_records_selected:fCi,count_record_selected:pCi,client_created:gCi,online_payment_email:mCi,manual_payment_email:_Ci,completed:vCi,gross:bCi,net_amount:yCi,net_balance:CCi,client_settings:wCi,selected_invoices:SCi,selected_payments:ECi,selected_quotes:xCi,selected_tasks:TCi,selected_expenses:kCi,past_due_invoices:ICi,create_payment:LCi,update_quote:DCi,update_invoice:ACi,update_client:RCi,update_vendor:NCi,create_expense:OCi,update_expense:PCi,update_task:MCi,approve_quote:FCi,when_paid:BCi,expires_on:$Ci,show_sidebar:VCi,hide_sidebar:HCi,event_type:WCi,copy:zCi,must_be_online:UCi,crons_not_enabled:jCi,api_webhooks:qCi,search_webhooks:GCi,search_webhook:KCi,webhook:YCi,webhooks:QCi,new_webhook:XCi,edit_webhook:ZCi,created_webhook:JCi,updated_webhook:ewi,archived_webhook:twi,deleted_webhook:nwi,removed_webhook:iwi,restored_webhook:rwi,search_tokens:owi,search_token:swi,new_token:awi,removed_token:lwi,restored_token:cwi,client_registration:uwi,client_registration_help:dwi,customize_and_preview:hwi,search_document:fwi,search_design:pwi,search_invoice:gwi,search_client:mwi,search_product:_wi,search_quote:vwi,search_credit:bwi,search_vendor:ywi,search_user:Cwi,search_tax_rate:wwi,search_task:Swi,search_project:Ewi,search_expense:xwi,search_payment:Twi,search_group:kwi,created_on:Iwi,"payment_status_-1":"Unapplied",lock_invoices:Lwi,show_table:Dwi,show_list:Awi,view_changes:Rwi,force_update:Nwi,force_update_help:Owi,mark_paid_help:Pwi,mark_invoiceable_help:Mwi,add_documents_to_invoice_help:Fwi,convert_currency_help:Bwi,expense_settings:$wi,clone_to_recurring:Vwi,crypto:Hwi,user_field:Wwi,variables:zwi,show_password:Uwi,hide_password:jwi,copy_error:qwi,capture_card:Gwi,auto_bill_enabled:Kwi,total_taxes:Ywi,line_taxes:Qwi,total_fields:Xwi,stopped_recurring_invoice:Zwi,started_recurring_invoice:Jwi,resumed_recurring_invoice:eSi,gateway_refund:tSi,gateway_refund_help:nSi,due_date_days:iSi,paused:rSi,day_count:oSi,first_day_of_the_month:sSi,last_day_of_the_month:aSi,use_payment_terms:lSi,endless:cSi,next_send_date:uSi,remaining_cycles:dSi,created_recurring_invoice:hSi,updated_recurring_invoice:fSi,removed_recurring_invoice:pSi,search_recurring_invoice:gSi,search_recurring_invoices:mSi,send_date:_Si,auto_bill_on:vSi,minimum_under_payment_amount:bSi,allow_over_payment:ySi,allow_over_payment_help:CSi,allow_under_payment:wSi,allow_under_payment_help:SSi,test_mode:ESi,calculated_rate:xSi,default_task_rate:TSi,clear_cache:kSi,sort_order:ISi,task_status:LSi,task_statuses:DSi,new_task_status:ASi,edit_task_status:RSi,created_task_status:NSi,archived_task_status:OSi,deleted_task_status:PSi,removed_task_status:MSi,restored_task_status:FSi,search_task_status:BSi,search_task_statuses:$Si,show_tasks_table:VSi,show_tasks_table_help:HSi,invoice_task_timelog:WSi,invoice_task_timelog_help:zSi,auto_start_tasks_help:USi,configure_statuses:jSi,task_settings:qSi,configure_categories:GSi,edit_expense_category:KSi,removed_expense_category:YSi,search_expense_category:QSi,search_expense_categories:XSi,use_available_credits:ZSi,show_option:JSi,negative_payment_error:eEi,should_be_invoiced_help:tEi,configure_gateways:nEi,payment_partial:iEi,is_running:rEi,invoice_currency_id:oEi,tax_name1:sEi,tax_name2:aEi,transaction_id:lEi,invoice_late:cEi,quote_expired:uEi,recurring_invoice_total:dEi,actions:hEi,expense_number:fEi,task_number:pEi,project_number:gEi,view_settings:mEi,company_disabled_warning:_Ei,late_invoice:vEi,expired_quote:bEi,remind_invoice:yEi,client_phone:CEi,required_fields:wEi,enabled_modules:SEi,activity_60:EEi,activity_61:xEi,activity_62:TEi,activity_63:kEi,activity_64:IEi,activity_65:LEi,activity_66:DEi,expense_category_id:AEi,view_licenses:REi,fullscreen_editor:NEi,sidebar_editor:OEi,please_type_to_confirm:PEi,purge:MEi,clone_to:FEi,clone_to_other:BEi,labels:$Ei,add_custom:VEi,payment_tax:HEi,white_label:WEi,sent_invoices_are_locked:zEi,paid_invoices_are_locked:UEi,source_code:jEi,app_platforms:qEi,archived_task_statuses:GEi,deleted_task_statuses:KEi,restored_task_statuses:YEi,deleted_expense_categories:QEi,restored_expense_categories:XEi,archived_recurring_invoices:ZEi,deleted_recurring_invoices:JEi,restored_recurring_invoices:exi,archived_webhooks:txi,deleted_webhooks:nxi,removed_webhooks:ixi,restored_webhooks:rxi,api_docs:oxi,archived_tokens:sxi,deleted_tokens:axi,restored_tokens:lxi,archived_payment_terms:cxi,deleted_payment_terms:uxi,restored_payment_terms:dxi,archived_designs:hxi,deleted_designs:fxi,restored_designs:pxi,restored_credits:gxi,archived_users:mxi,deleted_users:_xi,removed_users:vxi,restored_users:bxi,archived_tax_rates:yxi,deleted_tax_rates:Cxi,restored_tax_rates:wxi,archived_company_gateways:Sxi,deleted_company_gateways:Exi,restored_company_gateways:xxi,archived_groups:Txi,deleted_groups:kxi,restored_groups:Ixi,archived_documents:Lxi,deleted_documents:Dxi,restored_documents:Axi,restored_vendors:Rxi,restored_expenses:Nxi,restored_tasks:Oxi,restored_projects:Pxi,restored_products:Mxi,restored_clients:Fxi,restored_invoices:Bxi,restored_payments:$xi,restored_quotes:Vxi,update_app:Hxi,started_import:Wxi,duplicate_column_mapping:zxi,uses_inclusive_taxes:Uxi,is_amount_discount:jxi,map_to:qxi,first_row_as_column_names:Gxi,no_file_selected:Kxi,import_type:Yxi,draft_mode:Qxi,draft_mode_help:Xxi,show_product_discount:Zxi,show_product_discount_help:Jxi,tax_name3:eTi,debug_mode_is_enabled:tTi,debug_mode_is_enabled_help:nTi,running_tasks:iTi,recent_tasks:rTi,recent_expenses:oTi,upcoming_expenses:sTi,search_payment_term:aTi,search_payment_terms:lTi,save_and_preview:cTi,save_and_email:uTi,converted_balance:dTi,is_sent:hTi,document_upload:fTi,document_upload_help:pTi,expense_total:gTi,enter_taxes:mTi,by_rate:_Ti,by_amount:vTi,enter_amount:bTi,before_taxes:yTi,after_taxes:CTi,color:wTi,show:STi,empty_columns:ETi,project_name:xTi,counter_pattern_error:TTi,this_quarter:kTi,to_update_run:ITi,registration_url:LTi,show_product_cost:DTi,complete:ATi,next:RTi,next_step:NTi,notification_credit_sent_subject:OTi,notification_credit_viewed_subject:PTi,notification_credit_sent:MTi,notification_credit_viewed:FTi,reset_password_text:BTi,password_reset:$Ti,account_login_text:VTi,request_cancellation:HTi,delete_payment_method:WTi,about_to_delete_payment_method:zTi,action_cant_be_reversed:UTi,profile_updated_successfully:jTi,currency_ethiopian_birr:qTi,client_information_text:GTi,status_id:KTi,email_already_register:YTi,locations:QTi,freq_indefinitely:XTi,cycles_remaining:ZTi,i_understand_delete:JTi,download_files:eki,download_timeframe:tki,new_signup:nki,new_signup_text:iki,notification_payment_paid_subject:rki,notification_partial_payment_paid_subject:oki,notification_payment_paid:ski,notification_partial_payment_paid:aki,notification_bot:lki,invoice_number_placeholder:cki,entity_number_placeholder:uki,email_link_not_working:dki,display_log:hki,send_fail_logs_to_our_server:fki,setup:pki,quick_overview_statistics:gki,update_your_personal_info:mki,name_website_logo:_ki,make_sure_use_full_link:vki,personal_address:bki,enter_your_personal_address:yki,enter_your_shipping_address:Cki,list_of_invoices:wki,with_selected:Ski,invoice_still_unpaid:Eki,list_of_recurring_invoices:xki,details_of_recurring_invoice:Tki,cancellation:kki,about_cancellation:Iki,cancellation_warning:Lki,cancellation_pending:Dki,list_of_payments:Aki,payment_details:Rki,list_of_payment_invoices:Nki,list_of_payment_methods:Oki,payment_method_details:Pki,permanently_remove_payment_method:Mki,warning_action_cannot_be_reversed:Fki,confirmation:Bki,list_of_quotes:$ki,waiting_for_approval:Vki,quote_still_not_approved:Hki,list_of_credits:Wki,required_extensions:zki,php_version:Uki,writable_env_file:jki,env_not_writable:qki,minumum_php_version:Gki,satisfy_requirements:Kki,oops_issues:Yki,open_in_new_tab:Qki,complete_your_payment:Xki,authorize_for_future_use:Zki,page:Jki,per_page:eIi,of:tIi,view_credit:nIi,to_view_entity_password:iIi,showing_x_of:rIi,no_results:oIi,payment_failed_subject:sIi,payment_failed_body:aIi,register:lIi,register_label:cIi,password_confirmation:uIi,verification:dIi,complete_your_bank_account_verification:hIi,checkout_com:fIi,footer_label:pIi,credit_card_invalid:gIi,month_invalid:mIi,year_invalid:_Ii,https_required:vIi,if_you_need_help:bIi,update_password_on_confirm:yIi,bank_account_not_linked:CIi,application_settings_label:wIi,recommended_in_production:SIi,enable_only_for_development:EIi,test_pdf:xIi,checkout_authorize_label:TIi,sofort_authorize_label:kIi,node_status:IIi,npm_status:LIi,node_status_not_found:DIi,npm_status_not_found:AIi,locked_invoice:RIi,downloads:NIi,resource:OIi,document_details:PIi,hash:MIi,resources:FIi,allowed_file_types:BIi,common_codes:$Ii,payment_error_code_20087:VIi,download_selected:HIi,to_pay_invoices:WIi,add_payment_method_first:zIi,no_items_selected:UIi,payment_due:jIi,account_balance:qIi,thanks:GIi,minimum_required_payment:KIi,under_payments_disabled:YIi,over_payments_disabled:QIi,saved_at:XIi,credit_payment:ZIi,credit_subject:JIi,credit_message:e2i,payment_type_Crypto:t2i,payment_type_Credit:n2i,store_for_future_use:i2i,pay_with_credit:r2i,payment_method_saving_failed:o2i,pay_with:s2i,"n/a":"N/A",by_clicking_next_you_accept_terms:a2i,not_specified:l2i,before_proceeding_with_payment_warning:c2i,after_completing_go_back_to_previous_page:u2i,pay:d2i,instructions:h2i,notification_invoice_reminder1_sent_subject:f2i,notification_invoice_reminder2_sent_subject:p2i,notification_invoice_reminder3_sent_subject:g2i,notification_invoice_custom_sent_subject:m2i,notification_invoice_reminder_endless_sent_subject:_2i,assigned_user:v2i,setup_steps_notice:b2i,setup_phantomjs_note:y2i,minimum_payment:C2i,no_action_provided:w2i,no_payable_invoices_selected:S2i,required_payment_information:E2i,required_payment_information_more:x2i,required_client_info_save_label:T2i,notification_credit_bounced:k2i,notification_credit_bounced_subject:I2i,save_payment_method_details:L2i,new_card:D2i,new_bank_account:A2i,company_limit_reached:R2i,credits_applied_validation:N2i,credit_number_taken:O2i,credit_not_found:P2i,invoices_dont_match_client:M2i,duplicate_credits_submitted:F2i,duplicate_invoices_submitted:B2i,credit_with_no_invoice:$2i,client_id_required:V2i,expense_number_taken:H2i,invoice_number_taken:W2i,payment_id_required:z2i,unable_to_retrieve_payment:U2i,invoice_not_related_to_payment:j2i,credit_not_related_to_payment:q2i,max_refundable_invoice:G2i,refund_without_invoices:K2i,refund_without_credits:Y2i,max_refundable_credit:Q2i,project_client_do_not_match:X2i,quote_number_taken:Z2i,recurring_invoice_number_taken:J2i,user_not_associated_with_account:eLi,amounts_do_not_balance:tLi,insufficient_applied_amount_remaining:nLi,insufficient_credit_balance:iLi,one_or_more_invoices_paid:rLi,invoice_cannot_be_refunded:oLi,attempted_refund_failed:sLi,user_not_associated_with_this_account:aLi,migration_completed:lLi,migration_completed_description:cLi,api_404:uLi,large_account_update_parameter:dLi,no_backup_exists:hLi,company_user_not_found:fLi,no_credits_found:pLi,action_unavailable:gLi,no_documents_found:mLi,no_group_settings_found:_Li,access_denied:vLi,invoice_cannot_be_marked_paid:bLi,invoice_license_or_environment:yLi,route_not_available:CLi,invalid_design_object:wLi,quote_not_found:SLi,quote_unapprovable:ELi,scheduler_has_run:xLi,scheduler_has_never_run:TLi,self_update_not_available:kLi,user_detached:ILi,create_webhook_failure:LLi,payment_message_extended:DLi,online_payments_minimum_note:ALi,payment_token_not_found:RLi,vendor_address1:NLi,vendor_address2:OLi,partially_unapplied:PLi,select_a_gmail_user:MLi,list_long_press:FLi,show_actions:BLi,start_multiselect:$Li,email_sent_to_confirm_email:VLi,converted_paid_to_date:HLi,converted_credit_balance:WLi,converted_total:zLi,reply_to_name:ULi,"payment_status_-2":"Partially Unapplied",color_theme:jLi,start_migration:qLi,recurring_cancellation_request:GLi,recurring_cancellation_request_body:KLi,hello:YLi,group_documents:QLi,quote_approval_confirmation_label:XLi,migration_select_company_label:ZLi,force_migration:JLi,require_password_with_social_login:eDi,stay_logged_in:tDi,session_about_to_expire:nDi,count_hours:iDi,count_day:rDi,count_days:oDi,web_session_timeout:sDi,security_settings:aDi,resend_email:lDi,confirm_your_email_address:cDi,freshbooks:uDi,invoice2go:dDi,invoicely:hDi,waveaccounting:fDi,zoho:pDi,accounting:gDi,required_files_missing:mDi,migration_auth_label:_Di,api_secret:vDi,migration_api_secret_notice:bDi,billing_coupon_notice:yDi,use_last_email:CDi,activate_company:wDi,activate_company_help:SDi,an_error_occurred_try_again:EDi,please_first_set_a_password:xDi,changing_phone_disables_two_factor:TDi,help_translate:kDi,please_select_a_country:IDi,disabled_two_factor:LDi,connected_google:DDi,disconnected_google:ADi,delivered:RDi,spam:NDi,view_docs:ODi,enter_phone_to_enable_two_factor:PDi,send_sms:MDi,sms_code:FDi,connect_google:BDi,disconnect_google:$Di,disable_two_factor:VDi,invoice_task_datelog:HDi,invoice_task_datelog_help:WDi,promo_code:zDi,recurring_invoice_issued_to:UDi,subscription:jDi,new_subscription:qDi,deleted_subscription:GDi,removed_subscription:KDi,restored_subscription:YDi,search_subscription:QDi,search_subscriptions:XDi,subdomain_is_not_available:ZDi,connect_gmail:JDi,disconnect_gmail:eAi,connected_gmail:tAi,disconnected_gmail:nAi,update_fail_help:iAi,client_id_number:rAi,count_minutes:oAi,password_timeout:sAi,shared_invoice_credit_counter:aAi,activity_80:lAi,activity_81:cAi,activity_82:uAi,activity_83:dAi,activity_84:hAi,amount_greater_than_balance_v5:fAi,click_to_continue:pAi,notification_invoice_created_body:gAi,notification_invoice_created_subject:mAi,notification_quote_created_body:_Ai,notification_quote_created_subject:vAi,notification_credit_created_body:bAi,notification_credit_created_subject:yAi,max_companies:CAi,max_companies_desc:wAi,migration_already_completed:SAi,migration_already_completed_desc:EAi,payment_method_cannot_be_authorized_first:xAi,new_account:TAi,activity_100:kAi,activity_101:IAi,activity_102:LAi,activity_103:DAi,activity_104:AAi,new_login_detected:RAi,new_login_description:NAi,contact_details:OAi,download_backup_subject:PAi,account_passwordless_login:MAi,user_duplicate_error:FAi,user_cross_linked_error:BAi,ach_verification_notification_label:$Ai,ach_verification_notification:VAi,login_link_requested_label:HAi,login_link_requested:WAi,invoices_backup_subject:zAi,migration_failed_label:UAi,migration_failed:jAi,client_email_company_contact_label:qAi,quote_was_approved_label:GAi,quote_was_approved:KAi,company_import_failure_subject:YAi,company_import_failure_body:QAi,recurring_invoice_due_date:XAi,amount_cents:ZAi,default_payment_method_label:JAi,default_payment_method:eRi,already_default_payment_method:tRi,auto_bill_disabled:nRi,select_payment_method:iRi,login_without_password:rRi,email_sent:oRi,one_time_purchases:sRi,recurring_purchases:aRi,you_might_be_interested_in_following:lRi,quotes_with_status_sent_can_be_approved:cRi,no_quotes_available_for_download:uRi,copyright:dRi,user_created_user:hRi,company_deleted:fRi,company_deleted_body:pRi,back_to:gRi,stripe_connect_migration_title:mRi,stripe_connect_migration_desc:_Ri,email_quota_exceeded_subject:vRi,email_quota_exceeded_body:bRi,auto_bill_option:yRi,lang_Arabic:CRi,lang_Persian:wRi,lang_Latvian:SRi,expiry_date:ERi,cardholder_name:xRi,recurring_quote_number_taken:TRi,account_type:kRi,locality:IRi,checking:LRi,savings:DRi,unable_to_verify_payment_method:ARi,generic_gateway_error:RRi,my_documents:NRi,payment_method_cannot_be_preauthorized:ORi,kbc_cbc:PRi,bancontact:MRi,sepa_mandat:FRi,ideal:BRi,bank_account_holder:$Ri,aio_checkout:VRi,przelewy24:HRi,przelewy24_accept:WRi,giropay:zRi,giropay_law:URi,klarna:jRi,eps:qRi,becs:GRi,bacs:KRi,payment_type_BACS:YRi,missing_payment_method:QRi,becs_mandate:XRi,you_need_to_accept_the_terms_before_proceeding:ZRi,direct_debit:JRi,clone_to_expense:eNi,checkout:tNi,acss:nNi,invalid_amount:iNi,client_payment_failure_body:rNi,browser_pay:oNi,no_available_methods:sNi,gocardless_mandate_not_ready:aNi,payment_type_instant_bank_pay:lNi,payment_type_iDEAL:cNi,payment_type_Przelewy24:uNi,"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:dNi,payment_type_EPS:hNi,"payment_type_Direct Debit":"Direct Debit",payment_type_Bancontact:fNi,payment_type_BECS:pNi,payment_type_ACSS:gNi,gross_line_total:mNi,lang_Slovak:_Ni,normal:vNi,large:bNi,extra_large:yNi,show_pdf_preview:CNi,show_pdf_preview_help:wNi,print_pdf:SNi,remind_me:ENi,instant_bank_pay:xNi,click_selected:TNi,hide_preview:kNi,edit_record:INi,credit_is_more_than_invoice:LNi,please_set_a_password:DNi,recommend_desktop:ANi,recommend_mobile:RNi,disconnected_gateway:NNi,disconnect:ONi,add_to_invoices:PNi,bulk_download:MNi,persist_data_help:FNi,persist_ui:BNi,persist_ui_help:$Ni,client_postal_code:VNi,client_vat_number:HNi,has_tasks:WNi,registration:zNi,unauthorized_stripe_warning:UNi,update_all_records:jNi,set_default_company:qNi,updated_company:GNi,kbc:KNi,why_are_you_leaving:YNi,webhook_success:QNi,error_cross_client_tasks:XNi,error_cross_client_expenses:ZNi,app:JNi,for_best_performance:eOi,bulk_email_invoice:tOi,bulk_email_quote:nOi,bulk_email_credit:iOi,removed_recurring_expense:rOi,search_recurring_expense:oOi,search_recurring_expenses:sOi,last_sent_date:aOi,include_drafts:lOi,include_drafts_help:cOi,is_invoiced:uOi,change_plan:dOi,persist_data:hOi,customer_count:fOi,verify_customers:pOi,google_analytics_tracking_id:gOi,decimal_comma:mOi,use_comma_as_decimal_place:_Oi,select_method:vOi,select_platform:bOi,use_web_app_to_connect_gmail:yOi,expense_tax_help:COi,enable_markdown:wOi,enable_markdown_help:SOi,add_second_contact:EOi,previous_page:xOi,next_page:TOi,export_colors:kOi,import_colors:IOi,clear_all:LOi,contrast:DOi,custom_colors:AOi,colors:ROi,sidebar_active_background_color:NOi,sidebar_active_font_color:OOi,sidebar_inactive_background_color:POi,sidebar_inactive_font_color:MOi,table_alternate_row_background_color:FOi,invoice_header_background_color:BOi,invoice_header_font_color:$Oi,review_app:VOi,check_status:HOi,free_trial:WOi,free_trial_help:zOi,free_trial_ends_in_days:UOi,free_trial_ends_today:jOi,change_email:qOi,client_portal_domain_hint:GOi,tasks_shown_in_portal:KOi,uninvoiced:YOi,subdomain_guide:QOi,send_time:XOi,import_settings:ZOi,json_file_missing:JOi,json_option_missing:ePi,json:tPi,no_payment_types_enabled:nPi,wait_for_data:iPi,net_total:rPi,has_taxes:oPi,import_customers:sPi,imported_customers:aPi,login_success:lPi,login_failure:cPi,exported_data:uPi,include_deleted_clients:dPi,include_deleted_clients_help:hPi,step_1_sign_in:fPi,step_2_authorize:pPi,account_id:gPi,migration_not_yet_completed:mPi,show_task_end_date:_Pi,show_task_end_date_help:vPi,gateway_setup:bPi,preview_sidebar:yPi,years_data_shown:CPi,ended_all_sessions:wPi,end_all_sessions:SPi,count_session:EPi,count_sessions:xPi,invoice_created:TPi,quote_created:kPi,credit_created:IPi,enterprise:LPi,invoice_item:DPi,quote_item:APi,order:RPi,search_kanban:NPi,search_kanbans:OPi,move_top:PPi,move_up:MPi,move_down:FPi,move_bottom:BPi,body_variable_missing:$Pi,add_body_variable_message:VPi,view_date_formats:HPi,is_viewed:WPi,letter:zPi,legal:UPi,page_layout:jPi,portrait:qPi,landscape:GPi,owner_upgrade_to_paid_plan:KPi,upgrade_to_paid_plan:YPi,invoice_payment_terms:QPi,quote_valid_until:XPi,no_headers:ZPi,add_header:JPi,remove_header:eMi,return_url:tMi,rest_method:nMi,header_key:iMi,header_value:rMi,recurring_products:oMi,promo_discount:sMi,allow_cancellation:aMi,per_seat_enabled:lMi,max_seats_limit:cMi,trial_enabled:uMi,trial_duration:dMi,allow_query_overrides:hMi,allow_plan_changes:fMi,plan_map:pMi,refund_period:gMi,webhook_configuration:mMi,purchase_page:_Mi,email_bounced:vMi,email_spam_complaint:bMi,email_delivery:yMi,webhook_response:CMi,pdf_response:wMi,authentication_failure:SMi,pdf_failed:EMi,pdf_success:xMi,modified:TMi,html_mode:kMi,html_mode_help:IMi,status_color_theme:LMi,load_color_theme:DMi,lang_Estonian:AMi,marked_credit_as_paid:RMi,marked_credits_as_paid:NMi,wait_for_loading:OMi,wait_for_saving:PMi,html_preview_warning:MMi,remaining:FMi,invoice_paid:BMi,activity_120:$Mi,activity_121:VMi,activity_122:HMi,activity_123:WMi,activity_124:zMi,fpx:UMi,to_view_entity_set_password:jMi,unsubscribe:qMi,unsubscribed:GMi,unsubscribed_text:KMi,client_shipping_state:YMi,client_shipping_city:QMi,client_shipping_postal_code:XMi,client_shipping_country:ZMi,load_pdf:JMi,start_free_trial:e4i,start_free_trial_message:t4i,due_on_receipt:n4i,is_paid:i4i,age_group_paid:r4i,id:o4i,convert_to:s4i,client_currency:a4i,company_currency:l4i,custom_emails_disabled_help:c4i,upgrade_to_add_company:u4i,file_saved_in_downloads_folder:d4i,small:h4i,quotes_backup_subject:f4i,credits_backup_subject:p4i,document_download_subject:g4i,reminder_message:m4i,gmail_credentials_invalid_subject:_4i,gmail_credentials_invalid_body:v4i,total_columns:b4i,view_task:y4i,cancel_invoice:C4i,changed_status:w4i,change_status:S4i,enable_touch_events:E4i,enable_touch_events_help:x4i,after_saving:T4i,view_record:k4i,enable_email_markdown:I4i,enable_email_markdown_help:L4i,enable_pdf_markdown:D4i,json_help:A4i,release_notes:R4i,upgrade_to_view_reports:N4i,started_tasks:O4i,stopped_tasks:P4i,approved_quote:M4i,approved_quotes:F4i,client_website:B4i,invalid_time:$4i,signed_in_as:V4i,total_results:H4i,restore_company_gateway:W4i,archive_company_gateway:z4i,delete_company_gateway:U4i,exchange_currency:j4i,tax_amount1:q4i,tax_amount2:G4i,tax_amount3:K4i,update_project:Y4i,auto_archive_invoice_cancelled:Q4i,auto_archive_invoice_cancelled_help:X4i,no_invoices_found:Z4i,created_record:J4i,auto_archive_paid_invoices:e3i,auto_archive_paid_invoices_help:t3i,auto_archive_cancelled_invoices:n3i,auto_archive_cancelled_invoices_help:i3i,alternate_pdf_viewer:r3i,alternate_pdf_viewer_help:o3i,currency_cayman_island_dollar:s3i,download_report_description:a3i,left:l3i,right:c3i,center:u3i,page_numbering:d3i,page_numbering_alignment:h3i,invoice_sent_notification_label:f3i,show_product_description:p3i,show_product_description_help:g3i,invoice_items:m3i,quote_items:_3i,profitloss:v3i,import_format:b3i,export_format:y3i,export_type:C3i,stop_on_unpaid:w3i,stop_on_unpaid_help:S3i,use_quote_terms:E3i,use_quote_terms_help:x3i,add_country:T3i,enable_tooltips:k3i,enable_tooltips_help:I3i,multiple_client_error:L3i,login_label:D3i,purchase_order:A3i,purchase_order_number:R3i,purchase_order_number_short:N3i,inventory_notification_subject:O3i,inventory_notification_body:P3i,activity_130:M3i,activity_131:F3i,activity_132:B3i,activity_133:$3i,activity_134:V3i,activity_135:H3i,activity_136:W3i,purchase_order_subject:z3i,purchase_order_message:U3i,view_purchase_order:j3i,purchase_orders_backup_subject:q3i,notification_purchase_order_viewed_subject:G3i,notification_purchase_order_viewed:K3i,purchase_order_date:Y3i,purchase_orders:Q3i,purchase_order_number_placeholder:X3i,accepted:Z3i,activity_137:J3i,vendor_information:e5i,notification_purchase_order_accepted_subject:t5i,notification_purchase_order_accepted:n5i,amount_received:i5i,purchase_order_already_expensed:r5i,convert_to_expense:o5i,add_to_inventory:s5i,added_purchase_order_to_inventory:a5i,added_purchase_orders_to_inventory:l5i,client_document_upload:c5i,vendor_document_upload:u5i,vendor_document_upload_help:d5i,are_you_enjoying_the_app:h5i,yes_its_great:f5i,not_so_much:p5i,would_you_rate_it:g5i,would_you_tell_us_more:m5i,sure_happy_to:_5i,no_not_now:v5i,add:b5i,last_sent_template:y5i,enable_flexible_search:C5i,enable_flexible_search_help:w5i,vendor_details:S5i,purchase_order_details:E5i,qr_iban:x5i,besr_id:T5i,clone_to_purchase_order:k5i,vendor_email_not_set:I5i,bulk_send_email:L5i,marked_purchase_order_as_sent:D5i,marked_purchase_orders_as_sent:A5i,accepted_purchase_order:R5i,accepted_purchase_orders:N5i,cancelled_purchase_order:O5i,cancelled_purchase_orders:P5i,please_select_a_vendor:M5i,purchase_order_total:F5i,email_purchase_order:B5i,bulk_email_purchase_order:$5i,disconnected_email:V5i,connect_email:H5i,disconnect_email:W5i,use_web_app_to_connect_microsoft:z5i,email_provider:U5i,connect_microsoft:j5i,disconnect_microsoft:q5i,connected_microsoft:G5i,disconnected_microsoft:K5i,microsoft_sign_in:Y5i,microsoft_sign_up:Q5i,emailed_purchase_order:X5i,emailed_purchase_orders:Z5i,enable_react_app:J5i,purchase_order_design:eFi,purchase_order_terms:tFi,purchase_order_footer:nFi,require_purchase_order_signature:iFi,require_purchase_order_signature_help:rFi,new_purchase_order:oFi,edit_purchase_order:sFi,created_purchase_order:aFi,updated_purchase_order:lFi,archived_purchase_order:cFi,deleted_purchase_order:uFi,removed_purchase_order:dFi,restored_purchase_order:hFi,search_purchase_order:fFi,search_purchase_orders:pFi,login_url:gFi,enable_applying_payments:mFi,enable_applying_payments_help:_Fi,stock_quantity:vFi,notification_threshold:bFi,track_inventory:yFi,track_inventory_help:CFi,stock_notifications:wFi,stock_notifications_help:SFi,vat:EFi,view_map:xFi,set_default_design:TFi,purchase_order_issued_to:kFi,archive_task_status:IFi,delete_task_status:LFi,restore_task_status:DFi,lang_Hebrew:AFi,price_change_accepted:RFi,price_change_failed:NFi,restore_purchases:OFi,activate:PFi,connect_apple:MFi,disconnect_apple:FFi,disconnected_apple:BFi,send_now:$Fi,received:VFi,converted_to_expense:HFi,converted_to_expenses:WFi,entity_removed:zFi,entity_removed_title:UFi,field:jFi,period:qFi,fields_per_row:GFi,total_active_invoices:KFi,total_outstanding_invoices:YFi,total_completed_payments:QFi,total_refunded_payments:XFi,total_active_quotes:ZFi,total_approved_quotes:JFi,total_unapproved_quotes:e6i,total_logged_tasks:t6i,total_invoiced_tasks:n6i,total_paid_tasks:i6i,total_logged_expenses:r6i,total_pending_expenses:o6i,total_invoiced_expenses:s6i,total_invoice_paid_expenses:a6i,vendor_portal:l6i,send_code:c6i,save_to_upload_documents:u6i,expense_tax_rates:d6i,invoice_item_tax_rates:h6i,verified_phone_number:f6i,code_was_sent:p6i,resend:g6i,verify:m6i,enter_phone_number:_6i,invalid_phone_number:v6i,verify_phone_number:b6i,verify_phone_number_help:y6i,merged_clients:C6i,merge_into:w6i,php81_required:S6i,bulk_email_purchase_orders:E6i,bulk_email_invoices:x6i,bulk_email_quotes:T6i,bulk_email_credits:k6i,archive_purchase_order:I6i,restore_purchase_order:L6i,delete_purchase_order:D6i,connect:A6i,mark_paid_payment_email:R6i,convert_to_project:N6i,client_email:O6i,invoice_task_project:P6i,invoice_task_project_help:M6i,bulk_action:F6i,phone_validation_error:B6i,transaction:$6i,disable_2fa:V6i,change_number:H6i,resend_code:W6i,base_type:z6i,category_type:U6i,bank_transaction:j6i,bulk_print:q6i,vendor_postal_code:G6i,preview_location:K6i,bottom:Y6i,side:Q6i,pdf_preview:X6i,long_press_to_select:Z6i,purchase_order_item:J6i,would_you_rate_the_app:eBi,include_deleted:tBi,include_deleted_help:nBi,due_on:iBi,browser_pdf_viewer:rBi,browser_pdf_viewer_help:oBi,converted_transactions:sBi,default_category:aBi,connect_accounts:lBi,manage_rules:cBi,search_category:uBi,search_categories:dBi,min_amount:hBi,max_amount:fBi,converted_transaction:pBi,convert_to_payment:gBi,deposit:mBi,withdrawal:_Bi,deposits:vBi,withdrawals:bBi,matched:yBi,unmatched:CBi,create_credit:wBi,transactions:SBi,new_transaction:EBi,edit_transaction:xBi,created_transaction:TBi,updated_transaction:kBi,archived_transaction:IBi,deleted_transaction:LBi,removed_transaction:DBi,restored_transaction:ABi,search_transaction:RBi,search_transactions:NBi,deleted_bank_account:OBi,removed_bank_account:PBi,restored_bank_account:MBi,search_bank_account:FBi,search_bank_accounts:BBi,code_was_sent_to:$Bi,verify_phone_number_2fa_help:VBi,enable_applying_payments_later:HBi,line_item_tax_rates:WBi,show_tasks_in_client_portal:zBi,notification_quote_expired_subject:UBi,notification_quote_expired:jBi,auto_sync:qBi,refresh_accounts:GBi,upgrade_to_connect_bank_account:KBi,click_here_to_connect_bank_account:YBi,include_tax:QBi,email_template_change:XBi,task_update_authorization_error:ZBi,cash_vs_accrual:JBi,cash_vs_accrual_help:e8i,expense_paid_report:t8i,expense_paid_report_help:n8i,online_payment_email_help:i8i,manual_payment_email_help:r8i,mark_paid_payment_email_help:o8i,linked_transaction:s8i,link_payment:a8i,link_expense:l8i,lock_invoiced_tasks:c8i,lock_invoiced_tasks_help:u8i,registration_required_help:d8i,use_inventory_management:h8i,use_inventory_management_help:f8i,optional_products:p8i,optional_recurring_products:g8i,convert_matched:m8i,auto_billed_invoice:_8i,auto_billed_invoices:v8i,operator:b8i,value:y8i,is:C8i,contains:w8i,starts_with:S8i,is_empty:E8i,add_rule:x8i,match_all_rules:T8i,match_all_rules_help:k8i,auto_convert_help:I8i,rules:L8i,transaction_rule:D8i,transaction_rules:A8i,new_transaction_rule:R8i,edit_transaction_rule:N8i,created_transaction_rule:O8i,updated_transaction_rule:P8i,archived_transaction_rule:M8i,deleted_transaction_rule:F8i,removed_transaction_rule:B8i,restored_transaction_rule:$8i,search_transaction_rule:V8i,search_transaction_rules:H8i,"payment_type_Interac E-Transfer":"Interac E-Transfer",delete_bank_account:W8i,archive_transaction:z8i,delete_transaction:U8i,otp_code_message:j8i,otp_code_subject:q8i,otp_code_body:G8i,delete_tax_rate:K8i,restore_tax_rate:Y8i,company_backup_file:Q8i,company_backup_file_help:X8i,backup_restore:Z8i,export_company:J8i,backup:e9i,notification_purchase_order_created_body:t9i,notification_purchase_order_created_subject:n9i,notification_purchase_order_sent_subject:i9i,notification_purchase_order_sent:r9i,subscription_blocked:o9i,subscription_blocked_title:s9i,purchase_order_created:a9i,purchase_order_sent:l9i,purchase_order_viewed:c9i,purchase_order_accepted:u9i,credit_payment_error:d9i,convert_payment_currency_help:h9i,convert_expense_currency_help:f9i,matomo_url:p9i,matomo_id:g9i,action_add_to_invoice:m9i,danger_zone:_9i,import_completed:v9i,client_statement_body:b9i,email_queued:y9i,clone_to_recurring_invoice:C9i,inventory_threshold:w9i,emailed_statement:S9i,show_email_footer:E9i,invoice_task_hours:x9i,invoice_task_hours_help:T9i,auto_bill_standard_invoices:k9i,auto_bill_recurring_invoices:I9i,email_alignment:L9i,pdf_preview_location:D9i,mailgun:A9i,brevo:R9i,postmark:N9i,microsoft:O9i,click_plus_to_create_record:P9i,last365_days:M9i,import_design:F9i,imported_design:B9i,invalid_design:$9i,setup_wizard_logo:V9i,installed_version:H9i,notify_vendor_when_paid:W9i,notify_vendor_when_paid_help:z9i,update_payment:U9i,markup:j9i,unlock_pro:q9i,upgrade_to_paid_plan_to_schedule:G9i,next_run:K9i,all_clients:Y9i,show_aging_table:Q9i,show_payments_table:X9i,only_clients_with_invoices:Z9i,email_statement:J9i,once:e7i,schedules:t7i,new_schedule:n7i,edit_schedule:i7i,created_schedule:r7i,updated_schedule:o7i,archived_schedule:s7i,deleted_schedule:a7i,removed_schedule:l7i,restored_schedule:c7i,search_schedule:u7i,search_schedules:d7i,update_product:h7i,create_purchase_order:f7i,update_purchase_order:p7i,sent_invoice:g7i,sent_quote:m7i,sent_credit:_7i,sent_purchase_order:v7i,image_url:b7i,max_quantity:y7i,test_url:C7i,auto_bill_help_off:w7i,auto_bill_help_optin:S7i,auto_bill_help_optout:E7i,auto_bill_help_always:x7i,view_all:T7i,edit_all:k7i,accept_purchase_order_number:I7i,accept_purchase_order_number_help:L7i,from_email:D7i,show_preview:A7i,show_paid_stamp:R7i,show_shipping_address:N7i,no_documents_to_download:O7i,pixels:P7i,logo_size:M7i,failed:F7i,client_contacts:B7i,sync_from:$7i,gateway_payment_text:V7i,gateway_payment_text_no_invoice:H7i,click_to_variables:W7i,ship_to:z7i,stripe_direct_debit_details:U7i,branch_name:j7i,branch_code:q7i,bank_name:G7i,bank_code:K7i,bic:Y7i,change_plan_description:Q7i,add_company_logo:X7i,add_stripe:Z7i,invalid_coupon:J7i,no_assigned_tasks:e$i,authorization_failure:t$i,authorization_sms_failure:n$i,white_label_body:i$i,payment_type_Klarna:r$i,"payment_type_Interac E Transfer":"Interac E Transfer",xinvoice_payable:o$i,xinvoice_no_buyers_reference:s$i,xinvoice_online_payment:a$i,pre_payment:l$i,number_of_payments:c$i,number_of_payments_helper:u$i,pre_payment_indefinitely:d$i,notification_payment_emailed:h$i,notification_payment_emailed_subject:f$i,record_not_found:p$i,minimum_payment_amount:g$i,client_initiated_payments:m$i,client_initiated_payments_help:_$i,share_invoice_quote_columns:v$i,cc_email:b$i,payment_balance:y$i,view_report_permission:C$i,activity_138:w$i,one_time_products:S$i,optional_one_time_products:E$i,required:x$i,hidden:T$i,payment_links:k$i,payment_link:I$i,new_payment_link:L$i,edit_payment_link:D$i,created_payment_link:A$i,updated_payment_link:R$i,archived_payment_link:N$i,deleted_payment_link:O$i,removed_payment_link:P$i,restored_payment_link:M$i,search_payment_link:F$i,search_payment_links:B$i,increase_prices:$$i,update_prices:V$i,incresed_prices:H$i,updated_prices:W$i,api_token:z$i,api_key:U$i,endpoint:j$i,not_billable:q$i,allow_billable_task_items:G$i,allow_billable_task_items_help:K$i,show_task_item_description:Y$i,show_task_item_description_help:Q$i,email_record:X$i,invoice_product_columns:Z$i,quote_product_columns:J$i,vendors:eVi,product_sales:tVi,user_sales_report_header:nVi,client_balance_report:iVi,client_sales_report:rVi,user_sales_report:oVi,aged_receivable_detailed_report:sVi,aged_receivable_summary_report:aVi,taxable_amount:lVi,tax_summary:cVi,oauth_mail:uVi,preferences:dVi,analytics:hVi,reduced_rate:fVi,tax_all:pVi,tax_selected:gVi,version:mVi,seller_subregion:_Vi,calculate_taxes:vVi,calculate_taxes_help:bVi,link_expenses:yVi,converted_client_balance:CVi,converted_payment_balance:wVi,total_hours:SVi,date_picker_hint:EVi,app_help_link:xVi,here:TVi,"industry_Restaurant & Catering":"Restaurant & Catering",show_credits_table:kVi,manual_payment:IVi,tax_summary_report:LVi,tax_category:DVi,physical_goods:AVi,digital_products:RVi,services:NVi,shipping:OVi,tax_exempt:PVi,late_fee_added_locked_invoice:MVi,lang_Khmer:FVi,routing_id:BVi,enable_e_invoice:$Vi,e_invoice_type:VVi,reduced_tax:HVi,override_tax:WVi,zero_rated:zVi,reverse_tax:UVi,updated_tax_category:jVi,updated_tax_categories:qVi,set_tax_category:GVi,payment_manual:KVi,expense_payment_type:YVi,"payment_type_Cash App":"Cash App",rename:QVi,renamed_document:XVi,e_invoice:ZVi,light_dark_mode:JVi,activities:eHi,recent_transactions:tHi,country_Palestine:nHi,country_Taiwan:iHi,duties:rHi,order_number:oHi,order_id:sHi,total_invoices_outstanding:aHi,recent_activity:lHi,enable_auto_bill:cHi,email_count_invoices:uHi,invoice_task_item_description:dHi,invoice_task_item_description_help:hHi,next_send_time:fHi,uploaded_certificate:pHi,certificate_set:gHi,certificate_not_set:mHi,passphrase_set:_Hi,passphrase_not_set:vHi,upload_certificate:bHi,certificate_passphrase:yHi,valid_vat_number:CHi,react_notification_link:wHi,react_notification_link_help:SHi,show_task_billable:EHi,credit_item:xHi,drop_file_here:THi,files:kHi,camera:IHi,gallery:LHi,project_location:DHi,add_gateway_help_message:AHi,lang_Hungarian:RHi,use_mobile_to_manage_plan:NHi,item_tax3:OHi,item_tax_rate1:PHi,item_tax_rate2:MHi,item_tax_rate3:FHi,buy_price:BHi,country_Macedonia:$Hi,admin_initiated_payments:VHi,admin_initiated_payments_help:HHi,paid_date:WHi,downloaded_entities:zHi,"lang_French - Swiss":"French - Swiss",currency_swazi_lilangeni:UHi,income:jHi,amount_received_help:qHi,vendor_phone:GHi,mercado_pago:KHi,mybank:YHi,paypal_paylater:QHi,district:XHi,region:ZHi,county:JHi,tax_details:eWi,activity_10_online:tWi,activity_10_manual:nWi,default_payment_type:iWi,number_precision:rWi,number_precision_help:oWi,is_tax_exempt:sWi,drop_files_here:aWi,upload_files:lWi,download_e_invoice:cWi,download_e_credit:uWi,download_e_quote:dWi,triangular_tax_info:hWi,intracommunity_tax_info:fWi,reverse_tax_info:pWi,currency_nicaraguan_cordoba:gWi,public:"Public",private:"Private",image:mWi,other:_Wi,linked_to:vWi,file_saved_in_path:bWi,unlinked_transactions:yWi,unlinked_transaction:CWi,view_dashboard_permission:wWi,marked_sent_credits:SWi,show_document_preview:EWi,cash_accounting:xWi,click_or_drop_files_here:TWi,set_public:kWi,set_private:IWi,individual:LWi,business:DWi,partnership:AWi,trust:RWi,charity:NWi,government:OWi,in_stock_quantity:PWi,vendor_contact:MWi,expense_status_4:FWi,expense_status_5:BWi,ziptax_help:$Wi,cache_data:VWi,unknown:HWi,webhook_failure:WWi,email_opened:zWi,email_delivered:UWi,log:jWi,classification:qWi,stock_quantity_number:GWi,upcoming:KWi,client_contact:YWi,uncategorized:QWi,login_notification:XWi,login_notification_help:ZWi,payment_refund_receipt:JWi,payment_receipt:ezi,load_template_description:tzi,run_template:nzi,statement_design:izi,delivery_note_design:rzi,payment_receipt_design:ozi,payment_refund_design:szi,task_extension_banner:azi,watch_video:lzi,view_extension:czi,reactivate_email:uzi,email_reactivated:dzi,template_help:hzi,quarter:fzi,item_description:pzi,task_item:gzi,record_state:mzi,save_files_to_this_folder:_zi,downloads_folder:vzi,total_invoiced_quotes:bzi,total_invoice_paid_quotes:yzi,downloads_folder_does_not_exist:Czi,user_logged_in_notification:wzi,user_logged_in_notification_help:Szi,payment_email_all_contacts:Ezi,payment_email_all_contacts_help:xzi,add_line:Tzi,activity_139:kzi,vendor_notification_subject:Izi,vendor_notification_body:Lzi,receipt:Dzi,charges:Azi,email_report:Rzi,"payment_type_Pay Later":"Pay Later",payment_type_credit:Nzi,payment_type_debit:Ozi,send_emails_to:Pzi,primary_contact:Mzi,all_contacts:Fzi,insert_below:Bzi,nordigen_handler_subtitle:$zi,nordigen_handler_error_heading_unknown:Vzi,nordigen_handler_error_contents_unknown:Hzi,nordigen_handler_error_heading_token_invalid:Wzi,nordigen_handler_error_contents_token_invalid:zzi,nordigen_handler_error_heading_account_config_invalid:Uzi,nordigen_handler_error_contents_account_config_invalid:jzi,nordigen_handler_error_heading_not_available:qzi,nordigen_handler_error_contents_not_available:Gzi,nordigen_handler_error_heading_institution_invalid:Kzi,nordigen_handler_error_contents_institution_invalid:Yzi,nordigen_handler_error_heading_ref_invalid:Qzi,nordigen_handler_error_contents_ref_invalid:Xzi,nordigen_handler_error_heading_not_found:Zzi,nordigen_handler_error_contents_not_found:Jzi,nordigen_handler_error_heading_requisition_invalid_status:eUi,nordigen_handler_error_contents_requisition_invalid_status:tUi,nordigen_handler_error_heading_requisition_no_accounts:nUi,nordigen_handler_error_contents_requisition_no_accounts:iUi,nordigen_handler_restart:rUi,nordigen_handler_return:oUi,lang_Lao:sUi,currency_lao_kip:aUi,yodlee_regions:lUi,nordigen_regions:cUi,select_provider:uUi,nordigen_requisition_subject:dUi,nordigen_requisition_body:hUi,participant:fUi,participant_name:pUi,client_unsubscribed:gUi,client_unsubscribed_help:mUi,resubscribe:_Ui,subscribe:vUi,subscribe_help:bUi,unsubscribe_help:yUi,notification_purchase_order_bounced:CUi,notification_purchase_order_bounced_subject:wUi,show_pdfhtml_on_mobile:SUi,show_pdfhtml_on_mobile_help:EUi,please_select_an_invoice_or_credit:xUi,mobile_version:TUi,venmo:kUi,my_bank:IUi,pay_later:LUi,local_domain:DUi,verify_peer:AUi,nordigen_help:RUi,ar_detailed:NUi,ar_summary:OUi,client_sales:PUi,user_sales:MUi,iframe_url:FUi,user_unsubscribed:BUi,out_of_stock:$Ui,step_dependency_fail:VUi,step_dependency_order_fail:HUi,step_authentication_fail:WUi,"auth.login":"Login","auth.login-or-register":"Login or Register","auth.register":"Register",cart:zUi,methods:UUi,rff:jUi,add_step:qUi,steps:GUi,steps_order_help:KUi,other_steps:YUi,use_available_payments:QUi,test_email_sent:XUi,gateway_type:ZUi,save_template_body:JUi,save_as_template:eji,checkout_only_for_existing_customers:tji,checkout_only_for_new_customers:nji,auto_bill_standard_invoices_help:iji,auto_bill_on_help:rji,use_available_credits_help:oji,use_unapplied_payments:sji,use_unapplied_payments_help:aji,payment_terms_help:lji,payment_type_help:cji,quote_valid_until_help:uji,expense_payment_type_help:dji,paylater:hji,payment_provider:fji,select_email_provider:pji,purchase_order_items:gji,csv_rows_length:mji,accept_payments_online:_ji,all_payment_gateways:vji,product_cost:bji,duration_words:yji,upcoming_recurring_invoices:Cji,shipping_country_id:wji,show_table_footer:Sji,show_table_footer_help:Eji,total_invoices:xji,add_to_group:Tji,check_credentials:kji,valid_credentials:Iji,e_quote:Lji,e_credit:Dji,e_purchase_order:Aji,e_quote_type:Rji,unlock_unlimited_clients:Nji,download_e_purchase_order:Oji,flutter_web_warning:Pji,rappen_rounding:Mji,rappen_rounding_help:Fji,assign_group:Bji,paypal_advanced_cards:$ji,local_domain_help:Vji,port_help:Hji,host_help:Wji,always_show_required_fields:zji,always_show_required_fields_help:Uji,advanced_cards:jji,activity_140:qji,invoice_net_amount:Gji,round_to_minutes:Kji,"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:Yji,round_tasks_help:Qji,direction:Xji,round_up:Zji,round_down:Jji,task_round_to_nearest:eqi,task_round_to_nearest_help:tqi,bulk_updated:nqi,bulk_update:iqi,calculate:rqi,sum:oqi,money:sqi,web_app:aqi,desktop_app:lqi,disconnected:cqi,reconnect:uqi,e_invoice_settings:dqi,btcpay_refund_subject:hqi,btcpay_refund_body:fqi,currency_mauritanian_ouguiya:pqi,currency_bhutan_ngultrum:gqi,end_of_month:mqi,merge_e_invoice_to_pdf:_qi,task_assigned_subject:vqi,task_assigned_body:bqi,activity_141:yqi,quote_reminder_subject:Cqi,quote_reminder_message:wqi,quote_reminder1:Sqi,before_valid_until_date:Eqi,after_valid_until_date:xqi,after_quote_date:Tqi,remind_quote:kqi,tax_currency_mismatch:Iqi,edocument_import_already_exists:Lqi,before_valid_until:Dqi,after_valid_until:Aqi,task_assigned_notification:Rqi,task_assigned_notification_help:Nqi,invoices_locked_end_of_month:Oqi,referral_url:Pqi,add_comment:Mqi,added_comment:Fqi,tickets:Bqi,assigned_group:$qi,merge_to_pdf:Vqi,latest_requires_php_version:Hqi,auto_expand_product_table_notes:Wqi,auto_expand_product_table_notes_help:zqi,institution_number:Uqi,transit_number:jqi,personal:qqi,address_information:Gqi,enter_the_information_for_the_bank_account:Kqi,account_holder_information:Yqi,enter_information_for_the_account_holder:Qqi,customer_type:Xqi,process_date:Zqi,forever_free:Jqi,comments_only:eGi,payment_balance_on_file:tGi,ubl_email_attachment_help:nGi,stop_task_to_add_task_entry:iGi,xml_file:rGi,one_page_checkout:oGi,one_page_checkout_help:sGi,applies_to:aGi,accept_purchase_order:lGi,round_to_seconds:cGi,activity_142:uGi,activity_143:dGi,activity_144:hGi,activity_145:fGi,payment_failed:pGi,ssl_host_override:gGi,upload_logo_short:mGi,country_Melilla:_Gi,country_Ceuta:vGi,"country_Canary Islands":"Canary Islands",lang_Vietnamese:bGi,invoice_status_changed:yGi,no_unread_notifications:CGi,how_to_import_data:wGi,download_example_file:SGi,expense_mailbox:EGi,expense_mailbox_help:xGi,expense_mailbox_active:TGi,expense_mailbox_active_help:kGi,inbound_mailbox_allow_company_users:IGi,inbound_mailbox_allow_company_users_help:LGi,inbound_mailbox_allow_vendors:DGi,inbound_mailbox_allow_vendors_help:AGi,inbound_mailbox_allow_clients:RGi,inbound_mailbox_allow_clients_help:NGi,inbound_mailbox_whitelist:OGi,inbound_mailbox_whitelist_help:PGi,inbound_mailbox_blacklist:MGi,inbound_mailbox_blacklist_help:FGi,inbound_mailbox_allow_unknown:BGi,inbound_mailbox_allow_unknown_help:$Gi,quick_actions:VGi,end_all_sessions_help:HGi,updated_records:WGi,vat_not_registered:zGi,small_company_info:UGi,log_duration_words:jGi,log_duration:qGi,merged_vendors:GGi,hidden_taxes_warning:KGi};function QGi({children:n}){return p(St,{children:n})}function XGi(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 ZGi(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZRe(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 JRe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ZRe(Object(t),!0).forEach(function(i){ZGi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ZRe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function JGi(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 eKi(n,e){if(n==null)return{};var t=JGi(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 tKi(n,e){return nKi(n)||iKi(n,e)||rKi(n,e)||oKi()}function nKi(n){if(Array.isArray(n))return n}function iKi(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 rKi(n,e){if(n){if(typeof n=="string")return eNe(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 eNe(n,e)}}function eNe(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 oKi(){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 sKi(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tNe(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 nNe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tNe(Object(t),!0).forEach(function(i){sKi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):tNe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function aKi(){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 mP(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 zW(n){return{}.toString.call(n).includes("Object")}function lKi(n){return!Object.keys(n).length}function b3(n){return typeof n=="function"}function cKi(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function uKi(n,e){return zW(e)||Mw("changeType"),Object.keys(e).some(function(t){return!cKi(n,t)})&&Mw("changeField"),e}function dKi(n){b3(n)||Mw("selectorType")}function hKi(n){b3(n)||zW(n)||Mw("handlerType"),zW(n)&&Object.values(n).some(function(e){return!b3(e)})&&Mw("handlersType")}function fKi(n){n||Mw("initialIsRequired"),zW(n)||Mw("initialType"),lKi(n)&&Mw("initialContent")}function pKi(n,e){throw new Error(n[e]||n.default)}var gKi={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"},Mw=mP(pKi)(gKi),T9={changes:uKi,selector:dKi,handler:hKi,initial:fKi};function mKi(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T9.initial(n),T9.handler(e);var t={current:n},i=mP(bKi)(t,e),r=mP(vKi)(t),o=mP(T9.changes)(n),s=mP(_Ki)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return T9.selector(c),c(t.current)}function l(c){aKi(i,r,o,s)(c)}return[a,l]}function _Ki(n,e){return b3(e)?e(n.current):e}function vKi(n,e){return n.current=nNe(nNe({},n.current),e),e}function bKi(n,e,t){return b3(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 yKi={create:mKi},CKi={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function wKi(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 SKi(n){return{}.toString.call(n).includes("Object")}function EKi(n){return n||iNe("configIsRequired"),SKi(n)||iNe("configType"),n.urls?(xKi(),{paths:{vs:n.urls.monacoBase}}):n}function xKi(){console.warn(YQe.deprecation)}function TKi(n,e){throw new Error(n[e]||n.default)}var YQe={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
`},iNe=wKi(TKi)(YQe),kKi={config:EKi},IKi=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 QQe(n,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&n[t]&&Object.assign(e[t],QQe(n[t],e[t]))}),JRe(JRe({},n),e)}var LKi={type:"cancelation",msg:"operation is manually canceled"};function Bee(n){var e=!1,t=new Promise(function(i,r){n.then(function(o){return e?r(LKi):i(o)}),n.catch(r)});return t.cancel=function(){return e=!0},t}var DKi=yKi.create({config:CKi,isInitialized:!1,resolve:null,reject:null,monaco:null}),XQe=tKi(DKi,2),y6=XQe[0],uK=XQe[1];function AKi(n){var e=kKi.config(n),t=e.monaco,i=eKi(e,["monaco"]);uK(function(r){return{config:QQe(r.config,i),monaco:t}})}function RKi(){var n=y6(function(e){var t=e.monaco,i=e.isInitialized,r=e.resolve;return{monaco:t,isInitialized:i,resolve:r}});if(!n.isInitialized){if(uK({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),Bee($ee);if(window.monaco&&window.monaco.editor)return ZQe(window.monaco),n.resolve(window.monaco),Bee($ee);IKi(NKi,PKi)(MKi)}return Bee($ee)}function NKi(n){return document.body.appendChild(n)}function OKi(n){var e=document.createElement("script");return n&&(e.src=n),e}function PKi(n){var e=y6(function(i){var r=i.config,o=i.reject;return{config:r,reject:o}}),t=OKi("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return n()},t.onerror=e.reject,t}function MKi(){var n=y6(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){ZQe(t),n.resolve(t)},function(t){n.reject(t)})}function ZQe(n){y6().monaco||uK({monaco:n})}function FKi(){return y6(function(n){var e=n.monaco;return e})}var $ee=new Promise(function(n,e){return uK({resolve:n,reject:e})}),dK={config:AKi,init:RKi,__getMonacoInstance:FKi},BKi={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Vee=BKi,$Ki={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},VKi=$Ki;function HKi({children:n}){return ce.createElement("div",{style:VKi.container},n)}var WKi=HKi,zKi=WKi;function UKi({width:n,height:e,isEditorReady:t,loading:i,_ref:r,className:o,wrapperProps:s}){return ce.createElement("section",{style:{...Vee.wrapper,width:n,height:e},...s},!t&&ce.createElement(zKi,null,i),ce.createElement("div",{ref:r,style:{...Vee.fullWidth,...!t&&Vee.hide},className:o}))}var jKi=UKi,JQe=w.memo(jKi);function qKi(n){w.useEffect(n,[])}var eXe=qKi;function GKi(n,e,t=!0){let i=w.useRef(!0);w.useEffect(i.current||!t?()=>{i.current=!1}:n,e)}var Op=GKi;function AM(){}function tL(n,e,t,i){return KKi(n,i)||YKi(n,e,t,i)}function KKi(n,e){return n.editor.getModel(tXe(n,e))}function YKi(n,e,t,i){return n.editor.createModel(e,t,i?tXe(n,i):void 0)}function tXe(n,e){return n.Uri.parse(e)}function QKi({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:f="100%",className:g,wrapperProps:m={},beforeMount:v=AM,onMount:_=AM}){let[b,y]=w.useState(!1),[C,E]=w.useState(!0),x=w.useRef(null),k=w.useRef(null),L=w.useRef(null),D=w.useRef(_),A=w.useRef(v),N=w.useRef(!1);eXe(()=>{let F=dK.init();return F.then(U=>(k.current=U)&&E(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>x.current?B():F.cancel()}),Op(()=>{if(x.current&&k.current){let F=x.current.getOriginalEditor(),U=tL(k.current,n||"",i||t||"text",o||"");U!==F.getModel()&&F.setModel(U)}},[o],b),Op(()=>{if(x.current&&k.current){let F=x.current.getModifiedEditor(),U=tL(k.current,e||"",r||t||"text",s||"");U!==F.getModel()&&F.setModel(U)}},[s],b),Op(()=>{let F=x.current.getModifiedEditor();F.getOption(k.current.editor.EditorOption.readOnly)?F.setValue(e||""):e!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[e],b),Op(()=>{var F,U;(U=(F=x.current)==null?void 0:F.getModel())==null||U.original.setValue(n||"")},[n],b),Op(()=>{let{original:F,modified:U}=x.current.getModel();k.current.editor.setModelLanguage(F,i||t||"text"),k.current.editor.setModelLanguage(U,r||t||"text")},[t,i,r],b),Op(()=>{var F;(F=k.current)==null||F.editor.setTheme(c)},[c],b),Op(()=>{var F;(F=x.current)==null||F.updateOptions(d)},[d],b);let P=w.useCallback(()=>{var H;if(!k.current)return;A.current(k.current);let F=tL(k.current,n||"",i||t||"text",o||""),U=tL(k.current,e||"",r||t||"text",s||"");(H=x.current)==null||H.setModel({original:F,modified:U})},[t,e,r,n,i,o,s]),M=w.useCallback(()=>{var F;!N.current&&L.current&&(x.current=k.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...d}),P(),(F=k.current)==null||F.editor.setTheme(c),y(!0),N.current=!0)},[d,c,P]);w.useEffect(()=>{b&&D.current(x.current,k.current)},[b]),w.useEffect(()=>{!C&&!b&&M()},[C,b,M]);function B(){var U,H,W,q;let F=(U=x.current)==null?void 0:U.getModel();a||((H=F==null?void 0:F.original)==null||H.dispose()),l||((W=F==null?void 0:F.modified)==null||W.dispose()),(q=x.current)==null||q.dispose()}return ce.createElement(JQe,{width:f,height:h,isEditorReady:b,loading:u,_ref:L,className:g,wrapperProps:m})}var XKi=QKi;w.memo(XKi);function ZKi(n){let e=w.useRef();return w.useEffect(()=>{e.current=n},[n]),e.current}var JKi=ZKi,k9=new Map;function eYi({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:f="100%",height:g="100%",className:m,wrapperProps:v={},beforeMount:_=AM,onMount:b=AM,onChange:y,onValidate:C=AM}){let[E,x]=w.useState(!1),[k,L]=w.useState(!0),D=w.useRef(null),A=w.useRef(null),N=w.useRef(null),P=w.useRef(b),M=w.useRef(_),B=w.useRef(),F=w.useRef(i),U=JKi(o),H=w.useRef(!1),W=w.useRef(!1);eXe(()=>{let re=dK.init();return re.then(oe=>(D.current=oe)&&L(!1)).catch(oe=>(oe==null?void 0:oe.type)!=="cancelation"&&console.error("Monaco initialization: error:",oe)),()=>A.current?V():re.cancel()}),Op(()=>{var oe,Q,Ne,Ve;let re=tL(D.current,n||i||"",e||r||"",o||t||"");re!==((oe=A.current)==null?void 0:oe.getModel())&&(d&&k9.set(U,(Q=A.current)==null?void 0:Q.saveViewState()),(Ne=A.current)==null||Ne.setModel(re),d&&((Ve=A.current)==null||Ve.restoreViewState(k9.get(o))))},[o],E),Op(()=>{var re;(re=A.current)==null||re.updateOptions(c)},[c],E),Op(()=>{!A.current||i===void 0||(A.current.getOption(D.current.editor.EditorOption.readOnly)?A.current.setValue(i):i!==A.current.getValue()&&(W.current=!0,A.current.executeEdits("",[{range:A.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),A.current.pushUndoStop(),W.current=!1))},[i],E),Op(()=>{var oe,Q;let re=(oe=A.current)==null?void 0:oe.getModel();re&&r&&((Q=D.current)==null||Q.editor.setModelLanguage(re,r))},[r],E),Op(()=>{var re;a!==void 0&&((re=A.current)==null||re.revealLine(a))},[a],E),Op(()=>{var re;(re=D.current)==null||re.editor.setTheme(s)},[s],E);let q=w.useCallback(()=>{var re;if(!(!N.current||!D.current)&&!H.current){M.current(D.current);let oe=o||t,Q=tL(D.current,i||n||"",e||r||"",oe||"");A.current=(re=D.current)==null?void 0:re.editor.create(N.current,{model:Q,automaticLayout:!0,...c},u),d&&A.current.restoreViewState(k9.get(oe)),D.current.editor.setTheme(s),a!==void 0&&A.current.revealLine(a),x(!0),H.current=!0}},[n,e,t,i,r,o,c,u,d,s,a]);w.useEffect(()=>{E&&P.current(A.current,D.current)},[E]),w.useEffect(()=>{!k&&!E&&q()},[k,E,q]),F.current=i,w.useEffect(()=>{var re,oe;E&&y&&((re=B.current)==null||re.dispose(),B.current=(oe=A.current)==null?void 0:oe.onDidChangeModelContent(Q=>{W.current||y(A.current.getValue(),Q)}))},[E,y]),w.useEffect(()=>{if(E){let re=D.current.editor.onDidChangeMarkers(oe=>{var Ne;let Q=(Ne=A.current.getModel())==null?void 0:Ne.uri;if(Q&&oe.find(Ve=>Ve.path===Q.path)){let Ve=D.current.editor.getModelMarkers({resource:Q});C==null||C(Ve)}});return()=>{re==null||re.dispose()}}return()=>{}},[E,C]);function V(){var re,oe;(re=B.current)==null||re.dispose(),h?d&&k9.set(o,A.current.saveViewState()):(oe=A.current.getModel())==null||oe.dispose(),A.current.dispose()}return ce.createElement(JQe,{width:f,height:g,isEditorReady:E,loading:l,_ref:N,className:m,wrapperProps:v})}var tYi=eYi,nYi=w.memo(tYi),Qkr=nYi;function xp(n,e=0){return n[n.length-(1+e)]}function iYi(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function ka(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 rYi(n,e){const t=n.length-1;e<t&&(n[e]=n[t]),n.pop()}function y3(n,e,t){return oYi(n.length,i=>t(n[i],e))}function oYi(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 ole(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?ole(n,r,t):n<r.length+s.length?s[0]:ole(n-(r.length+s.length),o,t)}function rNe(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*nXe(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 iXe(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 sYi(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 o0(n){return n.filter(e=>!!e)}function oNe(n){let e=0;for(let t=0;t<n.length;t++)n[t]&&(n[e]=n[t],e+=1);n.length=e}function rXe(n){return!Array.isArray(n)||n.length===0}function yu(n){return Array.isArray(n)&&n.length>0}function fS(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 oXe(n,e){return n.length>0?n[0]:e}function cd(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 hK(n,e,t){const i=n.slice(0,e),r=n.slice(e);return i.concat(t,r)}function Hee(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function I9(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function sle(n,e){for(const t of e)n.push(t)}function Xbe(n){return Array.isArray(n)?n:[n]}function aYi(n,e,t){const i=sXe(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 sNe(n,e,t,i){const r=sXe(n,e);let o=n.splice(r,t);return o===void 0&&(o=[]),aYi(n,r,i),o}function sXe(n,e){return e<0?Math.max(e+n.length,0):Math.min(e,n.length)}var C3;(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})(C3||(C3={}));function sg(n,e){return(t,i)=>e(n(t),n(i))}function lYi(...n){return(e,t)=>{for(const i of n){const r=i(e,t);if(!C3.isNeitherLessOrGreaterThan(r))return r}return C3.neitherLessOrGreaterThan}}const Yy=(n,e)=>n-e,cYi=(n,e)=>Yy(n?1:0,e?1:0);function aXe(n){return(e,t)=>-n(e,t)}class C1{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 Yb{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Yb(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Yb(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||C3.isGreaterThan(e(r,t)))&&(i=!1,t=r),!0)),t}}Yb.empty=new Yb(n=>{});function Rd(n){return typeof n=="string"}function xd(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function uYi(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function pS(n){return typeof n=="number"&&!isNaN(n)}function aNe(n){return!!n&&typeof n[Symbol.iterator]=="function"}function lXe(n){return n===!0||n===!1}function Fh(n){return typeof n>"u"}function w3(n){return!Ef(n)}function Ef(n){return Fh(n)||n===null}function ko(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Hx(n){if(Ef(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function S3(n){return typeof n=="function"}function dYi(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)hYi(n[i],e[i])}function hYi(n,e){if(Rd(e)){if(typeof n!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(S3(e)){try{if(n instanceof e)return}catch{}if(!Ef(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 gy(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"?gy(i):i}),e}function fYi(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(cXe.call(t,i)){const r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&!uYi(r)&&e.push(r)}}return n}const cXe=Object.prototype.hasOwnProperty;function uXe(n,e){return ale(n,e,new Set)}function ale(n,e,t){if(Ef(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(ale(o,e,t));return r}if(xd(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const r={};for(const o in n)cXe.call(n,o)&&(r[o]=ale(n[o],e,t));return t.delete(n),r}return n}function fK(n,e,t=!0){return xd(n)?(xd(e)&&Object.keys(e).forEach(i=>{i in n?t&&(xd(n[i])&&xd(e[i])?fK(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Uf(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(!Uf(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(),!Uf(r,o))return!1;for(t=0;t<r.length;t++)if(!Uf(n[r[t]],e[r[t]]))return!1}return!0}function pYi(n){let e=[];for(;Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}function Zbe(n){const e=[];for(const t of pYi(n))typeof n[t]=="function"&&e.push(t);return e}function gYi(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 mYi=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function _Yi(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}),mYi&&(t=""+t.replace(/[aouei]/g,"$&$&")+""),t}function T(n,e,...t){return _Yi(e,t)}var Wee;const nL="en";let UW=!1,jW=!1,z$=!1,dXe=!1,Jbe=!1,e0e=!1,hXe=!1,L9,U$=nL,lNe=nL,vYi,b_;const Em=typeof self=="object"?self:typeof global=="object"?global:{};let ud;typeof Em.vscode<"u"&&typeof Em.vscode.process<"u"?ud=Em.vscode.process:typeof process<"u"&&(ud=process);const bYi=typeof((Wee=ud==null?void 0:ud.versions)===null||Wee===void 0?void 0:Wee.electron)=="string",yYi=bYi&&(ud==null?void 0:ud.type)==="renderer";if(typeof navigator=="object"&&!yYi)b_=navigator.userAgent,UW=b_.indexOf("Windows")>=0,jW=b_.indexOf("Macintosh")>=0,e0e=(b_.indexOf("Macintosh")>=0||b_.indexOf("iPad")>=0||b_.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,z$=b_.indexOf("Linux")>=0,hXe=(b_==null?void 0:b_.indexOf("Mobi"))>=0,Jbe=!0,T({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),L9=nL,U$=L9,lNe=navigator.language;else if(typeof ud=="object"){UW=ud.platform==="win32",jW=ud.platform==="darwin",z$=ud.platform==="linux",z$&&ud.env.SNAP&&ud.env.SNAP_REVISION,ud.env.CI||ud.env.BUILD_ARTIFACTSTAGINGDIRECTORY,L9=nL,U$=nL;const n=ud.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];L9=e.locale,lNe=e.osLocale,U$=t||nL,vYi=e._translationsConfigFile}catch{}dXe=!0}else console.error("Unable to resolve platform.");const eu=UW,br=jW,Xu=z$,uv=dXe,sE=Jbe,CYi=Jbe&&typeof Em.importScripts=="function",bv=e0e,wYi=hXe,s0=b_,SYi=U$,EYi=typeof Em.postMessage=="function"&&!Em.importScripts,fXe=(()=>{if(EYi){const n=[];Em.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}),Em.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),Of=jW||e0e?2:UW?1:3;let cNe=!0,uNe=!1;function pXe(){if(!uNe){uNe=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,cNe=new Uint16Array(n.buffer)[0]===512+1}return cNe}const gXe=!!(s0&&s0.indexOf("Chrome")>=0),xYi=!!(s0&&s0.indexOf("Firefox")>=0),TYi=!!(!gXe&&s0&&s0.indexOf("Safari")>=0),kYi=!!(s0&&s0.indexOf("Edg/")>=0);s0&&s0.indexOf("Android")>=0;const pu={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var rr;(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*f(b,y){let C=0;for(const E of b)yield y(E,C++)}n.map=f;function*g(...b){for(const y of b)for(const C of y)yield C}n.concat=g;function m(b,y,C){let E=C;for(const x of b)E=y(E,x);return E}n.reduce=m;function*v(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=v;function _(b,y=Number.POSITIVE_INFINITY){const C=[];if(y===0)return[C,b];const E=b[Symbol.iterator]();for(let x=0;x<y;x++){const k=E.next();if(k.done)return[C,n.empty()];C.push(k.value)}return[C,{[Symbol.iterator](){return E}}]}n.consume=_})(rr||(rr={}));let ll=class lle{constructor(e){this.element=e,this.next=lle.Undefined,this.prev=lle.Undefined}};ll.Undefined=new ll(void 0);class Td{constructor(){this._first=ll.Undefined,this._last=ll.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ll.Undefined}clear(){let e=this._first;for(;e!==ll.Undefined;){const t=e.next;e.prev=ll.Undefined,e.next=ll.Undefined,e=t}this._first=ll.Undefined,this._last=ll.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new ll(e);if(this._first===ll.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!==ll.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ll.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ll.Undefined&&e.next!==ll.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ll.Undefined&&e.next===ll.Undefined?(this._first=ll.Undefined,this._last=ll.Undefined):e.next===ll.Undefined?(this._last=this._last.prev,this._last.next=ll.Undefined):e.prev===ll.Undefined&&(this._first=this._first.next,this._first.prev=ll.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ll.Undefined;)yield e.element,e=e.next}}const mXe="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function IYi(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of mXe)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const t0e=IYi();function _Xe(n){let e=t0e;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 vXe=new Td;vXe.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function E3(n,e,t,i,r){if(r||(r=rr.first(vXe)),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),E3(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=LYi(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 LYi(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 _C=8;class bXe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class yXe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Vs{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return pK(e,t)}compute(e,t,i){return i}}class RM{constructor(e,t){this.newValue=e,this.didChange=t}}function pK(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new RM(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&ka(n,e);return new RM(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const r=pK(n[i],e[i]);r.didChange&&(n[i]=r.newValue,t=!0)}return new RM(n,t)}class C6{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return pK(e,t)}validate(e){return this.defaultValue}}class eN{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return pK(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function Vn(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class Er extends eN{constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=i),super(e,t,i,r)}validate(e){return Vn(e,this.defaultValue)}}function ix(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 Uo extends eN{static clampedInt(e,t,i,r){return ix(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 Uo.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function DYi(n,e,t,i){if(typeof n>"u")return e;const r=gm.float(n,e);return gm.clamp(r,t,i)}class gm extends eN{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(gm.float(e,this.defaultValue))}}class Rh extends eN{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 Rh.string(e,this.defaultValue)}}function Pa(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class ra extends eN{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 Pa(e,this.defaultValue,this._allowedValues)}}class D9 extends Vs{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 AYi(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class RYi extends Vs{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[T("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),T("accessibilitySupport.on","Optimize for usage with a Screen Reader"),T("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:T("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 NYi extends Vs{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:T("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:T("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:Vn(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Vn(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function OYi(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var bc;(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"})(bc||(bc={}));function PYi(n){switch(n){case"line":return bc.Line;case"block":return bc.Block;case"underline":return bc.Underline;case"line-thin":return bc.LineThin;case"block-outline":return bc.BlockOutline;case"underline-thin":return bc.UnderlineThin}}class MYi extends C6{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 FYi extends Er{constructor(){super(37,"emptySelectionClipboard",!0,{description:T("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class BYi extends Vs{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:T("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:[T("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),T("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),T("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:T("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:[T("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),T("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),T("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:T("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:T("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:br},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:T("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:T("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:Vn(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Pa(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Pa(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Vn(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Vn(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Vn(t.loop,this.defaultValue.loop)}}}class xf extends Vs{constructor(){super(51,"fontLigatures",xf.OFF,{anyOf:[{type:"boolean",description:T("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:T("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:T("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"?xf.OFF:e==="true"?xf.ON:e:e?xf.ON:xf.OFF}}xf.OFF='"liga" off, "calt" off';xf.ON='"liga" on, "calt" on';class K_ extends Vs{constructor(){super(54,"fontVariations",K_.OFF,{anyOf:[{type:"boolean",description:T("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:T("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:T("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"?K_.OFF:e==="true"?K_.TRANSLATE:e:e?K_.TRANSLATE:K_.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}K_.OFF="normal";K_.TRANSLATE="translate";class $Yi extends C6{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class VYi extends eN{constructor(){super(52,"fontSize",zh.fontSize,{type:"number",minimum:6,maximum:100,default:zh.fontSize,description:T("fontSize","Controls the font size in pixels.")})}validate(e){const t=gm.float(e,this.defaultValue);return t===0?zh.fontSize:gm.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class vb extends Vs{constructor(){super(53,"fontWeight",zh.fontWeight,{anyOf:[{type:"number",minimum:vb.MINIMUM_VALUE,maximum:vb.MAXIMUM_VALUE,errorMessage:T("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:vb.SUGGESTION_VALUES}],default:zh.fontWeight,description:T("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(Uo.clampedInt(e,zh.fontWeight,vb.MINIMUM_VALUE,vb.MAXIMUM_VALUE))}}vb.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];vb.MINIMUM_VALUE=1;vb.MAXIMUM_VALUE=1e3;class HYi extends Vs{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:[T("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),T("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),T("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:T("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:T("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:T("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:T("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:T("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:T("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:T("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:T("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:T("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:T("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:T("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:Pa(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Pa(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Pa(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(r=a.multipleDeclarations)!==null&&r!==void 0?r:Pa(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Pa(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:Pa(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Rh.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Rh.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Rh.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Rh.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Rh.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class WYi extends Vs{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:T("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:T("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:T("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:T("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:T("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:Vn(t.enabled,this.defaultValue.enabled),delay:Uo.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Vn(t.sticky,this.defaultValue.sticky),hidingDelay:Uo.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Vn(t.above,this.defaultValue.above)}}}class YL extends C6{constructor(){super(143)}compute(e,t,i){return YL.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 f=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,v=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,C=d?2:3;let E=Math.floor(o*r);const x=E/o;let k=!1,L=!1,D=C*h,A=h/o,N=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:W,extraLinesBeforeFirstLine:q,extraLinesBeyondLastLine:V,desiredRatio:re,minimapLineCount:oe}=YL.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:o});if(_/oe>1)k=!0,L=!0,h=1,D=1,A=h/o;else{let Ne=!1,Ve=h+1;if(g==="fit"){const Ye=Math.ceil((q+_+V)*D);y&&a&&b<=t.stableFitRemainingWidth?(Ne=!0,Ve=t.stableFitMaxMinimapScale):Ne=Ye>E}if(g==="fill"||Ne){k=!0;const Ye=h;D=Math.min(l*o,Math.max(1,Math.floor(1/re))),y&&a&&b<=t.stableFitRemainingWidth&&(Ve=t.stableFitMaxMinimapScale),h=Math.min(Ve,Math.max(1,Math.floor(D/C))),h>Ye&&(N=Math.min(2,h/Ye)),A=h/o/N,E=Math.ceil(Math.max(W,q+_+V)*D),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(f*A),M=Math.min(P,Math.max(0,Math.floor((b-v-2)*A/(c+A)))+_C);let B=Math.floor(o*M);const F=B/o;B=Math.floor(B*N);const U=d?1:2,H=m==="left"?0:i-M-v;return{renderMinimap:U,minimapLeft:H,minimapWidth:M,minimapHeightIsEditorHeight:k,minimapIsSampling:L,minimapScale:h,minimapLineHeight:D,minimapCanvasInnerWidth:B,minimapCanvasInnerHeight:E,minimapCanvasOuterWidth:F,minimapCanvasOuterHeight:x}}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,f=h==="inherit"?e.get(130):h,g=e.get(133),m=t.isDominatedByLongLines,v=e.get(57),_=e.get(67).renderType!==0,b=e.get(68),y=e.get(104),C=e.get(83),E=e.get(72),x=e.get(102),k=x.verticalScrollbarSize,L=x.verticalHasArrows,D=x.arrowSize,A=x.horizontalScrollbarSize,N=e.get(43),P=e.get(109)!=="never";let M=e.get(65);N&&P&&(M+=16);let B=0;if(_){const He=Math.max(s,b);B=Math.round(He*l)}let F=0;v&&(F=o*t.glyphMarginDecorationLaneCount);let U=0,H=U+F,W=H+B,q=W+M;const V=i-F-B-M;let re=!1,oe=!1,Q=-1;h==="inherit"&&m?(re=!0,oe=!0):f==="on"||f==="bounded"?oe=!0:f==="wordWrapColumn"&&(Q=g);const Ne=YL._computeMinimapLayout({outerWidth:i,outerHeight:r,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:C.top,paddingBottom:C.bottom,minimap:E,verticalScrollbarWidth:k,viewLineCount:u,remainingWidth:V,isViewportWrapping:oe},t.memory||new yXe);Ne.renderMinimap!==0&&Ne.minimapLeft===0&&(U+=Ne.minimapWidth,H+=Ne.minimapWidth,W+=Ne.minimapWidth,q+=Ne.minimapWidth);const Ve=V-Ne.minimapWidth,Ye=Math.max(1,Math.floor((Ve-k-2)/a)),ye=L?D:0;return oe&&(Q=Math.max(1,Ye),f==="bounded"&&(Q=Math.min(Q,g))),{width:i,height:r,glyphMarginLeft:U,glyphMarginWidth:F,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:H,lineNumbersWidth:B,decorationsLeft:W,decorationsWidth:M,contentLeft:q,contentWidth:Ve,minimap:Ne,viewportColumn:Ye,isWordWrapMinified:re,isViewportWrapping:oe,wrappingColumn:Q,verticalScrollbarWidth:k,horizontalScrollbarHeight:A,overviewRuler:{top:ye,width:k,height:r-2*ye,right:0}}}}class zYi extends Vs{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[T("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."),T("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:T("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 Pa(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class UYi extends Vs{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:T("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Vn(e.enabled,this.defaultValue.enabled)}}}class jYi extends Vs{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:T("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:T("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:T("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:T("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:Vn(t.enabled,this.defaultValue.enabled),maxLineCount:Uo.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Pa(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Vn(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class qYi extends Vs{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:T("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[T("editor.inlayHints.on","Inlay hints are enabled"),T("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",br?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",br?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:T("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:T("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:T("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:Pa(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Uo.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Rh.string(t.fontFamily,this.defaultValue.fontFamily),padding:Vn(t.padding,this.defaultValue.padding)}}}class GYi extends Vs{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Uo.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Uo.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class KYi extends gm{constructor(){super(66,"lineHeight",zh.lineHeight,e=>gm.clamp(e,0,150),{markdownDescription:T("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 YYi extends Vs{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:T("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:T("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[T("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),T("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),T("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:T("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:T("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:T("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:T("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:T("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:T("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:Vn(t.enabled,this.defaultValue.enabled),autohide:Vn(t.autohide,this.defaultValue.autohide),size:Pa(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Pa(t.side,this.defaultValue.side,["right","left"]),showSlider:Pa(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Vn(t.renderCharacters,this.defaultValue.renderCharacters),scale:Uo.clampedInt(t.scale,1,1,3),maxColumn:Uo.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function QYi(n){return n==="ctrlCmd"?br?"metaKey":"ctrlKey":"altKey"}class XYi extends Vs{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:T("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:T("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:Uo.clampedInt(t.top,0,0,1e3),bottom:Uo.clampedInt(t.bottom,0,0,1e3)}}}class ZYi extends Vs{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:T("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:T("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:Vn(t.enabled,this.defaultValue.enabled),cycle:Vn(t.cycle,this.defaultValue.cycle)}}}class JYi extends C6{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class eQi extends Vs{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[T("on","Quick suggestions show inside the suggest widget"),T("inline","Quick suggestions show as ghost text"),T("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:T("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:T("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:T("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:T("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=Pa(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Pa(i,this.defaultValue.comments,o),typeof r=="boolean"?l=r?"on":"off":l=Pa(r,this.defaultValue.strings,o),{other:s,comments:a,strings:l}}}class tQi extends Vs{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[T("lineNumbers.off","Line numbers are not rendered."),T("lineNumbers.on","Line numbers are rendered as absolute number."),T("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),T("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:T("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 qW(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class nQi extends Vs{constructor(){const e=[],t={type:"number",description:T("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:T("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:T("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:Uo.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const r=i;t.push({column:Uo.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((i,r)=>i.column-r.column),t}return this.defaultValue}}class iQi extends Vs{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function dNe(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let rQi=class extends Vs{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:[T("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),T("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),T("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:T("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[T("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),T("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),T("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:T("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:T("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:T("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:T("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=Uo.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=Uo.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Uo.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:dNe(t.vertical,this.defaultValue.vertical),horizontal:dNe(t.horizontal,this.defaultValue.horizontal),useShadows:Vn(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Vn(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Vn(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Vn(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Vn(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Uo.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:r,verticalSliderSize:Uo.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:Vn(t.scrollByPage,this.defaultValue.scrollByPage)}}};const _f="inUntrustedWorkspace",th={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 oQi extends Vs{constructor(){const e={nonBasicASCII:_f,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:_f,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[th.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,_f],default:e.nonBasicASCII,description:T("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.")},[th.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:T("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[th.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:T("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.")},[th.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,_f],default:e.includeComments,description:T("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[th.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,_f],default:e.includeStrings,description:T("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[th.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:T("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[th.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:T("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Uf(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(Uf(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const r=super.applyUpdate(e,t);return i?new RM(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:QL(t.nonBasicASCII,_f,[!0,!1,_f]),invisibleCharacters:Vn(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Vn(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:QL(t.includeComments,_f,[!0,!1,_f]),includeStrings:QL(t.includeStrings,_f,[!0,!1,_f]),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 sQi extends Vs{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:T("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[T("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),T("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:T("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:T("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:Vn(t.enabled,this.defaultValue.enabled),mode:Pa(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Pa(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:Vn(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Vn(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class aQi extends Vs{constructor(){const e={enabled:pu.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:pu.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("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:T("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:Vn(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Vn(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class lQi extends Vs{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:[T("editor.guides.bracketPairs.true","Enables bracket pair guides."),T("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),T("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:T("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[T("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),T("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),T("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:T("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:T("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:T("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[T("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),T("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),T("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:T("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:QL(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:QL(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Vn(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Vn(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:QL(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function QL(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class cQi extends Vs{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:[T("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),T("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:T("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:T("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:T("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:T("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:[T("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),T("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),T("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),T("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:T("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:T("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:T("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:T("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:T("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:T("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:T("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:T("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:T("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:T("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:T("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Pa(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Vn(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Vn(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Vn(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Vn(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Pa(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Vn(t.showIcons,this.defaultValue.showIcons),showStatusBar:Vn(t.showStatusBar,this.defaultValue.showStatusBar),preview:Vn(t.preview,this.defaultValue.preview),previewMode:Pa(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Vn(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Vn(t.showMethods,this.defaultValue.showMethods),showFunctions:Vn(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Vn(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Vn(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Vn(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Vn(t.showFields,this.defaultValue.showFields),showVariables:Vn(t.showVariables,this.defaultValue.showVariables),showClasses:Vn(t.showClasses,this.defaultValue.showClasses),showStructs:Vn(t.showStructs,this.defaultValue.showStructs),showInterfaces:Vn(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Vn(t.showModules,this.defaultValue.showModules),showProperties:Vn(t.showProperties,this.defaultValue.showProperties),showEvents:Vn(t.showEvents,this.defaultValue.showEvents),showOperators:Vn(t.showOperators,this.defaultValue.showOperators),showUnits:Vn(t.showUnits,this.defaultValue.showUnits),showValues:Vn(t.showValues,this.defaultValue.showValues),showConstants:Vn(t.showConstants,this.defaultValue.showConstants),showEnums:Vn(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Vn(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Vn(t.showKeywords,this.defaultValue.showKeywords),showWords:Vn(t.showWords,this.defaultValue.showWords),showColors:Vn(t.showColors,this.defaultValue.showColors),showFiles:Vn(t.showFiles,this.defaultValue.showFiles),showReferences:Vn(t.showReferences,this.defaultValue.showReferences),showFolders:Vn(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Vn(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Vn(t.showSnippets,this.defaultValue.showSnippets),showUsers:Vn(t.showUsers,this.defaultValue.showUsers),showIssues:Vn(t.showIssues,this.defaultValue.showIssues)}}}class uQi extends Vs{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:T("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:T("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:Vn(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Vn(e.selectSubwords,this.defaultValue.selectSubwords)}}}class dQi extends Vs{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[T("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),T("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),T("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),T("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:T("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 hQi extends C6{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 fQi extends Vs{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("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:T("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:[T("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),T("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:Vn(t.enabled,this.defaultValue.enabled),showDropSelector:Pa(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class pQi extends Vs{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:T("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:[T("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),T("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:Vn(t.enabled,this.defaultValue.enabled),showPasteSelector:Pa(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const gQi="Consolas, 'Courier New', monospace",mQi="Menlo, Monaco, 'Courier New', monospace",_Qi="'Droid Sans Mono', 'monospace', monospace",zh={fontFamily:br?mQi:Xu?_Qi:gQi,fontWeight:"normal",fontSize:br?12:14,lineHeight:0,letterSpacing:0},iL=[];function Nt(n){return iL[n.id]=n,n}const Dv={acceptSuggestionOnCommitCharacter:Nt(new Er(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:T("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:Nt(new ra(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",T("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:T("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:Nt(new RYi),accessibilityPageSize:Nt(new Uo(3,"accessibilityPageSize",10,1,1073741824,{description:T("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:Nt(new Rh(4,"ariaLabel",T("editorViewAccessibleLabel","Editor content"))),ariaRequired:Nt(new Er(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Nt(new Er(8,"screenReaderAnnounceInlineSuggestion",!0,{description:T("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Nt(new ra(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),T("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:T("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Nt(new ra(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),T("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:T("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Nt(new ra(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",T("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:T("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Nt(new ra(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",T("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:T("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Nt(new ra(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),T("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:T("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Nt(new D9(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],AYi,{enumDescriptions:[T("editor.autoIndent.none","The editor will not insert indentation automatically."),T("editor.autoIndent.keep","The editor will keep the current line's indentation."),T("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),T("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),T("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:T("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Nt(new Er(13,"automaticLayout",!1)),autoSurround:Nt(new ra(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[T("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),T("editor.autoSurround.quotes","Surround with quotes but not brackets."),T("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:T("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Nt(new aQi),bracketPairGuides:Nt(new lQi),stickyTabStops:Nt(new Er(115,"stickyTabStops",!1,{description:T("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Nt(new Er(17,"codeLens",!0,{description:T("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Nt(new Rh(18,"codeLensFontFamily","",{description:T("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Nt(new Uo(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:T("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Nt(new Er(20,"colorDecorators",!0,{description:T("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Nt(new ra(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[T("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),T("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),T("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:T("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Nt(new Uo(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:T("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Nt(new Er(22,"columnSelection",!1,{description:T("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Nt(new NYi),contextmenu:Nt(new Er(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Nt(new Er(25,"copyWithSyntaxHighlighting",!0,{description:T("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Nt(new D9(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],OYi,{description:T("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Nt(new ra(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[T("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),T("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),T("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:T("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Nt(new D9(28,"cursorStyle",bc.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],PYi,{description:T("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Nt(new Uo(29,"cursorSurroundingLines",0,0,1073741824,{description:T("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:Nt(new ra(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[T("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),T("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:T("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Nt(new Uo(31,"cursorWidth",0,0,1073741824,{markdownDescription:T("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Nt(new Er(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Nt(new Er(33,"disableMonospaceOptimizations",!1)),domReadOnly:Nt(new Er(34,"domReadOnly",!1)),dragAndDrop:Nt(new Er(35,"dragAndDrop",!0,{description:T("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Nt(new FYi),dropIntoEditor:Nt(new fQi),stickyScroll:Nt(new jYi),experimentalWhitespaceRendering:Nt(new ra(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[T("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),T("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),T("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:T("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Nt(new Rh(39,"extraEditorClassName","")),fastScrollSensitivity:Nt(new gm(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:T("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Nt(new BYi),fixedOverflowWidgets:Nt(new Er(42,"fixedOverflowWidgets",!1)),folding:Nt(new Er(43,"folding",!0,{description:T("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Nt(new ra(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[T("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),T("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:T("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Nt(new Er(45,"foldingHighlight",!0,{description:T("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Nt(new Er(46,"foldingImportsByDefault",!1,{description:T("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Nt(new Uo(47,"foldingMaximumRegions",5e3,10,65e3,{description:T("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:Nt(new Er(48,"unfoldOnClickAfterEndOfLine",!1,{description:T("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Nt(new Rh(49,"fontFamily",zh.fontFamily,{description:T("fontFamily","Controls the font family.")})),fontInfo:Nt(new $Yi),fontLigatures2:Nt(new xf),fontSize:Nt(new VYi),fontWeight:Nt(new vb),fontVariations:Nt(new K_),formatOnPaste:Nt(new Er(55,"formatOnPaste",!1,{description:T("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:Nt(new Er(56,"formatOnType",!1,{description:T("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Nt(new Er(57,"glyphMargin",!0,{description:T("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Nt(new HYi),hideCursorInOverviewRuler:Nt(new Er(59,"hideCursorInOverviewRuler",!1,{description:T("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Nt(new WYi),inDiffEditor:Nt(new Er(61,"inDiffEditor",!1)),letterSpacing:Nt(new gm(63,"letterSpacing",zh.letterSpacing,n=>gm.clamp(n,-5,20),{description:T("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Nt(new UYi),lineDecorationsWidth:Nt(new GYi),lineHeight:Nt(new KYi),lineNumbers:Nt(new tQi),lineNumbersMinChars:Nt(new Uo(68,"lineNumbersMinChars",5,1,300)),linkedEditing:Nt(new Er(69,"linkedEditing",!1,{description:T("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Nt(new Er(70,"links",!0,{description:T("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Nt(new ra(71,"matchBrackets","always",["always","near","never"],{description:T("matchBrackets","Highlight matching brackets.")})),minimap:Nt(new YYi),mouseStyle:Nt(new ra(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Nt(new gm(74,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:T("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Nt(new Er(75,"mouseWheelZoom",!1,{markdownDescription:T("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Nt(new Er(76,"multiCursorMergeOverlapping",!0,{description:T("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Nt(new D9(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],QYi,{markdownEnumDescriptions:[T("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),T("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:T({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:Nt(new ra(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[T("multiCursorPaste.spread","Each cursor pastes a single line of the text."),T("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:T("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Nt(new Uo(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:T("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Nt(new Er(80,"occurrencesHighlight",!0,{description:T("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Nt(new Er(81,"overviewRulerBorder",!0,{description:T("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Nt(new Uo(82,"overviewRulerLanes",3,0,3)),padding:Nt(new XYi),pasteAs:Nt(new pQi),parameterHints:Nt(new ZYi),peekWidgetDefaultFocus:Nt(new ra(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[T("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),T("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:T("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Nt(new Er(87,"definitionLinkOpensInPeek",!1,{description:T("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Nt(new eQi),quickSuggestionsDelay:Nt(new Uo(89,"quickSuggestionsDelay",10,0,1073741824,{description:T("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Nt(new Er(90,"readOnly",!1)),readOnlyMessage:Nt(new iQi),renameOnType:Nt(new Er(92,"renameOnType",!1,{description:T("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:T("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Nt(new Er(93,"renderControlCharacters",!0,{description:T("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Nt(new ra(94,"renderFinalNewline",Xu?"dimmed":"on",["off","on","dimmed"],{description:T("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Nt(new ra(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",T("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:T("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Nt(new Er(96,"renderLineHighlightOnlyWhenFocus",!1,{description:T("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Nt(new ra(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Nt(new ra(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",T("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),T("renderWhitespace.selection","Render whitespace characters only on selected text."),T("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:T("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Nt(new Uo(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Nt(new Er(100,"roundedSelection",!0,{description:T("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Nt(new nQi),scrollbar:Nt(new rQi),scrollBeyondLastColumn:Nt(new Uo(103,"scrollBeyondLastColumn",4,0,1073741824,{description:T("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Nt(new Er(104,"scrollBeyondLastLine",!0,{description:T("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Nt(new Er(105,"scrollPredominantAxis",!0,{description:T("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:Nt(new Er(106,"selectionClipboard",!0,{description:T("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Xu})),selectionHighlight:Nt(new Er(107,"selectionHighlight",!0,{description:T("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Nt(new Er(108,"selectOnLineNumbers",!0)),showFoldingControls:Nt(new ra(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[T("showFoldingControls.always","Always show the folding controls."),T("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),T("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:T("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Nt(new Er(110,"showUnused",!0,{description:T("showUnused","Controls fading out of unused code.")})),showDeprecated:Nt(new Er(138,"showDeprecated",!0,{description:T("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Nt(new qYi),snippetSuggestions:Nt(new ra(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[T("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),T("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),T("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),T("snippetSuggestions.none","Do not show snippet suggestions.")],description:T("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Nt(new uQi),smoothScrolling:Nt(new Er(113,"smoothScrolling",!1,{description:T("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Nt(new Uo(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Nt(new cQi),inlineSuggest:Nt(new sQi),inlineCompletionsAccessibilityVerbose:Nt(new Er(147,"inlineCompletionsAccessibilityVerbose",!1,{description:T("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Nt(new Uo(118,"suggestFontSize",0,0,1e3,{markdownDescription:T("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Nt(new Uo(119,"suggestLineHeight",0,0,1e3,{markdownDescription:T("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:Nt(new Er(120,"suggestOnTriggerCharacters",!0,{description:T("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Nt(new ra(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[T("suggestSelection.first","Always select the first suggestion."),T("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),T("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:T("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Nt(new ra(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[T("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),T("tabCompletion.off","Disable tab completions."),T("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:T("tabCompletion","Enables tab completions.")})),tabIndex:Nt(new Uo(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:Nt(new oQi),unusualLineTerminators:Nt(new ra(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[T("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),T("unusualLineTerminators.off","Unusual line terminators are ignored."),T("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:T("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Nt(new Er(126,"useShadowDOM",!0)),useTabStops:Nt(new Er(127,"useTabStops",!0,{description:T("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Nt(new ra(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[T("wordBreak.normal","Use the default line break rule."),T("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:T("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Nt(new Rh(129,"wordSeparators",mXe,{description:T("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Nt(new ra(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[T("wordWrap.off","Lines will never wrap."),T("wordWrap.on","Lines will wrap at the viewport width."),T({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),T({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:T({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:Nt(new Rh(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Nt(new Rh(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥+")),wordWrapColumn:Nt(new Uo(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:T({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:Nt(new ra(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Nt(new ra(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Nt(new MYi),defaultColorDecorators:Nt(new Er(145,"defaultColorDecorators",!1,{markdownDescription:T("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Nt(new JYi),tabFocusMode:Nt(new Er(142,"tabFocusMode",!1,{markdownDescription:T("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Nt(new YL),wrappingInfo:Nt(new hQi),wrappingIndent:Nt(new dQi),wrappingStrategy:Nt(new zYi)};class vQi{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?vA.isErrorNoTelemetry(e)?new vA(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 CXe=new vQi;function Pi(n){Av(n)||CXe.onUnexpectedError(n)}function tl(n){Av(n)||CXe.onUnexpectedExternalError(n)}function hNe(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:vA.isErrorNoTelemetry(n)}}return n}const GW="Canceled";function Av(n){return n instanceof aE?!0:n instanceof Error&&n.name===GW&&n.message===GW}class aE extends Error{constructor(){super(GW),this.name=this.message}}function bQi(){const n=new Error(GW);return n.name=n.message,n}function ag(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function n0e(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class yQi extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class vA extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof vA)return e;const t=new vA;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 gS(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function i0e(n){return typeof n.dispose=="function"&&n.dispose.length===0}function _o(n){if(rr.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 xm(...n){return _i(()=>_o(n))}function _i(n){return{dispose:gS(()=>{n()})}}class yt{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{_o(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?yt.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)}}yt.DISABLE_DISPOSED_WARNING=!1;class qe{constructor(){this._store=new yt,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)}}qe.None=Object.freeze({dispose(){}});class Ac{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 CQi{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class wQi{constructor(e){this.object=e}dispose(){}}class r0e{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{_o(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 SQi=globalThis.performance&&typeof globalThis.performance.now=="function";class wu{static create(e){return new wu(e)}constructor(e){this._now=SQi&&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 on;(function(n){n.None=()=>qe.None;function e(P,M){return d(P,()=>{},0,void 0,!0,void 0,M)}n.defer=e;function t(P){return(M,B=null,F)=>{let U=!1,H;return H=P(W=>{if(!U)return H?H.dispose():U=!0,M.call(B,W)},null,F),U&&H.dispose(),H}}n.once=t;function i(P,M,B){return c((F,U=null,H)=>P(W=>F.call(U,M(W)),null,H),B)}n.map=i;function r(P,M,B){return c((F,U=null,H)=>P(W=>{M(W),F.call(U,W)},null,H),B)}n.forEach=r;function o(P,M,B){return c((F,U=null,H)=>P(W=>M(W)&&F.call(U,W),null,H),B)}n.filter=o;function s(P){return P}n.signal=s;function a(...P){return(M,B=null,F)=>{const U=xm(...P.map(H=>H(W=>M.call(B,W))));return u(U,F)}}n.any=a;function l(P,M,B,F){let U=B;return i(P,H=>(U=M(U,H),U),F)}n.reduce=l;function c(P,M){let B;const F={onWillAddFirstListener(){B=P(U.fire,U)},onDidRemoveLastListener(){B==null||B.dispose()}},U=new De(F);return M==null||M.add(U),U.event}function u(P,M){return M instanceof Array?M.push(P):M&&M.add(P),P}function d(P,M,B=100,F=!1,U=!1,H,W){let q,V,re,oe=0,Q;const Ne={leakWarningThreshold:H,onWillAddFirstListener(){q=P(Ye=>{oe++,V=M(V,Ye),F&&!re&&(Ve.fire(V),V=void 0),Q=()=>{const ye=V;V=void 0,re=void 0,(!F||oe>1)&&Ve.fire(ye),oe=0},typeof B=="number"?(clearTimeout(re),re=setTimeout(Q,B)):re===void 0&&(re=0,queueMicrotask(Q))})},onWillRemoveListener(){U&&oe>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,q.dispose()}},Ve=new De(Ne);return W==null||W.add(Ve),Ve.event}n.debounce=d;function h(P,M=0,B){return n.debounce(P,(F,U)=>F?(F.push(U),F):[U],M,void 0,!0,void 0,B)}n.accumulate=h;function f(P,M=(F,U)=>F===U,B){let F=!0,U;return o(P,H=>{const W=F||!M(H,U);return F=!1,U=H,W},B)}n.latch=f;function g(P,M,B){return[n.filter(P,M,B),n.filter(P,F=>!M(F),B)]}n.split=g;function m(P,M=!1,B=[],F){let U=B.slice(),H=P(V=>{U?U.push(V):q.fire(V)});F&&F.add(H);const W=()=>{U==null||U.forEach(V=>q.fire(V)),U=null},q=new De({onWillAddFirstListener(){H||(H=P(V=>q.fire(V)),F&&F.add(H))},onDidAddFirstListener(){U&&(M?setTimeout(W):W())},onDidRemoveLastListener(){H&&H.dispose(),H=null}});return F&&F.add(q),q.event}n.buffer=m;function v(P,M){return(F,U,H)=>{const W=M(new b);return P(function(q){const V=W.evaluate(q);V!==_&&F.call(U,V)},void 0,H)}}n.chain=v;const _=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(M){return this.steps.push(M),this}forEach(M){return this.steps.push(B=>(M(B),B)),this}filter(M){return this.steps.push(B=>M(B)?B:_),this}reduce(M,B){let F=B;return this.steps.push(U=>(F=M(F,U),F)),this}latch(M=(B,F)=>B===F){let B=!0,F;return this.steps.push(U=>{const H=B||!M(U,F);return B=!1,F=U,H?U:_}),this}evaluate(M){for(const B of this.steps)if(M=B(M),M===_)break;return M}}function y(P,M,B=F=>F){const F=(...q)=>W.fire(B(...q)),U=()=>P.on(M,F),H=()=>P.removeListener(M,F),W=new De({onWillAddFirstListener:U,onDidRemoveLastListener:H});return W.event}n.fromNodeEventEmitter=y;function C(P,M,B=F=>F){const F=(...q)=>W.fire(B(...q)),U=()=>P.addEventListener(M,F),H=()=>P.removeEventListener(M,F),W=new De({onWillAddFirstListener:U,onDidRemoveLastListener:H});return W.event}n.fromDOMEventEmitter=C;function E(P){return new Promise(M=>t(P)(M))}n.toPromise=E;function x(P){const M=new De;return P.then(B=>{M.fire(B)},()=>{M.fire(void 0)}).finally(()=>{M.dispose()}),M.event}n.fromPromise=x;function k(P,M){return M(void 0),P(B=>M(B))}n.runAndSubscribe=k;function L(P,M){let B=null;function F(H){B==null||B.dispose(),B=new yt,M(H,B)}F(void 0);const U=P(H=>F(H));return _i(()=>{U.dispose(),B==null||B.dispose()})}n.runAndSubscribeWithStore=L;class D{constructor(M,B){this._observable=M,this._counter=0,this._hasChanged=!1;const F={onWillAddFirstListener:()=>{M.addObserver(this)},onDidRemoveLastListener:()=>{M.removeObserver(this)}};this.emitter=new De(F),B&&B.add(this.emitter)}beginUpdate(M){this._counter++}handlePossibleChange(M){}handleChange(M,B){this._hasChanged=!0}endUpdate(M){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function A(P,M){return new D(P,M).emitter.event}n.fromObservable=A;function N(P){return M=>{let B=0,F=!1;const U={beginUpdate(){B++},endUpdate(){B--,B===0&&(P.reportChanges(),F&&(F=!1,M()))},handlePossibleChange(){},handleChange(){F=!0}};return P.addObserver(U),P.reportChanges(),{dispose(){P.removeObserver(U)}}}}n.fromObservableLight=N})(on||(on={}));class bA{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${bA._idPool++}`,bA.all.add(this)}start(e){this._stopWatch=new wu,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}}}bA.all=new Set;bA._idPool=0;let EQi=-1;class xQi{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 o0e{static create(){var e;return new o0e((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}}class zee{constructor(e){this.value=e}}const TQi=2;let De=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 xQi((r=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&r!==void 0?r:EQi):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new bA(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`),qe.None;if(this._disposed)return qe.None;i&&(t=t.bind(i));const u=new zee(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=o0e.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof zee?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new wXe),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=_i(()=>{d==null||d(),this._removeListener(u)});return r instanceof yt?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*TQi<=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)||Pi;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 zee)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 kQi=()=>new wXe;class wXe{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 qT extends De{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Td,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 SXe extends qT{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 IQi extends De{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 LQi{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new De({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),_i(gS(()=>{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 s0e{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 fNe{constructor(){this.listening=!1,this.inputEvent=on.None,this.inputEventListener=qe.None,this.emitter=new De({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 EXe=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var or;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof j$?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:on.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:EXe})})(or||(or={}));class j${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?EXe:(this._emitter||(this._emitter=new De),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let $a=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 j$),this._token}cancel(){this._token?this._token instanceof j$&&this._token.cancel():this._token=or.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof j$&&this._token.dispose():this._token=or.None}};class a0e{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 q$=new a0e,cle=new a0e,ule=new a0e,xXe=new Array(230),DQi=Object.create(null),AQi=Object.create(null),l0e=[];for(let n=0;n<=193;n++)l0e[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,f]=r;if(i[s]||(i[s]=!0,DQi[a]=s,AQi[a.toLowerCase()]=s,o&&(l0e[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);q$.define(l,c),cle.define(l,h||c),ule.define(l,f||h||c)}u&&(xXe[u]=l)}})();var Cy;(function(n){function e(a){return q$.keyCodeToStr(a)}n.toString=e;function t(a){return q$.strToKeyCode(a)}n.fromString=t;function i(a){return cle.keyCodeToStr(a)}n.toUserSettingsUS=i;function r(a){return ule.keyCodeToStr(a)}n.toUserSettingsGeneral=r;function o(a){return cle.strToKeyCode(a)||ule.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 q$.keyCodeToStr(a)}n.toElectronAccelerator=s})(Cy||(Cy={}));function gl(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}let XL;if(typeof Em.vscode<"u"&&typeof Em.vscode.process<"u"){const n=Em.vscode.process;XL={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?XL={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:XL={get platform(){return eu?"win32":br?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const KW=XL.cwd,TXe=XL.env,RQi=XL.platform,NQi=65,OQi=97,PQi=90,MQi=122,Fw=46,Ru=47,mf=92,sC=58,FQi=63;class kXe 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 BQi(n,e){if(n===null||typeof n!="object")throw new kXe(e,"Object",n)}function Kl(n,e){if(typeof n!="string")throw new kXe(e,"string",n)}const lE=RQi==="win32";function yo(n){return n===Ru||n===mf}function dle(n){return n===Ru}function aC(n){return n>=NQi&&n<=PQi||n>=OQi&&n<=MQi}function YW(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=Ru}if(i(l)){if(!(s===c-1||a===1))if(a===2){if(r.length<2||o!==2||r.charCodeAt(r.length-1)!==Fw||r.charCodeAt(r.length-2)!==Fw){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===Fw&&a!==-1?++a:a=-1}return r}function IXe(n,e){BQi(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 Bh={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],Kl(o,"path"),o.length===0)continue}else e.length===0?o=KW():(o=TXe[`=${e}`]||KW(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===mf)&&(o=`${e}\\`));const s=o.length;let a=0,l="",c=!1;const u=o.charCodeAt(0);if(s===1)yo(u)&&(a=1,c=!0);else if(yo(u))if(c=!0,yo(o.charCodeAt(1))){let d=2,h=d;for(;d<s&&!yo(o.charCodeAt(d));)d++;if(d<s&&d!==h){const f=o.slice(h,d);for(h=d;d<s&&yo(o.charCodeAt(d));)d++;if(d<s&&d!==h){for(h=d;d<s&&!yo(o.charCodeAt(d));)d++;(d===s||d!==h)&&(l=`\\\\${f}\\${o.slice(h,d)}`,a=d)}}}else a=1;else aC(u)&&o.charCodeAt(1)===sC&&(l=o.slice(0,2),a=2,s>2&&yo(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=YW(t,!i,"\\",yo),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){Kl(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 dle(o)?"\\":n;if(yo(o))if(r=!0,yo(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!yo(n.charCodeAt(a));)a++;if(a<e&&a!==l){const c=n.slice(l,a);for(l=a;a<e&&yo(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!yo(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 aC(o)&&n.charCodeAt(1)===sC&&(i=n.slice(0,2),t=2,e>2&&yo(n.charCodeAt(2))&&(r=!0,t=3));let s=t<e?YW(n.slice(t),!r,"\\",yo):"";return s.length===0&&!r&&(s="."),s.length>0&&yo(n.charCodeAt(e-1))&&(s+="\\"),i===void 0?r?`\\${s}`:s:r?`${i}\\${s}`:`${i}${s}`},isAbsolute(n){Kl(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return yo(t)||e>2&&aC(t)&&n.charCodeAt(1)===sC&&yo(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];Kl(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"&&yo(t.charCodeAt(0))){++r;const o=t.length;o>1&&yo(t.charCodeAt(1))&&(++r,o>2&&(yo(t.charCodeAt(2))?++r:i=!1))}if(i){for(;r<e.length&&yo(e.charCodeAt(r));)r++;r>=2&&(e=`\\${e.slice(r)}`)}return Bh.normalize(e)},relative(n,e){if(Kl(n,"from"),Kl(e,"to"),n===e)return"";const t=Bh.resolve(n),i=Bh.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let r=0;for(;r<n.length&&n.charCodeAt(r)===mf;)r++;let o=n.length;for(;o-1>r&&n.charCodeAt(o-1)===mf;)o--;const s=o-r;let a=0;for(;a<e.length&&e.charCodeAt(a)===mf;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===mf;)l--;const c=l-a,u=s<c?s:c;let d=-1,h=0;for(;h<u;h++){const g=n.charCodeAt(r+h);if(g!==e.charCodeAt(a+h))break;g===mf&&(d=h)}if(h!==u){if(d===-1)return i}else{if(c>u){if(e.charCodeAt(a+h)===mf)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}s>u&&(n.charCodeAt(r+h)===mf?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=r+d+1;h<=o;++h)(h===o||n.charCodeAt(h)===mf)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===mf&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=Bh.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===mf){if(e.charCodeAt(1)===mf){const t=e.charCodeAt(2);if(t!==FQi&&t!==Fw)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(aC(e.charCodeAt(0))&&e.charCodeAt(1)===sC&&e.charCodeAt(2)===mf)return`\\\\?\\${e}`;return n},dirname(n){Kl(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const r=n.charCodeAt(0);if(e===1)return yo(r)?n:".";if(yo(r)){if(t=i=1,yo(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!yo(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&yo(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!yo(n.charCodeAt(a));)a++;if(a===e)return n;a!==l&&(t=i=a+1)}}}}else aC(r)&&n.charCodeAt(1)===sC&&(t=e>2&&yo(n.charCodeAt(2))?3:2,i=t);let o=-1,s=!0;for(let a=e-1;a>=i;--a)if(yo(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&&Kl(e,"ext"),Kl(n,"path");let t=0,i=-1,r=!0,o;if(n.length>=2&&aC(n.charCodeAt(0))&&n.charCodeAt(1)===sC&&(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(yo(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(yo(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){Kl(n,"path");let e=0,t=-1,i=0,r=-1,o=!0,s=0;n.length>=2&&n.charCodeAt(1)===sC&&aC(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(yo(l)){if(!o){i=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===Fw?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:IXe.bind(null,"\\"),parse(n){Kl(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 yo(r)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(yo(r)){if(i=1,yo(n.charCodeAt(1))){let d=2,h=d;for(;d<t&&!yo(n.charCodeAt(d));)d++;if(d<t&&d!==h){for(h=d;d<t&&yo(n.charCodeAt(d));)d++;if(d<t&&d!==h){for(h=d;d<t&&!yo(n.charCodeAt(d));)d++;d===t?i=d:d!==h&&(i=d+1)}}}}else if(aC(r)&&n.charCodeAt(1)===sC){if(t<=2)return e.root=e.dir=n,e;if(i=2,yo(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),yo(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===Fw?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},$Qi=(()=>{if(lE){const n=/\\/g;return()=>{const e=KW().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>KW()})(),hl={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const r=i>=0?n[i]:$Qi();Kl(r,"path"),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===Ru)}return e=YW(e,!t,"/",dle),t?`/${e}`:e.length>0?e:"."},normalize(n){if(Kl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Ru,t=n.charCodeAt(n.length-1)===Ru;return n=YW(n,!e,"/",dle),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return Kl(n,"path"),n.length>0&&n.charCodeAt(0)===Ru},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const i=n[t];Kl(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":hl.normalize(e)},relative(n,e){if(Kl(n,"from"),Kl(e,"to"),n===e||(n=hl.resolve(n),e=hl.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===Ru&&(l=c)}if(c===a)if(s>a){if(e.charCodeAt(o+c)===Ru)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else r>a&&(n.charCodeAt(t+c)===Ru?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Ru)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(Kl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Ru;let t=-1,i=!0;for(let r=n.length-1;r>=1;--r)if(n.charCodeAt(r)===Ru){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&&Kl(e,"ext"),Kl(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===Ru){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)===Ru){if(!r){t=o+1;break}}else i===-1&&(r=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Kl(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===Ru){if(!r){t=s+1;break}continue}i===-1&&(r=!1,i=s+1),a===Fw?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:IXe.bind(null,"/"),parse(n){Kl(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Ru;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===Ru){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===Fw?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};hl.win32=Bh.win32=Bh;hl.posix=Bh.posix=hl;const LXe=lE?Bh.normalize:hl.normalize,VQi=lE?Bh.resolve:hl.resolve,HQi=lE?Bh.relative:hl.relative,DXe=lE?Bh.dirname:hl.dirname,Bw=lE?Bh.basename:hl.basename,WQi=lE?Bh.extname:hl.extname,dv=lE?Bh.sep:hl.sep,zQi=/^\w[\w\d+.-]*$/,UQi=/^\//,jQi=/^\/\//;function qQi(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&&!zQi.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!UQi.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(jQi.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 GQi(n,e){return!n&&!e?"file":n}function KQi(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==W_&&(e=W_+e):e=W_;break}return e}const Aa="",W_="/",YQi=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Jn{static isUri(e){return e instanceof Jn?!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||Aa,this.authority=e.authority||Aa,this.path=e.path||Aa,this.query=e.query||Aa,this.fragment=e.fragment||Aa):(this.scheme=GQi(e,s),this.authority=t||Aa,this.path=KQi(this.scheme,i||Aa),this.query=r||Aa,this.fragment=o||Aa,qQi(this,s))}get fsPath(){return QW(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=Aa),i===void 0?i=this.authority:i===null&&(i=Aa),r===void 0?r=this.path:r===null&&(r=Aa),o===void 0?o=this.query:o===null&&(o=Aa),s===void 0?s=this.fragment:s===null&&(s=Aa),t===this.scheme&&i===this.authority&&r===this.path&&o===this.query&&s===this.fragment?this:new QI(t,i,r,o,s)}static parse(e,t=!1){const i=YQi.exec(e);return i?new QI(i[2]||Aa,A9(i[4]||Aa),A9(i[5]||Aa),A9(i[7]||Aa),A9(i[9]||Aa),t):new QI(Aa,Aa,Aa,Aa,Aa)}static file(e){let t=Aa;if(eu&&(e=e.replace(/\\/g,W_)),e[0]===W_&&e[1]===W_){const i=e.indexOf(W_,2);i===-1?(t=e.substring(2),e=W_):(t=e.substring(2,i),e=e.substring(i)||W_)}return new QI("file",t,e,Aa,Aa)}static from(e,t){return new QI(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 eu&&e.scheme==="file"?i=Jn.file(Bh.join(QW(e,!0),...t)).path:i=hl.join(e.path,...t),e.with({path:i})}toString(e=!1){return hle(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof Jn)return e;{const r=new QI(e);return r._formatted=(t=e.external)!==null&&t!==void 0?t:null,r._fsPath=e._sep===AXe&&(i=e.fsPath)!==null&&i!==void 0?i:null,r}}else return e}}const AXe=eu?1:void 0;let QI=class extends Jn{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=QW(this,!1)),this._fsPath}toString(e=!1){return e?hle(this,!0):(this._formatted||(this._formatted=hle(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=AXe),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 RXe={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 pNe(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=RXe[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 QQi(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+=RXe[i]):e!==void 0&&(e+=n[t])}return e!==void 0?e:n}function QW(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,eu&&(t=t.replace(/\//g,"\\")),t}function hle(n,e){const t=e?QQi:pNe;let i="",{scheme:r,authority:o,path:s,query:a,fragment:l}=n;if(r&&(i+=r,i+=":"),(o||r==="file")&&(i+=W_,i+=W_),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:pNe(l,!1,!1)),i}function NXe(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+NXe(n.substr(3)):n}}const gNe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function A9(n){return n.match(gNe)?n.replace(gNe,e=>NXe(e)):n}let Re=class rx{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 rx(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return rx.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return rx.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 rx.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 rx(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new rx(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}},J=class uc{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 uc.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return uc.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 uc.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 uc.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 uc.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 uc(i,r,o,s)}intersectRanges(e){return uc.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 uc(i,r,o,s)}equalsRange(e){return uc.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 uc.getEndPosition(this)}static getEndPosition(e){return new Re(e.endLineNumber,e.endColumn)}getStartPosition(){return uc.getStartPosition(this)}static getStartPosition(e){return new Re(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new uc(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new uc(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return uc.collapseToStart(this)}static collapseToStart(e){return new uc(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return uc.collapseToEnd(this)}static collapseToEnd(e){return new uc(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new uc(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new uc(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new uc(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}},kn=class im extends J{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 im.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 im(this.startLineNumber,this.startColumn,e,t):new im(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Re(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Re(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new im(e,t,this.endLineNumber,this.endColumn):new im(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new im(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new im(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new im(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new im(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 im(e,t,i,r):new im(i,r,e,t)}};const fle=Object.create(null);function K(n,e){if(Rd(e)){const t=fle[e];if(t===void 0)throw new Error(`${n} references an unknown codicon: ${e}`);e=t}return fle[n]=e,{id:n}}function OXe(){return fle}const jt={add:K("add",6e4),plus:K("plus",6e4),gistNew:K("gist-new",6e4),repoCreate:K("repo-create",6e4),lightbulb:K("lightbulb",60001),lightBulb:K("light-bulb",60001),repo:K("repo",60002),repoDelete:K("repo-delete",60002),gistFork:K("gist-fork",60003),repoForked:K("repo-forked",60003),gitPullRequest:K("git-pull-request",60004),gitPullRequestAbandoned:K("git-pull-request-abandoned",60004),recordKeys:K("record-keys",60005),keyboard:K("keyboard",60005),tag:K("tag",60006),tagAdd:K("tag-add",60006),tagRemove:K("tag-remove",60006),gitPullRequestLabel:K("git-pull-request-label",60006),person:K("person",60007),personFollow:K("person-follow",60007),personOutline:K("person-outline",60007),personFilled:K("person-filled",60007),gitBranch:K("git-branch",60008),gitBranchCreate:K("git-branch-create",60008),gitBranchDelete:K("git-branch-delete",60008),sourceControl:K("source-control",60008),mirror:K("mirror",60009),mirrorPublic:K("mirror-public",60009),star:K("star",60010),starAdd:K("star-add",60010),starDelete:K("star-delete",60010),starEmpty:K("star-empty",60010),comment:K("comment",60011),commentAdd:K("comment-add",60011),alert:K("alert",60012),warning:K("warning",60012),search:K("search",60013),searchSave:K("search-save",60013),logOut:K("log-out",60014),signOut:K("sign-out",60014),logIn:K("log-in",60015),signIn:K("sign-in",60015),eye:K("eye",60016),eyeUnwatch:K("eye-unwatch",60016),eyeWatch:K("eye-watch",60016),circleFilled:K("circle-filled",60017),primitiveDot:K("primitive-dot",60017),closeDirty:K("close-dirty",60017),debugBreakpoint:K("debug-breakpoint",60017),debugBreakpointDisabled:K("debug-breakpoint-disabled",60017),debugHint:K("debug-hint",60017),primitiveSquare:K("primitive-square",60018),edit:K("edit",60019),pencil:K("pencil",60019),info:K("info",60020),issueOpened:K("issue-opened",60020),gistPrivate:K("gist-private",60021),gitForkPrivate:K("git-fork-private",60021),lock:K("lock",60021),mirrorPrivate:K("mirror-private",60021),close:K("close",60022),removeClose:K("remove-close",60022),x:K("x",60022),repoSync:K("repo-sync",60023),sync:K("sync",60023),clone:K("clone",60024),desktopDownload:K("desktop-download",60024),beaker:K("beaker",60025),microscope:K("microscope",60025),vm:K("vm",60026),deviceDesktop:K("device-desktop",60026),file:K("file",60027),fileText:K("file-text",60027),more:K("more",60028),ellipsis:K("ellipsis",60028),kebabHorizontal:K("kebab-horizontal",60028),mailReply:K("mail-reply",60029),reply:K("reply",60029),organization:K("organization",60030),organizationFilled:K("organization-filled",60030),organizationOutline:K("organization-outline",60030),newFile:K("new-file",60031),fileAdd:K("file-add",60031),newFolder:K("new-folder",60032),fileDirectoryCreate:K("file-directory-create",60032),trash:K("trash",60033),trashcan:K("trashcan",60033),history:K("history",60034),clock:K("clock",60034),folder:K("folder",60035),fileDirectory:K("file-directory",60035),symbolFolder:K("symbol-folder",60035),logoGithub:K("logo-github",60036),markGithub:K("mark-github",60036),github:K("github",60036),terminal:K("terminal",60037),console:K("console",60037),repl:K("repl",60037),zap:K("zap",60038),symbolEvent:K("symbol-event",60038),error:K("error",60039),stop:K("stop",60039),variable:K("variable",60040),symbolVariable:K("symbol-variable",60040),array:K("array",60042),symbolArray:K("symbol-array",60042),symbolModule:K("symbol-module",60043),symbolPackage:K("symbol-package",60043),symbolNamespace:K("symbol-namespace",60043),symbolObject:K("symbol-object",60043),symbolMethod:K("symbol-method",60044),symbolFunction:K("symbol-function",60044),symbolConstructor:K("symbol-constructor",60044),symbolBoolean:K("symbol-boolean",60047),symbolNull:K("symbol-null",60047),symbolNumeric:K("symbol-numeric",60048),symbolNumber:K("symbol-number",60048),symbolStructure:K("symbol-structure",60049),symbolStruct:K("symbol-struct",60049),symbolParameter:K("symbol-parameter",60050),symbolTypeParameter:K("symbol-type-parameter",60050),symbolKey:K("symbol-key",60051),symbolText:K("symbol-text",60051),symbolReference:K("symbol-reference",60052),goToFile:K("go-to-file",60052),symbolEnum:K("symbol-enum",60053),symbolValue:K("symbol-value",60053),symbolRuler:K("symbol-ruler",60054),symbolUnit:K("symbol-unit",60054),activateBreakpoints:K("activate-breakpoints",60055),archive:K("archive",60056),arrowBoth:K("arrow-both",60057),arrowDown:K("arrow-down",60058),arrowLeft:K("arrow-left",60059),arrowRight:K("arrow-right",60060),arrowSmallDown:K("arrow-small-down",60061),arrowSmallLeft:K("arrow-small-left",60062),arrowSmallRight:K("arrow-small-right",60063),arrowSmallUp:K("arrow-small-up",60064),arrowUp:K("arrow-up",60065),bell:K("bell",60066),bold:K("bold",60067),book:K("book",60068),bookmark:K("bookmark",60069),debugBreakpointConditionalUnverified:K("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:K("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:K("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:K("debug-breakpoint-data-unverified",60072),debugBreakpointData:K("debug-breakpoint-data",60073),debugBreakpointDataDisabled:K("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:K("debug-breakpoint-log-unverified",60074),debugBreakpointLog:K("debug-breakpoint-log",60075),debugBreakpointLogDisabled:K("debug-breakpoint-log-disabled",60075),briefcase:K("briefcase",60076),broadcast:K("broadcast",60077),browser:K("browser",60078),bug:K("bug",60079),calendar:K("calendar",60080),caseSensitive:K("case-sensitive",60081),check:K("check",60082),checklist:K("checklist",60083),chevronDown:K("chevron-down",60084),dropDownButton:K("drop-down-button",60084),chevronLeft:K("chevron-left",60085),chevronRight:K("chevron-right",60086),chevronUp:K("chevron-up",60087),chromeClose:K("chrome-close",60088),chromeMaximize:K("chrome-maximize",60089),chromeMinimize:K("chrome-minimize",60090),chromeRestore:K("chrome-restore",60091),circle:K("circle",60092),circleOutline:K("circle-outline",60092),debugBreakpointUnverified:K("debug-breakpoint-unverified",60092),circleSlash:K("circle-slash",60093),circuitBoard:K("circuit-board",60094),clearAll:K("clear-all",60095),clippy:K("clippy",60096),closeAll:K("close-all",60097),cloudDownload:K("cloud-download",60098),cloudUpload:K("cloud-upload",60099),code:K("code",60100),collapseAll:K("collapse-all",60101),colorMode:K("color-mode",60102),commentDiscussion:K("comment-discussion",60103),compareChanges:K("compare-changes",60157),creditCard:K("credit-card",60105),dash:K("dash",60108),dashboard:K("dashboard",60109),database:K("database",60110),debugContinue:K("debug-continue",60111),debugDisconnect:K("debug-disconnect",60112),debugPause:K("debug-pause",60113),debugRestart:K("debug-restart",60114),debugStart:K("debug-start",60115),debugStepInto:K("debug-step-into",60116),debugStepOut:K("debug-step-out",60117),debugStepOver:K("debug-step-over",60118),debugStop:K("debug-stop",60119),debug:K("debug",60120),deviceCameraVideo:K("device-camera-video",60121),deviceCamera:K("device-camera",60122),deviceMobile:K("device-mobile",60123),diffAdded:K("diff-added",60124),diffIgnored:K("diff-ignored",60125),diffModified:K("diff-modified",60126),diffRemoved:K("diff-removed",60127),diffRenamed:K("diff-renamed",60128),diff:K("diff",60129),discard:K("discard",60130),editorLayout:K("editor-layout",60131),emptyWindow:K("empty-window",60132),exclude:K("exclude",60133),extensions:K("extensions",60134),eyeClosed:K("eye-closed",60135),fileBinary:K("file-binary",60136),fileCode:K("file-code",60137),fileMedia:K("file-media",60138),filePdf:K("file-pdf",60139),fileSubmodule:K("file-submodule",60140),fileSymlinkDirectory:K("file-symlink-directory",60141),fileSymlinkFile:K("file-symlink-file",60142),fileZip:K("file-zip",60143),files:K("files",60144),filter:K("filter",60145),flame:K("flame",60146),foldDown:K("fold-down",60147),foldUp:K("fold-up",60148),fold:K("fold",60149),folderActive:K("folder-active",60150),folderOpened:K("folder-opened",60151),gear:K("gear",60152),gift:K("gift",60153),gistSecret:K("gist-secret",60154),gist:K("gist",60155),gitCommit:K("git-commit",60156),gitCompare:K("git-compare",60157),gitMerge:K("git-merge",60158),githubAction:K("github-action",60159),githubAlt:K("github-alt",60160),globe:K("globe",60161),grabber:K("grabber",60162),graph:K("graph",60163),gripper:K("gripper",60164),heart:K("heart",60165),home:K("home",60166),horizontalRule:K("horizontal-rule",60167),hubot:K("hubot",60168),inbox:K("inbox",60169),issueClosed:K("issue-closed",60324),issueReopened:K("issue-reopened",60171),issues:K("issues",60172),italic:K("italic",60173),jersey:K("jersey",60174),json:K("json",60175),bracket:K("bracket",60175),kebabVertical:K("kebab-vertical",60176),key:K("key",60177),law:K("law",60178),lightbulbAutofix:K("lightbulb-autofix",60179),linkExternal:K("link-external",60180),link:K("link",60181),listOrdered:K("list-ordered",60182),listUnordered:K("list-unordered",60183),liveShare:K("live-share",60184),loading:K("loading",60185),location:K("location",60186),mailRead:K("mail-read",60187),mail:K("mail",60188),markdown:K("markdown",60189),megaphone:K("megaphone",60190),mention:K("mention",60191),milestone:K("milestone",60192),gitPullRequestMilestone:K("git-pull-request-milestone",60192),mortarBoard:K("mortar-board",60193),move:K("move",60194),multipleWindows:K("multiple-windows",60195),mute:K("mute",60196),noNewline:K("no-newline",60197),note:K("note",60198),octoface:K("octoface",60199),openPreview:K("open-preview",60200),package:K("package",60201),paintcan:K("paintcan",60202),pin:K("pin",60203),play:K("play",60204),run:K("run",60204),plug:K("plug",60205),preserveCase:K("preserve-case",60206),preview:K("preview",60207),project:K("project",60208),pulse:K("pulse",60209),question:K("question",60210),quote:K("quote",60211),radioTower:K("radio-tower",60212),reactions:K("reactions",60213),references:K("references",60214),refresh:K("refresh",60215),regex:K("regex",60216),remoteExplorer:K("remote-explorer",60217),remote:K("remote",60218),remove:K("remove",60219),replaceAll:K("replace-all",60220),replace:K("replace",60221),repoClone:K("repo-clone",60222),repoForcePush:K("repo-force-push",60223),repoPull:K("repo-pull",60224),repoPush:K("repo-push",60225),report:K("report",60226),requestChanges:K("request-changes",60227),rocket:K("rocket",60228),rootFolderOpened:K("root-folder-opened",60229),rootFolder:K("root-folder",60230),rss:K("rss",60231),ruby:K("ruby",60232),saveAll:K("save-all",60233),saveAs:K("save-as",60234),save:K("save",60235),screenFull:K("screen-full",60236),screenNormal:K("screen-normal",60237),searchStop:K("search-stop",60238),server:K("server",60240),settingsGear:K("settings-gear",60241),settings:K("settings",60242),shield:K("shield",60243),smiley:K("smiley",60244),sortPrecedence:K("sort-precedence",60245),splitHorizontal:K("split-horizontal",60246),splitVertical:K("split-vertical",60247),squirrel:K("squirrel",60248),starFull:K("star-full",60249),starHalf:K("star-half",60250),symbolClass:K("symbol-class",60251),symbolColor:K("symbol-color",60252),symbolCustomColor:K("symbol-customcolor",60252),symbolConstant:K("symbol-constant",60253),symbolEnumMember:K("symbol-enum-member",60254),symbolField:K("symbol-field",60255),symbolFile:K("symbol-file",60256),symbolInterface:K("symbol-interface",60257),symbolKeyword:K("symbol-keyword",60258),symbolMisc:K("symbol-misc",60259),symbolOperator:K("symbol-operator",60260),symbolProperty:K("symbol-property",60261),wrench:K("wrench",60261),wrenchSubaction:K("wrench-subaction",60261),symbolSnippet:K("symbol-snippet",60262),tasklist:K("tasklist",60263),telescope:K("telescope",60264),textSize:K("text-size",60265),threeBars:K("three-bars",60266),thumbsdown:K("thumbsdown",60267),thumbsup:K("thumbsup",60268),tools:K("tools",60269),triangleDown:K("triangle-down",60270),triangleLeft:K("triangle-left",60271),triangleRight:K("triangle-right",60272),triangleUp:K("triangle-up",60273),twitter:K("twitter",60274),unfold:K("unfold",60275),unlock:K("unlock",60276),unmute:K("unmute",60277),unverified:K("unverified",60278),verified:K("verified",60279),versions:K("versions",60280),vmActive:K("vm-active",60281),vmOutline:K("vm-outline",60282),vmRunning:K("vm-running",60283),watch:K("watch",60284),whitespace:K("whitespace",60285),wholeWord:K("whole-word",60286),window:K("window",60287),wordWrap:K("word-wrap",60288),zoomIn:K("zoom-in",60289),zoomOut:K("zoom-out",60290),listFilter:K("list-filter",60291),listFlat:K("list-flat",60292),listSelection:K("list-selection",60293),selection:K("selection",60293),listTree:K("list-tree",60294),debugBreakpointFunctionUnverified:K("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:K("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:K("debug-breakpoint-function-disabled",60296),debugStackframeActive:K("debug-stackframe-active",60297),circleSmallFilled:K("circle-small-filled",60298),debugStackframeDot:K("debug-stackframe-dot",60298),debugStackframe:K("debug-stackframe",60299),debugStackframeFocused:K("debug-stackframe-focused",60299),debugBreakpointUnsupported:K("debug-breakpoint-unsupported",60300),symbolString:K("symbol-string",60301),debugReverseContinue:K("debug-reverse-continue",60302),debugStepBack:K("debug-step-back",60303),debugRestartFrame:K("debug-restart-frame",60304),callIncoming:K("call-incoming",60306),callOutgoing:K("call-outgoing",60307),menu:K("menu",60308),expandAll:K("expand-all",60309),feedback:K("feedback",60310),gitPullRequestReviewer:K("git-pull-request-reviewer",60310),groupByRefType:K("group-by-ref-type",60311),ungroupByRefType:K("ungroup-by-ref-type",60312),account:K("account",60313),gitPullRequestAssignee:K("git-pull-request-assignee",60313),bellDot:K("bell-dot",60314),debugConsole:K("debug-console",60315),library:K("library",60316),output:K("output",60317),runAll:K("run-all",60318),syncIgnored:K("sync-ignored",60319),pinned:K("pinned",60320),githubInverted:K("github-inverted",60321),debugAlt:K("debug-alt",60305),serverProcess:K("server-process",60322),serverEnvironment:K("server-environment",60323),pass:K("pass",60324),stopCircle:K("stop-circle",60325),playCircle:K("play-circle",60326),record:K("record",60327),debugAltSmall:K("debug-alt-small",60328),vmConnect:K("vm-connect",60329),cloud:K("cloud",60330),merge:K("merge",60331),exportIcon:K("export",60332),graphLeft:K("graph-left",60333),magnet:K("magnet",60334),notebook:K("notebook",60335),redo:K("redo",60336),checkAll:K("check-all",60337),pinnedDirty:K("pinned-dirty",60338),passFilled:K("pass-filled",60339),circleLargeFilled:K("circle-large-filled",60340),circleLarge:K("circle-large",60341),circleLargeOutline:K("circle-large-outline",60341),combine:K("combine",60342),gather:K("gather",60342),table:K("table",60343),variableGroup:K("variable-group",60344),typeHierarchy:K("type-hierarchy",60345),typeHierarchySub:K("type-hierarchy-sub",60346),typeHierarchySuper:K("type-hierarchy-super",60347),gitPullRequestCreate:K("git-pull-request-create",60348),runAbove:K("run-above",60349),runBelow:K("run-below",60350),notebookTemplate:K("notebook-template",60351),debugRerun:K("debug-rerun",60352),workspaceTrusted:K("workspace-trusted",60353),workspaceUntrusted:K("workspace-untrusted",60354),workspaceUnspecified:K("workspace-unspecified",60355),terminalCmd:K("terminal-cmd",60356),terminalDebian:K("terminal-debian",60357),terminalLinux:K("terminal-linux",60358),terminalPowershell:K("terminal-powershell",60359),terminalTmux:K("terminal-tmux",60360),terminalUbuntu:K("terminal-ubuntu",60361),terminalBash:K("terminal-bash",60362),arrowSwap:K("arrow-swap",60363),copy:K("copy",60364),personAdd:K("person-add",60365),filterFilled:K("filter-filled",60366),wand:K("wand",60367),debugLineByLine:K("debug-line-by-line",60368),inspect:K("inspect",60369),layers:K("layers",60370),layersDot:K("layers-dot",60371),layersActive:K("layers-active",60372),compass:K("compass",60373),compassDot:K("compass-dot",60374),compassActive:K("compass-active",60375),azure:K("azure",60376),issueDraft:K("issue-draft",60377),gitPullRequestClosed:K("git-pull-request-closed",60378),gitPullRequestDraft:K("git-pull-request-draft",60379),debugAll:K("debug-all",60380),debugCoverage:K("debug-coverage",60381),runErrors:K("run-errors",60382),folderLibrary:K("folder-library",60383),debugContinueSmall:K("debug-continue-small",60384),beakerStop:K("beaker-stop",60385),graphLine:K("graph-line",60386),graphScatter:K("graph-scatter",60387),pieChart:K("pie-chart",60388),bracketDot:K("bracket-dot",60389),bracketError:K("bracket-error",60390),lockSmall:K("lock-small",60391),azureDevops:K("azure-devops",60392),verifiedFilled:K("verified-filled",60393),newLine:K("newline",60394),layout:K("layout",60395),layoutActivitybarLeft:K("layout-activitybar-left",60396),layoutActivitybarRight:K("layout-activitybar-right",60397),layoutPanelLeft:K("layout-panel-left",60398),layoutPanelCenter:K("layout-panel-center",60399),layoutPanelJustify:K("layout-panel-justify",60400),layoutPanelRight:K("layout-panel-right",60401),layoutPanel:K("layout-panel",60402),layoutSidebarLeft:K("layout-sidebar-left",60403),layoutSidebarRight:K("layout-sidebar-right",60404),layoutStatusbar:K("layout-statusbar",60405),layoutMenubar:K("layout-menubar",60406),layoutCentered:K("layout-centered",60407),layoutSidebarRightOff:K("layout-sidebar-right-off",60416),layoutPanelOff:K("layout-panel-off",60417),layoutSidebarLeftOff:K("layout-sidebar-left-off",60418),target:K("target",60408),indent:K("indent",60409),recordSmall:K("record-small",60410),errorSmall:K("error-small",60411),arrowCircleDown:K("arrow-circle-down",60412),arrowCircleLeft:K("arrow-circle-left",60413),arrowCircleRight:K("arrow-circle-right",60414),arrowCircleUp:K("arrow-circle-up",60415),heartFilled:K("heart-filled",60420),map:K("map",60421),mapFilled:K("map-filled",60422),circleSmall:K("circle-small",60423),bellSlash:K("bell-slash",60424),bellSlashDot:K("bell-slash-dot",60425),commentUnresolved:K("comment-unresolved",60426),gitPullRequestGoToChanges:K("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:K("git-pull-request-new-changes",60428),searchFuzzy:K("search-fuzzy",60429),commentDraft:K("comment-draft",60430),send:K("send",60431),sparkle:K("sparkle",60432),insert:K("insert",60433),mic:K("mic",60434),dialogError:K("dialog-error","error"),dialogWarning:K("dialog-warning","warning"),dialogInfo:K("dialog-info","info"),dialogClose:K("dialog-close","close"),treeItemExpanded:K("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:K("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:K("tree-filter-on-type-off","list-selection"),treeFilterClear:K("tree-filter-clear","close"),treeItemLoading:K("tree-item-loading","loading"),menuSelection:K("menu-selection","check"),menuSubmenu:K("menu-submenu","chevron-right"),menuBarMore:K("menubar-more","more"),scrollbarButtonLeft:K("scrollbar-button-left","triangle-left"),scrollbarButtonRight:K("scrollbar-button-right","triangle-right"),scrollbarButtonUp:K("scrollbar-button-up","triangle-up"),scrollbarButtonDown:K("scrollbar-button-down","triangle-down"),toolBarMore:K("toolbar-more","more"),quickInputBack:K("quick-input-back","arrow-left")};var ple=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 XQi=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new De,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]),_i(()=>{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 ZQi(this,e,t);return this._factories.set(e,r),_i(()=>{const o=this._factories.get(e);!o||o!==r||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return ple(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 ZQi extends qe{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 ple(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return ple(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 x3=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 c0e{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class gK{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var T3;(function(n){const e=new Map;e.set(0,jt.symbolMethod),e.set(1,jt.symbolFunction),e.set(2,jt.symbolConstructor),e.set(3,jt.symbolField),e.set(4,jt.symbolVariable),e.set(5,jt.symbolClass),e.set(6,jt.symbolStruct),e.set(7,jt.symbolInterface),e.set(8,jt.symbolModule),e.set(9,jt.symbolProperty),e.set(10,jt.symbolEvent),e.set(11,jt.symbolOperator),e.set(12,jt.symbolUnit),e.set(13,jt.symbolValue),e.set(15,jt.symbolEnum),e.set(14,jt.symbolConstant),e.set(15,jt.symbolEnum),e.set(16,jt.symbolEnumMember),e.set(17,jt.symbolKeyword),e.set(27,jt.symbolSnippet),e.set(18,jt.symbolText),e.set(19,jt.symbolColor),e.set(20,jt.symbolFile),e.set(21,jt.symbolReference),e.set(22,jt.symbolCustomColor),e.set(23,jt.symbolFolder),e.set(24,jt.symbolTypeParameter),e.set(25,jt.account),e.set(26,jt.issues);function t(o){let s=e.get(o);return s||(console.info("No codicon found for CompletionItemKind "+o),s=jt.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})(T3||(T3={}));var Qy;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Qy||(Qy={}));class PXe{constructor(e,t,i,r){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=r}equals(e){return J.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Qb;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Qb||(Qb={}));var k3;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(k3||(k3={}));function JQi(n){return n&&Jn.isUri(n.uri)&&J.isIRange(n.range)&&(J.isIRange(n.originSelectionRange)||J.isIRange(n.targetSelectionRange))}const eXi={17:T("Array","array"),16:T("Boolean","boolean"),4:T("Class","class"),13:T("Constant","constant"),8:T("Constructor","constructor"),9:T("Enum","enumeration"),21:T("EnumMember","enumeration member"),23:T("Event","event"),7:T("Field","field"),0:T("File","file"),11:T("Function","function"),10:T("Interface","interface"),19:T("Key","key"),5:T("Method","method"),1:T("Module","module"),2:T("Namespace","namespace"),20:T("Null","null"),15:T("Number","number"),18:T("Object","object"),24:T("Operator","operator"),3:T("Package","package"),6:T("Property","property"),14:T("String","string"),22:T("Struct","struct"),25:T("TypeParameter","type parameter"),12:T("Variable","variable")};function tXi(n,e){return T("symbolAriaLabel","{0} ({1})",n,eXi[e])}var XW;(function(n){const e=new Map;e.set(0,jt.symbolFile),e.set(1,jt.symbolModule),e.set(2,jt.symbolNamespace),e.set(3,jt.symbolPackage),e.set(4,jt.symbolClass),e.set(5,jt.symbolMethod),e.set(6,jt.symbolProperty),e.set(7,jt.symbolField),e.set(8,jt.symbolConstructor),e.set(9,jt.symbolEnum),e.set(10,jt.symbolInterface),e.set(11,jt.symbolFunction),e.set(12,jt.symbolVariable),e.set(13,jt.symbolConstant),e.set(14,jt.symbolString),e.set(15,jt.symbolNumber),e.set(16,jt.symbolBoolean),e.set(17,jt.symbolArray),e.set(18,jt.symbolObject),e.set(19,jt.symbolKey),e.set(20,jt.symbolNull),e.set(21,jt.symbolEnumMember),e.set(22,jt.symbolStruct),e.set(23,jt.symbolEvent),e.set(24,jt.symbolOperator),e.set(25,jt.symbolTypeParameter);function t(i){let r=e.get(i);return r||(console.info("No codicon found for SymbolKind "+i),r=jt.symbolProperty),r}n.toIcon=t})(XW||(XW={}));class kd{static fromValue(e){switch(e){case"comment":return kd.Comment;case"imports":return kd.Imports;case"region":return kd.Region}return new kd(e)}constructor(e){this.value=e}}kd.Comment=new kd("comment");kd.Imports=new kd("imports");kd.Region=new kd("region");var gle;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(gle||(gle={}));var ZW;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(ZW||(ZW={}));class nXi{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 Ks=new XQi;var mle;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(mle||(mle={}));var _le;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(_le||(_le={}));var vle;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(vle||(vle={}));var ble;(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"})(ble||(ble={}));var yle;(function(n){n[n.Deprecated=1]="Deprecated"})(yle||(yle={}));var Cle;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(Cle||(Cle={}));var wle;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(wle||(wle={}));var Sle;(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"})(Sle||(Sle={}));var Ele;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(Ele||(Ele={}));var xle;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(xle||(xle={}));var Tle;(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"})(Tle||(Tle={}));var kle;(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"})(kle||(kle={}));var Ile;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(Ile||(Ile={}));var Lle;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(Lle||(Lle={}));var Dle;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(Dle||(Dle={}));var Ale;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Ale||(Ale={}));var Rle;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Rle||(Rle={}));var Nle;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(Nle||(Nle={}));var Ole;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Ole||(Ole={}));var Ple;(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"})(Ple||(Ple={}));var Mle;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Mle||(Mle={}));var Fle;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(Fle||(Fle={}));var Ble;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Ble||(Ble={}));var $le;(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"})($le||($le={}));var Vle;(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"})(Vle||(Vle={}));var Hle;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Hle||(Hle={}));var Wle;(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"})(Wle||(Wle={}));var zle;(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"})(zle||(zle={}));var Ule;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(Ule||(Ule={}));var jle;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(jle||(jle={}));var qle;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(qle||(qle={}));var Gle;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(Gle||(Gle={}));var Kle;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Kle||(Kle={}));var Yle;(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"})(Yle||(Yle={}));var Qle;(function(n){n[n.Deprecated=1]="Deprecated"})(Qle||(Qle={}));var Xle;(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"})(Xle||(Xle={}));var Zle;(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"})(Zle||(Zle={}));var Jle;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Jle||(Jle={}));var ece;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(ece||(ece={}));let w6=class{static chord(e,t){return gl(e,t)}};w6.CtrlCmd=2048;w6.Shift=1024;w6.Alt=512;w6.WinCtrl=256;function MXe(){return{editor:void 0,languages:void 0,CancellationTokenSource:$a,Emitter:De,KeyCode:Ple,KeyMod:w6,Position:Re,Range:J,Selection:kn,SelectionDirection:Gle,MarkerSeverity:Mle,MarkerTag:Fle,Uri:Jn,Token:x3}}class iXi{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 mNe{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 cE{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 yA;function FXe(n){return!n||typeof n!="string"?!0:n.trim().length===0}const rXi=/{(\d+)}/g;function GT(n,...e){return e.length===0?n:n.replace(rXi,function(t,i){const r=parseInt(i,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function JW(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})}function ep(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function oXi(n,e=" "){const t=S6(n,e);return BXe(t,e)}function S6(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 BXe(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 sXi(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function aXi(n){return n.replace(/\*/g,"")}function $Xe(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=ep(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 lXi(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function a0(n){return n.split(/\r\n|\r|\n/)}function Gu(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 jo(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 hv(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 I3(n,e){return n<e?-1:n>e?1:0}function u0e(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 tce(n,e){return E6(n,e,0,n.length,0,e.length)}function E6(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 u0e(n.toLowerCase(),e.toLowerCase(),t,i,r,o);nw(l)&&(l-=32),nw(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 R9(n){return n>=48&&n<=57}function nw(n){return n>=97&&n<=122}function ab(n){return n>=65&&n<=90}function rL(n,e){return n.length===e.length&&E6(n,e)===0}function d0e(n,e){const t=e.length;return e.length>n.length?!1:E6(n,e,0,t)===0}function KT(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 ez(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 Rl(n){return 55296<=n&&n<=56319}function YT(n){return 56320<=n&&n<=57343}function h0e(n,e){return(n-55296<<10)+(e-56320)+65536}function tz(n,e,t){const i=n.charCodeAt(t);if(Rl(i)&&t+1<e){const r=n.charCodeAt(t+1);if(YT(r))return h0e(i,r)}return i}function cXi(n,e){const t=n.charCodeAt(e-1);if(YT(t)&&e>1){const i=n.charCodeAt(e-2);if(Rl(i))return h0e(i,t)}return t}class f0e{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=cXi(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=tz(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class nz{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new f0e(e,t)}nextGraphemeLength(){const e=iw.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(_Ne(r,s)){t.setOffset(o);break}r=s}return t.offset-i}prevGraphemeLength(){const e=iw.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(_Ne(s,r)){t.setOffset(o);break}r=s}return i-t.offset}eol(){return this._iterator.eol()}}function p0e(n,e){return new nz(n,e).nextGraphemeLength()}function VXe(n,e){return new nz(n,e).prevGraphemeLength()}function uXi(n,e){e>0&&YT(n.charCodeAt(e))&&e--;const t=e+p0e(n,e);return[t-VXe(n,t),t]}let Uee;function dXi(){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 CA(n){return Uee||(Uee=dXi()),Uee.test(n)}const hXi=/^[\t\n\r\x20-\x7E]*$/;function x6(n){return hXi.test(n)}const HXe=/[\u2028\u2029]/;function WXe(n){return HXe.test(n)}function mS(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function g0e(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 fXi=String.fromCharCode(65279);function m0e(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function pXi(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function zXe(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function _Ne(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 iw{static getInstance(){return iw._INSTANCE||(iw._INSTANCE=new iw),iw._INSTANCE}constructor(){this._data=gXi()}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}}iw._INSTANCE=null;function gXi(){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 mXi(n,e){if(n===0)return 0;const t=_Xi(n,e);if(t!==void 0)return t;const i=new f0e(e,n);return i.prevCodePoint(),i.offset}function _Xi(n,e){const t=new f0e(e,n);let i=t.prevCodePoint();for(;vXi(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!g0e(i))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function vXi(n){return 127995<=n&&n<=127999}const UXe=" ";class QT{static getInstance(e){return yA.cache.get(Array.from(e))}static getLocales(){return yA._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())}}yA=QT;QT.ambiguousCharacterData=new cE(()=>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]}'));QT.cache=new iXi(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,f]of u)d.set(h,f);return d}function i(c,u){if(!c)return u;const d=new Map;for(const[h,f]of c)u.has(h)&&d.set(h,f);return d}const r=yA.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 yA(l)});QT._locales=new cE(()=>Object.keys(yA.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class Xb{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(Xb.getRawData())),this._data}static isInvisibleCharacter(e){return Xb.getData().has(e)}static get codePoints(){return Xb.getData()}}Xb._data=void 0;class nce{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}nce.INSTANCE=new nce;class bXi extends qe{constructor(){super(),this._onDidChange=this._register(new De),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 yXi extends qe{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new De),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new bXi);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 CXi{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new yXi),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function jXe(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const L3=new CXi;function wXi(){return nce.INSTANCE.getZoomFactor()}const tN=navigator.userAgent,mg=tN.indexOf("Firefox")>=0,dT=tN.indexOf("AppleWebKit")>=0,_0e=tN.indexOf("Chrome")>=0,w1=!_0e&&tN.indexOf("Safari")>=0,qXe=!_0e&&!w1&&dT;tN.indexOf("Electron/")>=0;const vNe=tN.indexOf("Android")>=0;let G$=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");G$=n.matches,jXe(n,({matches:t})=>{G$&&e.matches||(G$=t)})}function SXi(){return G$}class GXe{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=p_(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=p_(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=p_(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=p_(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=p_(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=p_(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=p_(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=p_(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=p_(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=p_(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=p_(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 p_(n){return typeof n=="number"?`${n}px`:n}function oo(n){return new GXe(n)}function Zc(n,e){n instanceof GXe?(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 EXi{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class v0e{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");Zc(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Zc(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const r=document.createElement("div");Zc(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");v0e._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 xXi(n,e){new v0e(n,e).read()}const Hp=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new De,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))}},TXi=br?1.5:1.35,jee=8;class hT{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 hT._create(r,o,s,a,l,c,u,t,i)}static _create(e,t,i,r,o,s,a,l,c){s===0?s=TXi*i:s<jee&&(s=s*i),s=Math.round(s),s<jee&&(s=jee);const u=1+(c?0:Hp.getZoomLevel()*.1);return i*=u,s*=u,o===K_.TRANSLATE&&(t==="normal"||t==="bold"?o=K_.OFF:(o=`'wght' ${parseInt(t,10)}`,t="normal")),new hT({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=zh.fontFamily,t=hT._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const kXi=2;class ice extends hT{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=kXi,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 IXi extends qe{constructor(){super(),this._onDidChange=this._register(new De),this.onDidChange=this._onDidChange.event,this._cache=new bNe,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new bNe,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 ice({pixelRatio:L3.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 EXi(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),f=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),m=this._createRequest("8",0,t,i),v=this._createRequest("9",0,t,i),_=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),E="|/-_ilm%";for(let A=0,N=E.length;A<N;A++)this._createRequest(E.charAt(A),0,t,i),this._createRequest(E.charAt(A),1,t,i),this._createRequest(E.charAt(A),2,t,i);xXi(e,t);const x=Math.max(a.width,l.width,c.width,u.width,d.width,h.width,f.width,g.width,m.width,v.width);let k=e.fontFeatureSettings===xf.OFF;const L=i[0].width;for(let A=1,N=i.length;k&&A<N;A++){const P=L-i[A].width;if(P<-.001||P>.001){k=!1;break}}let D=!0;return k&&b.width!==L&&(D=!1),b.width>_.width&&(D=!1),new ice({pixelRatio:L3.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:k,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:s.width,middotWidth:y.width,wsmiddotWidth:C.width,maxDigitWidth:x},!0)}}class bNe{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 rce=new IXi;var tv;(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})(tv||(tv={}));const pi=lr("instantiationService");function LXi(n,e,t){e[tv.DI_TARGET]===e?e[tv.DI_DEPENDENCIES].push({id:n,index:t}):(e[tv.DI_DEPENDENCIES]=[{id:n,index:t}],e[tv.DI_TARGET]=e)}function lr(n){if(tv.serviceIds.has(n))return tv.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");LXi(e,t,r)};return e.toString=()=>n,tv.serviceIds.set(n,e),e}const io=lr("codeEditorService"),Ls=lr("modelService"),vh=lr("textModelService");var wA=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 Nd extends qe{constructor(e,t="",i="",r=!0,o){super(),this._onDidChange=this._register(new De),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 wA(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class SA extends qe{constructor(){super(...arguments),this._onWillRun=this._register(new De),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new De),this.onDidRun=this._onDidRun.event}run(e,t){return wA(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 wA(this,void 0,void 0,function*(){yield e.run(t)})}}class ic{constructor(){this.id=ic.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 ic,...i]:t=i);return t}run(){return wA(this,void 0,void 0,function*(){})}}ic.ID="vs.actions.separator";class EA{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 wA(this,void 0,void 0,function*(){})}}class mK extends Nd{constructor(){super(mK.ID,T("submenu.empty","(empty)"),void 0,!1)}}mK.ID="vs.actions.empty";function ZL(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)=>wA(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var oce;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(oce||(oce={}));var ei;(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 f=e.exec(h.id);if(!f)return t(jt.error);const[,g,m]=f,v=["codicon","codicon-"+g];return m&&v.push("codicon-modifier-"+m.substring(1)),v}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"||oce.isThemeColor(h.color))}n.isThemeIcon=o;const s=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}n.fromString=a;function l(h){return{id:h}}n.fromId=l;function c(h,f){let g=h.id;const m=g.lastIndexOf("~");return m!==-1&&(g=g.substring(0,m)),f&&(g=`${g}~${f}`),{id:g}}n.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}n.getModifier=u;function d(h,f){var g,m;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((m=f.color)===null||m===void 0?void 0:m.id)}n.isEqual=d})(ei||(ei={}));const ga=lr("commandService"),yr=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new De,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 dYi(c,s),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new Td,this._commands.set(t,i));const r=i.unshift(n),o=_i(()=>{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 yr.registerCommand(n,(t,...i)=>t.get(ga).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return rr.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}};yr.registerCommand("noop",()=>{});function qee(...n){switch(n.length){case 1:return T("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return T("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return T("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const DXi=T("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),AXi=T("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let bx=class sce{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 n0e(`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(qee("==","=~"));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(qee("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(qee("||"));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=sce._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(DXi);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(AXi);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&&sce._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}};bx._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));bx._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Su=new Map;Su.set("false",!1);Su.set("true",!0);Su.set("isMac",br);Su.set("isLinux",Xu);Su.set("isWindows",eu);Su.set("isWeb",sE);Su.set("isMacNative",br&&!sE);Su.set("isEdge",kYi);Su.set("isFirefox",xYi);Su.set("isChrome",gXe);Su.set("isSafari",TYi);const RXi=Object.prototype.hasOwnProperty,NXi={regexParsingWithErrorRecovery:!0},OXi=T("contextkey.parser.error.emptyString","Empty context key expression"),PXi=T("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."),MXi=T("contextkey.parser.error.noInAfterNot","'in' after 'not'."),yNe=T("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),FXi=T("contextkey.parser.error.unexpectedToken","Unexpected token"),BXi=T("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),$Xi=T("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),VXi=T("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let KXe=class _P{constructor(e=NXi){this._config=e,this._scanner=new bx,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:OXi,offset:0,lexeme:"",additionalInfo:PXi});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?BXi:void 0;throw this._parsingErrors.push({message:FXi,offset:i.offset,lexeme:bx.getLexeme(i),additionalInfo:r}),_P._parseError}return t}catch(t){if(t!==_P._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]:ht.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:ht.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Pd.INSTANCE;case 12:return this._advance(),ch.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,yNe),t==null?void 0:t.negate()}case 17:return this._advance(),Xk.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(),ht.true();case 12:return this._advance(),ht.false();case 0:{this._advance();const t=this._expr();return this._consume(1,yNe),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 D3.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(bx.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 ht.regex(t,d)}case 18:{const o=r.lexeme;this._advance();let s=null;if(!FXe(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 D3.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,MXi);const r=this._value();return ht.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return ht.equals(t,r);switch(r){case"true":return ht.has(t);case"false":return ht.not(t);default:return ht.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return ht.notEquals(t,r);switch(r){case"true":return ht.not(t);case"false":return ht.has(t);default:return ht.notEquals(t,r)}}case 5:return this._advance(),SK.create(t,this._value());case 6:return this._advance(),EK.create(t,this._value());case 7:return this._advance(),CK.create(t,this._value());case 8:return this._advance(),wK.create(t,this._value());case 13:return this._advance(),ht.in(t,this._value());default:return ht.has(t)}}case 20:throw this._parsingErrors.push({message:$Xi,offset:e.offset,lexeme:"",additionalInfo:VXi}),_P._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=T("contextkey.parser.error.expectedButGot",`Expected: {0}
Received: '{1}'.`,e,bx.getLexeme(t)),o=t.offset,s=bx.getLexeme(t);return this._parsingErrors.push({message:r,offset:o,lexeme:s,additionalInfo:i}),_P._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};KXe._parseError=new Error;class ht{static false(){return Pd.INSTANCE}static true(){return ch.INSTANCE}static has(e){return Qk.create(e)}static equals(e,t){return nN.create(e,t)}static notEquals(e,t){return bK.create(e,t)}static regex(e,t){return D3.create(e,t)}static in(e,t){return _K.create(e,t)}static notIn(e,t){return vK.create(e,t)}static not(e){return Xk.create(e)}static and(...e){return Wx.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)}}ht._parser=new KXe({regexParsingWithErrorRecovery:!1});function HXi(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 NM(n,e){return n.cmp(e)}class Pd{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 ch.INSTANCE}}Pd.INSTANCE=new Pd;class ch{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 Pd.INSTANCE}}ch.INSTANCE=new ch;class Qk{static create(e,t=null){const i=Su.get(e);return typeof i=="boolean"?i?ch.INSTANCE:Pd.INSTANCE:new Qk(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:QXe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Su.get(this.key);return typeof e=="boolean"?e?ch.INSTANCE:Pd.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Xk.create(this.key,this)),this.negated}}class nN{static create(e,t,i=null){if(typeof t=="boolean")return t?Qk.create(e,i):Xk.create(e,i);const r=Su.get(e);return typeof r=="boolean"?t===(r?"true":"false")?ch.INSTANCE:Pd.INSTANCE:new nN(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:Zk(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=Su.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ch.INSTANCE:Pd.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=bK.create(this.key,this.value,this)),this.negated}}class _K{static create(e,t){return new _K(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:Zk(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?RXi.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=vK.create(this.key,this.valueKey)),this.negated}}class vK{static create(e,t){return new vK(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=_K.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 bK{static create(e,t,i=null){if(typeof t=="boolean")return t?Xk.create(e,i):Qk.create(e,i);const r=Su.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Pd.INSTANCE:ch.INSTANCE:new bK(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:Zk(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=Su.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Pd.INSTANCE:ch.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=nN.create(this.key,this.value,this)),this.negated}}class Xk{static create(e,t=null){const i=Su.get(e);return typeof i=="boolean"?i?Pd.INSTANCE:ch.INSTANCE:new Xk(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:QXe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Su.get(this.key);return typeof e=="boolean"?e?Pd.INSTANCE:ch.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Qk.create(this.key,this)),this.negated}}function yK(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):Pd.INSTANCE}class CK{static create(e,t,i=null){return yK(t,r=>new CK(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:Zk(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=EK.create(this.key,this.value,this)),this.negated}}class wK{static create(e,t,i=null){return yK(t,r=>new wK(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:Zk(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=SK.create(this.key,this.value,this)),this.negated}}class SK{static create(e,t,i=null){return yK(t,r=>new SK(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:Zk(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=wK.create(this.key,this.value,this)),this.negated}}class EK{static create(e,t,i=null){return yK(t,r=>new EK(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:Zk(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=CK.create(this.key,this.value,this)),this.negated}}class D3{static create(e,t){return new D3(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=b0e.create(this)),this.negated}}class b0e{static create(e){return new b0e(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 YXe(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 Wx{static create(e,t,i){return Wx._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=NM(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=YXe(this.expr);return e===this.expr?this:Wx.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 Pd.INSTANCE;if(s.type===6){r.push(...s.expr);continue}r.push(s)}if(r.length===0&&o)return ch.INSTANCE;if(r.length!==0){if(r.length===1)return r[0];r.sort(NM);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=>Wx.create([u,a],null,i)),null,l);c&&(r.push(c),r.sort(NM))}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 Pd.INSTANCE;if(r.length===1)return r[0]}return new Wx(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=NM(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=YXe(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 ch.INSTANCE;if(l.type===9){r=r.concat(l.expr);continue}r.push(l)}}if(r.length===0&&o)return Pd.INSTANCE;r.sort(NM)}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 ch.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 wNe(t))for(const s of wNe(i))r.push(Wx.create([o,s],null,!1));e.unshift(wy.create(r,null,!1))}this.negated=wy.create(e,this,!0)}return this.negated}}class sn extends Qk{static all(){return sn._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?sn._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&sn._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 nN.create(this.key,e)}}sn._info=[];const bi=lr("contextKeyService");function QXe(n,e){return n<e?-1:n>e?1:0}function Zk(n,e,t,i){return n<t?-1:n>t?1:e<i?-1:e>i?1:0}function ace(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?CNe(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(ace(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return CNe(e.expr,n.expr);for(const t of n.expr)if(ace(t,e))return!0;return!1}return n.equals(e)}function CNe(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 wNe(n){return n.type===9?n.expr:[n]}function lce(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new Gee([N9(t,e),N9(i,e)]):new Gee([N9(t,e)])}else{const t=[];for(let i=0;i<n.length;i++)t.push(N9(n[i],e));return new Gee(t)}}function N9(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 S1(r,o,s,a,l)}class S1{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 S1&&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 Gee{constructor(e){if(e.length===0)throw ag("chords");this.chords=e}}class WXi{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 zXi{}function Kee(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function xK(n,e="Unreachable"){throw new Error(e)}function A3(n){if(!n()){debugger;n(),Pi(new Ya("Assertion Failed"))}}function XXe(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 UXi{constructor(){this.data=new Map}add(e,t){Kee(Rd(e)),Kee(xd(t)),Kee(!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 Hs=new UXi;class y0e{constructor(){this._coreKeybindings=new Td,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(Of===1){if(e&&e.win)return e.win}else if(Of===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=y0e.bindToCurrentPlatform(e),i=new yt;if(t&&t.primary){const r=lce(t.primary,Of);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=lce(s,Of);a&&i.add(this._registerDefaultKeybinding(a,e.id,e.args,e.weight,-r-1,e.when))}return i}registerCommandAndKeybindingRule(e){return xm(this.registerKeybindingRule(e),yr.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,_i(()=>{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(qXi)),this._cachedMergedKeybindings.slice(0)}}const uh=new y0e,jXi={EditorModes:"platform.keybindingsRegistry"};Hs.add(jXi.EditorModes,uh);function qXi(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 GXi=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},SNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},KXi=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},K$;function oL(n){return n.command!==void 0}function YXi(n){return n.submenu!==void 0}class ue{constructor(e){if(ue._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);ue._instances.set(e,this),this.id=e}}ue._instances=new Map;ue.CommandPalette=new ue("CommandPalette");ue.DebugBreakpointsContext=new ue("DebugBreakpointsContext");ue.DebugCallStackContext=new ue("DebugCallStackContext");ue.DebugConsoleContext=new ue("DebugConsoleContext");ue.DebugVariablesContext=new ue("DebugVariablesContext");ue.DebugWatchContext=new ue("DebugWatchContext");ue.DebugToolBar=new ue("DebugToolBar");ue.DebugToolBarStop=new ue("DebugToolBarStop");ue.EditorContext=new ue("EditorContext");ue.SimpleEditorContext=new ue("SimpleEditorContext");ue.EditorContent=new ue("EditorContent");ue.EditorLineNumberContext=new ue("EditorLineNumberContext");ue.EditorContextCopy=new ue("EditorContextCopy");ue.EditorContextPeek=new ue("EditorContextPeek");ue.EditorContextShare=new ue("EditorContextShare");ue.EditorTitle=new ue("EditorTitle");ue.EditorTitleRun=new ue("EditorTitleRun");ue.EditorTitleContext=new ue("EditorTitleContext");ue.EditorTitleContextShare=new ue("EditorTitleContextShare");ue.EmptyEditorGroup=new ue("EmptyEditorGroup");ue.EmptyEditorGroupContext=new ue("EmptyEditorGroupContext");ue.EditorTabsBarContext=new ue("EditorTabsBarContext");ue.ExplorerContext=new ue("ExplorerContext");ue.ExplorerContextShare=new ue("ExplorerContextShare");ue.ExtensionContext=new ue("ExtensionContext");ue.GlobalActivity=new ue("GlobalActivity");ue.CommandCenter=new ue("CommandCenter");ue.CommandCenterCenter=new ue("CommandCenterCenter");ue.LayoutControlMenuSubmenu=new ue("LayoutControlMenuSubmenu");ue.LayoutControlMenu=new ue("LayoutControlMenu");ue.MenubarMainMenu=new ue("MenubarMainMenu");ue.MenubarAppearanceMenu=new ue("MenubarAppearanceMenu");ue.MenubarDebugMenu=new ue("MenubarDebugMenu");ue.MenubarEditMenu=new ue("MenubarEditMenu");ue.MenubarCopy=new ue("MenubarCopy");ue.MenubarFileMenu=new ue("MenubarFileMenu");ue.MenubarGoMenu=new ue("MenubarGoMenu");ue.MenubarHelpMenu=new ue("MenubarHelpMenu");ue.MenubarLayoutMenu=new ue("MenubarLayoutMenu");ue.MenubarNewBreakpointMenu=new ue("MenubarNewBreakpointMenu");ue.PanelAlignmentMenu=new ue("PanelAlignmentMenu");ue.PanelPositionMenu=new ue("PanelPositionMenu");ue.MenubarPreferencesMenu=new ue("MenubarPreferencesMenu");ue.MenubarRecentMenu=new ue("MenubarRecentMenu");ue.MenubarSelectionMenu=new ue("MenubarSelectionMenu");ue.MenubarShare=new ue("MenubarShare");ue.MenubarSwitchEditorMenu=new ue("MenubarSwitchEditorMenu");ue.MenubarSwitchGroupMenu=new ue("MenubarSwitchGroupMenu");ue.MenubarTerminalMenu=new ue("MenubarTerminalMenu");ue.MenubarViewMenu=new ue("MenubarViewMenu");ue.MenubarHomeMenu=new ue("MenubarHomeMenu");ue.OpenEditorsContext=new ue("OpenEditorsContext");ue.OpenEditorsContextShare=new ue("OpenEditorsContextShare");ue.ProblemsPanelContext=new ue("ProblemsPanelContext");ue.SCMChangeContext=new ue("SCMChangeContext");ue.SCMResourceContext=new ue("SCMResourceContext");ue.SCMResourceContextShare=new ue("SCMResourceContextShare");ue.SCMResourceFolderContext=new ue("SCMResourceFolderContext");ue.SCMResourceGroupContext=new ue("SCMResourceGroupContext");ue.SCMSourceControl=new ue("SCMSourceControl");ue.SCMTitle=new ue("SCMTitle");ue.SearchContext=new ue("SearchContext");ue.SearchActionMenu=new ue("SearchActionContext");ue.StatusBarWindowIndicatorMenu=new ue("StatusBarWindowIndicatorMenu");ue.StatusBarRemoteIndicatorMenu=new ue("StatusBarRemoteIndicatorMenu");ue.StickyScrollContext=new ue("StickyScrollContext");ue.TestItem=new ue("TestItem");ue.TestItemGutter=new ue("TestItemGutter");ue.TestMessageContext=new ue("TestMessageContext");ue.TestMessageContent=new ue("TestMessageContent");ue.TestPeekElement=new ue("TestPeekElement");ue.TestPeekTitle=new ue("TestPeekTitle");ue.TouchBarContext=new ue("TouchBarContext");ue.TitleBarContext=new ue("TitleBarContext");ue.TitleBarTitleContext=new ue("TitleBarTitleContext");ue.TunnelContext=new ue("TunnelContext");ue.TunnelPrivacy=new ue("TunnelPrivacy");ue.TunnelProtocol=new ue("TunnelProtocol");ue.TunnelPortInline=new ue("TunnelInline");ue.TunnelTitle=new ue("TunnelTitle");ue.TunnelLocalAddressInline=new ue("TunnelLocalAddressInline");ue.TunnelOriginInline=new ue("TunnelOriginInline");ue.ViewItemContext=new ue("ViewItemContext");ue.ViewContainerTitle=new ue("ViewContainerTitle");ue.ViewContainerTitleContext=new ue("ViewContainerTitleContext");ue.ViewTitle=new ue("ViewTitle");ue.ViewTitleContext=new ue("ViewTitleContext");ue.CommentEditorActions=new ue("CommentEditorActions");ue.CommentThreadTitle=new ue("CommentThreadTitle");ue.CommentThreadActions=new ue("CommentThreadActions");ue.CommentThreadAdditionalActions=new ue("CommentThreadAdditionalActions");ue.CommentThreadTitleContext=new ue("CommentThreadTitleContext");ue.CommentThreadCommentContext=new ue("CommentThreadCommentContext");ue.CommentTitle=new ue("CommentTitle");ue.CommentActions=new ue("CommentActions");ue.InteractiveToolbar=new ue("InteractiveToolbar");ue.InteractiveCellTitle=new ue("InteractiveCellTitle");ue.InteractiveCellDelete=new ue("InteractiveCellDelete");ue.InteractiveCellExecute=new ue("InteractiveCellExecute");ue.InteractiveInputExecute=new ue("InteractiveInputExecute");ue.NotebookToolbar=new ue("NotebookToolbar");ue.NotebookStickyScrollContext=new ue("NotebookStickyScrollContext");ue.NotebookCellTitle=new ue("NotebookCellTitle");ue.NotebookCellDelete=new ue("NotebookCellDelete");ue.NotebookCellInsert=new ue("NotebookCellInsert");ue.NotebookCellBetween=new ue("NotebookCellBetween");ue.NotebookCellListTop=new ue("NotebookCellTop");ue.NotebookCellExecute=new ue("NotebookCellExecute");ue.NotebookCellExecutePrimary=new ue("NotebookCellExecutePrimary");ue.NotebookDiffCellInputTitle=new ue("NotebookDiffCellInputTitle");ue.NotebookDiffCellMetadataTitle=new ue("NotebookDiffCellMetadataTitle");ue.NotebookDiffCellOutputsTitle=new ue("NotebookDiffCellOutputsTitle");ue.NotebookOutputToolbar=new ue("NotebookOutputToolbar");ue.NotebookEditorLayoutConfigure=new ue("NotebookEditorLayoutConfigure");ue.NotebookKernelSource=new ue("NotebookKernelSource");ue.BulkEditTitle=new ue("BulkEditTitle");ue.BulkEditContext=new ue("BulkEditContext");ue.TimelineItemContext=new ue("TimelineItemContext");ue.TimelineTitle=new ue("TimelineTitle");ue.TimelineTitleContext=new ue("TimelineTitleContext");ue.TimelineFilterSubMenu=new ue("TimelineFilterSubMenu");ue.AccountsContext=new ue("AccountsContext");ue.PanelTitle=new ue("PanelTitle");ue.AuxiliaryBarTitle=new ue("AuxiliaryBarTitle");ue.TerminalInstanceContext=new ue("TerminalInstanceContext");ue.TerminalEditorInstanceContext=new ue("TerminalEditorInstanceContext");ue.TerminalNewDropdownContext=new ue("TerminalNewDropdownContext");ue.TerminalTabContext=new ue("TerminalTabContext");ue.TerminalTabEmptyAreaContext=new ue("TerminalTabEmptyAreaContext");ue.WebviewContext=new ue("WebviewContext");ue.InlineCompletionsActions=new ue("InlineCompletionsActions");ue.NewFile=new ue("NewFile");ue.MergeInput1Toolbar=new ue("MergeToolbar1Toolbar");ue.MergeInput2Toolbar=new ue("MergeToolbar2Toolbar");ue.MergeBaseToolbar=new ue("MergeBaseToolbar");ue.MergeInputResultToolbar=new ue("MergeToolbarResultToolbar");ue.InlineSuggestionToolbar=new ue("InlineSuggestionToolbar");ue.ChatContext=new ue("ChatContext");ue.ChatCodeBlock=new ue("ChatCodeblock");ue.ChatMessageTitle=new ue("ChatMessageTitle");ue.ChatExecute=new ue("ChatExecute");ue.ChatInputSide=new ue("ChatInputSide");ue.AccessibleView=new ue("AccessibleView");const k0=lr("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 Sc=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new IQi({merge:Sy.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Sy.for(ue.CommandPalette)),_i(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Sy.for(ue.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 Td,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(Sy.for(n)),_i(()=>{i(),this._onDidChangeMenu.fire(Sy.for(n))})}appendMenuItems(n){const e=new yt;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===ue.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)oL(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 R3 extends EA{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 Wm=K$=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=K$.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&&ei.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=ei.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new K$(t,void 0,i,r,o,s):void 0,this._options=i,this.class=c&&ei.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)}};Wm=K$=GXi([SNe(4,bi),SNe(5,ga)],Wm);class up{constructor(e){this.desc=e}}function ys(n){const e=new yt,t=new n,i=t.desc,{f1:r,menu:o,keybinding:s,description:a}=i,l=KXi(i,["f1","menu","keybinding","description"]);if(e.add(yr.registerCommand({id:l.id,handler:(c,...u)=>t.run(c,...u),description:a})),Array.isArray(o))for(const c of o)e.add(Sc.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(Sc.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(r&&(e.add(Sc.appendMenuItem(ue.CommandPalette,{command:l,when:l.precondition})),e.add(Sc.addCommand(l))),Array.isArray(s))for(const c of s)e.add(uh.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?ht.and(l.precondition,c.when):c.when})));else s&&e.add(uh.registerKeybindingRule(Object.assign(Object.assign({},s),{id:l.id,when:l.precondition?ht.and(l.precondition,s.when):s.when})));return e}const dp=lr("telemetryService"),hp=lr("logService");var qc;(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"})(qc||(qc={}));const ZXe=qc.Info;class JXe extends qe{constructor(){super(...arguments),this.level=ZXe,this._onDidChangeLogLevel=this._register(new De),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!==qc.Off&&this.level<=e}}class QXi extends JXe{constructor(e=ZXe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(qc.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(qc.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(qc.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(qc.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(qc.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class XXi extends JXe{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 ZXi(n){switch(n){case qc.Trace:return"trace";case qc.Debug:return"debug";case qc.Info:return"info";case qc.Warning:return"warn";case qc.Error:return"error";case qc.Off:return"off"}}new sn("logLevel",ZXi(qc.Info));const C0e={clipboard:{writeText:uv||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:uv||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>uv||SXi()?0:navigator.keyboard||w1?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function JXi(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(mg)switch(e){case 59:return 85;case 60:if(Xu)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(br)return 57;break}else if(dT){if(br&&e===93)return 57;if(!br&&e===92)return 57}return xXe[e]||0}const eZi=br?256:2048,tZi=512,nZi=1024,iZi=br?2048:256;class ls{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=JXi(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|=eZi),this.altKey&&(t|=tZi),this.shiftKey&&(t|=nZi),this.metaKey&&(t|=iZi),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new S1(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let ENe=!1,wO=null;function rZi(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 ENe=!0,null}catch{return ENe=!0,null}return n.parent}class oZi{static getSameOriginWindowChain(){if(!wO){wO=[];let e=window,t;do t=rZi(e),t?wO.push({window:e,iframeElement:e.frameElement||null}):wO.push({window:e,iframeElement:null}),e=t;while(e)}return wO.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 Zp{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=oZi.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class XT{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?mg&&!br?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")w1&&eu?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?mg&&!br?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:eZe,setPrototypeOf:xNe,isFrozen:sZi,getPrototypeOf:aZi,getOwnPropertyDescriptor:lZi}=Object;let{freeze:Qh,seal:yv,create:cZi}=Object,{apply:cce,construct:uce}=typeof Reflect<"u"&&Reflect;cce||(cce=function(e,t,i){return e.apply(t,i)});Qh||(Qh=function(e){return e});yv||(yv=function(e){return e});uce||(uce=function(e,t){return new e(...t)});const uZi=zm(Array.prototype.forEach),TNe=zm(Array.prototype.pop),SO=zm(Array.prototype.push),Y$=zm(String.prototype.toLowerCase),Yee=zm(String.prototype.toString),dZi=zm(String.prototype.match),g_=zm(String.prototype.replace),hZi=zm(String.prototype.indexOf),fZi=zm(String.prototype.trim),Tp=zm(RegExp.prototype.test),EO=pZi(TypeError);function zm(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 cce(n,e,i)}}function pZi(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return uce(n,t)}}function So(n,e,t){var i;t=(i=t)!==null&&i!==void 0?i:Y$,xNe&&xNe(n,null);let r=e.length;for(;r--;){let o=e[r];if(typeof o=="string"){const s=t(o);s!==o&&(sZi(e)||(e[r]=s),o=s)}n[o]=!0}return n}function XI(n){const e=cZi(null);for(const[t,i]of eZe(n))e[t]=i;return e}function O9(n,e){for(;n!==null;){const i=lZi(n,e);if(i){if(i.get)return zm(i.get);if(typeof i.value=="function")return zm(i.value)}n=aZi(n)}function t(i){return console.warn("fallback value for",i),null}return t}const kNe=Qh(["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"]),Qee=Qh(["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"]),Xee=Qh(["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"]),gZi=Qh(["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"]),Zee=Qh(["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"]),mZi=Qh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),INe=Qh(["#text"]),LNe=Qh(["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"]),Jee=Qh(["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"]),DNe=Qh(["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"]),P9=Qh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_Zi=yv(/\{\{[\w\W]*|[\w\W]*\}\}/gm),vZi=yv(/<%[\w\W]*|[\w\W]*%>/gm),bZi=yv(/\${[\w\W]*}/gm),yZi=yv(/^data-[\-\w.\u00B7-\uFFFF]/),CZi=yv(/^aria-[\-\w]+$/),tZe=yv(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wZi=yv(/^(?:\w+script|data):/i),SZi=yv(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nZe=yv(/^html$/i);var ANe=Object.freeze({__proto__:null,MUSTACHE_EXPR:_Zi,ERB_EXPR:vZi,TMPLIT_EXPR:bZi,DATA_ATTR:yZi,ARIA_ATTR:CZi,IS_ALLOWED_URI:tZe,IS_SCRIPT_OR_DATA:wZi,ATTR_WHITESPACE:SZi,DOCTYPE_NAME:nZe});const EZi=()=>typeof window>"u"?null:window,xZi=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 iZe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:EZi();const e=ut=>iZe(ut);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:f}=n,g=l.prototype,m=O9(g,"cloneNode"),v=O9(g,"nextSibling"),_=O9(g,"childNodes"),b=O9(g,"parentNode");if(typeof s=="function"){const ut=r.createElement("template");ut.content&&ut.content.ownerDocument&&(r=ut.content.ownerDocument)}let y,C="";const{implementation:E,createNodeIterator:x,createDocumentFragment:k,getElementsByTagName:L}=r,{importNode:D}=t;let A={};e.isSupported=typeof eZe=="function"&&typeof b=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:N,ERB_EXPR:P,TMPLIT_EXPR:M,DATA_ATTR:B,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:H}=ANe;let{IS_ALLOWED_URI:W}=ANe,q=null;const V=So({},[...kNe,...Qee,...Xee,...Zee,...INe]);let re=null;const oe=So({},[...LNe,...Jee,...DNe,...P9]);let Q=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}})),Ne=null,Ve=null,Ye=!0,ye=!0,He=!1,Pe=!0,Ge=!1,Fe=!1,bt=!1,Mt=!1,Ft=!1,Yt=!1,ln=!1,Et=!0,mt=!1;const Lt="user-content-";let be=!0,Te=!1,se={},Y=null;const X=So({},["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 le=null;const te=So({},["audio","video","img","source","image","track"]);let me=null;const Me=So({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",It="http://www.w3.org/2000/svg",Qt="http://www.w3.org/1999/xhtml";let pe=Qt,We=!1,ne=null;const Se=So({},[rt,It,Qt],Yee);let Ie;const Ke=["application/xhtml+xml","text/html"],Je="text/html";let ot,wt=null;const pn=r.createElement("form"),Kn=function(Le){return Le instanceof RegExp||Le instanceof Function},Cn=function(Le){if(!(wt&&wt===Le)){if((!Le||typeof Le!="object")&&(Le={}),Le=XI(Le),Ie=Ke.indexOf(Le.PARSER_MEDIA_TYPE)===-1?Ie=Je:Ie=Le.PARSER_MEDIA_TYPE,ot=Ie==="application/xhtml+xml"?Yee:Y$,q="ALLOWED_TAGS"in Le?So({},Le.ALLOWED_TAGS,ot):V,re="ALLOWED_ATTR"in Le?So({},Le.ALLOWED_ATTR,ot):oe,ne="ALLOWED_NAMESPACES"in Le?So({},Le.ALLOWED_NAMESPACES,Yee):Se,me="ADD_URI_SAFE_ATTR"in Le?So(XI(Me),Le.ADD_URI_SAFE_ATTR,ot):Me,le="ADD_DATA_URI_TAGS"in Le?So(XI(te),Le.ADD_DATA_URI_TAGS,ot):te,Y="FORBID_CONTENTS"in Le?So({},Le.FORBID_CONTENTS,ot):X,Ne="FORBID_TAGS"in Le?So({},Le.FORBID_TAGS,ot):{},Ve="FORBID_ATTR"in Le?So({},Le.FORBID_ATTR,ot):{},se="USE_PROFILES"in Le?Le.USE_PROFILES:!1,Ye=Le.ALLOW_ARIA_ATTR!==!1,ye=Le.ALLOW_DATA_ATTR!==!1,He=Le.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=Le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ge=Le.SAFE_FOR_TEMPLATES||!1,Fe=Le.WHOLE_DOCUMENT||!1,Ft=Le.RETURN_DOM||!1,Yt=Le.RETURN_DOM_FRAGMENT||!1,ln=Le.RETURN_TRUSTED_TYPE||!1,Mt=Le.FORCE_BODY||!1,Et=Le.SANITIZE_DOM!==!1,mt=Le.SANITIZE_NAMED_PROPS||!1,be=Le.KEEP_CONTENT!==!1,Te=Le.IN_PLACE||!1,W=Le.ALLOWED_URI_REGEXP||tZe,pe=Le.NAMESPACE||Qt,Q=Le.CUSTOM_ELEMENT_HANDLING||{},Le.CUSTOM_ELEMENT_HANDLING&&Kn(Le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=Le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Le.CUSTOM_ELEMENT_HANDLING&&Kn(Le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=Le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Le.CUSTOM_ELEMENT_HANDLING&&typeof Le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=Le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ge&&(ye=!1),Yt&&(Ft=!0),se&&(q=So({},[...INe]),re=[],se.html===!0&&(So(q,kNe),So(re,LNe)),se.svg===!0&&(So(q,Qee),So(re,Jee),So(re,P9)),se.svgFilters===!0&&(So(q,Xee),So(re,Jee),So(re,P9)),se.mathMl===!0&&(So(q,Zee),So(re,DNe),So(re,P9))),Le.ADD_TAGS&&(q===V&&(q=XI(q)),So(q,Le.ADD_TAGS,ot)),Le.ADD_ATTR&&(re===oe&&(re=XI(re)),So(re,Le.ADD_ATTR,ot)),Le.ADD_URI_SAFE_ATTR&&So(me,Le.ADD_URI_SAFE_ATTR,ot),Le.FORBID_CONTENTS&&(Y===X&&(Y=XI(Y)),So(Y,Le.FORBID_CONTENTS,ot)),be&&(q["#text"]=!0),Fe&&So(q,["html","head","body"]),q.table&&(So(q,["tbody"]),delete Ne.tbody),Le.TRUSTED_TYPES_POLICY){if(typeof Le.TRUSTED_TYPES_POLICY.createHTML!="function")throw EO('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw EO('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=Le.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=xZi(f,i)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));Qh&&Qh(Le),wt=Le}},hn=So({},["mi","mo","mn","ms","mtext"]),bn=So({},["foreignobject","desc","title","annotation-xml"]),Wn=So({},["title","style","font","a","script"]),Ei=So({},Qee);So(Ei,Xee),So(Ei,gZi);const er=So({},Zee);So(er,mZi);const ur=function(Le){let st=b(Le);(!st||!st.tagName)&&(st={namespaceURI:pe,tagName:"template"});const ze=Y$(Le.tagName),Ee=Y$(st.tagName);return ne[Le.namespaceURI]?Le.namespaceURI===It?st.namespaceURI===Qt?ze==="svg":st.namespaceURI===rt?ze==="svg"&&(Ee==="annotation-xml"||hn[Ee]):!!Ei[ze]:Le.namespaceURI===rt?st.namespaceURI===Qt?ze==="math":st.namespaceURI===It?ze==="math"&&bn[Ee]:!!er[ze]:Le.namespaceURI===Qt?st.namespaceURI===It&&!bn[Ee]||st.namespaceURI===rt&&!hn[Ee]?!1:!er[ze]&&(Wn[ze]||!Ei[ze]):!!(Ie==="application/xhtml+xml"&&ne[Le.namespaceURI]):!1},Jr=function(Le){SO(e.removed,{element:Le});try{Le.parentNode.removeChild(Le)}catch{Le.remove()}},$i=function(Le,st){try{SO(e.removed,{attribute:st.getAttributeNode(Le),from:st})}catch{SO(e.removed,{attribute:null,from:st})}if(st.removeAttribute(Le),Le==="is"&&!re[Le])if(Ft||Yt)try{Jr(st)}catch{}else try{st.setAttribute(Le,"")}catch{}},xs=function(Le){let st,ze;if(Mt)Le="<remove></remove>"+Le;else{const xt=dZi(Le,/^[\r\n\t ]+/);ze=xt&&xt[0]}Ie==="application/xhtml+xml"&&pe===Qt&&(Le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Le+"</body></html>");const Ee=y?y.createHTML(Le):Le;if(pe===Qt)try{st=new h().parseFromString(Ee,Ie)}catch{}if(!st||!st.documentElement){st=E.createDocument(pe,"template",null);try{st.documentElement.innerHTML=We?C:Ee}catch{}}const tt=st.body||st.documentElement;return Le&&ze&&tt.insertBefore(r.createTextNode(ze),tt.childNodes[0]||null),pe===Qt?L.call(st,Fe?"html":"body")[0]:Fe?st.documentElement:tt},wr=function(Le){return x.call(Le.ownerDocument||Le,Le,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Ji=function(Le){return Le instanceof d&&(typeof Le.nodeName!="string"||typeof Le.textContent!="string"||typeof Le.removeChild!="function"||!(Le.attributes instanceof u)||typeof Le.removeAttribute!="function"||typeof Le.setAttribute!="function"||typeof Le.namespaceURI!="string"||typeof Le.insertBefore!="function"||typeof Le.hasChildNodes!="function")},rn=function(Le){return typeof a=="object"?Le instanceof a:Le&&typeof Le=="object"&&typeof Le.nodeType=="number"&&typeof Le.nodeName=="string"},di=function(Le,st,ze){A[Le]&&uZi(A[Le],Ee=>{Ee.call(e,st,ze,wt)})},Wr=function(Le){let st;if(di("beforeSanitizeElements",Le,null),Ji(Le))return Jr(Le),!0;const ze=ot(Le.nodeName);if(di("uponSanitizeElement",Le,{tagName:ze,allowedTags:q}),Le.hasChildNodes()&&!rn(Le.firstElementChild)&&(!rn(Le.content)||!rn(Le.content.firstElementChild))&&Tp(/<[/\w]/g,Le.innerHTML)&&Tp(/<[/\w]/g,Le.textContent))return Jr(Le),!0;if(!q[ze]||Ne[ze]){if(!Ne[ze]&&Ct(ze)&&(Q.tagNameCheck instanceof RegExp&&Tp(Q.tagNameCheck,ze)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(ze)))return!1;if(be&&!Y[ze]){const Ee=b(Le)||Le.parentNode,tt=_(Le)||Le.childNodes;if(tt&&Ee){const xt=tt.length;for(let lt=xt-1;lt>=0;--lt)Ee.insertBefore(m(tt[lt],!0),v(Le))}}return Jr(Le),!0}return Le instanceof l&&!ur(Le)||(ze==="noscript"||ze==="noembed"||ze==="noframes")&&Tp(/<\/no(script|embed|frames)/i,Le.innerHTML)?(Jr(Le),!0):(Ge&&Le.nodeType===3&&(st=Le.textContent,st=g_(st,N," "),st=g_(st,P," "),st=g_(st,M," "),Le.textContent!==st&&(SO(e.removed,{element:Le.cloneNode()}),Le.textContent=st)),di("afterSanitizeElements",Le,null),!1)},Qe=function(Le,st,ze){if(Et&&(st==="id"||st==="name")&&(ze in r||ze in pn))return!1;if(!(ye&&!Ve[st]&&Tp(B,st))){if(!(Ye&&Tp(F,st))){if(!re[st]||Ve[st]){if(!(Ct(Le)&&(Q.tagNameCheck instanceof RegExp&&Tp(Q.tagNameCheck,Le)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(Le))&&(Q.attributeNameCheck instanceof RegExp&&Tp(Q.attributeNameCheck,st)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(st))||st==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&Tp(Q.tagNameCheck,ze)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(ze))))return!1}else if(!me[st]){if(!Tp(W,g_(ze,H,""))){if(!((st==="src"||st==="xlink:href"||st==="href")&&Le!=="script"&&hZi(ze,"data:")===0&&le[Le])){if(!(He&&!Tp(U,g_(ze,H,"")))){if(ze)return!1}}}}}}return!0},Ct=function(Le){return Le.indexOf("-")>0},Gt=function(Le){let st,ze,Ee,tt;di("beforeSanitizeAttributes",Le,null);const{attributes:xt}=Le;if(!xt)return;const lt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re};for(tt=xt.length;tt--;){st=xt[tt];const{name:gn,namespaceURI:Ln}=st;if(ze=gn==="value"?st.value:fZi(st.value),Ee=ot(gn),lt.attrName=Ee,lt.attrValue=ze,lt.keepAttr=!0,lt.forceKeepAttr=void 0,di("uponSanitizeAttribute",Le,lt),ze=lt.attrValue,lt.forceKeepAttr||($i(gn,Le),!lt.keepAttr))continue;if(!Pe&&Tp(/\/>/i,ze)){$i(gn,Le);continue}Ge&&(ze=g_(ze,N," "),ze=g_(ze,P," "),ze=g_(ze,M," "));const ri=ot(Le.nodeName);if(Qe(ri,Ee,ze)){if(mt&&(Ee==="id"||Ee==="name")&&($i(gn,Le),ze=Lt+ze),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ln)switch(f.getAttributeType(ri,Ee)){case"TrustedHTML":{ze=y.createHTML(ze);break}case"TrustedScriptURL":{ze=y.createScriptURL(ze);break}}try{Ln?Le.setAttributeNS(Ln,gn,ze):Le.setAttribute(gn,ze),TNe(e.removed)}catch{}}}di("afterSanitizeAttributes",Le,null)},Jt=function ut(Le){let st;const ze=wr(Le);for(di("beforeSanitizeShadowDOM",Le,null);st=ze.nextNode();)di("uponSanitizeShadowNode",st,null),!Wr(st)&&(st.content instanceof o&&ut(st.content),Gt(st));di("afterSanitizeShadowDOM",Le,null)};return e.sanitize=function(ut){let Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},st,ze,Ee,tt;if(We=!ut,We&&(ut="<!-->"),typeof ut!="string"&&!rn(ut))if(typeof ut.toString=="function"){if(ut=ut.toString(),typeof ut!="string")throw EO("dirty is not a string, aborting")}else throw EO("toString is not a function");if(!e.isSupported)return ut;if(bt||Cn(Le),e.removed=[],typeof ut=="string"&&(Te=!1),Te){if(ut.nodeName){const gn=ot(ut.nodeName);if(!q[gn]||Ne[gn])throw EO("root node is forbidden and cannot be sanitized in-place")}}else if(ut instanceof a)st=xs("<!---->"),ze=st.ownerDocument.importNode(ut,!0),ze.nodeType===1&&ze.nodeName==="BODY"||ze.nodeName==="HTML"?st=ze:st.appendChild(ze);else{if(!Ft&&!Ge&&!Fe&&ut.indexOf("<")===-1)return y&&ln?y.createHTML(ut):ut;if(st=xs(ut),!st)return Ft?null:ln?C:""}st&&Mt&&Jr(st.firstChild);const xt=wr(Te?ut:st);for(;Ee=xt.nextNode();)Wr(Ee)||(Ee.content instanceof o&&Jt(Ee.content),Gt(Ee));if(Te)return ut;if(Ft){if(Yt)for(tt=k.call(st.ownerDocument);st.firstChild;)tt.appendChild(st.firstChild);else tt=st;return(re.shadowroot||re.shadowrootmode)&&(tt=D.call(t,tt,!0)),tt}let lt=Fe?st.outerHTML:st.innerHTML;return Fe&&q["!doctype"]&&st.ownerDocument&&st.ownerDocument.doctype&&st.ownerDocument.doctype.name&&Tp(nZe,st.ownerDocument.doctype.name)&&(lt="<!DOCTYPE "+st.ownerDocument.doctype.name+`>
`+lt),Ge&&(lt=g_(lt,N," "),lt=g_(lt,P," "),lt=g_(lt,M," ")),y&&ln?y.createHTML(lt):lt},e.setConfig=function(ut){Cn(ut),bt=!0},e.clearConfig=function(){wt=null,bt=!1},e.isValidAttribute=function(ut,Le,st){wt||Cn({});const ze=ot(ut),Ee=ot(Le);return Qe(ze,Ee,st)},e.addHook=function(ut,Le){typeof Le=="function"&&(A[ut]=A[ut]||[],SO(A[ut],Le))},e.removeHook=function(ut){if(A[ut])return TNe(A[ut])},e.removeHooks=function(ut){A[ut]&&(A[ut]=[])},e.removeAllHooks=function(){A={}},e}var I0=iZe();I0.version;I0.isSupported;const rZe=I0.sanitize;I0.setConfig;I0.clearConfig;I0.isValidAttribute;const oZe=I0.addHook,sZe=I0.removeHook;I0.removeHooks;I0.removeAllHooks;var Qi;(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"})(Qi||(Qi={}));const TZi="tkn";class kZi{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${Qi.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Pi(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+=`&${TZi}=${encodeURIComponent(o)}`),Jn.from({scheme:sE?this._preferredWebSchema:Qi.vscodeRemoteResource,authority:`${i}:${r}`,path:this._remoteResourcesPath,query:s})}}const aZe=new kZi;class N3{uriToBrowserUri(e){return e.scheme===Qi.vscodeRemote?aZe.rewrite(e):e.scheme===Qi.file&&(uv||CYi&&Em.origin===`${Qi.vscodeFileResource}://${N3.FALLBACK_AUTHORITY}`)?e.with({scheme:Qi.vscodeFileResource,authority:e.authority||N3.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}N3.FALLBACK_AUTHORITY="vscode-app";const lZe=new N3;var RNe;(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:Jn.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})(RNe||(RNe={}));const{registerWindow:oIr,getWindows:IZi,onDidCreateWindow:sIr}=function(){const n=[],e=new De;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new yt;return i.add(_i(()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function kc(n){for(;n.firstChild;)n.firstChild.remove()}function w0e(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class LZi{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 at(n,e,t,i){return new LZi(n,e,t,i)}function cZe(n){return function(e){return n(new Zp(e))}}function DZi(n){return function(e){return n(new ls(e))}}const Ba=function(e,t,i,r){let o=i;return t==="click"||t==="mousedown"?o=cZe(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=DZi(i)),at(e,t,o,r)},AZi=function(e,t,i){const r=cZe(t);return RZi(e,r,i)};function RZi(n,e,t){return at(n,bv&&C0e.pointerEvents?Xt.POINTER_DOWN:Xt.MOUSE_DOWN,e,t)}let iz,_g;class ete{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){Pi(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(ete.sort),e.shift().execute();i=!1};_g=(o,s=0)=>{const a=new ete(o,s);return n.push(a),t||(t=!0,requestAnimationFrame(r)),a},iz=(o,s)=>{if(i){const a=new ete(o,s);return e.push(a),a}else return _g(o,s)}})();function TK(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function iN(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 Kr(n.clientWidth,n.clientHeight);if(bv&&(i!=null&&i.visualViewport))return new Kr(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new Kr(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new Kr(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new Kr(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class ya{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const r=TK(e),o=r?r.getPropertyValue(t):"0";return ya.convertToPixels(e,o)}static getBorderLeftWidth(e){return ya.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return ya.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return ya.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return ya.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return ya.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return ya.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return ya.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return ya.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return ya.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return ya.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return ya.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return ya.getDimension(e,"margin-bottom","marginBottom")}}class Kr{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Kr(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Kr?e:new Kr(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Kr.None=new Kr(0,0);function uZe(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=dZe(n)?null:TK(n);r&&(i-=r.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=ya.getBorderLeftWidth(n),t+=ya.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function NZi(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function pl(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 OZi(n){let e=n,t=1;do{const i=TK(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Jd(n){const e=ya.getMarginLeft(n)+ya.getMarginRight(n);return n.offsetWidth+e}function tte(n){const e=ya.getBorderLeftWidth(n)+ya.getBorderRightWidth(n),t=ya.getPaddingLeft(n)+ya.getPaddingRight(n);return n.offsetWidth-e-t}function PZi(n){const e=ya.getBorderTopWidth(n)+ya.getBorderBottomWidth(n),t=ya.getPaddingTop(n)+ya.getPaddingBottom(n);return n.offsetHeight-e-t}function zx(n){const e=ya.getMarginTop(n)+ya.getMarginBottom(n);return n.offsetHeight+e}function Qc(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function MZi(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 nte(n,e,t){return!!MZi(n,e,t)}function dZe(n){return n&&!!n.host&&!!n.mode}function rz(n){return!!ZT(n)}function ZT(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 dZe(n)?n:null}function Tm(){let n=kK().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function kK(){var n;return(n=[document,...IZi().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function vg(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 ite=null;function hZe(){return ite||(ite=vg()),ite}function FZi(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 dce(n,e,t=hZe()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function NNe(n,e=hZe()){if(!e)return;const t=FZi(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 S0e(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const Xt={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:dT?"webkitAnimationStart":"animationstart",ANIMATION_END:dT?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:dT?"webkitAnimationIteration":"animationiteration"};function BZi(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const ji={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function $Zi(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function VZi(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 oz extends qe{static hasFocusWithin(e){if(S0e(e)){const t=ZT(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Qc(i,e)}else return Qc(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new De),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new De),this.onDidBlur=this._onDidBlur.event;let t=oz.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=()=>{oz.hasFocusWithin(e)!==t&&(t?o():r())},this._register(at(e,Xt.FOCUS,r,!0)),this._register(at(e,Xt.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(at(e,Xt.FOCUS_IN,()=>this._refreshStateHandler())),this._register(at(e,Xt.FOCUS_OUT,()=>this._refreshStateHandler())))}}function l0(n){return new oz(n)}function ft(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function fZe(n,e){return n.insertBefore(e,n.firstChild),e}function Ic(n,...e){n.innerText="",ft(n,...e)}const HZi=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var O3;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(O3||(O3={}));function pZe(n,e,t,...i){const r=HZi.exec(e);if(!r)throw new Error("Bad use of emmet");const o=r[1]||"div";let s;return n!==O3.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 Rt(n,e,...t){return pZe(O3.HTML,n,e,...t)}Rt.SVG=function(n,e,...t){return pZe(O3.SVG,n,e,...t)};function WZi(n,...e){n?Ph(...e):md(...e)}function Ph(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function md(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function ONe(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function gZe(n){window.open(n,"_blank","noopener")}function zZi(n){const e=()=>{n(),t=_g(e)};let t=_g(e);return _i(()=>t.dispose())}aZe.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function _S(n){return n?`url('${lZe.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function PNe(n){return`'${n.replace(/'/g,"%27")}'`}function fT(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=fT(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function UZi(n,e=!1){const t=document.createElement("a");return oZe("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)}}}),_i(()=>{sZe("afterSanitizeAttributes")})}const jZi=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 Py extends De{constructor(){super(),this._subscriptions=new yt,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(at(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new ls(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(at(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(at(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(at(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(at(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(at(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 Py.instance||(Py.instance=new Py),Py.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class qZi extends qe{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(at(this.element,Xt.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(at(this.element,Xt.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(at(this.element,Xt.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(at(this.element,Xt.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(at(this.element,Xt.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const GZi=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function gc(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const r=GZi.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(MNe(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(MNe(c),u.toString());return l.root=s,l}function MNe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class IK{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=ht.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};uh.registerKeybindingRule(r)}}yr.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Sc.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 rN extends IK{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(hp),r=e.get(bi);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(Tm());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 mZe extends IK{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class oc extends IK{static bindToContribution(e){return class extends oc{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(io),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext(a=>{if(a.get(bi).contextMatchesRules(i??void 0))return r(a,s,t)})}runCommand(e,t){return oc.runEditorCommand(e,t,this.precondition,(i,r,o)=>this.runEditorCommand(i,r,o))}}class vn extends oc{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=ue.EditorContext),r.title||(r.title=e.label),r.when=ht.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(vn.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(dp).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class _Ze extends vn{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 Rv extends up{run(e,...t){const i=e.get(io),r=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(r)return r.invokeWithinContext(o=>{var s,a;const l=o.get(bi),c=o.get(hp);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 L0(n,e){yr.registerCommand(n,function(t,...i){const r=t.get(pi),[o,s]=i;ko(Jn.isUri(o)),ko(Re.isIPosition(s));const a=t.get(Ls).getModel(o);if(a){const l=Re.lift(s);return r.invokeFunction(e,a,l,...i.slice(2))}return t.get(vh).createModelReference(o).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,Re.lift(s),i.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function qt(n){return Wp.INSTANCE.registerEditorCommand(n),n}function Pt(n){const e=new n;return Wp.INSTANCE.registerEditorAction(e),e}function vZe(n){return Wp.INSTANCE.registerEditorAction(n),n}function KZi(n){Wp.INSTANCE.registerEditorAction(n)}function Hr(n,e,t){Wp.INSTANCE.registerEditorContribution(n,e,t)}var JL;(function(n){function e(s){return Wp.INSTANCE.getEditorCommand(s)}n.getEditorCommand=e;function t(){return Wp.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return Wp.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function r(s){return Wp.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}n.getSomeEditorContributions=r;function o(){return Wp.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(JL||(JL={}));const YZi={EditorCommonContributions:"editor.contributions"};class Wp{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}}Wp.INSTANCE=new Wp;Hs.add(YZi.EditorCommonContributions,Wp.INSTANCE);function T6(n){return n.register(),n}const bZe=T6(new rN({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:ue.MenubarEditMenu,group:"1_do",title:T({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:ue.CommandPalette,group:"",title:T("undo","Undo"),order:1}]}));T6(new mZe(bZe,{id:"default:undo",precondition:void 0}));const yZe=T6(new rN({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:ue.MenubarEditMenu,group:"1_do",title:T({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:ue.CommandPalette,group:"",title:T("redo","Redo"),order:1}]}));T6(new mZe(yZe,{id:"default:redo",precondition:void 0}));const QZi=T6(new rN({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:ue.MenubarSelectionMenu,group:"1_basic",title:T({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:ue.CommandPalette,group:"",title:T("selectAll","Select All"),order:1}]})),CZe=Symbol("MicrotaskDelay");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())})},vP=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 hce(n){return!!n&&typeof n.then=="function"}function Sl(n){const e=new $a,t=n(e.token),i=new Promise((r,o)=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),o(new aE)});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 LK(n,e,t){return new Promise((i,r)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,r).finally(()=>o.dispose())})}class XZi{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 ZZi=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},JZi=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Um{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===CZe?JZi(i):ZZi(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 aE),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class wZe{constructor(e){this.delayer=new Um(e),this.throttler=new XZi}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function vS(n,e){return e?new Promise((t,i)=>{const r=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(r),o.dispose(),i(new aE)})}):Sl(t=>vS(n,t))}function bS(n,e=0,t){const i=setTimeout(()=>{n(),t&&r.dispose()},e),r=_i(()=>{clearTimeout(i),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function SZe(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 Jm{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 k6{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 Mo{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 My;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?My=n=>{fXe(()=>{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)}}}:My=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class Q${constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=My(()=>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 DK{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 aE)}}var fce;(function(n){function e(i){return Ap(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)=>Ap(this,void 0,void 0,function*(){try{yield i(r,o)}catch(s){o(s)}}))}n.withAsyncBody=t})(fce||(fce={}));class Ka{static fromArray(e){return new Ka(t=>{t.emitMany(e)})}static fromPromise(e){return new Ka(t=>Ap(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Ka(t=>Ap(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>Ap(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new Ka(t=>Ap(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var r,o,s;return Ap(this,void 0,void 0,function*(){var a,l,c,u;try{for(r=!0,o=vP(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 De,queueMicrotask(()=>Ap(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:()=>Ap(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 on.toPromise(this._onStateChanged.event)}while(!0)})}}static map(e,t){return new Ka(i=>Ap(this,void 0,void 0,function*(){var r,o,s,a;try{for(var l=!0,c=vP(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 Ka.map(this,e)}static filter(e,t){return new Ka(i=>Ap(this,void 0,void 0,function*(){var r,o,s,a;try{for(var l=!0,c=vP(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 Ka.filter(this,e)}static coalesce(e){return Ka.filter(e,t=>!!t)}coalesce(){return Ka.coalesce(this)}static toPromise(e){var t,i,r,o,s,a,l;return Ap(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=vP(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 Ka.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())}}Ka.EMPTY=Ka.fromArray([]);class eJi extends Ka{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function tJi(n){const e=new $a,t=n(e.token);return new eJi(e,i=>Ap(this,void 0,void 0,function*(){var r,o,s,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new aE)});try{try{for(var c=!0,u=vP(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 nJi="$initialize";let FNe=!1;function pce(n){sE&&(FNe||(FNe=!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 iJi{constructor(e,t,i,r){this.vsWorker=e,this.req=t,this.method=i,this.args=r,this.type=0}}class BNe{constructor(e,t,i,r){this.vsWorker=e,this.seq=t,this.res=i,this.err=r,this.type=1}}class rJi{constructor(e,t,i,r){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=r,this.type=2}}class oJi{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class sJi{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class aJi{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 iJi(this._workerId,i,e,t))})}listen(e,t){let i=null;const r=new De({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,r),this._send(new rJi(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new sJi(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 BNe(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=hNe(r.detail)),this._send(new BNe(this._workerId,t,void 0,hNe(r)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(r=>{this._send(new oJi(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 lJi extends qe{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 aJi({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(xZe(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(EZe(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=Zbe(i);this._onModuleLoaded=this._protocol.sendMessage(nJi,[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(cJi(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 EZe(n){return n[0]==="o"&&n[1]==="n"&&ab(n.charCodeAt(2))}function xZe(n){return/^onDynamic/.test(n)&&ab(n.charCodeAt(9))}function cJi(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(xZe(s)){o[s]=r(s);continue}if(EZe(s)){o[s]=t(s,void 0);continue}o[s]=i(s)}return o}function M1(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(r){Pi(r);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(r){Pi(r);return}}const $Ne=M1("defaultWorkerFactory",{createScriptURL:n=>n});function uJi(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($Ne?$Ne.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function dJi(n){return typeof n.then=="function"}class hJi{constructor(e,t,i,r,o){this.id=t,this.label=i;const s=uJi(i);dJi(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){Pi(o),Pi(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 AK{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const r=++AK.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new hJi(e,r,this._label||"anonymous"+r,t,o=>{pce(o),this._webWorkerFailedBeforeError=o,i(o)})}}AK.LAST_WORKER_ID=0;var Qa;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Qa||(Qa={}));class rte{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 fJi{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)xO(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),xO(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),xO(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),xO(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&xO(this.autoClosingPairsCloseSingleChar,t.close,t)}}function xO(n,e,t){n.has(e)?n.get(e).push(t):n.set(e,[t])}function RK(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 pJi(n,r,s,o+1,n.getStartOffset(s),n.getEndOffset(o))}class pJi{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 qv(n){return(n&3)!==0}class xA{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new rte(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new rte({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new rte({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:xA.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:xA.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}}xA.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])>
`;xA.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
`;const VNe=typeof Buffer<"u";let ote;class NK{static wrap(e){return VNe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new NK(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return VNe?this.buffer.toString():(ote||(ote=new TextDecoder),ote.decode(this.buffer))}}function gJi(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function mJi(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function T_(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 k_(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 HNe(n,e){return n[e]}function WNe(n,e,t){n[t]=e}let ste;function TZe(){return ste||(ste=new TextDecoder("UTF-16LE")),ste}let ate;function _Ji(){return ate||(ate=new TextDecoder("UTF-16BE")),ate}let lte;function kZe(){return lte||(lte=pXe()?TZe():_Ji()),lte}function vJi(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?bJi(n,e,t):TZe().decode(i)}function bJi(n,e,t){const i=[];let r=0;for(let o=0;o<t;o++){const s=gJi(n,e);e+=2,i[r++]=String.fromCharCode(s)}return i.join("")}class oN{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 kZe().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||Rl(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 sz{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=sz._toSet(this.open),this._closeSet=sz._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 yJi(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 CJi{constructor(e,t){this._richEditBracketsBrand=void 0;const i=yJi(t);this.brackets=i.map((r,o)=>new sz(e,o,r.open,r.close,wJi(r.open,r.close,i,o),SJi(r.open,r.close,i,o))),this.forwardRegex=EJi(this.brackets),this.reversedRegex=xJi(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 IZe(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 LZe(n,e){return n.length-e.length}function OK(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 wJi(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let o=0,s=r.length;o<s;o++)IZe(r[o],t,i,r);return r=OK(r),r.sort(LZe),r.reverse(),PK(r)}function SJi(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let o=0,s=r.length;o<s;o++)IZe(r[o],t,i,r);return r=OK(r),r.sort(LZe),r.reverse(),PK(r.map(E0e))}function EJi(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=OK(e),PK(e)}function xJi(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=OK(e),PK(e.map(E0e))}function TJi(n){const e=/^[\w ]+$/.test(n);return n=ep(n),e?`\\b${n}\\b`:n}function PK(n){const e=`(${n.map(TJi).join(")|(")})`;return $Xe(e,!0)}const E0e=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 kZe().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=n(e)),t}}();class rm{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 J(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,r,o){const a=E0e(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 J(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 kJi{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 fS(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(i-1);if(qv(t.getStandardTokenType(r)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,a=rm.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 M9(n){return n.global&&(n.lastIndex=0),!0}class IJi{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&M9(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&M9(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&M9(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&M9(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 sL{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=sL._createOpenBracketRegExp(t[0]),r=sL._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:Qa.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:Qa.Indent}}return null}static _createOpenBracketRegExp(e){let t=ep(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",sL._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=ep(e);return/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"),t="^\\s*"+t,sL._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return Pi(t),null}}}const pr=lr("configurationService");function gce(n,e){const t=Object.create(null);for(const i in n)DZe(t,i,n[i],e);return t}function DZe(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 LJi(n,e){const t=e.split(".");AZe(n,t)}function AZe(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)&&(AZe(i,e),Object.keys(i).length===0&&delete n[t])}}function zNe(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 DJi(n){return n.replace(/[\[\]]/g,"")}const Es=lr("languageService");class lb{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const RZe=[];function Cr(n,e,t){e instanceof lb||(e=new lb(e,[],!!t)),RZe.push([n,e])}function UNe(){return RZe}const xa=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),MK={JSONContribution:"base.contributions.json"};function AJi(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class RJi{constructor(){this._onDidChangeSchema=new De,this.schemasById={}}registerSchema(e,t){this.schemasById[AJi(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const NJi=new RJi;Hs.add(MK.JSONContribution,NJi);const Nv={Configuration:"base.contributions.configuration"},TO="vscode://schemas/settings/resourceLanguage",jNe=Hs.as(MK.JSONContribution);class OJi{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new De,this._onDidUpdateConfiguration=new De,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:T("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={},jNe.registerSchema(TO,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),jNe.registerSchema(TO,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),yS.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 f of Object.keys(o[a]))c.set(f,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=DJi(a),h={type:"object",default:u,description:T("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:TO,defaultDefaultValue:u,source:Rd(s)?void 0:s,defaultValueSource:s};r.push(...az(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=Ef(e.scope)?o:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&FJi(u,d)){delete l[u];continue}if(d.source=i,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),yS.test(u)?d.scope=void 0:(d.scope=Ef(d.scope)?o:d.scope,d.restricted=Ef(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:T("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:T("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:TO};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){T("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),T("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;Fh(r)&&(r=t.defaultDefaultValue,o=void 0),Fh(r)&&(r=MJi(t.type)),t.default=r,t.defaultValueSource=o}}const NZe="\\[([^\\]]+)\\]",qNe=new RegExp(NZe,"g"),PJi=`^(${NZe})+$`,yS=new RegExp(PJi);function az(n){const e=[];if(yS.test(n)){let t=qNe.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=qNe.exec(n)}}return fS(e)}function MJi(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 X$=new OJi;Hs.add(Nv.Configuration,X$);function FJi(n,e){var t,i,r,o;return n.trim()?yS.test(n)?T("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):X$.getConfigurationProperties()[n]!==void 0?T("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&X$.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?T("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,X$.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:T("config.property.empty","Cannot register an empty property")}const BJi={ModesRegistry:"editor.modesRegistry"};class $Ji{constructor(){this._onDidChangeLanguages=new De,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 TA=new $Ji;Hs.add(BJi.ModesRegistry,TA);const jf="plaintext",VJi=".txt";TA.registerLanguage({id:jf,extensions:[VJi],aliases:[T("plainText.alias","Plain Text"),"text"],mimetypes:[xa.text]});Hs.as(Nv.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class HJi{constructor(e,t){this.languageId=e;const i=t.brackets?GNe(t.brackets):[],r=new mNe(a=>{const l=new Set;return{info:new WJi(this,a,l),closing:l}}),o=new mNe(a=>{const l=new Set,c=new Set;return{info:new zJi(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?GNe(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 GNe(n){return n.filter(([e,t])=>e!==""&&t!=="")}class OZe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class WJi extends OZe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class zJi extends OZe{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 UJi=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},KNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class cte{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const es=lr("languageConfigurationService");let mce=class extends qe{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new KJi),this.onDidChangeEmitter=this._register(new De),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(_ce));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 cte(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new cte(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new cte(r.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=jJi(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};mce=UJi([KNe(0,pr),KNe(1,Es)],mce);function jJi(n,e,t,i){let r=e.getLanguageConfiguration(n);if(!r){if(!i.isRegisteredLanguageId(n))return new tD(n,{});r=new tD(n,{})}const o=qJi(r.languageId,t),s=MZe([r.underlyingConfig,o]);return new tD(r.languageId,s)}const _ce={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function qJi(n,e){const t=e.getValue(_ce.brackets,{overrideIdentifier:n}),i=e.getValue(_ce.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:YNe(t),colorizedBracketPairs:YNe(i)}}function YNe(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 PZe(n,e,t){const i=n.getLineContent(e);let r=jo(i);return r.length>t-1&&(r=r.substring(0,t-1)),r}function eD(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),r=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return RK(i,r)}class GJi{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new QNe(e,t,++this._order);return this._entries.push(i),this._resolved=null,_i(()=>{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 tD(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(QNe.cmp),MZe(this._entries.map(e=>e.configuration)))}}function MZe(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 QNe{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 XNe{constructor(e){this.languageId=e}}class KJi extends qe{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new De),this.onDidChange=this._onDidChange.event,this._register(this.register(jf,{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 GJi(e),this._entries.set(e,r));const o=r.register(t,i);return this._onDidChange.fire(new XNe(e)),_i(()=>{o.dispose(),this._onDidChange.fire(new XNe(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class tD{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 sL(this.underlyingConfig):null,this.comments=tD._handleComments(this.underlyingConfig),this.characterPair=new xA(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||t0e,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new IJi(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new HJi(e,this.underlyingConfig)}getWordDefinition(){return _Xe(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new CJi(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new kJi(this.brackets)),this._electricCharacter}onEnter(e,t,i,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,r):null}getAutoClosingPairs(){return new fJi(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}}Cr(es,mce,1);class vC{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 FZe(n){return FK(n,0)}function FK(n,e){switch(typeof n){case"object":return n===null?Fy(349,e):Array.isArray(n)?QJi(n,e):XJi(n,e);case"string":return x0e(n,e);case"boolean":return YJi(n,e);case"number":return Fy(n,e);case"undefined":return Fy(937,e);default:return Fy(617,e)}}function Fy(n,e){return(e<<5)-e+n|0}function YJi(n,e){return Fy(n?433:863,e)}function x0e(n,e){e=Fy(149417,e);for(let t=0,i=n.length;t<i;t++)e=Fy(n.charCodeAt(t),e);return e}function QJi(n,e){return e=Fy(104579,e),n.reduce((t,i)=>FK(i,t),e)}function XJi(n,e){return e=Fy(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=x0e(i,t),FK(n[i],t)),e)}function ute(n,e,t=32){const i=t-e,r=~((1<<i)-1);return(n<<e|(r&n)>>>i)>>>0}function ZNe(n,e=0,t=n.byteLength,i=0){for(let r=0;r<t;r++)n[e+r]=i}function ZJi(n,e,t="0"){for(;n.length<e;)n=t+n;return n}function kO(n,e=32){return n instanceof ArrayBuffer?Array.from(new Uint8Array(n)).map(t=>t.toString(16).padStart(2,"0")).join(""):ZJi((n>>>0).toString(16),e/4)}class BK{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(Rl(s))if(a+1<t){const c=e.charCodeAt(a+1);YT(c)?(a++,l=h0e(s,c)):l=65533}else{o=s;break}else YT(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()),kO(this._h0)+kO(this._h1)+kO(this._h2)+kO(this._h3)+kO(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,ZNe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),ZNe(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=BK._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,ute(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=ute(i,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=o,o=ute(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}}BK._bigBlock32=new DataView(new ArrayBuffer(320));class JNe{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 JJi(n,e,t){return new bb(new JNe(n),new JNe(e)).ComputeDiff(t).changes}class ZI{static Assert(e,t){if(!e)throw new Error(t)}}class JI{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 eOe{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 vC(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 bb{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[r,o,s]=bb._getElements(e),[a,l,c]=bb._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(bb._isStringArray(t)){const i=new Int32Array(t.length);for(let r=0,o=t.length;r<o;r++)i[r]=x0e(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=bb._getStrictElement(this._originalSequence,e),r=bb._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?(ZI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new vC(e,0,i,r-i+1)]):e<=t?(ZI.Assert(i===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new vC(e,t-e+1,i,0)]):(ZI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),ZI.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 vC(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 vC(e,t-e+1,i,r-i+1)]}WALKTRACE(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m,v,_,b){let y=null,C=null,E=new eOe,x=t,k=i,L=f[0]-v[0]-r,D=-1073741824,A=this.m_forwardHistory.length-1;do{const N=L+e;N===x||N<k&&c[N-1]<c[N+1]?(d=c[N+1],g=d-L-r,d<D&&E.MarkNextChange(),D=d,E.AddModifiedElement(d+1,g),L=N+1-e):(d=c[N-1]+1,g=d-L-r,d<D&&E.MarkNextChange(),D=d-1,E.AddOriginalElement(d,g+1),L=N-1-e),A>=0&&(c=this.m_forwardHistory[A],e=c[0],x=1,k=c.length-1)}while(--A>=-1);if(y=E.getReverseChanges(),b[0]){let N=f[0]+1,P=v[0]+1;if(y!==null&&y.length>0){const M=y[y.length-1];N=Math.max(N,M.getOriginalEnd()),P=Math.max(P,M.getModifiedEnd())}C=[new vC(N,h-N+1,P,m-P+1)]}else{E=new eOe,x=s,k=a,L=f[0]-v[0]-l,D=1073741824,A=_?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const N=L+o;N===x||N<k&&u[N-1]>=u[N+1]?(d=u[N+1]-1,g=d-L-l,d>D&&E.MarkNextChange(),D=d+1,E.AddOriginalElement(d+1,g+1),L=N+1-o):(d=u[N-1],g=d-L-l,d>D&&E.MarkNextChange(),D=d,E.AddModifiedElement(d+1,g+1),L=N-1-o),A>=0&&(u=this.m_reverseHistory[A],o=u[0],x=1,k=u.length-1)}while(--A>=-1);C=E.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,f=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(r-i),m=g+1,v=new Int32Array(m),_=new Int32Array(m),b=r-i,y=t-e,C=e-i,E=t-r,k=(y-b)%2===0;v[b]=e,_[y]=t,a[0]=!1;for(let L=1;L<=g/2+1;L++){let D=0,A=0;u=this.ClipDiagonalBound(b-L,L,b,m),d=this.ClipDiagonalBound(b+L,L,b,m);for(let P=u;P<=d;P+=2){P===u||P<d&&v[P-1]<v[P+1]?l=v[P+1]:l=v[P-1]+1,c=l-(P-b)-C;const M=l;for(;l<t&&c<r&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(v[P]=l,l+c>D+A&&(D=l,A=c),!k&&Math.abs(P-y)<=L-1&&l>=_[P])return o[0]=l,s[0]=c,M<=_[P]&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,f,E,v,_,l,t,o,c,r,s,k,a):null}const N=(D-e+(A-i)-L)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(D,N))return a[0]=!0,o[0]=D,s[0]=A,N>0&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,f,E,v,_,l,t,o,c,r,s,k,a):(e++,i++,[new vC(e,t-e+1,i,r-i+1)]);h=this.ClipDiagonalBound(y-L,L,y,m),f=this.ClipDiagonalBound(y+L,L,y,m);for(let P=h;P<=f;P+=2){P===h||P<f&&_[P-1]>=_[P+1]?l=_[P+1]-1:l=_[P-1],c=l-(P-y)-E;const M=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(_[P]=l,k&&Math.abs(P-b)<=L&&l<=v[P])return o[0]=l,s[0]=c,M>=v[P]&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,f,E,v,_,l,t,o,c,r,s,k,a):null}if(L<=1447){let P=new Int32Array(d-u+2);P[0]=b-u+1,JI.Copy2(v,u,P,1,d-u+1),this.m_forwardHistory.push(P),P=new Int32Array(f-h+2),P[0]=y-h+1,JI.Copy2(_,h,P,1,f-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(b,u,d,C,y,h,f,E,v,_,l,t,o,c,r,s,k,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,f=i.modifiedStart-d;if(h<r||f<o||s&&!this.OriginalElementsAreEqual(h,h+i.originalLength)||a&&!this.ModifiedElementsAreEqual(f,f+i.modifiedLength))break;const m=(h===r&&f===o?5:0)+this._boundaryScore(h,i.originalLength,f,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 f=this._findBetterContiguousSequence(a,c,u,h,s);if(f){const[g,m]=f;(g!==r.originalStart+r.originalLength||m!==r.modifiedStart+r.modifiedLength)&&(r.originalLength=g-r.originalStart,r.modifiedLength=m-r.modifiedStart,o.originalStart=g+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 f=this._contiguousSequenceScore(d,h,o);f>0&&f>l&&(l=f,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 JI.Copy(e,0,r,0,e.length-1),r[e.length-1]=i[0],JI.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return JI.Copy(e,0,r,0,e.length),JI.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,i){if(ZI.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),ZI.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 vC(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 lz(n){return n<0?0:n>255?255:n|0}function e2(n){return n<0?0:n>4294967295?4294967295:n|0}class eer{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=e2(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=e2(e),t=e2(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=e2(e),t=e2(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=e2(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 BZe(r,e-s)}}class ter{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 BZe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=hK(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 BZe{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class ner{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 Re(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 eer(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=a0(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 sN{constructor(e){const t=lz(e);this._defaultValue=t,this._asciiMap=sN._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=lz(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 cz{constructor(){this._actual=new sN(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class ier{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 rer{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 ier(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 dte=null;function oer(){return dte===null&&(dte=new rer([[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]])),dte}let IO=null;function ser(){if(IO===null){IO=new sN(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<n.length;t++)IO.set(n.charCodeAt(t),1);const e=".,;:";for(let t=0;t<e.length;t++)IO.set(e.charCodeAt(t),2)}return IO}class uz{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=oer()){const i=ser(),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,f=!1,g=!1,m=!1,v=!1;for(;c<l;){let _=!1;const b=a.charCodeAt(c);if(h===13){let y;switch(b){case 40:f=!0,y=0;break;case 41:y=f?0:1;break;case 91:m=!0,g=!0,y=0;break;case 93:m=!1,y=g?0:1;break;case 123:v=!0,y=0;break;case 125:y=v?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(uz._createLink(i,a,o,u,c)),_=!0)}else if(h===12){let y;b===91?(g=!0,y=0):y=i.get(b),y===1?_=!0:h=13}else h=t.nextState(h,b),h===0&&(_=!0);_&&(h=1,f=!1,g=!1,v=!1,u=c+1,d=b),c++}h===13&&r.push(uz._createLink(i,a,o,u,l))}return r}}function aer(n){return!n||typeof n.getLineCount!="function"||typeof n.getLineContent!="function"?[]:uz.computeLinks(n)}class vce{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}}vce.INSTANCE=new vce;class ler extends sN{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 cer(n){const e={};return t=>(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const bg=cer(n=>new ler(n));var tp;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(tp||(tp={}));var nD;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(nD||(nD={}));var Uh;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Uh||(Uh={}));var nv;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(nv||(nv={}));class Z${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&&Uf(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 P3{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function uer(n){return n&&typeof n.read=="function"}class hte{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 der{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class her{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function fer(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const per=999;class ox{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=ger(this.searchString):e=this.searchString.indexOf(`
`)>=0;let t=null;try{t=$Xe(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 der(t,this.wordSeparators?bg(this.wordSeparators):null,i?this.searchString:null)}}function ger(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 yx(n,e,t){if(!t)return new P3(n,null);const i=[];for(let r=0,o=e.length;r<o;r++)i[r]=e[r];return new P3(n,i)}class tOe{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 F9{static findMatches(e,t,i,r,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new aL(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 f=r.findLineFeedCountBeforeOffset(o+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new J(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 tOe(a):null,c=[];let u=0,d;for(i.reset(0);d=i.next(a);)if(c[u++]=yx(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,f=h.length,g=t.length;let m=-f;for(;(m=t.indexOf(h,m+f))!==-1;)if((!c||T0e(c,t,g,m,f))&&(s[o++]=new P3(new J(i,m+1+r,i,m+1+f+r),null),o>=l))return o;return o}const u=new aL(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[o++]=yx(new J(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 aL(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 Re(t.lineNumber,1),s=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new J(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r
`?new tOe(l):null;i.reset(t.column-1);const u=i.next(l);return u?yx(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new Re(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?yx(new J(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 aL(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 J(1,1,t.lineNumber,t.column),i,r,10*per);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 Re(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=yx(new J(i,s.index+1,i,s.index+1+s[0].length),s,r);return o}}function mer(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 _er(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 T0e(n,e,t,i,r){return mer(n,e,t,i,r)&&_er(n,e,t,i,r)}class aL{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){tz(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||T0e(this._wordSeparators,e,t,r,o))return i}while(i);return null}}class k0e{static computeUnicodeHighlights(e,t,i){const r=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new nOe(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${ver(Array.from(a))}`,"g");const c=new aL(null,l),u=[];let d=!1,h,f=0,g=0,m=0;e:for(let v=r,_=o;v<=_;v++){const b=e.getLineContent(v),y=b.length;c.reset(0);do if(h=c.next(b),h){let C=h.index,E=h.index+h[0].length;if(C>0){const D=b.charCodeAt(C-1);Rl(D)&&C--}if(E+1<y){const D=b.charCodeAt(E-1);Rl(D)&&E++}const x=b.substring(C,E);let k=E3(C+1,t0e,b,0);k&&k.endColumn<=C+1&&(k=null);const L=s.shouldHighlightNonBasicASCII(x,k?k.word:null);if(L!==0){L===3?f++:L===2?g++:L===1?m++:xK();const D=1e3;if(u.length>=D){d=!0;break e}u.push(new J(v,C+1,v,E+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new nOe(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=QT.getLocales().filter(l=>!QT.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function ver(n,e){return`[${ep(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class nOe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=QT.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Xb.codePoints)iOe(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=x6(s);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Xb.isInvisibleCharacter(a)&&(o=!0)}return!r&&o?0:this.options.invisibleCharacters&&!iOe(e)&&Xb.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function iOe(n){return n===" "||n===`
`||n===" "}class J${constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class $Ze{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class ar{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 ar(o,s))}}static tryCreate(e,t){if(!(e>t))return new ar(e,t)}static ofLength(e){return new ar(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 ar(this.start+e,this.endExclusive+e)}deltaStart(e){return new ar(this.start+e,this.endExclusive)}deltaEnd(e){return new ar(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 ar(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 ar(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 I0e{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 ar(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 I0e;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 dz(n,e,t){const i=ber(n,e);if(i!==-1)return n[i]}function ber(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 M3(n,e){const t=F3(n,e);return t===-1?void 0:n[t]}function F3(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 yer(n,e){const t=B3(n,e);return t===n.length?void 0:n[t]}function B3(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 I6{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(I6.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=F3(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}}I6.assertInvariants=!1;function VZe(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 Cer(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 wer(n,e){return VZe(n,(t,i)=>-e(t,i))}function Ser(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 Eer(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let hr=class bC{static fromRange(e){return new bC(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new yb(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new yb(e[i].slice()));return t.ranges}static ofLength(e,t){return new bC(e,e+t)}static deserialize(e){return new bC(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 bC(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new bC(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new bC(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 bC(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 J(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new J(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 ar(this.startLineNumber-1,this.endLineNumberExclusive-1)}};class yb{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(e.length===0)return;const t=B3(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=F3(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=M3(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 hr(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return o!==null&&t.push(o),new yb(t)}subtractFrom(e){const t=B3(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),i=F3(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new yb([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 hr(o,a.startLineNumber)),o=a.endLineNumberExclusive}return o<e.endLineNumberExclusive&&r.push(new hr(o,e.endLineNumberExclusive)),new yb(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 yb(t)}getWithDelta(e){return new yb(this._normalizedRanges.map(t=>t.delta(e)))}}class c0{static inverse(e,t,i){const r=[];let o=1,s=1;for(const l of e){const c=new yg(new hr(o,l.original.startLineNumber),new hr(s,l.modified.startLineNumber),void 0);c.modified.isEmpty||r.push(c),o=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new yg(new hr(o,t+1),new hr(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 c0(this.modified,this.original)}join(e){return new c0(this.original.join(e.original),this.modified.join(e.modified))}}class yg extends c0{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new yg(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class CS{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new CS(this.modifiedRange,this.originalRange)}}const xer=3;class Ter{computeDiff(e,t,i){var r;const s=new Ler(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 hr(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new hr(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new hr(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new hr(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new yg(u,d,(r=c.charChanges)===null||r===void 0?void 0:r.map(f=>new CS(new J(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new J(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new yg(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 A3(()=>XXe(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 J$(a,[],s.quitEarly)}}function HZe(n,e,t,i){return new bb(n,e,t).ComputeDiff(i)}let rOe=class{constructor(e){const t=[],i=[];for(let r=0,o=e.length;r<o;r++)t[r]=bce(e[r],1),i[r]=yce(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 ker(r,o,s)}};class ker{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 iD{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 iD(r,o,s,a,l,c,u,d)}}function Ier(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)<xer?(t.originalLength=o.originalStart+o.originalLength-t.originalStart,t.modifiedLength=o.modifiedStart+o.modifiedLength-t.modifiedStart):(e.push(o),t=o)}return e}class OM{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 f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let m=HZe(f,g,o,!0).changes;a&&(m=Ier(m)),h=[];for(let v=0,_=m.length;v<_;v++)h.push(iD.createFromDiffChange(m[v],f,g))}}return new OM(l,c,u,d,h)}}class Ler{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 rOe(e),this.modified=new rOe(t),this.continueLineDiff=oOe(i.maxComputationTime),this.continueCharDiff=oOe(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=HZe(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(OM.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],f=this.modifiedLines[s];if(h!==f){{let g=bce(h,1),m=bce(f,1);for(;g>1&&m>1;){const v=h.charCodeAt(g-2),_=f.charCodeAt(m-2);if(v!==_)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(r,o+1,1,g,s+1,1,m)}{let g=yce(h,1),m=yce(f,1);const v=h.length+1,_=f.length+1;for(;g<v&&m<_;){const b=h.charCodeAt(g-1),y=h.charCodeAt(m-1);if(b!==y)break;g++,m++}(g<v||m<_)&&this._pushTrimWhitespaceCharChange(r,o+1,g,v,s+1,m,_)}}o++,s++}c&&(r.push(OM.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 iD(t,i,t,r,o,s,o,a)]),e.push(new OM(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 iD(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 iD(t,i,t,r,o,s,o,a)),!0):!1}}function bce(n,e){const t=Gu(n);return t===-1?e:t+1}function yce(n,e){const t=hv(n);return t===-1?e:t+2}function oOe(n){if(n===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<n}class Xy{static trivial(e,t){return new Xy([new mc(ar.ofLength(e.length),ar.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new Xy([new mc(ar.ofLength(e.length),ar.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class mc{static invert(e,t){const i=[];return iXe(e,(r,o)=>{i.push(mc.fromOffsetPairs(r?r.getEndExclusives():Rb.zero,o?o.getStarts():new Rb(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new mc(new ar(e.offset1,t.offset1),new ar(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new mc(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new mc(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new mc(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new mc(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new mc(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 mc(t,i)}getStarts(){return new Rb(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Rb(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Rb{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Rb.zero=new Rb(0,0);Rb.max=new Rb(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class $3{isValid(){return!0}}$3.instance=new $3;class Der{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 fte{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 Cce(n){return n===32||n===9}class kA{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=kA.getKey(c);this.histogram[u]=(this.histogram[u]||0)+1}r++;const a=kA.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)}}kA.chrKeys=new Map;class Aer{compute(e,t,i=$3.instance,r){if(e.length===0||t.length===0)return Xy.trivial(e,t);const o=new fte(e.length,t.length),s=new fte(e.length,t.length),a=new fte(e.length,t.length);for(let g=0;g<e.length;g++)for(let m=0;m<t.length;m++){if(!i.isValid())return Xy.trivialTimedOut(e,t);const v=g===0?0:o.get(g-1,m),_=m===0?0:o.get(g,m-1);let b;e.getElement(g)===t.getElement(m)?(g===0||m===0?b=0:b=o.get(g-1,m-1),g>0&&m>0&&s.get(g-1,m-1)===3&&(b+=a.get(g-1,m-1)),b+=r?r(g,m):1):b=-1;const y=Math.max(v,_,b);if(y===b){const C=g>0&&m>0?a.get(g-1,m-1):0;a.set(g,m,C+1),s.set(g,m,3)}else y===v?(a.set(g,m,0),s.set(g,m,1)):y===_&&(a.set(g,m,0),s.set(g,m,2));o.set(g,m,y)}const l=[];let c=e.length,u=t.length;function d(g,m){(g+1!==c||m+1!==u)&&l.push(new mc(new ar(g+1,c),new ar(m+1,u))),c=g,u=m}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new Xy(l,!1)}}class WZe{compute(e,t,i=$3.instance){if(e.length===0||t.length===0)return Xy.trivial(e,t);const r=e,o=t;function s(m,v){for(;m<r.length&&v<o.length&&r.getElement(m)===o.getElement(v);)m++,v++;return m}let a=0;const l=new Rer;l.set(0,s(0,0));const c=new Ner;c.set(0,l.get(0)===0?null:new sOe(null,0,0,l.get(0)));let u=0;e:for(;;){if(a++,!i.isValid())return Xy.trivialTimedOut(r,o);const m=-Math.min(a,o.length+a%2),v=Math.min(a,r.length+a%2);for(u=m;u<=v;u+=2){const _=u===v?-1:l.get(u+1),b=u===m?-1:l.get(u-1)+1,y=Math.min(Math.max(_,b),r.length),C=y-u;if(y>r.length||C>o.length)continue;const E=s(y,C);l.set(u,E);const x=y===_?c.get(u+1):c.get(u-1);if(c.set(u,E!==y?new sOe(x,y,C,E-y):x),l.get(u)===r.length&&l.get(u)-u===o.length)break e}}let d=c.get(u);const h=[];let f=r.length,g=o.length;for(;;){const m=d?d.x+d.length:0,v=d?d.y+d.length:0;if((m!==f||v!==g)&&h.push(new mc(new ar(m,f),new ar(v,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new Xy(h,!1)}}class sOe{constructor(e,t,i,r){this.prev=e,this.x=t,this.y=i,this.length=r}}class Rer{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 Ner{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 aOe,lOe;class Oer{constructor(e,t){this.uri=e,this.value=t}}function Per(n){return Array.isArray(n)}class gu{constructor(e,t){if(this[aOe]="ResourceMap",e instanceof gu)this.map=new Map(e.map),this.toKey=t??gu.defaultToKey;else if(Per(e)){this.map=new Map,this.toKey=t??gu.defaultToKey;for(const[i,r]of e)this.set(i,r)}else this.map=new Map,this.toKey=e??gu.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Oer(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]}*[(aOe=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}gu.defaultToKey=n=>n.toString();class Mer{constructor(){this[lOe]="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}[(lOe=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 uE extends Mer{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 Fer{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 L0e{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 hz{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 ar(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 ar(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=uOe(e>0?this.elements[e-1]:-1),i=uOe(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+=cOe(t),r+=cOe(i),r}translateOffset(e){if(this.lineRange.isEmpty)return new Re(this.lineRange.start+1,1);const t=F3(this.firstCharOffsetByLine,i=>i<=e);return new Re(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return J.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!pte(this.elements[e]))return;let t=e;for(;t>0&&pte(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&pte(this.elements[i]);)i++;return new ar(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=M3(this.firstCharOffsetByLine,s=>s<=e.start))!==null&&t!==void 0?t:0,o=(i=yer(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&i!==void 0?i:this.elements.length;return new ar(r,o)}}function pte(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const Ber={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function cOe(n){return Ber[n]}function uOe(n){return n===10?7:n===13?6:Cce(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function $er(n,e,t,i,r,o){let{moves:s,excludedChanges:a}=Ver(n,e,t,o);if(!o.isValid())return[];const l=n.filter(u=>!a.has(u)),c=Her(l,i,r,e,t,o);return sle(s,c),s=Wer(s),s=s.filter(u=>u.original.toOffsetRange().slice(e).map(h=>h.trim()).join(`
`).length>=10),s=zer(n,s),s}function Ver(n,e,t,i){const r=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new kA(l.original,e,l)),s=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new kA(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 c0(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 Her(n,e,t,i,r,o){const s=[],a=new L0e;for(const h of n)for(let f=h.original.startLineNumber;f<h.original.endLineNumberExclusive-2;f++){const g=`${e[f-1]}:${e[f+1-1]}:${e[f+2-1]}`;a.add(g,{range:new hr(f,f+3)})}const l=[];n.sort(sg(h=>h.modified.startLineNumber,Yy));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g<h.modified.endLineNumberExclusive-2;g++){const m=`${t[g-1]}:${t[g+1-1]}:${t[g+2-1]}`,v=new hr(g,g+3),_=[];a.forEach(m,({range:b})=>{for(const C of f)if(C.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&C.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){C.originalLineRange=new hr(C.originalLineRange.startLineNumber,b.endLineNumberExclusive),C.modifiedLineRange=new hr(C.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),_.push(C);return}const y={modifiedLineRange:v,originalLineRange:b};l.push(y),_.push(y)}),f=_}if(!o.isValid())return[]}l.sort(aXe(sg(h=>h.modifiedLineRange.length,Yy)));const c=new yb,u=new yb;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),m=u.subtractFrom(h.originalLineRange).getWithDelta(f),v=g.getIntersection(m);for(const _ of v.ranges){if(_.length<3)continue;const b=_,y=_.delta(-f);s.push(new c0(y,b)),c.addRange(b),u.addRange(y)}}s.sort(sg(h=>h.original.startLineNumber,Yy));const d=new I6(n);for(let h=0;h<s.length;h++){const f=s[h],g=d.findLastMonotonous(x=>x.original.startLineNumber<=f.original.startLineNumber),m=M3(n,x=>x.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),_=d.findLastMonotonous(x=>x.original.startLineNumber<f.original.endLineNumberExclusive),b=M3(n,x=>x.modified.startLineNumber<f.modified.endLineNumberExclusive),y=Math.max(_.original.endLineNumberExclusive-f.original.endLineNumberExclusive,b.modified.endLineNumberExclusive-f.modified.endLineNumberExclusive);let C;for(C=0;C<v;C++){const x=f.original.startLineNumber-C-1,k=f.modified.startLineNumber-C-1;if(x>i.length||k>r.length||c.contains(k)||u.contains(x)||!dOe(i[x-1],r[k-1],o))break}C>0&&(u.addRange(new hr(f.original.startLineNumber-C,f.original.startLineNumber)),c.addRange(new hr(f.modified.startLineNumber-C,f.modified.startLineNumber)));let E;for(E=0;E<y;E++){const x=f.original.endLineNumberExclusive+E,k=f.modified.endLineNumberExclusive+E;if(x>i.length||k>r.length||c.contains(k)||u.contains(x)||!dOe(i[x-1],r[k-1],o))break}E>0&&(u.addRange(new hr(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+E)),c.addRange(new hr(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+E))),(C>0||E>0)&&(s[h]=new c0(new hr(f.original.startLineNumber-C,f.original.endLineNumberExclusive+E),new hr(f.modified.startLineNumber-C,f.modified.endLineNumberExclusive+E)))}return s}function dOe(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const r=new WZe().compute(new hz([n],new ar(0,1),!1),new hz([e],new ar(0,1),!1),t);let o=0;const s=mc.invert(r.diffs,n.length);for(const u of s)u.seq1Range.forEach(d=>{Cce(n.charCodeAt(d))||o++});function a(u){let d=0;for(let h=0;h<n.length;h++)Cce(u.charCodeAt(h))||d++;return d}const l=a(n.length>e.length?n:e);return o/l>.6&&l>10}function Wer(n){if(n.length===0)return n;n.sort(sg(t=>t.original.startLineNumber,Yy));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 zer(n,e){const t=new I6(n);return e=e.filter(i=>{const r=t.findLastMonotonous(a=>a.original.endLineNumberExclusive<i.original.endLineNumberExclusive)||new c0(new hr(1,1),new hr(1,1)),o=M3(n,a=>a.modified.endLineNumberExclusive<i.modified.endLineNumberExclusive);return r!==o}),e}function wce(n,e,t){let i=t;return i=Uer(n,e,i),i=jer(n,e,i),i}function Uer(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 mc(new ar(s.seq1Range.start,a.seq1Range.endExclusive-l),new ar(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 mc(new ar(a.seq1Range.start+l,s.seq1Range.endExclusive),new ar(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 jer(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 ar(r?r.seq1Range.start+1:0,s?s.seq1Range.endExclusive-1:n.length),l=new ar(r?r.seq2Range.start+1:0,s?s.seq2Range.endExclusive-1:e.length);o.seq1Range.isEmpty?t[i]=hOe(o,n,e,a,l):o.seq2Range.isEmpty&&(t[i]=hOe(o.swap(),e,n,l,a).swap())}return t}function hOe(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,f=n.seq1Range.start+u,g=e.getBoundaryScore(f)+t.getBoundaryScore(d)+t.getBoundaryScore(h);g>c&&(c=g,l=u)}return n.delta(l)}function qer(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 mc(o.seq1Range.join(r.seq1Range),o.seq2Range.join(r.seq2Range)):i.push(r)}return i}function Ger(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 mc(r.s1Range,r.s2Range)),r=void 0}for(const a of t){let l=function(f,g){var m,v,_,b;if(!r||!r.s1Range.containsRange(f)||!r.s2Range.containsRange(g))if(r&&!(r.s1Range.endExclusive<f.start&&r.s2Range.endExclusive<g.start)){const E=ar.tryCreate(r.s1Range.endExclusive,f.start),x=ar.tryCreate(r.s2Range.endExclusive,g.start);r.deleted+=(m=E==null?void 0:E.length)!==null&&m!==void 0?m:0,r.added+=(v=x==null?void 0:x.length)!==null&&v!==void 0?v:0,r.s1Range=r.s1Range.join(f),r.s2Range=r.s2Range.join(g)}else o(),r={added:0,deleted:0,count:0,s1Range:f,s2Range:g};const y=f.intersect(a.seq1Range),C=g.intersect(a.seq2Range);r.count++,r.deleted+=(_=y==null?void 0:y.length)!==null&&_!==void 0?_: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(),Ker(t,i)}function Ker(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 Yer(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,f){const g=new ar(c.seq1Range.endExclusive,l.seq1Range.start);return n.getText(g).replace(/\s/g,"").length<=4&&(h.seq1Range.length+h.seq2Range.length>5||f.seq1Range.length+f.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 Qer(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(f,g){const m=new ar(u.seq1Range.endExclusive,c.seq1Range.start);if(n.countLinesIn(m)>5||m.length>500)return!1;const _=n.getText(m).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),y=f.seq1Range.length,C=e.countLinesIn(f.seq2Range),E=f.seq2Range.length,x=n.countLinesIn(g.seq1Range),k=g.seq1Range.length,L=e.countLinesIn(g.seq2Range),D=g.seq2Range.length,A=2*40+50;function N(P){return Math.min(P,A)}return Math.pow(Math.pow(N(b*40+y),1.5)+Math.pow(N(C*40+E),1.5),1.5)+Math.pow(Math.pow(N(x*40+k),1.5)+Math.pow(N(L*40+D),1.5),1.5)>Math.pow(Math.pow(A,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 sYi(i,(a,l,c)=>{let u=l;function d(_){return _.length>0&&_.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=n.extendToFullLines(l.seq1Range),f=n.getText(new ar(h.start,l.seq1Range.start));d(f)&&(u=u.deltaStart(-f.length));const g=n.getText(new ar(l.seq1Range.endExclusive,h.endExclusive));d(g)&&(u=u.deltaEnd(g.length));const m=mc.fromOffsetPairs(a?a.getEndExclusives():Rb.zero,c?c.getStarts():Rb.max),v=u.intersect(m);s.push(v)}),s}class fOe{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:pOe(this.lines[e-1]),i=e===this.lines.length?0:pOe(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 pOe(n){let e=0;for(;e<n.length&&(n.charCodeAt(e)===32||n.charCodeAt(e)===9);)e++;return e}class zZe{constructor(){this.dynamicProgrammingDiffing=new Aer,this.myersDiffingAlgorithm=new WZe}computeDiff(e,t,i){if(e.length<=1&&ka(e,t,(E,x)=>E===x))return new J$([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new J$([new yg(new hr(1,e.length+1),new hr(1,t.length+1),[new CS(new J(1,1,e.length,e[0].length+1),new J(1,1,t.length,t[0].length+1))])],[],!1);const r=i.maxComputationTimeMs===0?$3.instance:new Der(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,s=new Map;function a(E){let x=s.get(E);return x===void 0&&(x=s.size,s.set(E,x)),x}const l=e.map(E=>a(E.trim())),c=t.map(E=>a(E.trim())),u=new fOe(l,e),d=new fOe(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(E,x)=>e[E]===t[x]?t[x].length===0?.1:1+Math.log(1+t[x].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=wce(u,d,f),f=Yer(u,d,f);const m=[],v=E=>{if(o)for(let x=0;x<E;x++){const k=_+x,L=b+x;if(e[k]!==t[L]){const D=this.refineDiff(e,t,new mc(new ar(k,k+1),new ar(L,L+1)),r,o);for(const A of D.mappings)m.push(A);D.hitTimeout&&(g=!0)}}};let _=0,b=0;for(const E of f){A3(()=>E.seq1Range.start-_===E.seq2Range.start-b);const x=E.seq1Range.start-_;v(x),_=E.seq1Range.endExclusive,b=E.seq2Range.endExclusive;const k=this.refineDiff(e,t,E,r,o);k.hitTimeout&&(g=!0);for(const L of k.mappings)m.push(L)}v(e.length-_);const y=gOe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,l,c,r,o)),A3(()=>{function E(k,L){if(k.lineNumber<1||k.lineNumber>L.length)return!1;const D=L[k.lineNumber-1];return!(k.column<1||k.column>D.length+1)}function x(k,L){return!(k.startLineNumber<1||k.startLineNumber>L.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>L.length+1)}for(const k of y){if(!k.innerChanges)return!1;for(const L of k.innerChanges)if(!(E(L.modifiedRange.getStartPosition(),t)&&E(L.modifiedRange.getEndPosition(),t)&&E(L.originalRange.getStartPosition(),e)&&E(L.originalRange.getEndPosition(),e)))return!1;if(!x(k.modified,t)||!x(k.original,e))return!1}return!0}),new J$(y,C,g)}computeMoves(e,t,i,r,o,s,a){return $er(e,t,i,r,o,s).map(u=>{const d=this.refineDiff(t,i,new mc(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=gOe(d.mappings,t,i,!0);return new $Ze(u,h)})}refineDiff(e,t,i,r,o){const s=new hz(e,i.seq1Range,o),a=new hz(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=wce(s,a,c),c=Ger(s,a,c),c=qer(s,a,c),c=Qer(s,a,c),{mappings:c.map(d=>new CS(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function gOe(n,e,t,i=!1){const r=[];for(const o of nXe(n.map(s=>Xer(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 yg(s.original.join(a.original),s.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return A3(()=>!i&&r.length>0&&r[0].original.startLineNumber!==r[0].modified.startLineNumber?!1:XXe(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 Xer(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 hr(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+r),s=new hr(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+r);return new yg(o,s,[n])}const mOe={getLegacy:()=>new Ter,getDefault:()=>new zZe};function $w(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class vr{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=$w(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 um{constructor(e,t,i,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=$w(Math.max(Math.min(1,t),0),3),this.l=$w(Math.max(Math.min(1,i),0),3),this.a=$w(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 um(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=um._hue2rgb(u,c,t+1/3),a=um._hue2rgb(u,c,t),l=um._hue2rgb(u,c,t-1/3)}return new vr(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}}class Nb{constructor(e,t,i,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=$w(Math.max(Math.min(1,t),0),3),this.v=$w(Math.max(Math.min(1,i),0),3),this.a=$w(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 Nb(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 vr(c,u,d,o)}}class je{static fromHex(e){return je.Format.CSS.parseHex(e)||je.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:um.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Nb.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof vr)this.rgba=e;else if(e instanceof um)this._hsla=e,this.rgba=um.toRGBA(e);else if(e instanceof Nb)this._hsva=e,this.rgba=Nb.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&vr.equals(this.rgba,e.rgba)&&um.equals(this.hsla,e.hsla)&&Nb.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=je._relativeLuminanceForComponent(this.rgba.r),t=je._relativeLuminanceForComponent(this.rgba.g),i=je._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*i;return $w(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 je(new um(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new je(new um(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 je(new vr(t,i,r,o*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new je(new vr(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 je(new vr(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=je.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)}}je.white=new je(new vr(255,255,255,1));je.black=new je(new vr(0,0,0,1));je.red=new je(new vr(255,0,0,1));je.blue=new je(new vr(0,0,255,1));je.green=new je(new vr(0,255,0,1));je.cyan=new je(new vr(0,255,255,1));je.lightgrey=new je(new vr(211,211,211,1));je.transparent=new je(new vr(0,0,0,0));(function(n){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:n.Format.CSS.formatRGBA(f)}t.formatRGB=i;function r(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=r;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(f)}t.formatHSL=o;function s(f){return`hsla(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%, ${f.hsla.a.toFixed(2)})`}t.formatHSLA=s;function a(f){const g=f.toString(16);return g.length!==2?"0"+g:g}function l(f){return`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}`}t.formatHex=l;function c(f,g=!1){return g&&f.rgba.a===1?n.Format.CSS.formatHex(f):`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}${a(Math.round(f.rgba.a*255))}`}t.formatHexA=c;function u(f){return f.isOpaque()?n.Format.CSS.formatHex(f):n.Format.CSS.formatRGBA(f)}t.format=u;function d(f){const g=f.length;if(g===0||f.charCodeAt(0)!==35)return null;if(g===7){const m=16*h(f.charCodeAt(1))+h(f.charCodeAt(2)),v=16*h(f.charCodeAt(3))+h(f.charCodeAt(4)),_=16*h(f.charCodeAt(5))+h(f.charCodeAt(6));return new n(new vr(m,v,_,1))}if(g===9){const m=16*h(f.charCodeAt(1))+h(f.charCodeAt(2)),v=16*h(f.charCodeAt(3))+h(f.charCodeAt(4)),_=16*h(f.charCodeAt(5))+h(f.charCodeAt(6)),b=16*h(f.charCodeAt(7))+h(f.charCodeAt(8));return new n(new vr(m,v,_,b/255))}if(g===4){const m=h(f.charCodeAt(1)),v=h(f.charCodeAt(2)),_=h(f.charCodeAt(3));return new n(new vr(16*m+m,16*v+v,16*_+_))}if(g===5){const m=h(f.charCodeAt(1)),v=h(f.charCodeAt(2)),_=h(f.charCodeAt(3)),b=h(f.charCodeAt(4));return new n(new vr(16*m+m,16*v+v,16*_+_,(16*b+b)/255))}return null}t.parseHex=d;function h(f){switch(f){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={}))})(je||(je={}));function UZe(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 D0e(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function LO(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 Zer(n,e){if(!n)return;const t=je.Format.CSS.parseHex(e);if(t)return{range:n,color:D0e(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function _Oe(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),o=UZe(r);return{range:n,color:D0e(o[0],o[1],o[2],t?o[3]:1)}}function vOe(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),o=UZe(r),s=new je(new um(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:n,color:D0e(s.rgba.r,s.rgba.g,s.rgba.b,s.rgba.a)}}function DO(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function Jer(n){const e=[],i=DO(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=_Oe(LO(n,r),DO(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=_Oe(LO(n,r),DO(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=vOe(LO(n,r),DO(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=vOe(LO(n,r),DO(a,c),!0)}else s==="#"&&(l=Zer(LO(n,r),s+a));l&&e.push(l)}return e}function etr(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:Jer(n)}var lC=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 ttr extends ner{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 Re(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=E3(e.column,_Xe(t),this._lines[e.lineNumber-1],0);return i?new J(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(!Re.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 Vw{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 ttr(Jn.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 lC(this,void 0,void 0,function*(){const r=this._getModel(e);return r?k0e.computeUnicodeHighlights(r,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,r){return lC(this,void 0,void 0,function*(){const o=this._getModel(e),s=this._getModel(t);return!o||!s?null:Vw.computeDiff(o,s,i,r)})}static computeDiff(e,t,i,r){const o=r==="advanced"?mOe.getDefault():mOe.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 f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.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 lC(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 J.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++)J.getEndPosition(t[a].range).equals(J.getStartPosition(t[l].range))?(t[a].range=J.fromPositions(J.getStartPosition(t[a].range),J.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),J.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)>Vw._diffLimit){o.push({range:l,text:c});continue}const h=JJi(d,c,i),f=r.offsetAt(J.lift(l).getStartPosition());for(const g of h){const m=r.positionAt(f+g.originalStart),v=r.positionAt(f+g.originalStart+g.originalLength),_={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};r.getValueInRange(_.range)!==_.text&&o.push(_)}}return typeof s=="number"&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return lC(this,void 0,void 0,function*(){const t=this._getModel(e);return t?aer(t):null})}computeDefaultDocumentColors(e){return lC(this,void 0,void 0,function*(){const t=this._getModel(e);return t?etr(t):null})}textualSuggest(e,t,i,r){return lC(this,void 0,void 0,function*(){const o=new wu,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>Vw._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,r){return lC(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 lC(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 vce.INSTANCE.navigateValueSet(t,l,c,u,i)})}loadForeignModule(e,t,i){const s={host:gYi(i,(a,l)=>this._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Zbe(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)}}}Vw._diffLimit=1e5;Vw._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=MXe());const A0e=lr("textResourceConfigurationService"),jZe=lr("textResourcePropertiesService"),wn=lr("ILanguageFeaturesService");var ntr=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},AO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},fz=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 bOe=60*1e3,yOe=5*60*1e3;function Cx(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Sce=class extends qe{constructor(e,t,i,r,o){super(),this._modelService=e,this._workerManager=this._register(new rtr(this._modelService,r)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>Cx(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 itr(this._workerManager,t,this._modelService,r)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return Cx(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(r=>r.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,r){return fz(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 $Ze(new c0(new hr(l[0],l[1]),new hr(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new yg(new hr(c[0],c[1]),new hr(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new CS(new J(d[0],d[1],d[2],d[3]),new J(d[4],d[5],d[6],d[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(yu(t)){if(!Cx(this._modelService,e))return Promise.resolve(t);const r=wu.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,vS(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return Cx(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(r=>r.navigateValueSet(e,t,i))}canComputeWordRanges(e){return Cx(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};Sce=ntr([AO(0,Ls),AO(1,A0e),AO(2,hp),AO(3,es),AO(4,wn)],Sce);class itr{constructor(e,t,i,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return fz(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")Cx(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())Cx(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 J(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):J.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 rtr extends qe{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new k6).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(yOe/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>yOe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new R0e(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class otr extends qe{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 k6;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(bOe/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)_o(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]>bOe&&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 yt;o.add(i.onDidChangeContent(s=>{this._proxy.acceptModelChanged(r.toString(),s)})),o.add(i.onWillDispose(()=>{this._stopModelSync(r)})),o.add(_i(()=>{this._proxy.acceptRemovedModel(r)})),this._syncedModels[r]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],_o(t)}}class COe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class gte{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class R0e extends qe{constructor(e,t,i,r){super(),this.languageConfigurationService=r,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new AK(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 lJi(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new gte(this)))}catch(e){pce(e),this._worker=new COe(new Vw(new gte(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(pce(e),this._worker=new COe(new Vw(new gte(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new otr(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return fz(this,void 0,void 0,function*(){return this._disposed?Promise.reject(bQi()):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 fz(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 str(n,e,t){return new atr(n,e,t)}class atr extends R0e{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?Zbe(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 L6={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},IA=new class{clone(){return this}equals(n){return this===n}};function N0e(n,e){return new c0e([new x3(0,"",n)],e)}function $K(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new gK(t,e===null?IA:e)}class Gc{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 Ol{static createEmpty(e,t){const i=Ol.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=i,new Ol(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 Ol?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=Gc.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Gc.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Gc.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Gc.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Gc.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Gc.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Ol.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new O0e(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 Ol(new Uint32Array(o),r,this._languageIdCodec)}}Ol.defaultTokenMetadata=(32768|2<<24)>>>0;class O0e{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 O0e?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 $h{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(!$h._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 $h(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 $h(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=$h._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className<t.className?-1:1:0}}class wOe{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=r}}class pz{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 wOe(t,this.stopOffsets[r],this.classNames.join(" "),pz._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 wOe(t,e-1,this.classNames.join(" "),pz._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 ltr{static normalize(e,t){if(t.length===0)return[];const i=[],r=new pz;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);Rl(m)&&c--}if(u>1){const m=e.charCodeAt(u-2);Rl(m)&&u--}const f=c-1,g=u-2;o=r.consumeLowerThan(f,o,i),r.count===0&&(o=f),r.insert(g,d,h)}return r.consumeLowerThan(1073741824,o,i),i}}class Zl{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 qZe{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class dE{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f,g,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($h.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=_,this.fontLigatures=b,this.selectionsOnLine=y&&y.sort((x,k)=>x.startOffset<k.startOffset?-1:1);const C=Math.abs(g-h),E=Math.abs(f-h);C<E?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=f,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&&$h.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class GZe{constructor(e,t){this.partIndex=e,this.charIndex=t}}class cb{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=cb.getPartIndex(t),r=cb.getCharIndex(t);return new GZe(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,v=this._data[m];if(v===r)return m;v>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=cb.getPartIndex(a),u=cb.getCharIndex(a),d=cb.getPartIndex(l);let h;c!==d?h=t:h=cb.getCharIndex(l);const f=i-u,g=h-i;return f<=g?o:s}}class Ece{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function D6(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 cb(1,t+i);return o.setColumnInfo(1,t,0,0),new Ece(o,!1,r)}return e.appendString("<span><span></span></span>"),new Ece(new cb(0,0),!1,0)}return _tr(dtr(n),e)}class ctr{constructor(e,t,i,r){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=r}}function VK(n){const e=new oN(1e4),t=D6(n,e);return new ctr(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class utr{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m,v){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=f,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=v}}function dtr(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=htr(e,n.containsRTL,n.lineTokens,n.fauxIndentLength,r);n.renderControlCharacters&&!n.isBasicASCII&&(o=ptr(e,o)),(n.renderWhitespace===4||n.renderWhitespace===1||n.renderWhitespace===2&&n.selectionsOnLine||n.renderWhitespace===3&&!n.continuesWithWrappedLine)&&(o=gtr(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=mtr(e,r,o,n.lineDecorations)}return n.containsRTL||(o=ftr(e,o,!n.isBasicASCII||n.fontLigatures)),new utr(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 htr(n,e,t,i,r){const o=[];let s=0;i>0&&(o[s++]=new Zl(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 f=e?CA(n.substring(a,r)):!1;o[s++]=new Zl(r,d,0,f);break}const h=e?CA(n.substring(a,u)):!1;o[s++]=new Zl(u,d,0,h),a=u}return o}function ftr(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 f=-1,g=i;for(let m=i;m<c;m++)n.charCodeAt(m)===32&&(f=m),f!==-1&&m-g>=50&&(r[o++]=new Zl(f+1,u,d,h),g=f+1,f=-1);g!==c&&(r[o++]=new Zl(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,f=l.containsRTL,g=Math.ceil(u/50);for(let m=1;m<g;m++){const v=i+m*50;r[o++]=new Zl(v,d,h,f)}r[o++]=new Zl(c,d,h,f)}else r[o++]=l;i=c}return r}function KZe(n){return n<32?n!==9:n===127||n>=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function ptr(n,e){const t=[];let i=new Zl(0,"",0,!1),r=0;for(const o of e){const s=o.endIndex;for(;r<s;r++){const a=n.charCodeAt(r);KZe(a)&&(r>i.endIndex&&(i=new Zl(r,o.type,o.metadata,o.containsRTL),t.push(i)),i=new Zl(r+1,"mtkcontrol",o.metadata,!1),t.push(i))}r>i.endIndex&&(i=new Zl(s,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function gtr(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,f=[];let g=0,m=0,v=i[m].type,_=i[m].containsRTL,b=i[m].endIndex;const y=i.length;let C=!1,E=Gu(e),x;E===-1?(C=!0,E=t,x=t):x=hv(e);let k=!1,L=0,D=c&&c[L],A=a%s;for(let P=o;P<t;P++){const M=e.charCodeAt(P);D&&P>=D.endOffset&&(L++,D=c&&c[L]);let B;if(P<E||P>x)B=!0;else if(M===9)B=!0;else if(M===32)if(u)if(k)B=!0;else{const F=P+1<t?e.charCodeAt(P+1):0;B=F===32||F===9}else B=!0;else B=!1;if(B&&c&&(B=!!D&&D.startOffset<=P&&D.endOffset>P),B&&d&&(B=C||P>x),B&&_&&P>=E&&P<=x&&(B=!1),k){if(!B||!l&&A>=s){if(h){const F=g>0?f[g-1].endIndex:o;for(let U=F+1;U<=P;U++)f[g++]=new Zl(U,"mtkw",1,!1)}else f[g++]=new Zl(P,"mtkw",1,!1);A=A%s}}else(P===b||B&&P>o)&&(f[g++]=new Zl(P,v,0,_),A=A%s);for(M===9?A=s:mS(M)?A+=2:A++,k=B;P===b&&(m++,m<y);)v=i[m].type,_=i[m].containsRTL,b=i[m].endIndex}let N=!1;if(k)if(r&&u){const P=t>0?e.charCodeAt(t-1):0,M=t>1?e.charCodeAt(t-2):0;P===32&&M!==32&&M!==9||(N=!0)}else N=!0;if(N)if(h){const P=g>0?f[g-1].endIndex:o;for(let M=P+1;M<=t;M++)f[g++]=new Zl(M,"mtkw",1,!1)}else f[g++]=new Zl(t,"mtkw",1,!1);else f[g++]=new Zl(t,v,0,_);return f}function mtr(n,e,t,i){i.sort($h.compare);const r=ltr.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 f=t[d],g=f.endIndex,m=f.type,v=f.metadata,_=f.containsRTL;for(;s<o&&r[s].startOffset<g;){const b=r[s];if(b.startOffset>c&&(c=b.startOffset,a[l++]=new Zl(c,m,v,_)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new Zl(c,m+" "+b.className,v|b.metadata,_),s++;else{c=g,a[l++]=new Zl(c,m+" "+b.className,v|b.metadata,_);break}}g>c&&(c=g,a[l++]=new Zl(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 Zl(c,d.className,d.metadata,!1),s++}return a}function _tr(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,f=n.containsRTL,g=n.spaceWidth,m=n.renderSpaceCharCode,v=n.renderWhitespace,_=n.renderControlCharacters,b=new cb(s+1,c.length);let y=!1,C=0,E=h,x=0,k=0,L=0;f?e.appendString('<span dir="ltr">'):e.appendString("<span>");for(let D=0,A=c.length;D<A;D++){const N=c[D],P=N.endIndex,M=N.type,B=N.containsRTL,F=v!==0&&N.isWhitespace(),U=F&&!t&&(M==="mtkw"||!r),H=C===P&&N.isPseudoAfter();if(x=0,e.appendString("<span "),B&&e.appendString('style="unicode-bidi:isolate" '),e.appendString('class="'),e.appendString(U?"mtkz":M),e.appendASCIICharCode(34),F){let W=0;{let q=C,V=E;for(;q<P;q++){const oe=(o.charCodeAt(q)===9?d-V%d:1)|0;W+=oe,q>=u&&(V+=oe)}}for(U&&(e.appendString(' style="width:'),e.appendString(String(g*W)),e.appendString('px"')),e.appendASCIICharCode(62);C<P;C++){b.setColumnInfo(C+1,D-L,x,k),L=0;const q=o.charCodeAt(C);let V,re;if(q===9){V=d-E%d|0,re=V,!i||re>1?e.appendCharCode(8594):e.appendCharCode(65515);for(let oe=2;oe<=re;oe++)e.appendCharCode(160)}else V=2,re=1,e.appendCharCode(m),e.appendCharCode(8204);x+=V,k+=re,C>=u&&(E+=re)}}else for(e.appendASCIICharCode(62);C<P;C++){b.setColumnInfo(C+1,D-L,x,k),L=0;const W=o.charCodeAt(C);let q=1,V=1;switch(W){case 9:q=d-E%d,V=q;for(let re=1;re<=q;re++)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:_?e.appendCharCode(9216):e.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:e.appendCharCode(65533);break;default:mS(W)&&V++,_&&W<32?e.appendCharCode(9216+W):_&&W===127?e.appendCharCode(9249):_&&KZe(W)?(e.appendString("[U+"),e.appendString(vtr(W)),e.appendString("]"),q=8,V=q):e.appendCharCode(W)}x+=q,k+=V,C>=u&&(E+=V)}H?L++:L=0,C>=s&&!y&&N.isPseudoAfter()&&(y=!0,b.setColumnInfo(C+1,D,x,k)),e.appendString("</span>")}return y||b.setColumnInfo(s+1,c.length-1,x,k),a&&(e.appendString('<span class="mtkoverflow">'),e.appendString(T("showMore","Show more ({0})",btr(l))),e.appendString("</span>")),e.appendString("</span>"),new Ece(b,f,r)}function vtr(n){return n.toString(16).toUpperCase().padStart(4,"0")}function btr(n){return n<1024?T("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class SOe{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 ytr{constructor(e,t){this.tabSize=e,this.data=t}}class P0e{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 np{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=np.isBasicASCII(i,s),this.containsRTL=np.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?x6(e):!0}static containsRTL(e,t,i){return!t&&i?CA(e):!1}}class PM{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Ctr{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new PM(new J(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class YZe{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class V3{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&&ka(e.data,t.data)}static equalsArr(e,t){return ka(e,t,V3.equals)}}function wtr(n){return Array.isArray(n)}function Str(n){return!wtr(n)}function QZe(n){return typeof n=="string"}function EOe(n){return!QZe(n)}function x2(n){return!n}function Hw(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function xOe(n){return n.replace(/[&<>'"_]/g,"-")}function Etr(n,e){console.log(`${n.languageId}: ${e}`)}function _s(n,e){return new Error(`${n.languageId}: ${e}`)}function HC(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,f,g,m){return x2(c)?x2(u)?!x2(d)&&d<i.length?Hw(n,i[d]):!x2(f)&&n&&typeof n[f]=="string"?n[f]:(s===null&&(s=r.split("."),s.unshift(r)),!x2(h)&&h<s.length?Hw(n,s[h]):""):Hw(n,t):"$"})}function B9(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 xtr(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 Ttr=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},ktr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},xce;const XZe=5;class H3{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 rD(e,t);let i=rD.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let r=this._entries[i];return r||(r=new rD(e,t),this._entries[i]=r,r)}}H3._INSTANCE=new H3(XZe);class rD{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 rD._equals(this,e)}push(e){return H3.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return H3.create(this.parent,e)}}class lL{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 lL(this.languageId,this.state)}}class WC{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 MM(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new MM(e,t);const i=rD.getStackElementId(e);let r=this._entries[i];return r||(r=new MM(e,null),this._entries[i]=r,r)}}WC._INSTANCE=new WC(XZe);class MM{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:WC.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof MM)||!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 Itr{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 x3(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,r){const o=i.languageId,s=i.state,a=Ks.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 x3(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 c0e(this._tokens,e)}}class gz{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=Ks.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=gz._merge(this._prependTokens,this._tokens,l.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,l.endState}finalize(e){return new gK(gz._merge(this._prependTokens,this._tokens,null),e)}}let W3=xce=class extends qe{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(Ks.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,Ks.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=Ks.get(t);if(i){if(i instanceof xce){const r=i.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}Ks.isResolved(t)||e.push(Ks.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=H3.create(null,this._lexer.start);return WC.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return N0e(this._languageId,i);const r=new Itr,o=this._tokenize(e,t,i,r);return r.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return $K(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const r=new gz(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=B9(this._lexer,t.stack.state),!i))throw _s(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,o=!1;for(const s of i){if(!EOe(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 _s(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 WC.create(i.stack,new lL(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,f=!0;for(;f||d<l;){const g=d,m=u.depth,v=h?h.groups.length:0,_=u.state;let b=null,y=null,C=null,E=null,x=null;if(h){b=h.matches;const D=h.groups.shift();y=D.matched,C=D.action,E=h.rule,h.groups.length===0&&(h=null)}else{if(!f&&d>=l)break;f=!1;let D=this._lexer.tokenizer[_];if(!D&&(D=B9(this._lexer,_),!D))throw _s(this._lexer,"tokenizer state is not defined: "+_);const A=a.substr(d);for(const N of D)if((d===0||!N.matchOnlyAtLineStart)&&(b=A.match(N.regex),b)){y=b[0],C=N.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;Str(C)&&EOe(C)&&C.test;)C=C.test(y,b,_,d===l);let k=null;if(typeof C=="string"||Array.isArray(C))k=C;else if(C.group)k=C.group;else if(C.token!==null&&C.token!==void 0){if(C.tokenSubst?k=HC(this._lexer,C.token,y,b,_):k=C.token,C.nextEmbedded)if(C.nextEmbedded==="@pop"){if(!c)throw _s(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw _s(this._lexer,"cannot enter embedded language from within an embedded language");x=HC(this._lexer,C.nextEmbedded,y,b,_)}if(C.goBack&&(d=Math.max(0,d-C.goBack)),C.switchTo&&typeof C.switchTo=="string"){let D=HC(this._lexer,C.switchTo,y,b,_);if(D[0]==="@"&&(D=D.substr(1)),B9(this._lexer,D))u=u.switchTo(D);else throw _s(this._lexer,"trying to switch to a state '"+D+"' that is undefined in rule: "+this._safeRuleName(E))}else{if(C.transform&&typeof C.transform=="function")throw _s(this._lexer,"action.transform not supported");if(C.next)if(C.next==="@push"){if(u.depth>=this._lexer.maxStack)throw _s(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(_)}else if(C.next==="@pop"){if(u.depth<=1)throw _s(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(E));u=u.pop()}else if(C.next==="@popall")u=u.popall();else{let D=HC(this._lexer,C.next,y,b,_);if(D[0]==="@"&&(D=D.substr(1)),B9(this._lexer,D))u=u.push(D);else throw _s(this._lexer,"trying to set a next state '"+D+"' that is undefined in rule: "+this._safeRuleName(E))}}C.log&&typeof C.log=="string"&&Etr(this._lexer,this._lexer.languageId+": "+HC(this._lexer,C.log,y,b,_))}if(k===null)throw _s(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(E));const L=D=>{const A=this._languageService.getLanguageIdByLanguageName(D)||this._languageService.getLanguageIdByMimeType(D)||D,N=this._getNestedEmbeddedLanguageData(A);if(d<l){const P=e.substr(d);return this._nestedTokenize(P,t,WC.create(u,N),r+d,o)}else return WC.create(u,N)};if(Array.isArray(k)){if(h&&h.groups.length>0)throw _s(this._lexer,"groups cannot be nested: "+this._safeRuleName(E));if(b.length!==k.length+1)throw _s(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(E));let D=0;for(let A=1;A<b.length;A++)D+=b[A].length;if(D!==y.length)throw _s(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(E));h={rule:E,matches:b,groups:[]};for(let A=0;A<k.length;A++)h.groups[A]={action:k[A],matched:b[A+1]};d-=y.length;continue}else{if(k==="@rematch"&&(d-=y.length,y="",b=null,k="",x!==null))return L(x);if(y.length===0){if(l===0||m!==u.depth||_!==u.state||(h?h.groups.length:0)!==v)continue;throw _s(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(E))}let D=null;if(QZe(k)&&k.indexOf("@brackets")===0){const A=k.substr(9),N=Ltr(this._lexer,y);if(!N)throw _s(this._lexer,"@brackets token returned but no bracket defined as: "+y);D=xOe(N.token+A)}else{const A=k===""?"":k+this._lexer.tokenPostfix;D=xOe(A)}g<s&&o.emit(g+r,D)}if(x!==null)return L(x)}return WC.create(u,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new lL(e,IA);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),Ks.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=Ks.get(e);return t?new lL(e,t.getInitialState()):new lL(e,IA)}};W3=xce=Ttr([ktr(4,pr)],W3);function Ltr(n,e){if(!e)return null;e=Hw(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 Dtr=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 mte=M1("standaloneColorizer",{createHTML:n=>n});class M0e{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=mte==null?void 0:mte.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 Dtr(this,void 0,void 0,function*(){const o=e.languageIdCodec;let s=4;r&&typeof r.tabSize=="number"&&(s=r.tabSize),m0e(t)&&(t=t.substr(1));const a=a0(t);if(!e.isRegisteredLanguageId(i))return TOe(a,s,o);const l=yield Ks.getOrCreate(i);return l?Atr(a,s,l,o):TOe(a,s,o)})}static colorizeLine(e,t,i,r,o=4){const s=np.isBasicASCII(e,t),a=np.containsRTL(e,s,i);return VK(new dE(!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 Atr(n,e,t,i){return new Promise((r,o)=>{const s=()=>{const a=Rtr(n,e,t,i);if(t instanceof W3){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,o);return}}r(a)};s()})}function TOe(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 Ol(o,l,t),u=np.isBasicASCII(l,!0),d=np.containsRTL(l,u,!0),h=VK(new dE(!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 Rtr(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);Ol.convertToEndOffset(c.tokens,l.length);const u=new Ol(c.tokens,l,i),d=np.isBasicASCII(l,!0),h=np.containsRTL(l,d,!0),f=VK(new dE(!1,!0,l,!1,d,h,0,u.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));r=r.concat(f.html),r.push("<br/>"),o=c.endState}return r.join("")}const kOe=2e4;let wx,eV,Tce,tV,kce;function Ntr(n){wx=document.createElement("div"),wx.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"),wx.appendChild(i),i};eV=e(),Tce=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),wx.appendChild(i),i};tV=t(),kce=t(),n.appendChild(wx)}function vu(n){wx&&(eV.textContent!==n?(kc(Tce),mz(eV,n)):(kc(eV),mz(Tce,n)))}function wS(n){wx&&(tV.textContent!==n?(kc(kce),mz(tV,n)):(kc(tV),mz(kce,n)))}function mz(n,e){kc(n),e.length>kOe&&(e=e.substr(0,kOe)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const F0e=lr("markerDecorationsService");var Otr=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},Ptr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let z3=class{constructor(e,t){}dispose(){}};z3.ID="editor.contrib.markerDecorations";z3=Otr([Ptr(1,F0e)],z3);Hr(z3.ID,z3,0);class ZZe extends qe{constructor(e,t){super(),this._onDidChange=this._register(new De),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 Ww{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Ww._read(e,this.key),i=o=>Ww._read(e,o),r=(o,s)=>Ww._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}}Ww.items=[];function hE(n,e){Ww.items.push(new Ww(n,e))}function Dg(n,e){hE(n,(t,i,r)=>{if(typeof t<"u"){for(const[o,s]of e)if(t===o){r(n,s);return}}})}function Mtr(n){Ww.items.forEach(e=>e.apply(n))}Dg("wordWrap",[[!0,"on"],[!1,"off"]]);Dg("lineNumbers",[[!0,"on"],[!1,"off"]]);Dg("cursorBlinking",[["visible","solid"]]);Dg("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Dg("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Dg("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Dg("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Dg("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Dg("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Dg("autoIndent",[[!1,"advanced"],[!0,"full"]]);Dg("matchBrackets",[[!0,"always"],[!1,"never"]]);Dg("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Dg("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);hE("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});hE("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});hE("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const Ftr={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"};hE("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(Ftr))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});hE("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});hE("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});hE("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 Btr{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new De,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const LA=new Btr,F1=lr("accessibilityService"),A6=new sn("accessibilityModeEnabled",!1);var $tr=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},Vtr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Ice=class extends qe{constructor(e,t,i,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new De),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new De),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new yXe,this.isSimpleWidget=e,this._containerObserver=this._register(new ZZe(i,t.dimension)),this._rawOptions=IOe(t),this._validatedOptions=zC.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Hp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(LA.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(rce.onDidChange(()=>this._recomputeOptions())),this._register(L3.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=zC.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=hT.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:LA.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return zC.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:Wtr(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:dT||mg,pixelRatio:L3.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return rce.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=IOe(e);zC.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=zC.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=Htr(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())}};Ice=$tr([Vtr(3,F1)],Ice);function Htr(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function Wtr(){let n="";return!w1&&!qXe&&(n+="no-user-select "),w1&&(n+="no-minimap-shadow ",n+="enable-user-select "),br&&(n+="mac "),n}class ztr{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Utr{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 zC{static validateOptions(e){const t=new ztr;for(const i of iL){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 Utr;for(const r of iL)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)?ka(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!zC._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let r=!1;for(const o of iL){const s=!zC._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(r=!0)}return r?new bXe(i):null}static applyUpdate(e,t){let i=!1;for(const r of iL)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 IOe(n){const e=gy(n);return Mtr(e),e}function Ha(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 jtr=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},Qo;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Qo||(Qo={}));class Yo extends qe{constructor(){super(),this.dispatched=!1,this.targets=new Td,this.ignoreTargets=new Td,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(at(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(at(document,"touchend",e=>this.onTouchEnd(e))),this._register(at(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Yo.isTouchDevice())return qe.None;Yo.INSTANCE||(Yo.INSTANCE=new Yo);const t=Yo.INSTANCE.targets.push(e);return _i(t)}static ignoreTarget(e){if(!Yo.isTouchDevice())return qe.None;Yo.INSTANCE||(Yo.INSTANCE=new Yo);const t=Yo.INSTANCE.ignoreTargets.push(e);return _i(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(Qo.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<Yo.HOLD_DELAY&&Math.abs(a.initialPageX-xp(a.rollingPageX))<30&&Math.abs(a.initialPageY-xp(a.rollingPageY))<30){const c=this.newGestureEvent(Qo.Tap,a.initialTarget);c.pageX=xp(a.rollingPageX),c.pageY=xp(a.rollingPageY),this.dispatchEvent(c)}else if(l>=Yo.HOLD_DELAY&&Math.abs(a.initialPageX-xp(a.rollingPageX))<30&&Math.abs(a.initialPageY-xp(a.rollingPageY))<30){const c=this.newGestureEvent(Qo.Contextmenu,a.initialTarget);c.pageX=xp(a.rollingPageX),c.pageY=xp(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=xp(a.rollingPageX),u=xp(a.rollingPageY),d=xp(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=u-a.rollingPageY[0],g=[...this.targets].filter(m=>a.initialTarget instanceof Node&&m.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/d,h>0?1:-1,c,Math.abs(f)/d,f>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(Qo.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===Qo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Yo.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Qo.Change||e.type===Qo.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=_g(()=>{const c=Date.now(),u=c-t;let d=0,h=0,f=!0;i+=Yo.SCROLL_FRICTION*u,s+=Yo.SCROLL_FRICTION*u,i>0&&(f=!1,d=r*i*u),s>0&&(f=!1,h=a*s*u);const g=this.newGestureEvent(Qo.Change);g.translationX=d,g.translationY=h,e.forEach(m=>m.dispatchEvent(g)),f||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(Qo.Change,s.initialTarget);a.translationX=o.pageX-xp(s.rollingPageX),a.translationY=o.pageY-xp(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)}}Yo.SCROLL_FRICTION=-.005;Yo.HOLD_DELAY=700;Yo.CLEAR_TAP_COUNT_TIME=400;jtr([Ha],Yo,"isTouchDevice",null);class aN{constructor(){this._hooks=new yt,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(_i(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=window}this._hooks.add(at(s,Xt.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(at(s,Xt.POINTER_UP,a=>this.stopMonitoring(!0)))}}function B0e(n){return`--vscode-${n.replace(/\./g,"-")}`}function an(n){return`var(${B0e(n)})`}function qtr(n,e){return`var(${B0e(n)}, ${e})`}const JZe={ColorContribution:"base.contributions.colors"};class Gtr{constructor(){this._onDidChangeSchema=new De,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 y_(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 HK=new Gtr;Hs.add(JZe.ColorContribution,HK);function fe(n,e,t,i,r){return HK.registerColor(n,e,t,i,r)}const Bt=fe("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},T("foreground","Overall foreground color. This color is only used if not overridden by a component."));fe("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},T("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const Ktr=fe("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},T("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));fe("descriptionForeground",{light:"#717171",dark:Bn(Bt,.7),hcDark:Bn(Bt,.7),hcLight:Bn(Bt,.7)},T("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const rw=fe("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},T("iconForeground","The default color for icons in the workbench.")),Pf=fe("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},T("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),fr=fe("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},T("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),vs=fe("contrastActiveBorder",{light:null,dark:null,hcDark:Pf,hcLight:Pf},T("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));fe("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},T("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."));fe("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:je.black,hcLight:"#292929"},T("textSeparatorForeground","Color for text separators."));const Ytr=fe("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},T("textLinkForeground","Foreground color for links in text."));fe("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},T("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));fe("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},T("textPreformatForeground","Foreground color for preformatted text segments."));fe("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},T("textBlockQuoteBackground","Background color for block quotes in text."));fe("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:je.white,hcLight:"#292929"},T("textBlockQuoteBorder","Border color for block quotes in text."));fe("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:je.black,hcLight:"#F2F2F2"},T("textCodeBlockBackground","Background color for code blocks in text."));const Ob=fe("widget.shadow",{dark:Bn(je.black,.36),light:Bn(je.black,.16),hcDark:null,hcLight:null},T("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),$0e=fe("widget.border",{dark:null,light:null,hcDark:fr,hcLight:fr},T("widgetBorder","Border color of widgets such as find/replace inside the editor.")),eJe=fe("input.background",{dark:"#3C3C3C",light:je.white,hcDark:je.black,hcLight:je.white},T("inputBoxBackground","Input box background.")),tJe=fe("input.foreground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("inputBoxForeground","Input box foreground.")),nJe=fe("input.border",{dark:null,light:null,hcDark:fr,hcLight:fr},T("inputBoxBorder","Input box border.")),V0e=fe("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:fr,hcLight:fr},T("inputBoxActiveOptionBorder","Border color of activated options in input fields."));fe("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},T("inputOption.hoverBackground","Background color of activated options in input fields."));const Ux=fe("inputOption.activeBackground",{dark:Bn(Pf,.4),light:Bn(Pf,.2),hcDark:je.transparent,hcLight:je.transparent},T("inputOption.activeBackground","Background hover color of options in input fields.")),H0e=fe("inputOption.activeForeground",{dark:je.white,light:je.black,hcDark:Bt,hcLight:Bt},T("inputOption.activeForeground","Foreground color of activated options in input fields."));fe("input.placeholderForeground",{light:Bn(Bt,.5),dark:Bn(Bt,.5),hcDark:Bn(Bt,.7),hcLight:Bn(Bt,.7)},T("inputPlaceholderForeground","Input box foreground color for placeholder text."));const Qtr=fe("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:je.black,hcLight:je.white},T("inputValidationInfoBackground","Input validation background color for information severity.")),Xtr=fe("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Bt},T("inputValidationInfoForeground","Input validation foreground color for information severity.")),Ztr=fe("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:fr,hcLight:fr},T("inputValidationInfoBorder","Input validation border color for information severity.")),Jtr=fe("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:je.black,hcLight:je.white},T("inputValidationWarningBackground","Input validation background color for warning severity.")),enr=fe("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Bt},T("inputValidationWarningForeground","Input validation foreground color for warning severity.")),tnr=fe("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:fr,hcLight:fr},T("inputValidationWarningBorder","Input validation border color for warning severity.")),nnr=fe("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:je.black,hcLight:je.white},T("inputValidationErrorBackground","Input validation background color for error severity.")),inr=fe("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Bt},T("inputValidationErrorForeground","Input validation foreground color for error severity.")),rnr=fe("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:fr,hcLight:fr},T("inputValidationErrorBorder","Input validation border color for error severity.")),Pb=fe("dropdown.background",{dark:"#3C3C3C",light:je.white,hcDark:je.black,hcLight:je.white},T("dropdownBackground","Dropdown background.")),onr=fe("dropdown.listBackground",{dark:null,light:null,hcDark:je.black,hcLight:je.white},T("dropdownListBackground","Dropdown list background.")),By=fe("dropdown.foreground",{dark:"#F0F0F0",light:Bt,hcDark:je.white,hcLight:Bt},T("dropdownForeground","Dropdown foreground.")),cL=fe("dropdown.border",{dark:Pb,light:"#CECECE",hcDark:fr,hcLight:fr},T("dropdownBorder","Dropdown border.")),bP=fe("button.foreground",{dark:je.white,light:je.white,hcDark:je.white,hcLight:je.white},T("buttonForeground","Button foreground color.")),snr=fe("button.separator",{dark:Bn(bP,.4),light:Bn(bP,.4),hcDark:Bn(bP,.4),hcLight:Bn(bP,.4)},T("buttonSeparator","Button separator color.")),yP=fe("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},T("buttonBackground","Button background color.")),anr=fe("button.hoverBackground",{dark:fv(yP,.2),light:Jk(yP,.2),hcDark:yP,hcLight:yP},T("buttonHoverBackground","Button background color when hovering.")),lnr=fe("button.border",{dark:fr,light:fr,hcDark:fr,hcLight:fr},T("buttonBorder","Button border color.")),cnr=fe("button.secondaryForeground",{dark:je.white,light:je.white,hcDark:je.white,hcLight:Bt},T("buttonSecondaryForeground","Secondary button foreground color.")),Lce=fe("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:je.white},T("buttonSecondaryBackground","Secondary button background color.")),unr=fe("button.secondaryHoverBackground",{dark:fv(Lce,.2),light:Jk(Lce,.2),hcDark:null,hcLight:null},T("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),nV=fe("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:je.black,hcLight:"#0F4A85"},T("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),dnr=fe("badge.foreground",{dark:je.white,light:"#333",hcDark:je.white,hcLight:je.white},T("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),hnr=fe("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},T("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),CP=fe("scrollbarSlider.background",{dark:je.fromHex("#797979").transparent(.4),light:je.fromHex("#646464").transparent(.4),hcDark:Bn(fr,.6),hcLight:Bn(fr,.4)},T("scrollbarSliderBackground","Scrollbar slider background color.")),wP=fe("scrollbarSlider.hoverBackground",{dark:je.fromHex("#646464").transparent(.7),light:je.fromHex("#646464").transparent(.7),hcDark:Bn(fr,.8),hcLight:Bn(fr,.8)},T("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),SP=fe("scrollbarSlider.activeBackground",{dark:je.fromHex("#BFBFBF").transparent(.4),light:je.fromHex("#000000").transparent(.6),hcDark:fr,hcLight:fr},T("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),fnr=fe("progressBar.background",{dark:je.fromHex("#0E70C0"),light:je.fromHex("#0E70C0"),hcDark:fr,hcLight:fr},T("progressBarBackground","Background color of the progress bar that can show for long running operations."));fe("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},T("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 Mb=fe("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},T("editorError.foreground","Foreground color of error squigglies in the editor.")),pnr=fe("editorError.border",{dark:null,light:null,hcDark:je.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},T("errorBorder","If set, color of double underlines for errors in the editor."));fe("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},T("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 Mf=fe("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},T("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),U3=fe("editorWarning.border",{dark:null,light:null,hcDark:je.fromHex("#FFCC00").transparent(.8),hcLight:je.fromHex("#FFCC00").transparent(.8)},T("warningBorder","If set, color of double underlines for warnings in the editor."));fe("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},T("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 sh=fe("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},T("editorInfo.foreground","Foreground color of info squigglies in the editor.")),j3=fe("editorInfo.border",{dark:null,light:null,hcDark:je.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},T("infoBorder","If set, color of double underlines for infos in the editor.")),gnr=fe("editorHint.foreground",{dark:je.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},T("editorHint.foreground","Foreground color of hint squigglies in the editor."));fe("editorHint.border",{dark:null,light:null,hcDark:je.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},T("hintBorder","If set, color of double underlines for hints in the editor."));fe("sash.hoverBorder",{dark:Pf,light:Pf,hcDark:Pf,hcLight:Pf},T("sashActiveBorder","Border color of active sashes."));const Pl=fe("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:je.black,hcLight:je.white},T("editorBackground","Editor background color.")),mm=fe("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:je.white,hcLight:Bt},T("editorForeground","Editor default foreground color."));fe("editorStickyScroll.background",{light:Pl,dark:Pl,hcDark:Pl,hcLight:Pl},T("editorStickyScrollBackground","Sticky scroll background color for the editor"));fe("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:je.fromHex("#0F4A85").transparent(.1)},T("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const ca=fe("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:je.white},T("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Fb=fe("editorWidget.foreground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Bb=fe("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:fr,hcLight:fr},T("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.")),mnr=fe("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},T("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.")),LOe=fe("quickInput.background",{dark:ca,light:ca,hcDark:ca,hcLight:ca},T("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),_nr=fe("quickInput.foreground",{dark:Fb,light:Fb,hcDark:Fb,hcLight:Fb},T("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),vnr=fe("quickInputTitle.background",{dark:new je(new vr(255,255,255,.105)),light:new je(new vr(0,0,0,.06)),hcDark:"#000000",hcLight:je.white},T("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),iJe=fe("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:je.white,hcLight:"#0F4A85"},T("pickerGroupForeground","Quick picker color for grouping labels.")),bnr=fe("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:je.white,hcLight:"#0F4A85"},T("pickerGroupBorder","Quick picker color for grouping borders.")),ynr=fe("keybindingLabel.background",{dark:new je(new vr(128,128,128,.17)),light:new je(new vr(221,221,221,.4)),hcDark:je.transparent,hcLight:je.transparent},T("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Cnr=fe("keybindingLabel.foreground",{dark:je.fromHex("#CCCCCC"),light:je.fromHex("#555555"),hcDark:je.white,hcLight:Bt},T("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),wnr=fe("keybindingLabel.border",{dark:new je(new vr(51,51,51,.6)),light:new je(new vr(204,204,204,.4)),hcDark:new je(new vr(111,195,223)),hcLight:fr},T("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Snr=fe("keybindingLabel.bottomBorder",{dark:new je(new vr(68,68,68,.6)),light:new je(new vr(187,187,187,.4)),hcDark:new je(new vr(111,195,223)),hcLight:Bt},T("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ow=fe("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},T("editorSelectionBackground","Color of the editor selection.")),Enr=fe("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:je.white},T("editorSelectionForeground","Color of the selected text for high contrast.")),rJe=fe("editor.inactiveSelectionBackground",{light:Bn(ow,.5),dark:Bn(ow,.5),hcDark:Bn(ow,.7),hcLight:Bn(ow,.5)},T("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),W0e=fe("editor.selectionHighlightBackground",{light:MOe(ow,Pl,.3,.6),dark:MOe(ow,Pl,.3,.6),hcDark:null,hcLight:null},T("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);fe("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:vs,hcLight:vs},T("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const xnr=fe("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},T("editorFindMatch","Color of the current search match.")),$b=fe("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},T("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Tnr=fe("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},T("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),knr=fe("editor.findMatchBorder",{light:null,dark:null,hcDark:vs,hcLight:vs},T("editorFindMatchBorder","Border color of the current search match.")),sw=fe("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:vs,hcLight:vs},T("findMatchHighlightBorder","Border color of the other search matches.")),Inr=fe("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Bn(vs,.4),hcLight:Bn(vs,.4)},T("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);fe("searchEditor.findMatchBackground",{light:Bn($b,.66),dark:Bn($b,.66),hcDark:$b,hcLight:$b},T("searchEditor.queryMatch","Color of the Search Editor query matches."));fe("searchEditor.findMatchBorder",{light:Bn(sw,.66),dark:Bn(sw,.66),hcDark:sw,hcLight:sw},T("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));fe("search.resultsInfoForeground",{light:Bt,dark:Bn(Bt,.65),hcDark:Bt,hcLight:Bt},T("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));fe("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},T("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 _z=fe("editorHoverWidget.background",{light:ca,dark:ca,hcDark:ca,hcLight:ca},T("hoverBackground","Background color of the editor hover."));fe("editorHoverWidget.foreground",{light:Fb,dark:Fb,hcDark:Fb,hcLight:Fb},T("hoverForeground","Foreground color of the editor hover."));const Lnr=fe("editorHoverWidget.border",{light:Bb,dark:Bb,hcDark:Bb,hcLight:Bb},T("hoverBorder","Border color of the editor hover."));fe("editorHoverWidget.statusBarBackground",{dark:fv(_z,.2),light:Jk(_z,.05),hcDark:ca,hcLight:ca},T("statusBarBackground","Background color of the editor hover status bar."));const Dnr=fe("editorLink.activeForeground",{dark:"#4E94CE",light:je.blue,hcDark:je.cyan,hcLight:"#292929"},T("activeLinkForeground","Color of active links.")),$y=fe("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:je.white,hcLight:je.black},T("editorInlayHintForeground","Foreground color of inline hints")),Vy=fe("editorInlayHint.background",{dark:Bn(nV,.1),light:Bn(nV,.1),hcDark:Bn(je.white,.1),hcLight:Bn(nV,.1)},T("editorInlayHintBackground","Background color of inline hints")),Anr=fe("editorInlayHint.typeForeground",{dark:$y,light:$y,hcDark:$y,hcLight:$y},T("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Rnr=fe("editorInlayHint.typeBackground",{dark:Vy,light:Vy,hcDark:Vy,hcLight:Vy},T("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Nnr=fe("editorInlayHint.parameterForeground",{dark:$y,light:$y,hcDark:$y,hcLight:$y},T("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Onr=fe("editorInlayHint.parameterBackground",{dark:Vy,light:Vy,hcDark:Vy,hcLight:Vy},T("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));fe("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},T("editorLightBulbForeground","The color used for the lightbulb actions icon."));fe("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const Dce=new je(new vr(155,185,85,.2)),Ace=new je(new vr(255,0,0,.2)),Pnr=fe("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},T("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Mnr=fe("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},T("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);fe("diffEditor.insertedLineBackground",{dark:Dce,light:Dce,hcDark:null,hcLight:null},T("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);fe("diffEditor.removedLineBackground",{dark:Ace,light:Ace,hcDark:null,hcLight:null},T("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);fe("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));fe("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const Fnr=fe("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Bnr=fe("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));fe("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},T("diffEditorInsertedOutline","Outline color for the text that got inserted."));fe("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},T("diffEditorRemovedOutline","Outline color for text that got removed."));fe("diffEditor.border",{dark:null,light:null,hcDark:fr,hcLight:fr},T("diffEditorBorder","Border color between the two text editors."));fe("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},T("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));fe("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},T("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));fe("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},T("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));fe("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},T("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const $nr=fe("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),Vnr=fe("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),Hnr=fe("list.focusOutline",{dark:Pf,light:Pf,hcDark:vs,hcLight:vs},T("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.")),Wnr=fe("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),Hy=fe("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:je.fromHex("#0F4A85").transparent(.1)},T("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.")),Vb=fe("list.activeSelectionForeground",{dark:je.white,light:je.white,hcDark:null,hcLight:null},T("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.")),EP=fe("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),znr=fe("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:je.fromHex("#0F4A85").transparent(.1)},T("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.")),Unr=fe("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),jnr=fe("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),qnr=fe("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),Gnr=fe("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},T("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.")),oJe=fe("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:je.white.transparent(.1),hcLight:je.fromHex("#0F4A85").transparent(.1)},T("listHoverBackground","List/Tree background when hovering over items using the mouse.")),sJe=fe("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Knr=fe("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},T("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),_m=fe("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Pf,hcLight:Pf},T("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),$9=fe("list.focusHighlightForeground",{dark:_m,light:Eir(Hy,_m,"#BBE7FF"),hcDark:_m,hcLight:_m},T("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));fe("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},T("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));fe("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},T("listErrorForeground","Foreground color of list items containing errors."));fe("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},T("listWarningForeground","Foreground color of list items containing warnings."));const Ynr=fe("listFilterWidget.background",{light:Jk(ca,0),dark:fv(ca,0),hcDark:ca,hcLight:ca},T("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Qnr=fe("listFilterWidget.outline",{dark:je.transparent,light:je.transparent,hcDark:"#f38518",hcLight:"#007ACC"},T("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Xnr=fe("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:fr,hcLight:fr},T("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Znr=fe("listFilterWidget.shadow",{dark:Ob,light:Ob,hcDark:Ob,hcLight:Ob},T("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));fe("list.filterMatchBackground",{dark:$b,light:$b,hcDark:null,hcLight:null},T("listFilterMatchHighlight","Background color of the filtered match."));fe("list.filterMatchBorder",{dark:sw,light:sw,hcDark:fr,hcLight:vs},T("listFilterMatchHighlightBorder","Border color of the filtered match."));const xP=fe("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},T("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Jnr=fe("tree.inactiveIndentGuidesStroke",{dark:Bn(xP,.4),light:Bn(xP,.4),hcDark:Bn(xP,.4),hcLight:Bn(xP,.4)},T("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),eir=fe("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},T("tableColumnsBorder","Table border color between columns.")),tir=fe("tree.tableOddRowsBackground",{dark:Bn(Bt,.04),light:Bn(Bt,.04),hcDark:null,hcLight:null},T("tableOddRowsBackgroundColor","Background color for odd table rows."));fe("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},T("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const nir=fe("checkbox.background",{dark:Pb,light:Pb,hcDark:Pb,hcLight:Pb},T("checkbox.background","Background color of checkbox widget."));fe("checkbox.selectBackground",{dark:ca,light:ca,hcDark:ca,hcLight:ca},T("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const iir=fe("checkbox.foreground",{dark:By,light:By,hcDark:By,hcLight:By},T("checkbox.foreground","Foreground color of checkbox widget.")),rir=fe("checkbox.border",{dark:cL,light:cL,hcDark:cL,hcLight:cL},T("checkbox.border","Border color of checkbox widget."));fe("checkbox.selectBorder",{dark:rw,light:rw,hcDark:rw,hcLight:rw},T("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const DOe=fe("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,T("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),jx=fe("quickInputList.focusForeground",{dark:Vb,light:Vb,hcDark:Vb,hcLight:Vb},T("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),uL=fe("quickInputList.focusIconForeground",{dark:EP,light:EP,hcDark:EP,hcLight:EP},T("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),qx=fe("quickInputList.focusBackground",{dark:q3(DOe,Hy),light:q3(DOe,Hy),hcDark:null,hcLight:null},T("quickInput.listFocusBackground","Quick picker background color for the focused item.")),oir=fe("menu.border",{dark:null,light:null,hcDark:fr,hcLight:fr},T("menuBorder","Border color of menus.")),sir=fe("menu.foreground",{dark:By,light:By,hcDark:By,hcLight:By},T("menuForeground","Foreground color of menu items.")),air=fe("menu.background",{dark:Pb,light:Pb,hcDark:Pb,hcLight:Pb},T("menuBackground","Background color of menu items.")),lir=fe("menu.selectionForeground",{dark:Vb,light:Vb,hcDark:Vb,hcLight:Vb},T("menuSelectionForeground","Foreground color of the selected menu item in menus.")),cir=fe("menu.selectionBackground",{dark:Hy,light:Hy,hcDark:Hy,hcLight:Hy},T("menuSelectionBackground","Background color of the selected menu item in menus.")),uir=fe("menu.selectionBorder",{dark:null,light:null,hcDark:vs,hcLight:vs},T("menuSelectionBorder","Border color of the selected menu item in menus.")),dir=fe("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:fr,hcLight:fr},T("menuSeparatorBackground","Color of a separator menu item in menus.")),Rce=fe("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},T("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));fe("toolbar.hoverOutline",{dark:null,light:null,hcDark:vs,hcLight:vs},T("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));fe("toolbar.activeBackground",{dark:fv(Rce,.1),light:Jk(Rce,.1),hcDark:null,hcLight:null},T("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));fe("editor.snippetTabstopHighlightBackground",{dark:new je(new vr(124,124,124,.3)),light:new je(new vr(10,50,100,.2)),hcDark:new je(new vr(124,124,124,.3)),hcLight:new je(new vr(10,50,100,.2))},T("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));fe("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},T("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));fe("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));fe("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new je(new vr(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},T("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const hir=fe("breadcrumb.foreground",{light:Bn(Bt,.8),dark:Bn(Bt,.8),hcDark:Bn(Bt,.8),hcLight:Bn(Bt,.8)},T("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),fir=fe("breadcrumb.background",{light:Pl,dark:Pl,hcDark:Pl,hcLight:Pl},T("breadcrumbsBackground","Background color of breadcrumb items.")),AOe=fe("breadcrumb.focusForeground",{light:Jk(Bt,.2),dark:fv(Bt,.1),hcDark:fv(Bt,.1),hcLight:fv(Bt,.1)},T("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),pir=fe("breadcrumb.activeSelectionForeground",{light:Jk(Bt,.2),dark:fv(Bt,.1),hcDark:fv(Bt,.1),hcLight:fv(Bt,.1)},T("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));fe("breadcrumbPicker.background",{light:ca,dark:ca,hcDark:ca,hcLight:ca},T("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const aJe=.5,ROe=je.fromHex("#40C8AE").transparent(aJe),NOe=je.fromHex("#40A6FF").transparent(aJe),OOe=je.fromHex("#606060").transparent(.4),vm=.4,DA=1,dL=fe("merge.currentHeaderBackground",{dark:ROe,light:ROe,hcDark:null,hcLight:null},T("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);fe("merge.currentContentBackground",{dark:Bn(dL,vm),light:Bn(dL,vm),hcDark:Bn(dL,vm),hcLight:Bn(dL,vm)},T("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const hL=fe("merge.incomingHeaderBackground",{dark:NOe,light:NOe,hcDark:null,hcLight:null},T("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);fe("merge.incomingContentBackground",{dark:Bn(hL,vm),light:Bn(hL,vm),hcDark:Bn(hL,vm),hcLight:Bn(hL,vm)},T("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const fL=fe("merge.commonHeaderBackground",{dark:OOe,light:OOe,hcDark:null,hcLight:null},T("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);fe("merge.commonContentBackground",{dark:Bn(fL,vm),light:Bn(fL,vm),hcDark:Bn(fL,vm),hcLight:Bn(fL,vm)},T("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const AA=fe("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},T("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));fe("editorOverviewRuler.currentContentForeground",{dark:Bn(dL,DA),light:Bn(dL,DA),hcDark:AA,hcLight:AA},T("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));fe("editorOverviewRuler.incomingContentForeground",{dark:Bn(hL,DA),light:Bn(hL,DA),hcDark:AA,hcLight:AA},T("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));fe("editorOverviewRuler.commonContentForeground",{dark:Bn(fL,DA),light:Bn(fL,DA),hcDark:AA,hcLight:AA},T("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const z0e=fe("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},T("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),TP=fe("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},T("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),pL=fe("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},T("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),WK=fe("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},T("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),POe=fe("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},T("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),gir=fe("minimap.infoHighlight",{dark:sh,light:sh,hcDark:j3,hcLight:j3},T("minimapInfo","Minimap marker color for infos.")),mir=fe("minimap.warningHighlight",{dark:Mf,light:Mf,hcDark:U3,hcLight:U3},T("overviewRuleWarning","Minimap marker color for warnings.")),_ir=fe("minimap.errorHighlight",{dark:new je(new vr(255,18,18,.7)),light:new je(new vr(255,18,18,.7)),hcDark:new je(new vr(255,50,50,1)),hcLight:"#B5200D"},T("minimapError","Minimap marker color for errors.")),vir=fe("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},T("minimapBackground","Minimap background color.")),bir=fe("minimap.foregroundOpacity",{dark:je.fromHex("#000f"),light:je.fromHex("#000f"),hcDark:je.fromHex("#000f"),hcLight:je.fromHex("#000f")},T("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));fe("minimapSlider.background",{light:Bn(CP,.5),dark:Bn(CP,.5),hcDark:Bn(CP,.5),hcLight:Bn(CP,.5)},T("minimapSliderBackground","Minimap slider background color."));fe("minimapSlider.hoverBackground",{light:Bn(wP,.5),dark:Bn(wP,.5),hcDark:Bn(wP,.5),hcLight:Bn(wP,.5)},T("minimapSliderHoverBackground","Minimap slider background color when hovering."));fe("minimapSlider.activeBackground",{light:Bn(SP,.5),dark:Bn(SP,.5),hcDark:Bn(SP,.5),hcLight:Bn(SP,.5)},T("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const yir=fe("problemsErrorIcon.foreground",{dark:Mb,light:Mb,hcDark:Mb,hcLight:Mb},T("problemsErrorIconForeground","The color used for the problems error icon.")),Cir=fe("problemsWarningIcon.foreground",{dark:Mf,light:Mf,hcDark:Mf,hcLight:Mf},T("problemsWarningIconForeground","The color used for the problems warning icon.")),wir=fe("problemsInfoIcon.foreground",{dark:sh,light:sh,hcDark:sh,hcLight:sh},T("problemsInfoIconForeground","The color used for the problems info icon."));fe("charts.foreground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("chartsForeground","The foreground color used in charts."));fe("charts.lines",{dark:Bn(Bt,.5),light:Bn(Bt,.5),hcDark:Bn(Bt,.5),hcLight:Bn(Bt,.5)},T("chartsLines","The color used for horizontal lines in charts."));fe("charts.red",{dark:Mb,light:Mb,hcDark:Mb,hcLight:Mb},T("chartsRed","The red color used in chart visualizations."));fe("charts.blue",{dark:sh,light:sh,hcDark:sh,hcLight:sh},T("chartsBlue","The blue color used in chart visualizations."));fe("charts.yellow",{dark:Mf,light:Mf,hcDark:Mf,hcLight:Mf},T("chartsYellow","The yellow color used in chart visualizations."));fe("charts.orange",{dark:pL,light:pL,hcDark:pL,hcLight:pL},T("chartsOrange","The orange color used in chart visualizations."));fe("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},T("chartsGreen","The green color used in chart visualizations."));fe("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("chartsPurple","The purple color used in chart visualizations."));function Sir(n,e){var t,i,r,o;switch(n.op){case 0:return(t=y_(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=y_(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(r=y_(n.value,e))===null||r===void 0?void 0:r.transparent(n.factor);case 3:{const s=y_(n.background,e);return s?(o=y_(n.value,e))===null||o===void 0?void 0:o.makeOpaque(s):y_(n.value,e)}case 4:for(const s of n.values){const a=y_(s,e);if(a)return a}return;case 6:return y_(e.defines(n.if)?n.then:n.else,e);case 5:{const s=y_(n.value,e);if(!s)return;const a=y_(n.background,e);return a?s.isDarkerThan(a)?je.getLighterColor(s,a,n.factor).transparent(n.transparency):je.getDarkerColor(s,a,n.factor).transparent(n.transparency):s.transparent(n.factor*n.transparency)}default:throw xK()}}function Jk(n,e){return{op:0,value:n,factor:e}}function fv(n,e){return{op:1,value:n,factor:e}}function Bn(n,e){return{op:2,value:n,factor:e}}function q3(...n){return{op:4,values:n}}function Eir(n,e,t){return{op:6,if:n,then:e,else:t}}function MOe(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function y_(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?je.fromHex(n):e.getColor(n);if(n instanceof je)return n;if(typeof n=="object")return Sir(n,e)}}const lJe="vscode://schemas/workbench-colors",cJe=Hs.as(MK.JSONContribution);cJe.registerSchema(lJe,HK.getColorSchema());const FOe=new Mo(()=>cJe.notifySchemaChanged(lJe),200);HK.onDidChangeSchema(()=>{FOe.isScheduled()||FOe.schedule()});class zK{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new uJe(this.x-window.scrollX,this.y-window.scrollY)}}class uJe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new zK(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class xir{constructor(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r,this._editorPagePositionBrand=void 0}}class Tir{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function U0e(n){const e=pl(n);return new xir(e.left,e.top,e.width,e.height)}function j0e(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 Tir(o,s)}class SS extends Zp{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new zK(this.posx,this.posy),this.editorPos=U0e(i),this.relativePos=j0e(i,this.editorPos,this.pos)}}class kir{constructor(e){this._editorViewDomNode=e}_create(e){return new SS(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return at(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return at(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return at(e,Xt.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return at(e,Xt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return at(e,Xt.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return at(e,"mousemove",i=>t(this._create(i)))}}class Iir{constructor(e){this._editorViewDomNode=e}_create(e){return new SS(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return at(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return at(e,Xt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return at(e,Xt.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return at(e,"pointermove",i=>t(this._create(i)))}}class Lir extends qe{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new aN),this._keydownListener=null}startMonitoring(e,t,i,r,o){this._keydownListener=Ba(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,s=>{r(new SS(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),o(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class R6{constructor(e){this._editor=e,this._instanceId=++R6._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new Mo(()=>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 Dir(t,`dyn-rule-${this._instanceId}-${r}`,rz(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())}}R6._idPool=0;class Dir{constructor(e,t,i,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElement=vg(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=an(o.id):s=o;const a=Air(r);i+=`
${a}: ${s};`}return i+=`
}`,i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Air(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class N6 extends qe{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 tf extends N6{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class u0{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 Rir{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 Nir extends Rir{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 Oir{constructor(e,t,i,r){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=r}}class UK{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 UK(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 pT{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 Pir{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class BOe{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class iV{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(pT.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 pT(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 Jp;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Jp||(Jp={}));function pv(n){return n===Jp.HIGH_CONTRAST_DARK||n===Jp.HIGH_CONTRAST_LIGHT}function RA(n){return n===Jp.DARK||n===Jp.HIGH_CONTRAST_DARK}const Mir=function(){return uv?!0:!(Xu||mg||w1)}();let oD=!0;class $Oe{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 Cb{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=oo(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 pv(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=$h.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(pv(s.themeType)||this._options.renderWhitespace==="selection"){const h=i.selections;for(const f of h){if(f.endLineNumber<e||f.startLineNumber>e)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,m=f.endLineNumber===e?f.endColumn:o.maxColumn;g<m&&(pv(s.themeType)&&a.push(new $h(g,m,"inline-selected-text",0)),this._options.renderWhitespace==="selection"&&(l||(l=[]),l.push(new qZe(g-1,m-1))))}}const c=new dE(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!==xf.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(Cb.CLASS_NAME),r.appendString('">');const u=D6(c,r);r.appendString("</div>");let d=null;return oD&&Mir&&o.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new V9(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=hJe(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 V9:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof V9?this._renderedViewLine.monospaceAssumptionsAreValid():oD}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof V9&&(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 BOe(!0,[new pT(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 BOe(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Cb.CLASS_NAME="view-line";class V9{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 oD;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!"),oD=!1)}return oD}toSlowRenderedLine(){return hJe(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 pT(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=iV.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 q0e(this._characterMapping,e,t)}}class dJe{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 pT(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 pT(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=iV.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=iV.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 pT(0,this.getWidth(r))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return iV.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,r)}getColumnOfNodeOffset(e,t){return q0e(this._characterMapping,e,t)}}class Fir extends dJe{_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 hJe=function(){return dT?Bir:$ir}();function Bir(n,e,t,i,r){return new Fir(n,e,t,i,r)}function $ir(n,e,t,i,r){return new dJe(n,e,t,i,r)}function q0e(n,e,t){const i=e.textContent.length;let r=-1;for(;e;)e=e.previousSibling,r++;return n.getColumn(new GZe(r,t),i)}class Cl{static _nextVisibleColumn(e,t,i){return e===9?Cl.nextRenderTabStop(t,i):mS(e)||g0e(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 nz(o);let a=0;for(;!s.eol();){const l=tz(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 nz(e);let s=0,a=1;for(;!o.eol();){const l=tz(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 G3{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=Cl.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]=G3.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 f=s;f<o;++f){if(h===a+i)return s;switch(e.charCodeAt(f)){case 32:h+=1;break;case 9:h=Cl.nextRenderTabStop(h,i);break;default:return-1}}return h===a+i?s:-1}const u=Cl.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=Cl.nextRenderTabStop(d,i);break;default:return-1}}return d===u?o:-1}}class yC{constructor(e=null){this.hitTarget=e,this.type=0}}class fJe{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var Sx;(function(n){function e(t,i,r){const o=t.getPositionFromDOMInfo(i,r);return o?new fJe(o,i,null):new yC(i)}n.createFromDOMInfo=e})(Sx||(Sx={}));class Vir{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class Bu{static _deduceRage(e,t=null){return!t&&e?new J(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 hf{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 NA{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 NA.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 Re(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(s=new Re(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 J(r,o,r,o),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new J(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 NA._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 Hir{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,$c._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class G0e extends Hir{constructor(e,t,i,r,o){super(e,t,i,r),this._ctx=e,o?(this.target=o,this.targetPath=u0.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)?Cl.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Bu.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Bu.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,r){return Bu.createMargin(e,this.target,this._getMouseColumn(t),t,i,r)}fulfillViewZone(e,t,i){return Bu.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Bu.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Bu.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Bu.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Bu.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Bu.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new G0e(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const VOe={isAfterLines:!0};function _te(n){return{isAfterLines:!1,horizontalDistanceToText:n}}class $c{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=u0.collect(t,this._viewHelper.viewDomNode);return!!(hf.isChildOfContentWidgets(i)||hf.isChildOfOverflowingContentWidgets(i)||hf.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,r,o){const s=new NA(this._context,this._viewHelper,e),a=new G0e(s,t,i,r,o);try{const l=$c._createMouseTarget(s,a,!1);if(l.type===6&&s.stickyTabStops&&l.position!==null){const c=$c._snapToSoftTabBoundary(l.position,s.viewModel),u=J.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=$c._doHitTest(e,t);return s.type===1?$c.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}const r=t;let o=null;return!hf.isChildOfOverflowGuard(t.targetPath)&&!hf.isChildOfOverflowingContentWidgets(t.targetPath)&&(o=o||t.fulfillUnknown()),o=o||$c._hitTestContentWidget(e,r),o=o||$c._hitTestOverlayWidget(e,r),o=o||$c._hitTestMinimap(e,r),o=o||$c._hitTestScrollbarSlider(e,r),o=o||$c._hitTestViewZone(e,r),o=o||$c._hitTestMargin(e,r),o=o||$c._hitTestViewCursor(e,r),o=o||$c._hitTestTextArea(e,r),o=o||$c._hitTestViewLines(e,r,i),o=o||$c._hitTestScrollbar(e,r),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(hf.isChildOfContentWidgets(t.targetPath)||hf.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(hf.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 hf.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(!hf.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Re(1,1),VOe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new Re(o,s),VOe)}if(i){if(hf.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=_te(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new Re(o,1),l)}const s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){const a=_te(t.mouseContentHorizontalOffset-s),l=new Re(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const r=$c._doHitTest(e,t);return r.type===1?$c.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}static _hitTestMinimap(e,t){if(hf.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Re(i,r))}return null}static _hitTestScrollbarSlider(e,t){if(hf.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 Re(r,o))}}return null}static _hitTestScrollbar(e,t){if(hf.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Re(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 $c._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 _=_te(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,_)}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 _=e.visibleRangeForPosition(s,a-1);_&&d.push({offset:_.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(a<h){const _=e.visibleRangeForPosition(s,a+1);_&&d.push({offset:_.left,column:a+1})}d.sort((_,b)=>_.offset-b.offset);const f=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),m=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let _=1;_<d.length;_++){const b=d[_-1],y=d[_];if(b.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=y.offset){v=new J(s,b.column,s,y.column);const C=Math.abs(b.offset-t.mouseContentHorizontalOffset),E=Math.abs(y.offset-t.mouseContentHorizontalOffset);r=C<E?new Re(s,b.column):new Re(s,y.column);break}}return t.fulfillContentText(r,v,{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 zK(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=ZT(e.viewDomNode);let r;if(i?typeof i.caretRangeFromPoint>"u"?r=Wir(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 yC;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)===Cb.CLASS_NAME?Sx.createFromDOMInfo(e,s,r.startOffset):new yC(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)===Cb.CLASS_NAME?Sx.createFromDOMInfo(e,o,o.textContent.length):new yC(o)}return new yC}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)===Cb.CLASS_NAME?Sx.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new yC(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===Cb.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return Sx.createFromDOMInfo(e,l,0)}else if(a===Cb.CLASS_NAME)return Sx.createFromDOMInfo(e,i.offsetNode,0)}return new yC(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),o=G3.atomicPosition(i,e.column-1,r,2);return o!==-1?new Re(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new yC;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 fJe(o,i.spanNode,r))}return i}}function Wir(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}`,f=r.innerText;let g=o.left,m=0,v;if(e>o.left+o.width)m=f.length;else{const _=Gx.getInstance();for(let b=0;b<f.length+1;b++){if(v=_.getCharWidth(f.charAt(b),h)/2,g+=v,e<g){m=b;break}g+=v}}i.setStart(r.firstChild,m),i.setEnd(r.firstChild,m)}return i}class Gx{static getInstance(){return Gx._INSTANCE||(Gx._INSTANCE=new Gx),Gx._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}}Gx._INSTANCE=null;let e_=class extends qe{onclick(e,t){this._register(at(e,Xt.CLICK,i=>t(new Zp(i))))}onmousedown(e,t){this._register(at(e,Xt.MOUSE_DOWN,i=>t(new Zp(i))))}onmouseover(e,t){this._register(at(e,Xt.MOUSE_OVER,i=>t(new Zp(i))))}onmouseleave(e,t){this._register(at(e,Xt.MOUSE_LEAVE,i=>t(new Zp(i))))}onkeydown(e,t){this._register(at(e,Xt.KEY_DOWN,i=>t(new ls(i))))}onkeyup(e,t){this._register(at(e,Xt.KEY_UP,i=>t(new ls(i))))}oninput(e,t){this._register(at(e,Xt.INPUT,t))}onblur(e,t){this._register(at(e,Xt.BLUR,t))}onfocus(e,t){this._register(at(e,Xt.FOCUS,t))}ignoreGesture(e){return Yo.ignoreTarget(e)}};const OA=11;class zir extends e_{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(...ei.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=OA+"px",this.domNode.style.height=OA+"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 aN),this._register(Ba(this.bgDomNode,Xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ba(this.domNode,Xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new k6),this._pointerdownScheduleRepeatTimer=this._register(new Jm)}_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 Uir extends qe{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 Jm)}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 jir=140;class pJe extends e_{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 Uir(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new aN),this._shouldRender=!0,this.domNode=oo(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(at(this.domNode.domNode,Xt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new zir(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,r){this.slider=oo(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(at(this.slider.domNode,Xt.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=pl(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(eu&&a>jir){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 qir=20;class PA{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 PA(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(qir,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=PA._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 Gir extends pJe{constructor(e,t,i){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new PA(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-OA)/2,a=(t.horizontalScrollbarSize-OA)/2;this._createArrow({className:"scra",icon:jt.scrollbarButtonLeft,top:a,left:s,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new XT(null,1,0))}),this._createArrow({className:"scra",icon:jt.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new XT(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 Kir extends pJe{constructor(e,t,i){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new PA(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-OA)/2,a=(t.verticalScrollbarSize-OA)/2;this._createArrow({className:"scra",icon:jt.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new XT(null,0,1))}),this._createArrow({className:"scra",icon:jt.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new XT(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 vz{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 vz(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 vz(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 O6 extends qe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new De),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new vz(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 K3(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=K3.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 HOe{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function vte(n,e){const t=e-n;return function(i){return n+t*Xir(i)}}function Yir(n,e,t){return function(i){return i<t?n(i/t):e((i-t)/(1-t))}}class K3{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),Yir(vte(e,o),vte(s,t),.33)}return vte(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 HOe(i,r,!1)}return new HOe(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return K3.start(e,t,i)}static start(e,t,i){i=i+10;const r=Date.now()-10;return new K3(e,t,r,i)}}function Qir(n){return Math.pow(n,3)}function Xir(n){return 1-Qir(1-n)}const Zir=500,WOe=50;class Jir{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class bz{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/wXi();eu||Xu?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 Jir(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}}bz.INSTANCE=new bz;class K0e extends e_{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new De),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new De),e.style.overflow="hidden",this._options=err(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 Kir(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Gir(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=oo(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=oo(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=oo(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 Jm),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=_o(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,br&&(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 XT(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=_o(this._mouseWheelToDispose),e)){const i=r=>{this._onMouseWheel(new XT(r))};this._mouseWheelToDispose.push(at(this._listenOnDomNode,Xt.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=bz.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=!br&&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=WOe*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=WOe*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(),Zir)}}class gJe extends K0e{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new O6({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>_g(r)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class Y0e extends K0e{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 P6 extends K0e{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new O6({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>_g(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 err(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,br&&(e.className+=" mac"),e}class Q0e extends N6{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new $c(this._context,i),this._mouseDownOperation=this._register(new trr(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 kir(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=at(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new SS(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(at(this.viewHelper.viewDomNode,Xt.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=bz.INSTANCE;let t=0,i=Hp.getZoomLevel(),r=!1,o=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new XT(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=Hp.getZoomLevel(),d=c.deltaY>0?1:-1;Hp.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Hp.getZoomLevel(),r=a(l),o=0),t=Date.now(),o+=c.deltaY,r&&(Hp.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(at(this.viewHelper.viewDomNode,Xt.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return br?(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 uJe(e,t).toPageCoordinates(),o=U0e(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=j0e(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=ZT(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;br&&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 trr extends qe{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 Lir(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new nrr(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new jK,this._currentSelection=new kn(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=NA.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return Bu.createOutsideEditor(o,d,"above",a)}const u=r.getLineNumberAtVerticalOffset(l);return Bu.createOutsideEditor(o,new Re(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=NA.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return Bu.createOutsideEditor(o,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return Bu.createOutsideEditor(o,new Re(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 Bu.createOutsideEditor(o,new Re(s,1),"left",a)}if(e.posx>t.x+t.width){const a=e.posx-t.x-t.width;return Bu.createOutsideEditor(o,new Re(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 Bu.createViewZone(r.type,r.element,r.mouseColumn,s,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new Re(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 nrr extends qe{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 irr(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class irr extends qe{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=_g(()=>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=U0e(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(143).horizontalScrollbarHeight,d=new zK(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=j0e(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=Bu.createOutsideEditor(this._position.mouseColumn,new Re(a,1),"above",this._position.outsideDistance):l=Bu.createOutsideEditor(this._position.mouseColumn,new Re(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=_g(()=>this._execute())}}class jK{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>jK.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)}}jK.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class cr{get event(){return this.emitter.event}constructor(e,t,i){const r=o=>this.emitter.fire(o);this.emitter=new De({onWillAddFirstListener:()=>e.addEventListener(t,r,i),onDidRemoveLastListener:()=>e.removeEventListener(t,r,i)})}dispose(){this.emitter.dispose()}}var aw;(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(){_(),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,v()}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(){_()}n.onKeyUp=h;function f(){_()}n.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(m),v())}n.onRenderStart=g;function m(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(_)}function _(){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(k,L){const D=performance.getEntriesByName(k)[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 k={keydown:E(e),input:E(t),render:E(i),total:E(r),sampleCount:o};return x(e),x(t),x(i),x(r),o=0,k}n.getAndClearMeasurements=C;function E(k){return{average:k.total/o,max:k.max,min:k.min}}function x(k){k.total=0,k.min=Number.MAX_VALUE,k.max=0}})(aw||(aw={}));class pc{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 pc(i,r,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new pc(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(KT(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(ez(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(KT(e.value,t.value),e.selectionEnd),r=Math.min(ez(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}}}pc.EMPTY=new pc("",0,0,null,void 0);class gL{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 J(r,1,o+1,1)}static fromEditorSelection(e,t,i,r){const s=gL._getPageOfLine(t.startLineNumber,i),a=gL._getRangeForPage(s,i),l=gL._getPageOfLine(t.endLineNumber,i),c=gL._getRangeForPage(l,i);let u=a.intersectRanges(new J(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const _=e.modifyPosition(u.getEndPosition(),-500);u=J.fromPositions(_,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new J(t.endLineNumber,t.endColumn,h,f));if(r&&e.getValueLengthInRange(g,1)>500){const _=e.modifyPosition(g.getStartPosition(),500);g=J.fromPositions(g.getStartPosition(),_)}const m=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const _=a.intersectRanges(t),b=c.intersectRanges(t);v=e.getValueInRange(_,1)+String.fromCharCode(8230)+e.getValueInRange(b,1)}return r&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new pc(d+v+m,d.length,d.length+v.length,t,u.endLineNumber-u.startLineNumber)}}var yz;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(yz||(yz={}));const Nce={forceCopyWithSyntaxHighlighting:!1};class Y3{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)}}Y3.INSTANCE=new Y3;class rrr{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 orr extends qe{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 De),this.onFocus=this._onFocus.event,this._onBlur=this._register(new De),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new De),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new De),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new De),this.onCut=this._onCut.event,this._onPaste=this._register(new De),this.onPaste=this._onPaste.event,this._onType=this._register(new De),this.onType=this._onType.event,this._onCompositionStart=this._register(new De),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new De),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new De),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new De),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new Mo(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Mo(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=pc.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 ls(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 ls(s);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(s=>{const a=new rrr;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=pc.readFromTextArea(this._textArea,this._textAreaState),u=pc.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionUpdate.fire(s);return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=pc.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=pc.readFromTextArea(this._textArea,this._textAreaState),u=pc.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=pc.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=pc.readFromTextArea(this._textArea,this._textAreaState),l=pc.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(Rl(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]=Oce.getTextData(s.clipboardData);a&&(l=l||Y3.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 at(this._textArea.ownerDocument,"selectionchange",t=>{if(aw.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]),f=new kn(u.lineNumber,u.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}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};Y3.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,`
`):t.text,i),e.preventDefault(),e.clipboardData&&Oce.setTextData(e.clipboardData,t.text,t.html,i)}}const Oce={getTextData(n){const e=n.getData(xa.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(xa.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class srr extends qe{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new cr(this._actual,"keydown")).event,this.onKeyUp=this._register(new cr(this._actual,"keyup")).event,this.onCompositionStart=this._register(new cr(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new cr(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new cr(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new cr(this._actual,"beforeinput")).event,this.onInput=this._register(new cr(this._actual,"input")).event,this.onCut=this._register(new cr(this._actual,"cut")).event,this.onCopy=this._register(new cr(this._actual,"copy")).event,this.onPaste=this._register(new cr(this._actual,"paste")).event,this.onFocus=this._register(new cr(this._actual,"focus")).event,this.onBlur=this._register(new cr(this._actual,"blur")).event,this._onSyntheticTap=this._register(new De),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>aw.onKeyDown())),this._register(this.onBeforeInput(()=>aw.onBeforeInput())),this._register(this.onInput(()=>aw.onInput())),this._register(this.onKeyUp(()=>aw.onKeyUp())),this._register(at(this._actual,yz.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=ZT(this._actual);return e?e.activeElement===this._actual:w0e(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=ZT(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){mg&&window.parent!==window&&r.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,i),mg&&window.parent!==window&&r.focus();return}try{const u=$Zi(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,i),VZi(r,u)}catch{}}}class arr extends Q0e{constructor(e,t,i){super(e,t,i),this._register(Yo.addTarget(this.viewHelper.linesContentDomNode)),this._register(at(this.viewHelper.linesContentDomNode,Qo.Tap,o=>this.onTap(o))),this._register(at(this.viewHelper.linesContentDomNode,Qo.Change,o=>this.onChange(o))),this._register(at(this.viewHelper.linesContentDomNode,Qo.Contextmenu,o=>this._onContextMenu(new SS(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(at(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 Iir(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 SS(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 lrr extends Q0e{constructor(e,t,i){super(e,t,i),this._register(Yo.addTarget(this.viewHelper.linesContentDomNode)),this._register(at(this.viewHelper.linesContentDomNode,Qo.Tap,r=>this.onTap(r))),this._register(at(this.viewHelper.linesContentDomNode,Qo.Change,r=>this.onChange(r))),this._register(at(this.viewHelper.linesContentDomNode,Qo.Contextmenu,r=>this._onContextMenu(new SS(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new SS(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(yz.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 crr extends qe{constructor(e,t,i){super(),bv&&C0e.pointerEvents?this.handler=this._register(new arr(e,t,i)):window.TouchEvent?this.handler=this._register(new lrr(e,t,i)):this.handler=this._register(new Q0e(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class eI extends N6{}const Vl=lr("themeService");function Ys(n){return{id:n}}function Pce(n){switch(n){case Jp.DARK:return"vs-dark";case Jp.HIGH_CONTRAST_DARK:return"hc-black";case Jp.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const mJe={ThemingContribution:"base.contributions.theming"};class urr{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new De}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),_i(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const _Je=new urr;Hs.add(mJe.ThemingContribution,_Je);function t_(n){return _Je.onColorThemeChange(n)}class drr extends qe{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 vJe=fe("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},T("lineHighlight","Background color for the highlight of line at the cursor position.")),zOe=fe("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:fr},T("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));fe("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},T("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);fe("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:vs,hcLight:vs},T("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);fe("editor.symbolHighlightBackground",{dark:$b,light:$b,hcDark:null,hcLight:null},T("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);fe("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:vs,hcLight:vs},T("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const bJe=fe("editorCursor.foreground",{dark:"#AEAFAD",light:je.black,hcDark:je.white,hcLight:"#0F4A85"},T("caret","Color of the editor cursor.")),hrr=fe("editorCursor.background",null,T("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Wy=fe("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},T("editorWhitespaces","Color of whitespace characters in the editor.")),frr=fe("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:je.white,hcLight:"#292929"},T("editorLineNumbers","Color of editor line numbers.")),H9=fe("editorIndentGuide.background",{dark:Wy,light:Wy,hcDark:Wy,hcLight:Wy},T("editorIndentGuides","Color of the editor indentation guides."),!1,T("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),W9=fe("editorIndentGuide.activeBackground",{dark:Wy,light:Wy,hcDark:Wy,hcLight:Wy},T("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,T("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),M6=fe("editorIndentGuide.background1",{dark:H9,light:H9,hcDark:H9,hcLight:H9},T("editorIndentGuides1","Color of the editor indentation guides (1).")),prr=fe("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides2","Color of the editor indentation guides (2).")),grr=fe("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides3","Color of the editor indentation guides (3).")),mrr=fe("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides4","Color of the editor indentation guides (4).")),_rr=fe("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides5","Color of the editor indentation guides (5).")),vrr=fe("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorIndentGuides6","Color of the editor indentation guides (6).")),F6=fe("editorIndentGuide.activeBackground1",{dark:W9,light:W9,hcDark:W9,hcLight:W9},T("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),brr=fe("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),yrr=fe("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Crr=fe("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),wrr=fe("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Srr=fe("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),z9=fe("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:vs,hcLight:vs},T("editorActiveLineNumber","Color of editor active line number"),!1,T("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));fe("editorLineNumber.activeForeground",{dark:z9,light:z9,hcDark:z9,hcLight:z9},T("editorActiveLineNumber","Color of editor active line number"));const Err=fe("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},T("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));fe("editorRuler.foreground",{dark:"#5A5A5A",light:je.lightgrey,hcDark:je.white,hcLight:"#292929"},T("editorRuler","Color of the editor rulers."));fe("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},T("editorCodeLensForeground","Foreground color of editor CodeLens"));fe("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},T("editorBracketMatchBackground","Background color behind matching brackets"));fe("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:fr,hcLight:fr},T("editorBracketMatchBorder","Color for matching brackets boxes"));const xrr=fe("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},T("editorOverviewRulerBorder","Color of the overview ruler border.")),Trr=fe("editorOverviewRuler.background",null,T("editorOverviewRulerBackground","Background color of the editor overview ruler."));fe("editorGutter.background",{dark:Pl,light:Pl,hcDark:Pl,hcLight:Pl},T("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));fe("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:je.fromHex("#fff").transparent(.8),hcLight:fr},T("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const krr=fe("editorUnnecessaryCode.opacity",{dark:je.fromHex("#000a"),light:je.fromHex("#0007"),hcDark:null,hcLight:null},T("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.`));fe("editorGhostText.border",{dark:null,light:null,hcDark:je.fromHex("#fff").transparent(.8),hcLight:je.fromHex("#292929").transparent(.8)},T("editorGhostTextBorder","Border color of ghost text in the editor."));fe("editorGhostText.foreground",{dark:je.fromHex("#ffffff56"),light:je.fromHex("#0007"),hcDark:null,hcLight:null},T("editorGhostTextForeground","Foreground color of the ghost text in the editor."));fe("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},T("editorGhostTextBackground","Background color of the ghost text in the editor."));const U9=new je(new vr(0,122,204,.6)),yJe=fe("editorOverviewRuler.rangeHighlightForeground",{dark:U9,light:U9,hcDark:U9,hcLight:U9},T("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Irr=fe("editorOverviewRuler.errorForeground",{dark:new je(new vr(255,18,18,.7)),light:new je(new vr(255,18,18,.7)),hcDark:new je(new vr(255,50,50,1)),hcLight:"#B5200D"},T("overviewRuleError","Overview ruler marker color for errors.")),Lrr=fe("editorOverviewRuler.warningForeground",{dark:Mf,light:Mf,hcDark:U3,hcLight:U3},T("overviewRuleWarning","Overview ruler marker color for warnings.")),Drr=fe("editorOverviewRuler.infoForeground",{dark:sh,light:sh,hcDark:j3,hcLight:j3},T("overviewRuleInfo","Overview ruler marker color for infos.")),CJe=fe("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},T("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),wJe=fe("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},T("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),SJe=fe("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},T("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),EJe=fe("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),xJe=fe("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),TJe=fe("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Arr=fe("editorBracketHighlight.unexpectedBracket.foreground",{dark:new je(new vr(255,18,18,.8)),light:new je(new vr(255,18,18,.8)),hcDark:new je(new vr(255,50,50,1)),hcLight:""},T("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Rrr=fe("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Nrr=fe("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Orr=fe("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Prr=fe("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Mrr=fe("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Frr=fe("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Brr=fe("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),$rr=fe("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Vrr=fe("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Hrr=fe("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Wrr=fe("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),zrr=fe("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},T("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));fe("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},T("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));fe("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},T("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));t_((n,e)=>{const t=n.getColor(Pl),i=n.getColor(vJe),r=i&&!i.isTransparent()?i:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});class B6 extends eI{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Re(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 Re(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=Xu?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="${B6.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]}}B6.CLASS_NAME="line-numbers";t_((n,e)=>{const t=n.getColor(frr),i=n.getColor(Err);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 JT extends tf{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=oo(document.createElement("div")),this._domNode.setClassName(JT.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=oo(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(JT.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)}}JT.CLASS_NAME="glyph-margin";JT.OUTER_CLASS_NAME="margin";const sD="monaco-mouse-cursor-text";class Urr{constructor(){this._onDidChange=new De,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 FM=new Urr,Go=lr("keybindingService");var jrr=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},qrr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Grr{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 Re(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Re(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 bte=mg;let Mce=class extends tf{constructor(e,t,i,r){super(e),this._keybindingService=r,this._primaryCursorPosition=new Re(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 kn(1,1,1,1)],this._modelSelections=[new kn(1,1,1,1)],this._lastRenderPosition=null,this.textArea=oo(document.createElement("textarea")),u0.write(this.textArea,6),this.textArea.setClassName(`inputarea ${sD}`),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",T("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=oo(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,eu),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(d)?d:null,m=Array.isArray(d)?d.join(h):d;let v,_=null;if(Nce.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&m.length<65536){const b=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(v=b.html,_=b.mode)}return{isFromEmptySelection:f,multicursorText:g,text:m,html:v,mode:_}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const d=this._selections[0];if(br&&d.isEmpty()){const f=d.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new pc(g,g.length,g.length,J.fromPositions(f),0)}const h=500;if(br&&!d.isEmpty()&&l.getValueLengthInRange(d,0)<h){const f=l.getValueInRange(d,0);return new pc(f,0,f.length,d,0)}if(w1&&!d.isEmpty()){const f="vscode-placeholder";return new pc(f,0,f.length,null,void 0)}return pc.EMPTY}if(vNe){const d=this._selections[0];if(d.isEmpty()){const h=d.getStartPosition(),[f,g]=this._getAndroidWordAtPosition(h);if(f.length>0)return new pc(f,g,g,J.fromPositions(h),0)}return pc.EMPTY}return gL.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(d,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(d,h,f)},u=this._register(new srr(this.textArea.domNode));this._textAreaInput=this._register(new orr(c,u,Of,{isAndroid:vNe,isChrome:_0e,isFirefox:mg,isSafari:w1})),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,f=null,g=null;d.metadata&&(h=this._emptySelectionClipboard&&!!d.metadata.isFromEmptySelection,f=typeof d.metadata.multicursorText<"u"?d.metadata.multicursorText:null,g=d.metadata.mode),this._viewController.paste(d.text,h,f,g)})),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,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:m}=(()=>{const _=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),b=_.lastIndexOf(`
`),y=_.substring(b+1),C=y.lastIndexOf(" "),E=y.length-C-1,x=f.getStartPosition(),k=Math.min(x.column-1,E),L=x.column-1-k,D=y.substring(0,y.length-k),{tabSize:A}=this._context.viewModel.model.getOptions(),N=Krr(this.textArea.domNode.ownerDocument,D,this._fontInfo,A);return{distanceToModelLineStart:L,widthOfHiddenTextBefore:N}})(),{distanceToModelLineEnd:v}=(()=>{const _=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=_.indexOf(`
`),y=b===-1?_:_.substring(0,b),C=y.indexOf(" "),E=C===-1?y.length:y.length-C-1,x=f.getEndPosition(),k=Math.min(this._context.viewModel.model.getLineMaxColumn(x.lineNumber)-x.column,E);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(x.lineNumber)-x.column-k}})();this._context.viewModel.revealRange("keyboard",!0,J.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Grr(this._context,f.startLineNumber,g,m,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${sD} 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 ${sD}`),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(FM.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),r=bg(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=bg(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(!Rl(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=T("accessibilityModeOff","The editor is not accessible at this time.");return s?T("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?T("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?T("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===Dv.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=bte?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;!FM.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Re(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 f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),m=f.tokens.findTokenIndexAtOffset(a.column-1),v=g===m,_=this._visibleTextArea.definePresentation(v?f.tokens.getPresentation(g):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:(Ks.getColorMap()||[])[_.foreground],italic:_.italic,bold:_.bold,underline:_.underline,strikethrough:_.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(br){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:bte?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:bte?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Zc(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?je.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 "+JT.OUTER_CLASS_NAME):r.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+B6.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};Mce=jrr([qrr(3,Go)],Mce);function Krr(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");Zc(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 Yrr(n,e,t){let i=0;for(let o=0;o<n.length;o++)n.charAt(o)===" "?i=Cl.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 Cz(n,e,t){let i=Gu(n);return i===-1&&(i=n.length),Yrr(n.substring(0,i),e,t)+n.substring(i)}const Qrr=()=>!0,Xrr=()=>!1,Zrr=n=>n===" "||n===" ";class t2{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=RK(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return o?o.onElectricCharacter(e,r,i-r.firstCharOffset):null}normalizeIndentation(e){return Cz(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Zrr;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Qrr;case"never":return Xrr}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>i.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return Cl.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const r=Cl.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 Nr=class kJe{static fromModelState(e){return new Jrr(e)}static fromViewState(e){return new eor(e)}static fromModelSelection(e){const t=kn.liftSelection(e),i=new _c(J.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return kJe.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 Jrr{constructor(e){this.modelState=e,this.viewState=null}}class eor{constructor(e){this.modelState=null,this.viewState=e}}class _c{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=_c._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 _c(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new Re(t,i),r):new _c(new J(t,i,t,i),0,r,new Re(t,i),r)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?kn.fromPositions(e.getStartPosition(),t):kn.fromPositions(e.getEndPosition(),t)}}class Kd{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function CC(n){return n==="'"||n==='"'||n==="`"}class Ex{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 f=i+(l?-h:h),g=e.columnFromVisibleColumn(t,f,r),m=e.columnFromVisibleColumn(t,f,s),v=e.visibleColumnFromColumn(t,new Re(f,g)),_=e.visibleColumnFromColumn(t,new Re(f,m));u&&(v>s||_<r)||c&&(_>r||v<s)||d.push(new _c(new J(f,g,f,g),0,0,new Re(f,m),0))}if(d.length===0)for(let h=0;h<a;h++){const f=i+(l?-h:h),g=t.getLineMaxColumn(f);d.push(new _c(new J(f,g,f,g),0,0,new Re(f,g),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--,Ex.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 Re(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 Hc{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 kn.fromPositions(r.getEndPosition())}}class tor{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 kn.fromRange(r,0)}}class j9{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 kn.fromPositions(r.getStartPosition())}}class rV{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 kn.fromPositions(r.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class X0e{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 yte{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class lo{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-VXe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Re(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=G3.atomicPosition(o,t.column-1,i,0);if(s!==-1&&s+1>=r)return new Re(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const r=e.stickyTabStops?lo.leftPositionAtomicSoftTabs(t,i,e.tabSize):lo.leftPosition(t,i);return new yte(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(lo.clipPositionColumn(l,t),0),u=lo.left(e,t,c);s=u.lineNumber,a=u.column}return i.move(r,s,a,0)}static clipPositionColumn(e,t){return new Re(e.lineNumber,lo.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+p0e(e.getLineContent(t),i-1):t<e.getLineCount()&&(t=t+1,i=e.getLineMinColumn(t)),new Re(t,i)}static rightPositionAtomicSoftTabs(e,t,i,r,o){if(i<e.getLineIndentColumn(t)){const s=e.getLineContent(t),a=G3.atomicPosition(s,i-1,r,1);if(a!==-1)return new Re(t,a+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const r=e.stickyTabStops?lo.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):lo.rightPosition(t,i.lineNumber,i.column);return new yte(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(lo.clipPositionColumn(l,t),1),u=lo.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=Cl.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize)+o,u=t.getLineCount(),d=i===1&&r===1,h=i===u&&r===t.getLineMaxColumn(i),f=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),f?o=0:o=c-Cl.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize),l!==void 0){const g=new Re(i,r),m=t.normalizePosition(g,l);o=o+(r-m.column),i=m.lineNumber,r=m.column}return new yte(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=lo.down(e,t,s+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new Re(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=lo.down(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=lo.down(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new _c(new J(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new Re(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=lo.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=lo.up(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=lo.up(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new _c(new J(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new Re(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 ek{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=lo.right(t,i,d);u=new J(h.lineNumber,h.column,d.lineNumber,d.column)}if(u.isEmpty()){o[a]=null;continue}u.startLineNumber!==u.endLineNumber&&(s=!0),o[a]=new Hc(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 f=h.charAt(d.column-2),g=r.get(f);if(!g)return!1;if(CC(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=h.charAt(d.column-1);let v=!1;for(const _ of g)_.open===f&&_.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let _=!1;for(let b=0,y=a.length;b<y;b++){const C=a[b];if(d.lineNumber===C.startLineNumber&&d.column===C.startColumn){_=!0;break}}if(!_)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 J(a.lineNumber,a.column-1,a.lineNumber,a.column+1);r[o]=new Hc(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=ek.getDeleteRange(r[l],i,t);if(u.isEmpty()){s[l]=null;continue}u.startLineNumber!==u.endLineNumber&&(a=!0),s[l]=new Hc(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=Gu(o),a=s===-1?o.length+1:s+1;if(r.column<=a){const l=i.visibleColumnFromColumn(t,r),c=Cl.prevIndentTabStop(l,i.indentSize),u=i.columnFromVisibleColumn(t,r.lineNumber,c);return new J(r.lineNumber,u,r.lineNumber,r.column)}}return J.fromPositions(ek.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=mXi(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 Re(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const r=[];let o=null;i.sort((s,a)=>Re.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,f;c.lineNumber<t.getLineCount()?(u=c.lineNumber,d=1,h=c.lineNumber+1,f=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,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new J(u,d,h,f);o=g,g.isEmpty()?r[s]=null:r[s]=new Hc(g,"")}else r[s]=null;else r[s]=new Hc(l,"")}return new Kd(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class to{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=to._findPreviousWordOnLine(e,t,new Re(o,s));if(r===0)return new Re(o,a?a.start+1:1);if(r===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=to._findPreviousWordOnLine(e,t,new Re(o,a.start+1))),new Re(o,a?a.start+1:1);if(r===3){for(;a&&a.wordType===2;)a=to._findPreviousWordOnLine(e,t,new Re(o,a.start+1));return new Re(o,a?a.start+1:1)}return a&&s<=a.end+1&&(a=to._findPreviousWordOnLine(e,t,new Re(o,a.start+1))),new Re(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 Re(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 Re(i,s);if(a===45&&l!==45)return new Re(i,s);if((nw(a)||R9(a))&&ab(l))return new Re(i,s);if(ab(a)&&ab(l)&&s+1<r){const c=o.charCodeAt(s);if(nw(c)||R9(c))return new Re(i,s)}}return new Re(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=to._findNextWordOnLine(e,t,new Re(o,s));if(r===2)l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=to._findNextWordOnLine(e,t,new Re(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=to._findNextWordOnLine(e,t,new Re(o,l.end+1));l?s=l.start+1:s=t.getLineMaxColumn(o)}else l&&!a&&s>=l.start+1&&(l=to._findNextWordOnLine(e,t,new Re(o,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(o);return new Re(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,r=e.getLineMaxColumn(i);if(t.column===r)return i<e.getLineCount()?new Re(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 Re(i,s);if(a!==45&&l===45)return new Re(i,s);if((nw(a)||R9(a))&&ab(l))return new Re(i,s);if(ab(a)&&ab(l)&&s+1<r){const c=o.charCodeAt(s);if(nw(c)||R9(c))return new Re(i,s)}}return new Re(i,r)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=t.column-2,o=hv(i,r);return o+1<r?new J(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(ek.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const d=e.selection.getPosition();return new J(d.lineNumber,d.column-1,d.lineNumber,d.column+1)}const a=new Re(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=to._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=to._findPreviousWordOnLine(i,r,new Re(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new J(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const r=new Re(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 J(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 J(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new J(i.lineNumber,1,i.lineNumber+1,1):new J(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 J(i.lineNumber,d,i.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-1<o&&this._charAtIsWhitespace(r,f-1);)g=!0,f++;if(!g)for(;h>1&&this._charAtIsWhitespace(r,h-2);)h--;return a(h,f)},c=to._findPreviousWordOnLine(e,t,i);if(c&&s(c))return l(c);const u=to._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=to._moveWordPartLeft(e,i);return new J(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 J(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 Re(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 f=this._deleteWordRightWhitespace(r,a);if(f)return f}let h=to._findNextWordOnLine(i,r,a);return t===2?h?c=h.end+1:c<d||l===u?c=d:(l++,h=to._findNextWordOnLine(i,r,new Re(l,1)),h?c=h.start+1:c=r.getLineMaxColumn(l)):(h&&c>=h.start+1&&(h=to._findNextWordOnLine(i,r,new Re(l,h.end+1))),h?c=h.start+1:c<d||l===u?c=d:(l++,h=to._findNextWordOnLine(i,r,new Re(l,1)),h?c=h.start+1:c=r.getLineMaxColumn(l))),new J(l,c,a.lineNumber,a.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),r=to._moveWordPartRight(e,i);return new J(i.lineNumber,i.column,r.lineNumber,r.column)}static _createWordAtPosition(e,t,i){const r=new J(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=bg(t),o=to._findPreviousWordOnLine(r,e,i);if(o&&o.wordType===1&&o.start<=i.column-1&&i.column-1<=o.end)return to._createWordAtPosition(e,i.lineNumber,o);const s=to._findNextWordOnLine(r,e,i);return s&&s.wordType===1&&s.start<=i.column-1&&i.column-1<=s.end?to._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,r,o){const s=bg(e.wordSeparators),a=to._findPreviousWordOnLine(s,t,o),l=to._findNextWordOnLine(s,t,o);if(!r){let f,g;return a&&a.wordType===1&&a.start<=o.column-1&&o.column-1<=a.end?(f=a.start+1,g=a.end+1):l&&l.wordType===1&&l.start<=o.column-1&&o.column-1<=l.end?(f=l.start+1,g=l.end+1):(a?f=a.end+1:f=1,l?g=l.start+1:g=t.getLineMaxColumn(o.lineNumber)),new _c(new J(o.lineNumber,f,o.lineNumber,g),1,0,new Re(o.lineNumber,g),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 f=new Re(d,h);i.selectionStart.containsPosition(f)&&(h=i.selectionStart.endColumn)}else{h=u;const f=new Re(d,h);i.selectionStart.containsPosition(f)&&(h=i.selectionStart.startColumn)}return i.move(!0,d,h,0)}}class qK extends to{static deleteWordPartLeft(e){const t=q9([to.deleteWordLeft(e,0),to.deleteWordLeft(e,2),to._deleteWordPartLeft(e.model,e.selection)]);return t.sort(J.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=q9([to.deleteWordRight(e,0),to.deleteWordRight(e,2),to._deleteWordPartRight(e.model,e.selection)]);return t.sort(J.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const r=q9([to.moveWordLeft(e,t,i,0),to.moveWordLeft(e,t,i,2),to._moveWordPartLeft(t,i)]);return r.sort(Re.compare),r[2]}static moveWordPartRight(e,t,i){const r=q9([to.moveWordRight(e,t,i,0),to.moveWordRight(e,t,i,2),to._moveWordPartRight(t,i)]);return r.sort(Re.compare),r[0]}}function q9(n){return n.filter(e=>!!e)}class dc{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 Nr(l.modelState,l.viewState),i?r[o++]=Nr.fromModelState(lo.translateDown(e.cursorConfig,e.model,l.modelState)):r[o++]=Nr.fromViewState(lo.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 Nr(l.modelState,l.viewState),i?r[o++]=Nr.fromModelState(lo.translateUp(e.cursorConfig,e.model,l.modelState)):r[o++]=Nr.fromViewState(lo.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 Nr.fromViewState(lo.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Nr.fromModelState(lo.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 Nr.fromViewState(lo.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,r))}static _moveToLineEndByModel(e,t,i,r){return Nr.fromModelState(lo.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]=Nr.fromModelState(new _c(new J(a,1,a,1),0,0,new Re(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]=Nr.fromModelState(lo.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]=Nr.fromModelState(lo.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 Nr.fromModelState(new _c(new J(1,1,1,1),0,0,new Re(i,r),0))}static line(e,t,i,r,o){const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new Re(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)),Nr.fromModelState(new _c(new J(s.lineNumber,1,u,d),2,0,new Re(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<l)return Nr.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)),Nr.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return Nr.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,r){const o=e.model.validatePosition(r);return Nr.fromModelState(to.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Nr(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,r=t.viewState.position.column;return Nr.fromViewState(new _c(new J(i,r,i,r),0,0,new Re(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 Re(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Nr.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=>Nr.fromViewState(lo.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Nr.fromModelState(lo.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return s===2?t.map(a=>Nr.fromViewState(lo.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>Nr.fromModelState(lo.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 Nr(t.modelState,t.viewState);{let s;o>i.endLineNumber-1?s=i.endLineNumber-1:o<i.startLineNumber?s=i.startLineNumber:s=o;const a=lo.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return Nr.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=>Nr.fromViewState(lo.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]=Nr.fromViewState(lo.moveLeft(e.cursorConfig,e,a.viewState,i,c))}return r}static _moveRight(e,t,i,r){return t.map(o=>Nr.fromViewState(lo.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]=Nr.fromViewState(lo.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]=Nr.fromViewState(lo.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]=Nr.fromModelState(lo.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]=Nr.fromViewState(lo.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]=Nr.fromModelState(lo.moveUp(e.cursorConfig,e.model,l.modelState,i,r))}return o}static _moveToViewPosition(e,t,i,r,o){return Nr.fromViewState(t.viewState.move(i,r,o,0))}static _moveToModelPosition(e,t,i,r,o){return Nr.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 wz;(function(n){const e=function(i){if(!xd(i))return!1;const r=i;return!(!Rd(r.to)||!Fh(r.select)&&!lXe(r.select)||!Fh(r.by)&&!Rd(r.by)||!Fh(r.value)&&!pS(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})(wz||(wz={}));function aD(n,e,t,i){const r=eD(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=eD(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);let c="";if(t.startLineNumber>1&&r.firstCharOffset===0){const m=eD(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 f=u.removeText||0;h?d===Qa.Indent&&(h=" "+h):d===Qa.Indent||d===Qa.IndentOutdent?h=" ":h="";let g=PZe(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var nor=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},ior=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},oV;const Cte=Object.create(null);function FE(n,e){if(e<=0)return"";Cte[n]||(Cte[n]=["",n]);const t=Cte[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let zp=oV=class{static unshiftIndent(e,t,i,r,o){const s=Cl.visibleColumnFromColumn(e,t,i);if(o){const a=FE(" ",r),c=Cl.prevIndentTabStop(s,r)/r;return FE(a,c)}else{const a=" ",c=Cl.prevRenderTabStop(s,i)/i;return FE(a,c)}}static shiftIndent(e,t,i,r,o){const s=Cl.visibleColumnFromColumn(e,t,i);if(o){const a=FE(" ",r),c=Cl.nextIndentTabStop(s,r)/r;return FE(a,c)}else{const a=" ",c=Cl.nextRenderTabStop(s,i)/i;return FE(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 f=Gu(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&Cl.visibleColumnFromColumn(h,f+1,o)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const v=aD(this._opts.autoIndent,e,new J(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(v){if(u=c,v.appendText)for(let _=0,b=v.appendText.length;_<b&&u<s&&v.appendText.charCodeAt(_)===32;_++)u++;v.removeText&&(u=Math.max(0,u-v.removeText));for(let _=0;_<u&&!(f===0||h.charCodeAt(f-1)!==32);_++)f--}}if(this._opts.isUnshift&&f===0)continue;let g;this._opts.isUnshift?g=oV.unshiftIndent(h,f+1,o,s,a):g=oV.shiftIndent(h,f+1,o,s,a),this._addEditOperation(t,new J(d,1,d,f+1),g),d===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=f+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(i)===0&&(this._useLastEditRangeForCursorEndPosition=!0);const c=a?FE(" ",s):" ";for(let u=i;u<=r;u++){const d=e.getLineContent(u);let h=Gu(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 f=0;f<h;f++)if(d.charCodeAt(f)===9){h=f+1;break}this._addEditOperation(t,new J(u,1,u,h+1),"")}else this._addEditOperation(t,new J(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 kn(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 kn(i.startLineNumber,r,i.endLineNumber,i.endColumn):new kn(i.endLineNumber,i.endColumn,i.startLineNumber,r)}return i}};zp=oV=nor([ior(2,es)],zp);class ror{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new J(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new J(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 kn(r.endLineNumber,r.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class oor{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new J(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 kn(r.endLineNumber,r.startColumn,r.endLineNumber,r.endColumn-this._charAfter.length)}}function sor(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 GK(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=sor(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:jo(a),action:Qa.Indent,line:s};if(o.shouldDecrease(a))return{indentation:jo(a),action:null,line:s};{if(s===1)return{indentation:jo(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:jo(e.getLineContent(u+1)),action:null,line:u+1}}if(i)return{indentation:jo(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:jo(d),action:Qa.Indent,line:u};if(o.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:jo(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:jo(d),action:null,line:u}}return{indentation:jo(e.getLineContent(1)),action:null,line:1}}}function BM(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=GK(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 f=jo(e.getLineContent(u));return h.removeText&&(f=f.substring(0,f.length-h.removeText)),h.indentAction===Qa.Indent||h.indentAction===Qa.IndentOutdent?f=r.shiftIndent(f):h.indentAction===Qa.Outdent&&(f=r.unshiftIndent(f)),a.shouldDecrease(c)&&(f=r.unshiftIndent(f)),h.appendText&&(f+=h.appendText),jo(f)}}}return a.shouldDecrease(c)?l.action===Qa.Indent?l.indentation:r.unshiftIndent(l.indentation):l.action===Qa.Indent?r.shiftIndent(l.indentation):l.indentation}return null}function aor(n,e,t,i,r){if(n<4)return null;e.tokenization.forceTokenization(t.startLineNumber);const o=e.tokenization.getLineTokens(t.startLineNumber),s=RK(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=eD(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,f=jo(c),g={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=jo(o.getLineContent()),v=GK(n,g,t.startLineNumber+1,void 0,r);if(!v){const b=l?m:f;return{beforeEnter:b,afterEnter:b}}let _=l?m:v.indentation;return v.action===Qa.Indent&&(_=i.shiftIndent(_)),d.shouldDecrease(u)&&(_=i.unshiftIndent(_)),{beforeEnter:l?m:f,afterEnter:_}}function lor(n,e,t,i,r,o){if(n<4)return null;const s=eD(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=eD(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+i+u)){const d=GK(n,e,t.startLineNumber,!1,o);if(!d)return null;let h=d.indentation;return d.action!==Qa.Indent&&(h=r.unshiftIndent(h)),h}return null}function IJe(n,e,t){const i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}class Os{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 zp(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 zp(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,zp.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,zp.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 Hc(i[s],r[s]);return new Kd(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 J(u.lineNumber,1,u.lineNumber,1);s[a]=new X0e(d,r,c,!0)}else s[a]=new Hc(c,r)}return new Kd(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=a0(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(J.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=GK(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(hv(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=aD(e.autoIndent,t,new J(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return r&&(r===Qa.Indent&&(o=Os.shiftIndent(e,o)),r===Qa.Outdent&&(o=Os.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 Hc(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 Hc(new J(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 zp(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 Kd(4,c,{shouldPushStackElementBefore:G9(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 J(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===i&&s===0?null:new rV(u,i,0,s)}static _typeCommand(e,t,i){return i?new j9(e,t,!0):new Hc(e,t,!0)}static _enter(e,t,i,r){if(e.autoIndent===0)return Os._typeCommand(r,`
`,i);if(!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(r.startLineNumber),c=jo(l).substring(0,r.startColumn-1);return Os._typeCommand(r,`
`+e.normalizeIndentation(c),i)}const o=aD(e.autoIndent,t,r,e.languageConfigurationService);if(o){if(o.indentAction===Qa.None)return Os._typeCommand(r,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Qa.Indent)return Os._typeCommand(r,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Qa.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),u=`
`+c+`
`+l;return i?new j9(r,u,!0):new rV(r,u,-1,c.length-l.length,!0)}else if(o.indentAction===Qa.Outdent){const l=Os.unshiftIndent(e,o.indentation);return Os._typeCommand(r,`
`+e.normalizeIndentation(l+o.appendText),i)}}const s=t.getLineContent(r.startLineNumber),a=jo(s).substring(0,r.startColumn-1);if(e.autoIndent>=4){const l=aor(e.autoIndent,t,r,{unshiftIndent:c=>Os.unshiftIndent(e,c),shiftIndent:c=>Os.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=Gu(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 j9(r,`
`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return u<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new rV(r,`
`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Os._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=PZe(t,i.startLineNumber,i.startColumn),s=lor(e.autoIndent,t,i,r,{shiftIndent:a=>Os.shiftIndent(e,a),unshiftIndent:a=>Os.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Os._typeCommand(new J(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+r,!1):Os._typeCommand(new J(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=CC(o);if((c.column>2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,v=r.length;m<v;m++){const _=r[m];if(c.lineNumber===_.startLineNumber&&c.column===_.startColumn){g=!0;break}}if(!g)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 J(u.lineNumber,u.column,u.lineNumber,u.column+1);s[a]=new Hc(d,o)}return new Kd(4,s,{shouldPushStackElementBefore:G9(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 J(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 g of i)if(!g.isEmpty())return null;const s=i.map(g=>{const m=g.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(g=>new Re(g.lineNumber,g.beforeColumn)),r);if(!a)return null;let l,c;if(CC(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 f=!0;for(const g of s){const{lineNumber:m,beforeColumn:v,afterColumn:_}=g,b=t.getLineContent(m),y=b.substring(0,v-1),C=b.substring(_-1);if(C.startsWith(h)||(f=!1),C.length>0){const L=C.charAt(0);if(!Os._isBeforeClosingBrace(e,C)&&!c(L))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const L=bg(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 E=t.tokenization.getLineTokens(m),x=RK(E,v-1);if(!a.shouldAutoClose(x,v-x.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const L=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(L))return null}}return f?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 LJe(d,o,!s,a)}return new Kd(4,l,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return CC(t)?e.autoSurround==="quotes"||e.autoSurround==="languageDefined":e.autoSurround==="brackets"||e.autoSurround==="languageDefined"}static _isSurroundSelectionType(e,t,i,r){if(!Os._shouldSurroundChar(e,r)||!e.surroundingPairs.hasOwnProperty(r))return!1;const o=CC(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(CC(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 ror(c,o,u)}return new Kd(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 Pi(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=jo(d),f=t.normalizeIndentation(h),g=i.getLineContent(s.lineNumber),m=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,v=g.substring(m-1,s.column-1),_=f+v+o,b=new J(s.lineNumber,1,s.lineNumber,s.column),y=new Hc(b,_);return new Kd(wte(_,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(!Os._shouldSurroundChar(t,l)||!t.surroundingPairs.hasOwnProperty(l))return null;const d=CC(l);for(const g of r)if(g.deletedSelectionStart!==0||g.deletedSelectionEnd!==g.deletedText.length||/^[ \t]+$/.test(g.deletedText)||d&&CC(g.deletedText))return null;const h=[];for(const g of o){if(!g.isEmpty())return null;h.push(g.getPosition())}if(h.length!==r.length)return null;const f=[];for(let g=0,m=h.length;g<m;g++)f.push(new oor(h[g],r[g].deletedText,t.surroundingPairs[l]));return new Kd(4,f,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,o,s,l)){const d=o.map(h=>new Hc(new J(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Kd(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]=Os._enter(i,r,!1,o[d]);return new Kd(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,r,o)){const u=[];let d=!1;for(let h=0,f=o.length;h<f;h++)if(u[h]=this._runAutoIndentType(i,r,o[h],a),!u[h]){d=!0;break}if(!d)return new Kd(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 Hc(o[u],a);const c=wte(a,t);return new Kd(c,l,{shouldPushStackElementBefore:G9(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 Hc(r[l],o);const a=wte(o,e);return new Kd(a,s,{shouldPushStackElementBefore:G9(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 j9(new J(1,1,1,1),`
`);else{a--;const l=t.getLineMaxColumn(a);r[o]=this._enter(e,t,!1,new J(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 J(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 LJe extends rV{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 J(r.startLineNumber,r.endColumn-this._closeCharacter.length,r.endLineNumber,r.endColumn),this.enclosingRange=new J(r.startLineNumber,r.endColumn-this._openCharacter.length-this._closeCharacter.length,r.endLineNumber,r.endColumn),super.computeCursorState(e,t)}}class cor{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 wte(n,e){return n===" "?e===5||e===6?6:5:4}function G9(n,e){return jOe(n)&&!jOe(e)?!0:n===5?!1:UOe(n)!==UOe(e)}function UOe(n){return n===6||n===5?"space":n}function jOe(n){return n===4||n===5||n===6}var de;(function(n){n.editorSimpleInput=new sn("editorSimpleInput",!1,!0),n.editorTextFocus=new sn("editorTextFocus",!1,T("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),n.focus=new sn("editorFocus",!1,T("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),n.textInputFocus=new sn("textInputFocus",!1,T("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),n.readOnly=new sn("editorReadonly",!1,T("editorReadonly","Whether the editor is read-only")),n.inDiffEditor=new sn("inDiffEditor",!1,T("inDiffEditor","Whether the context is a diff editor")),n.isEmbeddedDiffEditor=new sn("isEmbeddedDiffEditor",!1,T("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),n.comparingMovedCode=new sn("comparingMovedCode",!1,T("comparingMovedCode","Whether a moved code block is selected for comparison")),n.accessibleDiffViewerVisible=new sn("accessibleDiffViewerVisible",!1,T("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),n.diffEditorRenderSideBySideInlineBreakpointReached=new sn("diffEditorRenderSideBySideInlineBreakpointReached",!1,T("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),n.columnSelection=new sn("editorColumnSelection",!1,T("editorColumnSelection","Whether `editor.columnSelection` is enabled")),n.writable=n.readOnly.toNegated(),n.hasNonEmptySelection=new sn("editorHasSelection",!1,T("editorHasSelection","Whether the editor has text selected")),n.hasOnlyEmptySelection=n.hasNonEmptySelection.toNegated(),n.hasMultipleSelections=new sn("editorHasMultipleSelections",!1,T("editorHasMultipleSelections","Whether the editor has multiple selections")),n.hasSingleSelection=n.hasMultipleSelections.toNegated(),n.tabMovesFocus=new sn("editorTabMovesFocus",!1,T("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),n.tabDoesNotMoveFocus=n.tabMovesFocus.toNegated(),n.isInWalkThroughSnippet=new sn("isInEmbeddedEditor",!1,!0),n.canUndo=new sn("canUndo",!1,!0),n.canRedo=new sn("canRedo",!1,!0),n.hoverVisible=new sn("editorHoverVisible",!1,T("editorHoverVisible","Whether the editor hover is visible")),n.hoverFocused=new sn("editorHoverFocused",!1,T("editorHoverFocused","Whether the editor hover is focused")),n.stickyScrollFocused=new sn("stickyScrollFocused",!1,T("stickyScrollFocused","Whether the sticky scroll is focused")),n.stickyScrollVisible=new sn("stickyScrollVisible",!1,T("stickyScrollVisible","Whether the sticky scroll is visible")),n.standaloneColorPickerVisible=new sn("standaloneColorPickerVisible",!1,T("standaloneColorPickerVisible","Whether the standalone color picker is visible")),n.standaloneColorPickerFocused=new sn("standaloneColorPickerFocused",!1,T("standaloneColorPickerFocused","Whether the standalone color picker is focused")),n.inCompositeEditor=new sn("inCompositeEditor",void 0,T("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),n.notInCompositeEditor=n.inCompositeEditor.toNegated(),n.languageId=new sn("editorLangId","",T("editorLangId","The language identifier of the editor")),n.hasCompletionItemProvider=new sn("editorHasCompletionItemProvider",!1,T("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),n.hasCodeActionsProvider=new sn("editorHasCodeActionsProvider",!1,T("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),n.hasCodeLensProvider=new sn("editorHasCodeLensProvider",!1,T("editorHasCodeLensProvider","Whether the editor has a code lens provider")),n.hasDefinitionProvider=new sn("editorHasDefinitionProvider",!1,T("editorHasDefinitionProvider","Whether the editor has a definition provider")),n.hasDeclarationProvider=new sn("editorHasDeclarationProvider",!1,T("editorHasDeclarationProvider","Whether the editor has a declaration provider")),n.hasImplementationProvider=new sn("editorHasImplementationProvider",!1,T("editorHasImplementationProvider","Whether the editor has an implementation provider")),n.hasTypeDefinitionProvider=new sn("editorHasTypeDefinitionProvider",!1,T("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),n.hasHoverProvider=new sn("editorHasHoverProvider",!1,T("editorHasHoverProvider","Whether the editor has a hover provider")),n.hasDocumentHighlightProvider=new sn("editorHasDocumentHighlightProvider",!1,T("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),n.hasDocumentSymbolProvider=new sn("editorHasDocumentSymbolProvider",!1,T("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),n.hasReferenceProvider=new sn("editorHasReferenceProvider",!1,T("editorHasReferenceProvider","Whether the editor has a reference provider")),n.hasRenameProvider=new sn("editorHasRenameProvider",!1,T("editorHasRenameProvider","Whether the editor has a rename provider")),n.hasSignatureHelpProvider=new sn("editorHasSignatureHelpProvider",!1,T("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),n.hasInlayHintsProvider=new sn("editorHasInlayHintsProvider",!1,T("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),n.hasDocumentFormattingProvider=new sn("editorHasDocumentFormattingProvider",!1,T("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),n.hasDocumentSelectionFormattingProvider=new sn("editorHasDocumentSelectionFormattingProvider",!1,T("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),n.hasMultipleDocumentFormattingProvider=new sn("editorHasMultipleDocumentFormattingProvider",!1,T("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),n.hasMultipleDocumentSelectionFormattingProvider=new sn("editorHasMultipleDocumentSelectionFormattingProvider",!1,T("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(de||(de={}));const Qr=0;class oa extends oc{runEditorCommand(e,t,i){const r=t._getViewModel();r&&this.runCoreEditorCommand(r,i||{})}}var Bc;(function(n){const e=function(i){if(!xd(i))return!1;const r=i;return!(!Rd(r.to)||!Fh(r.by)&&!Rd(r.by)||!Fh(r.value)&&!pS(r.value)||!Fh(r.revealCursor)&&!lXe(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})(Bc||(Bc={}));var mL;(function(n){const e=function(t){if(!xd(t))return!1;const i=t;return!(!pS(i.lineNumber)&&!Rd(i.lineNumber)||!Fh(i.at)&&!Rd(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"}})(mL||(mL={}));class Fce{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(io).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const r=Tm();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(io).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 ql;(function(n){class e extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;b.model.pushStackElement(),b.setCursorStates(y.source,3,[dc.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0)}}n.MoveTo=qt(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=qt(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends oa{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(E=>Nr.fromViewState(E))),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=qt(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(_,b,y,C){if(typeof C.position>"u"||typeof C.viewPosition>"u"||typeof C.mouseColumn>"u")return null;const E=_.model.validatePosition(C.position),x=_.coordinatesConverter.validateViewPosition(new Re(C.viewPosition.lineNumber,C.viewPosition.column),E),k=C.doColumnSelect?y.fromViewLineNumber:x.lineNumber,L=C.doColumnSelect?y.fromViewVisualColumn:C.mouseColumn-1;return Ex.columnSelect(_.cursorConfig,_,k,L,x.lineNumber,C.mouseColumn-1)}}),n.CursorColumnSelectLeft=qt(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(_,b,y,C){return Ex.columnSelectLeft(_.cursorConfig,_,y)}}),n.CursorColumnSelectRight=qt(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(_,b,y,C){return Ex.columnSelectRight(_.cursorConfig,_,y)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,E){return Ex.columnSelectUp(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectUp=qt(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=qt(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,E){return Ex.columnSelectDown(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectDown=qt(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=qt(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends oa{constructor(){super({id:"cursorMove",precondition:void 0,description:wz.description})}runCoreEditorCommand(b,y){const C=wz.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 E=C.select,x=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 dc.simpleMove(b,y,C.direction,E,x,C.unit);case 11:case 13:case 12:case 14:return dc.viewportMove(b,y,C.direction,E,x);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=qt(new o);class s extends oa{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,dc.simpleMove(b,b.getCursorStates(),C.direction,C.select,C.value,C.unit)),b.revealPrimaryCursor(y.source,!0)}}n.CursorLeft=qt(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=qt(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1039}})),n.CursorRight=qt(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=qt(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1041}})),n.CursorUp=qt(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=qt(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=qt(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:11}})),n.CursorPageUpSelect=qt(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1035}})),n.CursorDown=qt(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=qt(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=qt(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:12}})),n.CursorPageDownSelect=qt(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1036}})),n.CreateCursor=qt(new class extends oa{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(_,b){if(!b.position)return;let y;b.wholeLine?y=dc.line(_,_.getPrimaryCursorState(),!1,b.position,b.viewPosition):y=dc.moveTo(_,_.getPrimaryCursorState(),!1,b.position,b.viewPosition);const C=_.getCursorStates();if(C.length>1){const E=y.modelState?y.modelState.position:null,x=y.viewState?y.viewState.position:null;for(let k=0,L=C.length;k<L;k++){const D=C[k];if(!(E&&!D.modelState.selection.containsPosition(E))&&!(x&&!D.viewState.selection.containsPosition(x))){C.splice(k,1),_.model.pushStackElement(),_.setCursorStates(b.source,3,C);return}}}C.push(y),_.model.pushStackElement(),_.setCursorStates(b.source,3,C)}}),n.LastCursorMoveToSelect=qt(new class extends oa{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(_,b){if(!b.position)return;const y=_.getLastAddedCursorIndex(),C=_.getCursorStates(),E=C.slice(0);E[y]=dc.moveTo(_,C[y],!0,b.position,b.viewPosition),_.model.pushStackElement(),_.setCursorStates(b.source,3,E)}});class a extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,dc.moveToBeginningOfLine(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorHome=qt(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),n.CursorHomeSelect=qt(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends oa{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,E=b.length;C<E;C++){const x=b[C],k=x.modelState.position.lineNumber;y[C]=Nr.fromModelState(x.modelState.move(this._inSelectionMode,k,1,0))}return y}}n.CursorLineStart=qt(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:0,mac:{primary:287}}})),n.CursorLineStartSelect=qt(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:0,mac:{primary:1311}}}));class c extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,dc.moveToEndOfLine(b,b.getCursorStates(),this._inSelectionMode,y.sticky||!1)),b.revealPrimaryCursor(y.source,!0)}}n.CursorEnd=qt(new c({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Qr,kbExpr:de.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:T("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),n.CursorEndSelect=qt(new c({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:Qr,kbExpr:de.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:T("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class u extends oa{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 E=0,x=y.length;E<x;E++){const k=y[E],L=k.modelState.position.lineNumber,D=b.model.getLineMaxColumn(L);C[E]=Nr.fromModelState(k.modelState.move(this._inSelectionMode,L,D,0))}return C}}n.CursorLineEnd=qt(new u({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:0,mac:{primary:291}}})),n.CursorLineEndSelect=qt(new u({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:0,mac:{primary:1315}}}));class d extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,dc.moveToBeginningOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorTop=qt(new d({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:2062,mac:{primary:2064}}})),n.CursorTopSelect=qt(new d({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3086,mac:{primary:3088}}}));class h extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,dc.moveToEndOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorBottom=qt(new h({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:2061,mac:{primary:2066}}})),n.CursorBottomSelect=qt(new h({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:3085,mac:{primary:3090}}}));class f extends oa{constructor(){super({id:"editorScroll",precondition:void 0,description:Bc.description})}determineScrollMethod(b){const y=[6],C=[1,2,3,4,5,6],E=[4,2],x=[1,3];return y.includes(b.unit)&&E.includes(b.direction)?this._runHorizontalEditorScroll.bind(this):C.includes(b.unit)&&x.includes(b.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(b,y){const C=Bc.parse(y);if(!C)return;const E=this.determineScrollMethod(C);E&&E(b,y.source,C)}_runVerticalEditorScroll(b,y,C){const E=this._computeDesiredScrollTop(b,C);if(C.revealCursor){const x=b.getCompletelyVisibleViewRangeAtScrollTop(E);b.setCursorStates(y,3,[dc.findPositionInViewportIfOutside(b,b.getPrimaryCursorState(),x,C.select)])}b.viewLayout.setScrollPosition({scrollTop:E},0)}_computeDesiredScrollTop(b,y){if(y.unit===1){const x=b.viewLayout.getFutureViewport(),k=b.getCompletelyVisibleViewRangeAtScrollTop(x.top),L=b.coordinatesConverter.convertViewRangeToModelRange(k);let D;y.direction===1?D=Math.max(1,L.startLineNumber-y.value):D=Math.min(b.model.getLineCount(),L.startLineNumber+y.value);const A=b.coordinatesConverter.convertModelPositionToViewPosition(new Re(D,1));return b.viewLayout.getVerticalOffsetForLineNumber(A.lineNumber)}if(y.unit===5){let x=0;return y.direction===3&&(x=b.model.getLineCount()-b.cursorConfig.pageSize),b.viewLayout.getVerticalOffsetForLineNumber(x)}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 E=(y.direction===1?-1:1)*C;return b.viewLayout.getCurrentScrollTop()+E*b.cursorConfig.lineHeight}_runHorizontalEditorScroll(b,y,C){const E=this._computeDesiredScrollLeft(b,C);b.viewLayout.setScrollPosition({scrollLeft:E},0)}_computeDesiredScrollLeft(b,y){const C=(y.direction===4?-1:1)*y.value;return b.viewLayout.getCurrentScrollLeft()+C*b.cursorConfig.typicalHalfwidthCharacterWidth}}n.EditorScrollImpl=f,n.EditorScroll=qt(new f),n.ScrollLineUp=qt(new class extends oa{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Up,by:Bc.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageUp=qt(new class extends oa{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Up,by:Bc.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorTop=qt(new class extends oa{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Up,by:Bc.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLineDown=qt(new class extends oa{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Down,by:Bc.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageDown=qt(new class extends oa{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Down,by:Bc.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorBottom=qt(new class extends oa{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Down,by:Bc.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLeft=qt(new class extends oa{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Left,by:Bc.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollRight=qt(new class extends oa{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus}})}runCoreEditorCommand(_,b){n.EditorScroll.runCoreEditorCommand(_,{to:Bc.RawDirection.Right,by:Bc.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}});class g extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[dc.word(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position)]),y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0))}}n.WordSelect=qt(new g({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),n.WordSelectDrag=qt(new g({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),n.LastCursorWordSelect=qt(new class extends oa{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(_,b){if(!b.position)return;const y=_.getLastAddedCursorIndex(),C=_.getCursorStates(),E=C.slice(0),x=C[y];E[y]=dc.word(_,x,x.modelState.hasSelection(),b.position),_.model.pushStackElement(),_.setCursorStates(b.source,3,E)}});class m extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[dc.line(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)]),y.revealType!==2&&b.revealPrimaryCursor(y.source,!1,!0))}}n.LineSelect=qt(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),n.LineSelectDrag=qt(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class v extends oa{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;const C=b.getLastAddedCursorIndex(),E=b.getCursorStates(),x=E.slice(0);x[C]=dc.line(b,E[C],this._inSelectionMode,y.position,y.viewPosition),b.model.pushStackElement(),b.setCursorStates(y.source,3,x)}}n.LastCursorLineSelect=qt(new v({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),n.LastCursorLineSelectDrag=qt(new v({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),n.CancelSelection=qt(new class extends oa{constructor(){super({id:"cancelSelection",precondition:de.hasNonEmptySelection,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(_,b){_.model.pushStackElement(),_.setCursorStates(b.source,3,[dc.cancelSelection(_,_.getPrimaryCursorState())]),_.revealPrimaryCursor(b.source,!0)}}),n.RemoveSecondaryCursors=qt(new class extends oa{constructor(){super({id:"removeSecondaryCursors",precondition:de.hasMultipleSelections,kbOpts:{weight:Qr+1,kbExpr:de.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(_,b){_.model.pushStackElement(),_.setCursorStates(b.source,3,[_.getPrimaryCursorState()]),_.revealPrimaryCursor(b.source,!0),wS(T("removedCursor","Removed secondary cursors"))}}),n.RevealLine=qt(new class extends oa{constructor(){super({id:"revealLine",precondition:void 0,description:mL.description})}runCoreEditorCommand(_,b){const y=b,C=y.lineNumber||0;let E=typeof C=="number"?C+1:parseInt(C)+1;E<1&&(E=1);const x=_.model.getLineCount();E>x&&(E=x);const k=new J(E,1,E,_.model.getLineMaxColumn(E));let L=0;if(y.at)switch(y.at){case mL.RawAtArgument.Top:L=3;break;case mL.RawAtArgument.Center:L=1;break;case mL.RawAtArgument.Bottom:L=4;break}const D=_.coordinatesConverter.convertModelRangeToViewRange(k);_.revealRange(b.source,!1,D,L,0)}}),n.SelectAll=new class extends Fce{constructor(){super(QZi)}runDOMCommand(_){mg&&(_.focus(),_.select()),_.ownerDocument.execCommand("selectAll")}runEditorCommand(_,b,y){const C=b._getViewModel();C&&this.runCoreEditorCommand(C,y)}runCoreEditorCommand(_,b){_.model.pushStackElement(),_.setCursorStates("keyboard",3,[dc.selectAll(_,_.getPrimaryCursorState())])}},n.SetSelection=qt(new class extends oa{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(_,b){b.selection&&(_.model.pushStackElement(),_.setCursorStates(b.source,3,[Nr.fromModelSelection(b.selection)]))}})})(ql||(ql={}));const uor=ht.and(de.textInputFocus,de.columnSelection);function lN(n,e){uh.registerKeybindingRule({id:n,primary:e,when:uor,weight:Qr+1})}lN(ql.CursorColumnSelectLeft.id,1039);lN(ql.CursorColumnSelectRight.id,1041);lN(ql.CursorColumnSelectUp.id,1040);lN(ql.CursorColumnSelectPageUp.id,1035);lN(ql.CursorColumnSelectDown.id,1042);lN(ql.CursorColumnSelectPageDown.id,1036);function qOe(n){return n.register(),n}var lD;(function(n){class e extends oc{runEditorCommand(i,r,o){const s=r._getViewModel();s&&this.runCoreEditingCommand(r,s,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=qt(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:de.writable,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,Os.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=qt(new class extends e{constructor(){super({id:"outdent",precondition:de.writable,kbOpts:{weight:Qr,kbExpr:ht.and(de.editorTextFocus,de.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,Os.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=qt(new class extends e{constructor(){super({id:"tab",precondition:de.writable,kbOpts:{weight:Qr,kbExpr:ht.and(de.editorTextFocus,de.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,Os.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=qt(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,r){const[o,s]=ek.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=qt(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Qr,kbExpr:de.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,r){const[o,s]=ek.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 Fce{constructor(){super(bZe)}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 Fce{constructor(){super(yZe)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,r){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(lD||(lD={}));class GOe extends IK{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(io).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function tI(n,e){qOe(new GOe("default:"+n,n)),qOe(new GOe(n,n,e))}tI("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});tI("replacePreviousChar");tI("compositionType");tI("compositionStart");tI("compositionEnd");tI("paste");tI("cut");class dor{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){ql.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new Re(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=Xu&&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){ql.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){ql.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ql.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ql.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){ql.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){ql.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){ql.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){ql.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){ql.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){ql.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){ql.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){ql.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){ql.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 KK{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 KK.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 Re(e.afterLineNumber,1)).lineNumber}}}class DJe{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 AJe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new DJe(()=>this._host.createVisibleLine())}_createDomNode(){const e=oo(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=M1("editorViewLayer",{createHTML:n=>n});Ey._sb=new oN(1e5);class RJe extends tf{constructor(e){super(e),this._visibleLines=new AJe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Zc(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 hor(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 Zc(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 hor{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=oo(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 por extends RJe{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 gor extends RJe{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),Zc(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Zc(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 mor extends tf{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=oo(document.createElement("div")),u0.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=oo(document.createElement("div")),u0.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 _or(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 _or{constructor(e,t,i){this._primaryAnchor=new RO(null,null),this._secondaryAnchor=new RO(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=oo(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 RO(null,null);const l=s.model.validatePosition(o);if(s.coordinatesConverter.modelPositionIsVisible(l)){const c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new RO(o,c)}return new RO(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 f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),f<r.scrollLeft&&(f=r.scrollLeft),{fitsAbove:u,aboveTop:c,fitsBelow:h,belowTop:d,left:f}}_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 f=h-(c-r);h-=f,i-=f}if(h<l){const f=h-l;h-=f,i-=f}return[i,h]}_layoutBoxInPage(e,t,i,r){var o,s;const a=e.top-i,l=e.top+e.height,c=pl(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),f=c.top+l-((s=d==null?void 0:d.scrollY)!==null&&s!==void 0?s:0),g=iN(u.body),[m,v]=this._layoutHorizontalSegmentInPage(g,c,e.left-r.scrollLeft+this._contentLeft,t),_=22,b=22,y=h>=_,C=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,_),fitsBelow:C,belowTop:f,left:v}:{fitsAbove:y,aboveTop:a,fitsBelow:C,belowTop:l,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new NO(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,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new KOe(f,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 KOe(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=Ste(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 NO(o.aboveTop,o.left),position:1}}else if(a===2){if(!o)return null;if(s===2||o.fitsBelow)return{coordinate:new NO(o.belowTop,o.left),position:2}}else return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new NO(r.top,r.left)),position:0}:{coordinate:new NO(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"&&Ste(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"&&Ste(this._actual.afterRender,this._actual,this._renderData.position)}}class RO{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class NO{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class KOe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function Ste(n,e,...t){try{return n.call(e,...t)}catch{return null}}class NJe extends eI{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 kn(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),ka(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 vor extends NJe{_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 bor extends NJe{_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()}}t_((n,e)=>{const t=n.getColor(vJe);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(zOe)){const i=n.getColor(zOe);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}; }`),pv(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 yor extends eI{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:J.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 f=d;f<=h;f++){const g=f-o;i[g]+=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 f=t[d];if(f.options.isWholeLine)continue;const g=f.options.className,m=!!f.options.showIfCollapsed;let v=f.range;if(m&&v.endColumn===1&&v.endLineNumber!==v.startLineNumber&&(v=new J(v.startLineNumber,v.startColumn,v.endLineNumber-1,this._context.viewModel.getLineMaxColumn(v.endLineNumber-1))),a===g&&l===m&&J.areIntersectingOrTouching(c,v)){c=J.plusRange(c,v);continue}a!==null&&this._renderNormalDecoration(e,c,a,u,l,o,s,i),a=g,l=m,c=v,u=(r=f.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 f=h.lineNumber-a;if(o&&h.ranges.length===1){const g=h.ranges[0];if(g.width<this._typicalHalfwidthCharacterWidth){const m=Math.round(g.left+g.width/2),v=Math.max(0,Math.round(m-this._typicalHalfwidthCharacterWidth/2));h.ranges[0]=new UK(v,this._typicalHalfwidthCharacterWidth)}}for(let g=0,m=h.ranges.length;g<m;g++){const v=r&&h.continuesOnNextLine&&m===1,_=h.ranges[g],b='<div class="cdr '+i+'" style="left:'+String(_.left)+(v?"px;width:100%;height:":"px;width:"+String(_.width)+"px;height:")+s+'px;"></div>';l[f]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Cor extends tf{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 "+Pce(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 Y0e(t.domNode,u,this._context.viewLayout.getScrollable())),u0.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=oo(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const m={};if(f){const v=h.scrollTop;v&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register(at(i.domNode,"scroll",h=>d(i.domNode,!0,!0))),this._register(at(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(at(r.domNode,"scroll",h=>d(r.domNode,!0,!1))),this._register(at(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 "+Pce(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class OJe extends qe{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function YK(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 gT;(function(n){n[n.Disabled=0]="Disabled",n[n.EnabledForActive=1]="EnabledForActive",n[n.Enabled=2]="Enabled"})(gT||(gT={}));class Kx{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 $M{constructor(e,t){this.top=e,this.endColumn=t}}class wor extends OJe{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return YK(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=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,l=-1;for(let L=k-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=k;L<r;L++){const D=this._computeIndentLevel(L);if(D>=0){c=L,u=D;break}}}};let h=-2,f=-1,g=-2,m=-1;const v=k=>{if(h===-2){h=-1,f=-1;for(let L=k-2;L>=0;L--){const D=this._computeIndentLevel(L);if(D>=0){h=L,f=D;break}}}if(g!==-1&&(g===-2||g<k-1)){g=-1,m=-1;for(let L=k;L<r;L++){const D=this._computeIndentLevel(L);if(D>=0){g=L,m=D;break}}}};let _=0,b=!0,y=0,C=!0,E=0,x=0;for(let k=0;b||C;k++){const L=e-k,D=e+k;k>1&&(L<1||L<t)&&(b=!1),k>1&&(D>r||D>i)&&(C=!1),k>5e4&&(b=!1,C=!1);let A=-1;if(b&&L>=1){const P=this._computeIndentLevel(L-1);P>=0?(c=L-1,u=P,A=Math.ceil(P/this.textModel.getOptions().indentSize)):(d(L),A=this._getIndentLevelForWhitespaceLine(s,l,u))}let N=-1;if(C&&D<=r){const P=this._computeIndentLevel(D-1);P>=0?(h=D-1,f=P,N=Math.ceil(P/this.textModel.getOptions().indentSize)):(v(D),N=this._getIndentLevelForWhitespaceLine(s,f,m))}if(k===0){x=A;continue}if(k===1){if(D<=r&&N>=0&&x+1===N){b=!1,_=D,y=D,E=N;continue}if(L>=1&&A>=0&&A-1===x){C=!1,_=L,y=L,E=A;continue}if(_=e,y=e,E=x,E===0)return{startLineNumber:_,endLineNumber:y,indent:E}}b&&(A>=E?_=L:b=!1),C&&(N>=E?y=D:C=!1)}return{startLineNumber:_,endLineNumber:y,indent:E}}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 J(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(J.fromPositions(i)).toArray()).filter(f=>J.strictContainsPosition(f.range,i));c=(o=dz(h,f=>a))===null||o===void 0?void 0:o.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new PJe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!r.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(r.highlightActive&&f?" "+d.activeClassName:""),m=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),_=r.horizontalGuides===gT.Enabled||r.horizontalGuides===gT.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){_&&s[h.range.startLineNumber-e].push(new Kx(-1,h.openingBracketRange.getEndPosition().column,g,new $M(!1,v.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(v),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),C=Math.min(y,b,h.minVisibleColumnIndentation+1);let E=!1;Gu(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))<h.closingBracketRange.startColumn-1&&(E=!0);const L=Math.max(m.lineNumber,e),D=Math.min(v.lineNumber,t),A=E?1:0;for(let N=L;N<D+A;N++)s[N-e].push(new Kx(C,-1,g,null,N===m.lineNumber?m.column:-1,N===v.lineNumber?v.column:-1));_&&(m.lineNumber>=e&&y>C&&s[m.lineNumber-e].push(new Kx(C,-1,g,new $M(!1,m.column),-1,-1)),v.lineNumber<=t&&b>C&&s[v.lineNumber-e].push(new Kx(C,-1,g,new $M(!E,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return Cl.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 f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let m=h-2;m>=0;m--){const v=this._computeIndentLevel(m);if(v>=0){l=m,c=v;break}}}if(u!==-1&&(u===-2||u<h-1)){u=-1,d=-1;for(let m=h;m<i;m++){const v=this._computeIndentLevel(m);if(v>=0){u=m,d=v;break}}}a[f]=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 PJe{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 Sor extends eI{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 f=s;f<=a;f++){const g=f-s,m=d[g];let v="";const _=(i=(t=e.visibleRangeForPosition(new Re(f,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?_+(b.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new Re(f,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",E=b.horizontalLine?((o=(r=e.visibleRangeForPosition(new Re(f,b.horizontalLine.endColumn)))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;v+=`<div class="core-guide ${b.className} ${C}" style="left:${y}px;height:${c}px;width:${E}px"></div>`}h[g]=v}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?gT.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?gT.EnabledForActive:gT.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 f=r?r[d-e]:[],g=new C1(f),m=o?o[d-e]:0;for(let v=1;v<=m;v++){const _=(v-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&v===l;h.push(...g.takeWhile(C=>C.visibleColumn<_)||[]);const y=g.peek();(!y||y.visibleColumn!==_||y.horizontalLine)&&h.push(new Kx(_,-1,`core-guide-indent lvl-${(v-1)%30}`+(b?" indent-active":""),null,-1,-1))}h.push(...g.takeWhile(v=>!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 n2(n){if(!(n&&n.isTransparent()))return n}t_((n,e)=>{const t=[{bracketColor:CJe,guideColor:Rrr,guideColorActive:Brr},{bracketColor:wJe,guideColor:Nrr,guideColorActive:$rr},{bracketColor:SJe,guideColor:Orr,guideColorActive:Vrr},{bracketColor:EJe,guideColor:Prr,guideColorActive:Hrr},{bracketColor:xJe,guideColor:Mrr,guideColorActive:Wrr},{bracketColor:TJe,guideColor:Frr,guideColorActive:zrr}],i=new PJe,r=[{indentColor:M6,indentColorActive:F6},{indentColor:prr,indentColorActive:brr},{indentColor:grr,indentColorActive:yrr},{indentColor:mrr,indentColorActive:Crr},{indentColor:_rr,indentColorActive:wrr},{indentColor:vrr,indentColorActive:Srr}],o=t.map(a=>{var l,c;const u=n.getColor(a.bracketColor),d=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=n2((l=n2(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=n2((c=n2(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(w3),s=r.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),u=n2(l),d=n2(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(w3);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 Ete{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 Eor{constructor(){this._currentVisibleRange=new J(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class xor{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 Tor{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 QK extends tf{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new AJe(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 $Oe(i,this._context.theme.type),u0.write(this.domNode,7),this.domNode.setClassName(`view-lines ${sD}`),Zc(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new Mo(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Mo(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Eor,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 Cb(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,Zc(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new $Oe(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 xor(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 Tor(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 Re(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 Re(r,a)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===Cb.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 Ete(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=J.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const o=[];let s=0;const a=new Ete(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Re(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,f=d!==r.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):r.endColumn,m=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(m){if(t&&d<i){const v=l;l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Re(d+1,1)).lineNumber,v!==l&&(m.ranges[m.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new Oir(m.outsideRenderedLine,d,UK.from(m.ranges),f)}}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 Ete(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 Pir(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(),Xu&&!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 _=o[0].startLineNumber,b=o[0].endLineNumber;for(let y=1,C=o.length;y<C;y++){const E=o[y];_=Math.min(_,E.startLineNumber),b=Math.max(b,E.endLineNumber)}u=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(_),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 f=(t==="mouse"||i)&&this._cursorSurroundingLinesStyle==="default";let g=0,m=0;if(f)i||(g=this._lineHeight);else{const _=Math.min(l/this._lineHeight/2,this._cursorSurroundingLines);this._stickyScrollEnabled?g=Math.max(_,this._maxNumberStickyLines)*this._lineHeight:g=_*this._lineHeight,m=Math.max(0,_-1)*this._lineHeight}i||(s===0||s===4)&&(m+=this._lineHeight),d-=g,h+=m;let v;if(h-d>l){if(!u)return-1;v=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)v=a;else{const _=Math.max(5*this._lineHeight,l*.2),b=d-_,y=h-l;v=Math.max(y,b)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)v=a;else{const _=(d+h)/2;v=Math.max(0,_-l/2)}else v=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return v}_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-QK.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}}QK.HORIZONTAL_EXTRA_PX=30;class Bce{constructor(e,t,i,r){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=r??0}}class kor{constructor(e,t){this.className=e,this.zIndex=t}}class Ior{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class MJe extends eI{_render(e,t,i){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new Ior}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 f=Math.min(c.endLineNumber,t)-e;o===u?(h=Math.max(s+1,h),s=Math.max(s,f)):(o=u,s=f);for(let g=h;g<=s;g++)r[g].add(new kor(u,d))}return r}}class Lor extends tf{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(143);this.domNode=oo(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=oo(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&&J.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),f=Math.min((r=(i=c.options.glyphMargin)===null||i===void 0?void 0:i.position)!==null&&r!==void 0?r:1,this._glyphMarginDecorationLaneCount),g=(o=c.options.zIndex)!==null&&o!==void 0?o:0;for(let m=d;m<=h;m++)t.push(new Dor(m,f,g,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 Aor(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 C1(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=oo(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 Dor{constructor(e,t,i,r){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=r,this.type=0}accept(e){return new Ror(this.lineNumber,this.lane,e)}}class Aor{constructor(e,t,i,r){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=r,this.type=1}}class Ror{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class Nor extends MJe{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 Bce(a.range.startLineNumber,a.range.endLineNumber,l,c));const u=a.options.firstLineDecorationClassName;u&&(i[r++]=new Bce(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 f of d)h+='<div class="cldr '+f.className+a;l[u]=h}this._renderResult=l}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Oor extends MJe{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 Bce(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 eg{constructor(e,t,i,r){this._rgba8Brand=void 0,this.r=eg._clamp(e),this.g=eg._clamp(t),this.b=eg._clamp(i),this.a=eg._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}}eg.Empty=new eg(0,0,0,0);class $6 extends qe{static getInstance(){return this._INSTANCE||(this._INSTANCE=new $6),this._INSTANCE}constructor(){super(),this._onDidChange=new De,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ks.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Ks.getColorMap();if(!e){this._colors=[eg.Empty],this._backgroundIsLight=!0;return}this._colors=[eg.Empty];for(let i=1;i<e.length;i++){const r=e[i].rgba;this._colors[i]=new eg(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}}$6._INSTANCE=null;const Por=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),Mor=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class Q3{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Q3.soften(e,12/15),this.charDataLight=Q3.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]=lz(e[r]*t);return i}renderChar(e,t,i,r,o,s,a,l,c,u,d){const h=1*this.scale,f=2*this.scale,g=d?1:f;if(t+h>e.width||i+g>e.height){console.warn("bad render request outside image data");return}const m=u?this.charDataLight:this.charDataNormal,v=Mor(r,c),_=e.width*4,b=a.r,y=a.g,C=a.b,E=o.r-b,x=o.g-y,k=o.b-C,L=Math.max(s,l),D=e.data;let A=v*h*f,N=i*_+t*4;for(let P=0;P<g;P++){let M=N;for(let B=0;B<h;B++){const F=m[A++]/255*(s/255);D[M++]=b+E*F,D[M++]=y+x*F,D[M++]=C+k*F,D[M++]=L}N+=_}}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,f=.5*(o/255),g=s.r,m=s.g,v=s.b,_=r.r-g,b=r.g-m,y=r.b-v,C=g+_*f,E=m+b*f,x=v+y*f,k=Math.max(o,a),L=e.data;let D=i*h+t*4;for(let A=0;A<d;A++){let N=D;for(let P=0;P<c;P++)L[N++]=C,L[N++]=E,L[N++]=x,L[N++]=k;D+=h}}}const YOe={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},QOe=n=>{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t<n.length;t+=2)e[t>>1]=YOe[n[t]]<<4|YOe[n[t+1]]&15;return e},XOe={1:gS(()=>QOe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:gS(()=>QOe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class VM{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return XOe[e]?i=new Q3(XOe[e](),e):i=VM.createFromSampleData(VM.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 Por)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=VM._downsample(e,t);return new Q3(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 f=0;f<s;f++){const g=f/s*10,m=(f+1)/s*10;let v=0,_=0;for(let y=d;y<h;y++){const C=t+Math.floor(y)*3840,E=1-(y-Math.floor(y));for(let x=g;x<m;x++){const k=1-(x-Math.floor(x)),L=C+Math.floor(x)*4,D=k*E;_+=D,v+=e[L]*e[L+3]/255*D}}const b=v/_;c=Math.max(c,b),i[l++]=lz(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 For=140,Bor=2;class X3{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=gS(()=>VM.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=X3._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=X3._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(vir);return i?new eg(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(bir);return t?eg._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 HM{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,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let x=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(x+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/x)),L=Math.max(0,e.minimapHeight-k),D=L/(u-o),A=c*D,N=L>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),M=Math.floor(e.paddingTop/e.lineHeight);return new HM(c,u,N,D,A,k,M,1,Math.min(a,P))}let v;if(s&&i!==a){const x=i-t+1;v=Math.floor(x*f/h)}else{const x=o/m;v=Math.floor(x*f/h)}const _=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const x=o/m;b=Math.max(b,x-1)}let y;if(b>0){const x=o/m;y=(_+a+b-x-1)*f/h}else y=Math.max(0,(_+a)*f/h-v);y=Math.min(e.minimapHeight-v,y);const C=y/(u-o),E=c*C;if(g>=_+a+b){const x=y>0;return new HM(c,u,x,C,E,v,_,1,a)}else{let x;t>1?x=t+_:x=Math.max(1,c/m);let k,L=Math.max(1,Math.floor(x-E*h/f));L<_?(k=_-L+1,L=1):(k=0,L=Math.max(1,L-_)),d&&d.scrollHeight===u&&(d.scrollTop>c&&(L=Math.min(L,d.startLineNumber),k=Math.max(k,d.topPaddingLineCount)),d.scrollTop<c&&(L=Math.max(L,d.startLineNumber),k=Math.min(k,d.topPaddingLineCount)));const D=Math.min(a,L-k+g-1),A=(c-r)/m;let N;return c>=e.paddingTop?N=(t-L+k+A)*f/h:N=c/e.paddingTop*(k+A)*f/h,new HM(c,u,!0,C,N,v,k,L,D)}}}class Sz{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}Sz.INVALID=new Sz(-1);class ZOe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new DJe(()=>Sz.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 Z0e{constructor(e,t,i,r){this._backgroundFillData=Z0e._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 Z3{static compute(e,t,i){if(e.renderMinimap===0||!e.isSampling)return[null,[]];const{minimapLineCount:r}=YL.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 v=[];if(v[0]=1,r>1){for(let _=0,b=r-1;_<b;_++)v[_]=Math.round(_*o+s);v[r-1]=t}return[new Z3(o,v),[]]}const a=i.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],m=null;for(let v=0;v<r;v++){const _=Math.max(h,Math.round(v*o)),b=Math.max(_,Math.round((v+1)*o));for(;u<l&&a[u]<_;){if(g.length<f){const C=u+1+d;m&&m.type==="deleted"&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:u,deleteFromLineNumber:C,deleteToLineNumber:C},g.push(m)),d--}u++}let y;if(u<l&&a[u]<=b)y=a[u],u++;else if(v===0?y=1:v+1===r?y=t:y=Math.round(v*o+s),g.length<f){const C=u+1+d;m&&m.type==="inserted"&&m._i===v-1?m.insertToLineNumber++:(m={type:"inserted",_i:v,insertFromLineNumber:C,insertToLineNumber:C},g.push(m)),d++}c[v]=y,h=y}if(g.length<f)for(;u<l;){const v=u+1+d;m&&m.type==="deleted"&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:u,deleteFromLineNumber:v,deleteToLineNumber:v},g.push(m)),d--,u++}else g=[{type:"flush"}];return[new Z3(o,c),g]}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 $or extends tf{constructor(e){super(e),this.tokensColorTracker=$6.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new X3(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=Z3.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new Ez(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new X3(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]=Z3.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 kn(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 J(o,1,s,this._context.viewModel.getLineMaxColumn(s))}else i=new J(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 YZe(new J(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 J(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class Ez extends qe{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(POe),this._domNode=oo(document.createElement("div")),u0.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=oo(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=oo(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=oo(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=oo(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=oo(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Ba(this._domNode.domNode,Xt.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=pl(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 aN,this._sliderPointerDownListener=Ba(this._slider.domNode,Xt.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Yo.addTarget(this._domNode.domNode),this._sliderTouchStartListener=at(this._domNode.domNode,Qo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=at(this._domNode.domNode,Qo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ba(this._domNode.domNode,Qo.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=pl(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(eu&&c>For){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 Z0e(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(POe),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=HM.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(J.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,f)=>(h.options.zIndex||0)-(f.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 JOe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,i,u,e,s);const d=new JOe(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 g=u;g<=d;g++)i.set(g,!0);const h=r.getYForLineNumber(u,o),f=r.getYForLineNumber(d,o);a>=h||(a>s&&e.fillRect(_C,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(_C,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!==Uh.Inline)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let m=d;m<=h;m++){if(i.has(m))continue;i.set(m,!0);const v=r.getYForLineNumber(d,o);e.fillRect(_C,v,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 f=d;f<=h;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,r,f,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,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let m=h;m<=f;m++)switch(u.position){case Uh.Inline:this.renderDecorationOnLine(e,i,c.range,g,r,m,o,o,s,a,l);continue;case Uh.Gutter:{const v=r.getYForLineNumber(m,o),_=2;this.renderDecoration(e,g,_,v,Bor,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:f,endLineNumber:g}=i,m=f===s?i.startColumn:1,v=g===s?i.endColumn:this._model.getLineMaxColumn(s),_=this.getXOffsetForPosition(t,s,m,c,u,d),b=this.getXOffsetForPosition(t,s,v,c,u,d);this.renderDecoration(e,r,_,h,b-_,a)}getXOffsetForPosition(e,t,i,r,o,s){if(i===1)return _C;if((i-1)*o>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[_C];let u=_C;for(let d=1;d<c.length+1;d++){const h=c.charCodeAt(d-1),f=h===9?r*o:mS(h)?2*o:o,g=u+f;if(g>=s){l[d]=s;break}l[d]=g,u=g}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 ZOe(e,F.imageData,F.lines)}const o=this._getBuffer();if(!o)return null;const[s,a,l]=Ez._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,f=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),v=this._model.options.renderMinimap,_=this._model.options.charRenderer(),b=this._model.options.fontScale,y=this._model.options.minimapCharWidth,E=(v===1?2:2+1)*b,x=r>E?Math.floor((r-E)/2):0,k=h.a/255,L=new eg(Math.round((h.r-d.r)*k+d.r),Math.round((h.g-d.g)*k+d.g),Math.round((h.b-d.b)*k+d.b),255);let D=e.topPaddingLineCount*r;const A=[];for(let F=0,U=i-t+1;F<U;F++)l[F]&&Ez._renderLine(o,L,h.a,m,v,y,g,f,_,D,x,u,c[F],b,r),A[F]=new Sz(D),D+=r;const N=s===-1?0:s,M=(a===-1?o.height:a)-N;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,N,o.width,M),new ZOe(e,o,A)}static _renderUntouchedLines(e,t,i,r,o,s){const a=[];if(!s){for(let D=0,A=r-i+1;D<A;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,f=e.width,g=e.data,m=(r-i+1)*o*f*4;let v=-1,_=-1,b=-1,y=-1,C=-1,E=-1,x=t*o;for(let D=i;D<=r;D++){const A=D-i,N=D-u,P=N>=0&&N<h?d[N].dy:-1;if(P===-1){a[A]=!0,x+=o;continue}const M=P*f*4,B=(P+o)*f*4,F=x*f*4,U=(x+o)*f*4;y===M&&E===F?(y=B,E=U):(b!==-1&&(g.set(c.subarray(b,y),C),v===-1&&b===0&&b===C&&(v=y),_===-1&&y===m&&b===C&&(_=b)),b=M,y=B,C=F,E=U),a[A]=!1,x+=o}b!==-1&&(g.set(c.subarray(b,y),C),v===-1&&b===0&&b===C&&(v=y),_===-1&&y===m&&b===C&&(_=b));const k=v===-1?-1:v/(f*4),L=_===-1?-1:_/(f*4);return[k,L,a]}static _renderLine(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m){const v=f.content,_=f.tokens,b=e.width-s,y=m===1;let C=_C,E=0,x=0;for(let k=0,L=_.getCount();k<L;k++){const D=_.getEndOffset(k),A=_.getForeground(k),N=a.getColor(A);for(;E<D;E++){if(C>b)return;const P=v.charCodeAt(E);if(P===9){const M=h-(E+x)%h;x+=M-1,C+=M*s}else if(P===32)C+=s;else{const M=mS(P)?2:1;for(let B=0;B<M;B++)if(o===2?c.blockRenderChar(e,C,u+d,N,l,t,i,y):c.renderChar(e,C,u+d,P,N,l,t,i,g,r,y),C+=s,C>b)return}}}}}class JOe{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 Vor extends tf{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=oo(document.createElement("div")),u0.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=oo(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 Hor{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(xrr);this.borderColor=r?r.toString():null,this.hideCursor=i.get(59);const o=t.getColor(bJe);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(Trr),u=Ks.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[f,g]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=f,this.w=g}_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&&je.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 Wor extends tf{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=oo(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=Ks.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Hor(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(Re.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?je.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(V3.compareByRenderingProps),this._actualShouldRender===1&&!V3.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!ka(this._renderedCursorPositions,this._cursorPositions,(g,m)=>g.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=je.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):(d.clearRect(0,0,i,r),d.fillStyle=je.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):d.clearRect(0,0,i,r);const h=this._settings.x,f=this._settings.w;for(const g of t){const m=g.color,v=g.data;d.fillStyle=m;let _=0,b=0,y=0;for(let C=0,E=v.length/3;C<E;C++){const x=v[3*C],k=v[3*C+1],L=v[3*C+2];let D=s.getVerticalOffsetForLineNumber(k)*l|0,A=(s.getVerticalOffsetForLineNumber(L)+o)*l|0;if(A-D<c){let P=(D+A)/2|0;P<u?P=u:P+u>r&&(P=r-u),D=P-u,A=P+u}D>y+1||x!==_?(C!==0&&d.fillRect(h[_],b,f[_],y-b),_=x,b=D,y=A):A>y&&(y=A)}d.fillRect(h[_],b,f[_],y-b)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,m=g/2|0,v=this._settings.x[7],_=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let b=-100,y=-100;for(let C=0,E=this._cursorPositions.length;C<E;C++){const x=this._cursorPositions[C];let k=s.getVerticalOffsetForLineNumber(x.lineNumber)*l|0;k<m?k=m:k+m>r&&(k=r-m);const L=k-m,D=L+g;L>y+1?(C!==0&&d.fillRect(v,b,_,y-b),b=L,y=D):D>y&&(y=D)}d.fillRect(v,b,_,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 ePe{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 FJe{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 zor{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(FJe.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,f=Math.floor(o*d),g=Math.floor(o*h);let m=Math.floor((f+g)/2),v=g-m;v<s&&(v=s),m-v<0&&(m=v),m+v>i&&(m=i-v);const _=u.color;let b=this._color2Id[_];b||(b=++this._lastAssignedId,this._color2Id[_]=b,this._id2Color[b]=_);const y=new ePe(m-v,m+v,b);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(ePe.compare),a}}class Uor extends N6{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=oo(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new zor(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 jor extends tf{constructor(e){super(e),this.domNode=oo(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=oo(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 qor extends tf{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=oo(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 Gor{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Kor{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Yor(n){return new Gor(n)}function Qor(n){return new Kor(n.lineNumber,n.ranges.map(Yor))}class ba extends eI{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},f={top:0,bottom:0};if(a>0){const g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;K9(u-g)<r?h.top=2:u>g&&(h.top=1),K9(d-m)<r?f.top=2:g<d&&d<m&&(f.top=1)}else o&&(h.top=o.startStyle.top,f.top=o.endStyle.top);if(a+1<l){const g=t[a+1].ranges[0].left,m=t[a+1].ranges[0].left+t[a+1].ranges[0].width;K9(u-g)<r?h.bottom=2:g<u&&u<m&&(h.bottom=1),K9(d-m)<r?f.bottom=2:d<m&&(f.bottom=1)}else s&&(h.bottom=s.startStyle.bottom,f.bottom=s.endStyle.bottom);c.startStyle=h,c.endStyle=f}}_getVisibleRangesWithStyle(e,t,i){const o=(t.linesVisibleRangesForRange(e,!0)||[]).map(Qor);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],f=h.lineNumber,g=f-t,m=i&&(f===c||f===l)?a:s,v=i&&f===l?1:0;let _="",b="";for(let y=0,C=h.ranges.length;y<C;y++){const E=h.ranges[y];if(o){const k=E.startStyle,L=E.endStyle;if(k.top===1||k.bottom===1){_+=this._createSelectionPiece(v,m,ba.SELECTION_CLASS_NAME,E.left-ba.ROUNDED_PIECE_WIDTH,ba.ROUNDED_PIECE_WIDTH);let D=ba.EDITOR_BACKGROUND_CLASS_NAME;k.top===1&&(D+=" "+ba.SELECTION_TOP_RIGHT),k.bottom===1&&(D+=" "+ba.SELECTION_BOTTOM_RIGHT),_+=this._createSelectionPiece(v,m,D,E.left-ba.ROUNDED_PIECE_WIDTH,ba.ROUNDED_PIECE_WIDTH)}if(L.top===1||L.bottom===1){_+=this._createSelectionPiece(v,m,ba.SELECTION_CLASS_NAME,E.left+E.width,ba.ROUNDED_PIECE_WIDTH);let D=ba.EDITOR_BACKGROUND_CLASS_NAME;L.top===1&&(D+=" "+ba.SELECTION_TOP_LEFT),L.bottom===1&&(D+=" "+ba.SELECTION_BOTTOM_LEFT),_+=this._createSelectionPiece(v,m,D,E.left+E.width,ba.ROUNDED_PIECE_WIDTH)}}let x=ba.SELECTION_CLASS_NAME;if(o){const k=E.startStyle,L=E.endStyle;k.top===0&&(x+=" "+ba.SELECTION_TOP_LEFT),k.bottom===0&&(x+=" "+ba.SELECTION_BOTTOM_LEFT),L.top===0&&(x+=" "+ba.SELECTION_TOP_RIGHT),L.bottom===0&&(x+=" "+ba.SELECTION_BOTTOM_RIGHT)}b+=this._createSelectionPiece(v,m,x,E.left,E.width)}e[g][0]+=_,e[g][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]}}ba.SELECTION_CLASS_NAME="selected-text";ba.SELECTION_TOP_LEFT="top-left-radius";ba.SELECTION_BOTTOM_LEFT="bottom-left-radius";ba.SELECTION_TOP_RIGHT="top-right-radius";ba.SELECTION_BOTTOM_RIGHT="bottom-right-radius";ba.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";ba.ROUNDED_PIECE_WIDTH=10;t_((n,e)=>{const t=n.getColor(Enr);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function K9(n){return n<0?-n:n}class tPe{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 nPe{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=oo(document.createElement("div")),this._domNode.setClassName(`cursor ${sD}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Zc(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Re(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),Zc(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]=uXi(i,t-1);return[new Re(e,r+1),i.substring(r,o)]}_prepareRender(e){let t="",i="";const[r,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===bc.Line||this._cursorStyle===bc.LineThin){const h=e.visibleRangeForPosition(r);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===bc.Line?(f=ONe(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(r))):f=ONe(1);let g=h.left,m=0;f>=2&&g>=1&&(m=1,g-=m);const v=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new tPe(v,g,m,f,this._lineHeight,t,i)}const s=e.linesVisibleRangesForRange(new J(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===bc.Block&&(t=o,i=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===bc.Underline||this._cursorStyle===bc.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new tPe(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 ${sD} ${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 J3 extends tf{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 nPe(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=oo(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 Jm,this._cursorFlatBlinkInterval=new k6,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 nPe(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()},J3.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},J3.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case bc.Line:e+=" cursor-line-style";break;case bc.Block:e+=" cursor-block-style";break;case bc.Underline:e+=" cursor-underline-style";break;case bc.LineThin:e+=" cursor-line-thin-style";break;case bc.BlockOutline:e+=" cursor-block-outline-style";break;case bc.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}}J3.BLINK_INTERVAL=500;t_((n,e)=>{const t=n.getColor(bJe);if(t){let i=n.getColor(hrr);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),pv(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const xte=()=>{throw new Error("Invalid change accessor")};class Xor extends tf{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=oo(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=oo(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 Re(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)}};Zor(e,r),r.addZone=xte,r.removeZone=xte,r.layoutZone=xte}),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:oo(t.domNode),marginDomNode:t.marginDomNode?oo(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){Pi(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Pi(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 Zor(n,e){try{return n(e)}catch(t){Pi(t)}}class Jor{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 esr{constructor(e,t,i){this.configuration=e,this.theme=new Jor(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class tsr{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 J(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 nsr extends tf{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=oo(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]=oo(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 isr extends eI{constructor(e){super(),this._context=e,this._options=new iPe(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 iPe(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 f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f<g&&(u||(u=[]),u.push(new qZe(f-1,g-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(Wy),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",f=this._options.lineHeight,g=this._options.middotWidth,m=this._options.wsmiddotWidth,v=this._options.spaceWidth,_=Math.abs(m-v),b=Math.abs(g-v),y=_<b?11825:183,C=this._options.canUseHalfwidthRightwardsArrow;let E="",x=!1,k=Gu(a),L;k===-1?(x=!0,k=l,L=l):L=hv(a);let D=0,A=i&&i[D],N=0;for(let P=u;P<l;P++){const M=a.charCodeAt(P);if(A&&P>=A.endOffset&&(D++,A=i&&i[D]),M!==9&&M!==32||h&&!x&&P<=L)continue;if(d&&P>=k&&P<=L&&M===32){const F=P-1>=0?a.charCodeAt(P-1):0,U=P+1<l?a.charCodeAt(P+1):0;if(F!==32&&U!==32)continue}if(d&&c&&P===l-1){const F=P-1>=0?a.charCodeAt(P-1):0;if(M===32&&F!==32&&F!==9)continue}if(i&&(!A||A.startOffset>P||A.endOffset<=P))continue;const B=e.visibleRangeForPosition(new Re(t,P+1));B&&(s?(N=Math.max(N,B.left),M===9?E+=this._renderArrow(f,v,B.left):E+=`<circle cx="${(B.left+v/2).toFixed(2)}" cy="${(f/2).toFixed(2)}" r="${(v/7).toFixed(2)}" />`):M===9?E+=`<div class="mwh" style="left:${B.left}px;height:${f}px;">${C?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:E+=`<div class="mwh" style="left:${B.left}px;height:${f}px;">${String.fromCharCode(y)}</div>`)}return s?(N=Math.round(N+v),`<svg style="position:absolute;width:${N}px;height:${f}px" viewBox="0 0 ${N} ${f}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+E+"</svg>"):E}_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},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},m={x:u.x,y:-u.y},v={x:c.x,y:-c.y},_={x:l.x,y:-l.y};return`<path d="M ${[l,c,u,d,h,f,g,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 iPe{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 rsr=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},osr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let $ce=class extends N6{constructor(e,t,i,r,o,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new kn(1,1,1,1)],this._renderAnimationFrame=null;const l=new dor(t,r,o,e);this._context=new esr(t,i,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Mce,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=oo(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=oo(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=oo(document.createElement("div")),u0.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Cor(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new QK(this._context,this._linesContent),this._viewZones=new Xor(this._context),this._viewParts.push(this._viewZones);const c=new Wor(this._context);this._viewParts.push(c);const u=new qor(this._context);this._viewParts.push(u);const d=new por(this._context);this._viewParts.push(d),d.addDynamicOverlay(new vor(this._context)),d.addDynamicOverlay(new ba(this._context)),d.addDynamicOverlay(new Sor(this._context)),d.addDynamicOverlay(new yor(this._context)),d.addDynamicOverlay(new isr(this._context));const h=new gor(this._context);this._viewParts.push(h),h.addDynamicOverlay(new bor(this._context)),h.addDynamicOverlay(new Oor(this._context)),h.addDynamicOverlay(new Nor(this._context)),h.addDynamicOverlay(new B6(this._context)),this._glyphMarginWidgets=new Lor(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new JT(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new mor(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new J3(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Vor(this._context),this._viewParts.push(this._overlayWidgets);const g=new jor(this._context);this._viewParts.push(g);const m=new nsr(this._context);this._viewParts.push(m);const v=new $or(this._context);if(this._viewParts.push(v),c){const _=this._scrollbar.getOverviewRulerLayoutInfo();_.parent.insertBefore(c.getDomNode(),_.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.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(f.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(v.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 crr(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),aw.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:nD.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)=>J.compareRangesUsingStarts(o.range,s.range));let i=null,r=null;for(const o of t)if(o.lane===nD.Left&&(!i||J.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===nD.Right&&(!r||J.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 Vir(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 Re(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)+" "+Pce(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=iz(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){ssr(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!w0e(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 tsr(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 Nir(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 Re(r.lineNumber,r.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?KK.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Uor(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()}};$ce=rsr([osr(6,pi)],$ce);function ssr(n){try{return n()}catch(e){Pi(e)}}class BJe{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 ES(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 rPe{constructor(e,t,i,r){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=r}}class asr{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 lsr extends asr{constructor(e,t,i,r,o,s,a){super(e,t,i,r,o,s),this.minVisibleColumnIndentation=a}}class e5{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}e5.zero=new e5(0,0);function csr(n,e,t,i){return n!==t?Ra(t-n,i):Ra(0,i-e)}const Id=0;function xz(n){return n===0}const Ff=Math.pow(2,26);function Ra(n,e){return n*Ff+e}function lg(n){const e=n,t=Math.floor(e/Ff),i=e-t*Ff;return new e5(t,i)}function usr(n){return Math.floor(n/Ff)}function Qs(n,e){let t=n+e;return e>=Ff&&(t=t-n%Ff),t}function dsr(n,e){return n.reduce((t,i)=>Qs(t,e(i)),Id)}function $Je(n,e){return n===e}function t5(n,e){const t=n,i=e;if(i-t<=0)return Id;const o=Math.floor(t/Ff),s=Math.floor(i/Ff),a=i-s*Ff;if(o===s){const l=t-o*Ff;return Ra(0,a-l)}else return Ra(s-o,a)}function cD(n,e){return n<e}function uD(n,e){return n<=e}function kP(n,e){return n>=e}function _L(n){return Ra(n.lineNumber-1,n.column-1)}function mT(n,e){const t=n,i=Math.floor(t/Ff),r=t-i*Ff,o=e,s=Math.floor(o/Ff),a=o-s*Ff;return new J(i+1,r+1,s+1,a+1)}function hsr(n){const e=a0(n);return Ra(e.length-1,e[e.length-1].length)}class zy{static fromModelContentChanges(e){return e.map(i=>{const r=J.lift(i.range);return new zy(_L(r.getStartPosition()),_L(r.getEndPosition()),hsr(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${lg(this.startOffset)}...${lg(this.endOffset)}) -> ${lg(this.newLength)}`}}class fsr{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>J0e.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:t5(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ra(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ra(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=lg(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ra(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ra(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(uD(i,e)){this.nextEditIdx++;const r=lg(i),o=lg(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 J0e{static from(e){return new J0e(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=lg(t),this.endOffsetAfterObj=lg(Qs(e,i)),this.offsetObj=lg(e)}}const sV=[];class dl{static create(e,t){if(e<=128&&t.length===0){let i=dl.cache[e];return i||(i=new dl(e,t),dl.cache[e]=i),i}return new dl(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:dl.create(s,this.additionalItems)}r--;const o=this.additionalItems.slice(0);for(;o.length<r;)o.push(0);return o[r]|=1<<(i&31),dl.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===sV&&e.additionalItems===sV)return t===this.items?this:t===e.items?e:dl.create(t,sV);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 dl.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}}dl.cache=new Array(129);dl.empty=dl.create(0,sV);const oPe={getKey(n){return n}};class VJe{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 eye{get length(){return this._length}constructor(e){this._length=e}}class n5 extends eye{static create(e,t,i){let r=e.length;return t&&(r=Qs(r,t.length)),i&&(r=Qs(r,i.length)),new n5(r,e,t,i,t?t.missingOpeningBracketIds:dl.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 n5(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(Qs(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class d0 extends eye{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=Qs(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Qs(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return r?new psr(o,e.listHeight+1,e,t,i,s):new i5(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new gsr(Id,0,[],dl.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=Qs(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=Qs(r,s.length))}return this.cachedMinIndentation=i,i}}class i5 extends d0{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 i5(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 psr extends i5{toMutable(){return new i5(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Tz extends d0{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 Tz(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 gsr extends Tz{toMutable(){return new Tz(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const msr=[];class tye extends eye{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return msr}deepClone(){return this}}class xx extends tye{get kind(){return 0}get missingOpeningBracketIds(){return dl.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=lg(e),r=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,o=usr(Qs(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=Cl.visibleColumnFromColumn(c,l,t.getOptions().tabSize);s=Math.min(s,u)}return s}}class kz extends tye{static create(e,t,i){return new kz(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return dl.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 _sr extends tye{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 UC=class{constructor(e,t,i,r,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=r,this.astNode=o}};class HJe{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new vsr(this.textModel,this.bracketTokens),this._offset=Id,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Ra(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Qs(this._offset,e);const t=lg(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=Qs(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class vsr{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=Gc.getTokenType(l)===0,u=Gc.containsBalancedBrackets(l),d=o.getEndOffset(this.lineTokenOffset);if(u&&c&&this.lineCharOffset<d){const h=o.getLanguageId(this.lineTokenOffset),f=this.line.substring(this.lineCharOffset,d),g=this.bracketTokens.getSingleLanguageBracketTokens(h),m=g.regExpGlobal;if(m){m.lastIndex=0;const v=m.exec(f);v&&(a=g.getToken(v[0]),a&&(this.lineCharOffset+=v.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=csr(e,t,this.lineIdx,this.lineCharOffset);return new UC(r,0,-1,dl.getEmpty(),new xx(r))}}class bsr{constructor(e,t){this.text=e,this._offset=Id,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 g=0;g<60;g++)d.push(new UC(Ra(0,g),0,-1,dl.getEmpty(),new xx(Ra(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new UC(Ra(1,g),0,-1,dl.getEmpty(),new xx(Ra(1,g))));if(r)for(r.lastIndex=0;(s=r.exec(e))!==null;){const g=s.index,m=s[0];if(m===`
`)a++,l=g+1;else{if(c!==g){let v;if(u===a){const _=g-c;if(_<d.length)v=d[_];else{const b=Ra(0,_);v=new UC(b,0,-1,dl.getEmpty(),new xx(b))}}else{const _=a-u,b=g-l;if(_===1&&b<h.length)v=h[b];else{const y=Ra(_,b);v=new UC(y,0,-1,dl.getEmpty(),new xx(y))}}o.push(v)}o.push(t.getToken(m)),c=g+m.length,u=a}}const f=e.length;if(c!==f){const g=u===a?Ra(0,f-c):Ra(a-u,f-l);o.push(new UC(g,0,-1,dl.getEmpty(),new xx(g)))}this.length=Ra(a,f-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 yQi}}class nye{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=Ra(0,o.bracketText.length),a=i(o),l=dl.getEmpty().add(a,oPe);r.set(o.bracketText,new UC(s,1,a,l,kz.create(s,o,l)))}for(const o of e.bracketsNew.closingBrackets){const s=Ra(0,o.bracketText.length);let a=dl.getEmpty();const l=o.getOpeningBrackets();for(const c of l)a=a.add(i(c),oPe);r.set(o.bracketText,new UC(s,2,i(l[0]),a,kz.create(s,o,a)))}return new nye(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=>ysr(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 ysr(n){let e=ep(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class WJe{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=nye.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Csr(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?zJe(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())sPe(i,r)<=sPe(r,s)?(i=Tte(i,r),r=s):r=Tte(r,s);return Tte(i,r)}function zJe(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]=d0.create23(n[o],n[o+1],o+3===t?n[o+2]:null,e)}t=i}return d0.create23(n[0],n[1],t>=3?n[2]:null,e)}function sPe(n,e){return Math.abs(n.listHeight-e.listHeight)}function Tte(n,e){return n.listHeight===e.listHeight?d0.create23(n,e,null,!1):n.listHeight>e.listHeight?wsr(n,e):Ssr(e,n)}function wsr(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=d0.create23(s.unappendChild(),r,null,!1):(s.appendChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?d0.create23(n,r,null,!1):n}function Ssr(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=d0.create23(r,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?d0.create23(r,n,null,!1):n}class Esr{constructor(e){this.lastOffset=Id,this.nextNodes=[e],this.offsets=[Id],this.idxs=[]}readLongestNodeAt(e,t){if(cD(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=OO(this.nextNodes);if(!i)return;const r=OO(this.offsets);if(cD(e,r))return;if(cD(r,e))if(Qs(r,i.length)<=e)this.nextNodeAfterCurrent();else{const o=kte(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=kte(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=OO(this.offsets),t=OO(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=OO(this.nextNodes),r=kte(i,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(i.getChild(r)),this.offsets.push(Qs(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function kte(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function OO(n){return n.length>0?n[n.length-1]:void 0}function Vce(n,e,t,i){return new xsr(n,e,t,i).parseDocument()}class xsr{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 Esr(i):void 0,this.positionMapper=new fsr(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(dl.getEmpty(),0);return e||(e=d0.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?Csr(i):zJe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!xz(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!cD(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 _sr(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new xx(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(),n5.create(i.astNode,o,s.astNode)):n5.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function Iz(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new C1(aPe(n)),i=aPe(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&&!xz(c);){const[d,h]=r.splitAt(c);u.push(d),c=t5(d.lengthAfter,c),r=h??t.dequeue()}return xz(c)||u.push(new lw(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&$Je(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new zy(h.startOffset,u,Qs(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=Id;for(const c of i){const u=o(c.lengthBefore);if(c.modified){const d=dsr(u,f=>f.lengthBefore),h=Qs(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=Qs(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class lw{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=t5(e,this.lengthAfter);return $Je(t,Id)?[this,void 0]:this.modified?[new lw(this.modified,this.lengthBefore,e),new lw(this.modified,Id,t)]:[new lw(this.modified,e,e),new lw(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${lg(this.lengthBefore)} -> ${lg(this.lengthAfter)}`}}function aPe(n){const e=[];let t=Id;for(const i of n){const r=t5(t,i.startOffset);xz(r)||e.push(new lw(!1,r,r));const o=t5(i.startOffset,i.endOffset);e.push(new lw(!0,o,i.newLength)),t=i.endOffset}return e}class Tsr extends qe{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new De,this.denseKeyProvider=new VJe,this.brackets=new WJe(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 bsr(this.textModel.getValue(),i);this.initialAstWithoutTokens=Vce(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 zy(Ra(i.fromLineNumber-1,0),Ra(i.toLineNumber,0),Ra(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=zy.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=Iz(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=Iz(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 HJe(this.textModel,this.brackets);return Vce(o,e,r,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ra(e.startLineNumber-1,e.startColumn-1),r=Ra(e.endLineNumber-1,e.endColumn-1);return new Yb(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens;Hce(s,Id,s.length,i,r,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=_L(e.getStartPosition()),r=_L(e.getEndPosition());return new Yb(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new ksr(o,t,this.textModel);Wce(s,Id,s.length,i,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return jJe(t,Id,t.length,_L(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return UJe(t,Id,t.length,_L(e))}}function UJe(n,e,t,i){if(n.kind===4||n.kind===2){const r=[];for(const o of n.children)t=Qs(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(cD(s,i)){const l=UJe(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=mT(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function jJe(n,e,t,i){if(n.kind===4||n.kind===2){for(const r of n.children){if(t=Qs(e,r.length),cD(i,t)){const o=jJe(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=mT(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function Hce(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 f=n.getChild(h);if(f){if(t=Qs(e,f.length),uD(e,r)&&kP(t,i)){if(kP(t,r)){n=f;continue e}if(!Hce(f,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 g=l.get(n.openingBracket.text);g===void 0&&(g=0),h=g,d&&(g++,l.set(n.openingBracket.text,g))}const f=n.childrenLength;for(let g=0;g<f;g++){const m=n.getChild(g);if(m){if(t=Qs(e,m.length),uD(e,r)&&kP(t,i)){if(kP(t,r)&&m.kind!==1){n=m,d?(s++,a=h+1):a=h;continue e}if((d||m.kind!==1||!n.closingBracket)&&!Hce(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=mT(e,t);return o(new rPe(d,s-1,0,!0))}case 1:{const d=mT(e,t);return o(new rPe(d,s-1,a-1,u))}case 0:return!0}}class ksr{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function Wce(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 f=a.get(n.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(n.openingBracket.text,f)}const d=Qs(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new lsr(mT(e,t),mT(e,d),n.closingBracket?mT(Qs(d,((l=n.child)===null||l===void 0?void 0:l.length)||Id),t):void 0,s,u,n,h)),e=d,c&&n.child){const f=n.child;if(t=Qs(e,f.length),uD(e,r)&&kP(t,i)&&(c=Wce(f,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=Qs(u,d.length),uD(h,r)&&uD(i,u)&&(c=Wce(d,h,u,i,r,o,s,a),!c))return!1}}return c}class Isr extends qe{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ac),this.onDidChangeEmitter=new De,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 yt;this.bracketPairsTree.value=Lsr(e.add(new Tsr(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))||Yb.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))||Yb.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))||Yb.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(J.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?Y9(this._findMatchingBracketUp(l,r,Ite(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(J.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(sg(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,J.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=Ite(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(qv(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(qv(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&&!qv(r.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,s),u=null;for(;;){const d=rm.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(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof my)return null;u=f}}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&&!qv(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),h=rm.findPrevBracketInRange(c.reversedRegex,i,o,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof my?null:g}}}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 f=rm.findPrevBracketInRange(o,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.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 f=d-1,g=h.length,m=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1);let v=!0;for(;f>=0;f--){const _=u.getLanguageId(f)===r&&!qv(u.getStandardTokenType(f));if(_)v?g=u.getStartOffset(f):(g=u.getStartOffset(f),m=u.getEndOffset(f));else if(v&&g!==m){const b=l(c,h,g,m);if(b)return b}v=_}if(v&&g!==m){const _=l(c,h,g,m);if(_)return _}}return null}_findMatchingBracketDown(e,t,i){const r=e.languageId,o=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(i&&++a%100===0&&!i())return my.INSTANCE;const g=rm.findNextBracketInRange(o,u,d,h,f);if(!g)break;const m=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?s++:e.isClose(m)&&s--,s===0)return g;h=g.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(),f=this.textModel.getLineContent(u);let g=0,m=0,v=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),m=t.column-1,v=t.column-1);let _=!0;for(;g<h;g++){const b=d.getLanguageId(g)===r&&!qv(d.getStandardTokenType(g));if(b)_||(m=d.getStartOffset(g)),v=d.getEndOffset(g);else if(_&&m!==v){const y=l(u,f,m,v);if(y)return y}_=b}if(_&&m!==v){const b=l(u,f,m,v);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,f=u.length;if(a===i.lineNumber){d=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,f=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 g=!0;for(;d>=0;d--){const m=l.getLanguageId(d);if(r!==m){if(o&&s&&g&&h!==f){const _=rm.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(_)return this._toFoundBracket(s,_);g=!1}r=m,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const v=!!o&&!qv(l.getStandardTokenType(d));if(v)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&o&&g&&h!==f){const _=rm.findPrevBracketInRange(o.reversedRegex,a,u,h,f);if(_)return this._toFoundBracket(s,_)}g=v}if(s&&o&&g&&h!==f){const m=rm.findPrevBracketInRange(o.reversedRegex,a,u,h,f);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,f=0,g=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;const v=c.getLanguageId(h);o!==v&&(o=v,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let m=!0;for(;h<u;h++){const v=c.getLanguageId(h);if(o!==v){if(a&&s&&m&&f!==g){const b=rm.findNextBracketInRange(s.forwardRegex,l,d,f,g);if(b)return this._toFoundBracket(a,b);m=!1}o=v,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const _=!!s&&!qv(c.getStandardTokenType(h));if(_)m||(f=c.getStartOffset(h)),g=c.getEndOffset(h);else if(a&&s&&m&&f!==g){const b=rm.findNextBracketInRange(s.forwardRegex,l,d,f,g);if(b)return this._toFoundBracket(a,b)}m=_}if(a&&s&&m&&f!==g){const v=rm.findNextBracketInRange(s.forwardRegex,l,d,f,g);if(v)return this._toFoundBracket(a,v)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const f=J.fromPositions(i),g=this.getBracketPairsInRange(J.fromPositions(i,i)).findLast(m=>m.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const r=Ite(t),o=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const m=[];for(let v=0,_=g?g.brackets.length:0;v<_;v++)m[v]=0;s.set(f,m)}a=s.get(f)};let c=0;const u=(f,g,m,v,_)=>{for(;;){if(r&&++c%100===0&&!r())return my.INSTANCE;const b=rm.findNextBracketInRange(f.forwardRegex,g,m,v,_);if(!b)break;const y=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),C=f.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);v=b.endColumn-1}return null};let d=null,h=null;for(let f=i.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),m=g.getCount(),v=this.textModel.getLineContent(f);let _=0,b=0,y=0;if(f===i.lineNumber){_=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,y=i.column-1;const E=g.getLanguageId(_);d!==E&&(d=E,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let C=!0;for(;_<m;_++){const E=g.getLanguageId(_);if(d!==E){if(h&&C&&b!==y){const k=u(h,f,v,b,y);if(k)return Y9(k);C=!1}d=E,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h)}const x=!!h&&!qv(g.getStandardTokenType(_));if(x)C||(b=g.getStartOffset(_)),y=g.getEndOffset(_);else if(h&&C&&b!==y){const k=u(h,f,v,b,y);if(k)return Y9(k)}C=x}if(h&&C&&b!==y){const E=u(h,f,v,b,y);if(E)return Y9(E)}}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 Lsr(n,e){return{object:n,dispose:()=>e==null?void 0:e.dispose()}}function Ite(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 Y9(n){return n instanceof my?null:n}class Dsr extends qe{constructor(e){super(),this.textModel=e,this.colorProvider=new qJe,this.onDidChangeEmitter=new De,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 J(1,1,this.textModel.getLineCount(),1),e,t):[]}}class qJe{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}`}}t_((n,e)=>{const t=[CJe,wJe,SJe,EJe,xJe,TJe],i=new qJe;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(Arr)}; }`);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 Q9(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Wc{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} "${Q9(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Q9(this.oldText)}")`:`(replace@${this.oldPosition} "${Q9(this.oldText)}" with "${Q9(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const r=t.length;k_(e,r,i),i+=4;for(let o=0;o<r;o++)mJi(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=T_(e,t);return t+=4,vJi(e,t,i)}writeSize(){return 4+4+Wc._writeStringSize(this.oldText)+Wc._writeStringSize(this.newText)}write(e,t){return k_(e,this.oldPosition,t),t+=4,k_(e,this.newPosition,t),t+=4,t=Wc._writeString(e,this.oldText,t),t=Wc._writeString(e,this.newText,t),t}static read(e,t,i){const r=T_(e,t);t+=4;const o=T_(e,t);t+=4;const s=Wc._readString(e,t);t+=Wc._writeStringSize(s);const a=Wc._readString(e,t);return t+=Wc._writeStringSize(a),i.push(new Wc(r,s,o,a)),t}}function Asr(n,e){return n===null||n.length===0?e:new Zv(n,e).compress()}class Zv{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]=Zv._splitCurr(r,i.newPosition-r.oldPosition);this._acceptCurr(c),r=u;continue}if(i.newPosition<r.oldPosition){const[c,u]=Zv._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]=Zv._splitPrev(i,r.oldLength);a=c,l=r,i=u,r=this._getCurr(++t)}else{const[c,u]=Zv._splitCurr(r,i.newLength);a=i,l=c,i=this._getPrev(++e),r=u}this._result[this._resultLen++]=new Wc(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const o=Zv._merge(this._result);return Zv._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=Zv._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++]=Zv._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 Wc(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new Wc(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 Wc(e.oldPosition,e.oldText,e.newPosition,i),new Wc(e.oldEnd,"",e.newPosition+t,r)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),r=e.oldText.substr(t);return[new Wc(e.oldPosition,i,e.newPosition,e.newText),new Wc(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 Wc(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 cC(n){return n===47||n===92}function GJe(n){return n.replace(/[\\/]/g,hl.sep)}function Rsr(n){return n.indexOf("/")===-1&&(n=GJe(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function lPe(n,e=hl.sep){if(!n)return"";const t=n.length,i=n.charCodeAt(0);if(cC(i)){if(cC(n.charCodeAt(1))&&!cC(n.charCodeAt(2))){let o=3;const s=o;for(;o<t&&!cC(n.charCodeAt(o));o++);if(s!==o&&!cC(n.charCodeAt(o+1))){for(o+=1;o<t;o++)if(cC(n.charCodeAt(o)))return n.slice(0,o+1).replace(/[\\/]/g,e)}}return e}else if(KJe(i)&&n.charCodeAt(1)===58)return cC(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(cC(n.charCodeAt(r)))return n.slice(0,r+1)}return""}function zce(n,e,t,i=dv){if(n===e)return!0;if(!n||!e||e.length>n.length)return!1;if(t){if(!d0e(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 KJe(n){return n>=65&&n<=90||n>=97&&n<=122}function Nsr(n,e=eu){return e?KJe(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function Gv(n){return QW(n,!0)}class Osr{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:I3(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===Qi.file)return zce(Gv(e),Gv(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(uPe(e.authority,t.authority))return zce(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Jn.joinPath(e,...t)}basenameOrAuthority(e){return Cg(e)||e.authority}basename(e){return hl.basename(e.path)}extname(e){return hl.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Qi.file?t=Jn.file(DXe(Gv(e))).path:(t=hl.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===Qi.file?t=Jn.file(LXe(Gv(e))).path:t=hl.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!uPe(e.authority,t.authority))return;if(e.scheme===Qi.file){const o=HQi(Gv(e),Gv(t));return eu?GJe(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 hl.relative(i,r)}resolvePath(e,t){if(e.scheme===Qi.file){const i=Jn.file(VQi(Gv(e),t));return e.with({authority:i.authority,path:i.path})}return t=Rsr(t),e.with({path:hl.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&rL(e,t)}hasTrailingPathSeparator(e,t=dv){if(e.scheme===Qi.file){const i=Gv(e);return i.length>lPe(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=dv){return dPe(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=dv){let i=!1;if(e.scheme===Qi.file){const r=Gv(e);i=r!==void 0&&r.length===lPe(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&&!dPe(e,t)?e.with({path:e.path+"/"}):e}}const bs=new Osr(()=>!1),iye=bs.isEqual.bind(bs);bs.isEqualOrParent.bind(bs);bs.getComparisonKey.bind(bs);const Psr=bs.basenameOrAuthority.bind(bs),Cg=bs.basename.bind(bs),Msr=bs.extname.bind(bs),XK=bs.dirname.bind(bs),Fsr=bs.joinPath.bind(bs),Bsr=bs.normalizePath.bind(bs),$sr=bs.relativePath.bind(bs),cPe=bs.resolvePath.bind(bs);bs.isAbsolutePath.bind(bs);const uPe=bs.isEqualAuthority.bind(bs),dPe=bs.hasTrailingPathSeparator.bind(bs);bs.removeTrailingPathSeparator.bind(bs);bs.addTrailingPathSeparator.bind(bs);var xS;(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})(xS||(xS={}));function i2(n){return n.toString()}class Gl{static create(e,t){const i=e.getAlternativeVersionId(),r=Uce(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=Asr(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(k_(e,t?t.length:0,i),i+=4,t)for(const r of t)k_(e,r.selectionStartLineNumber,i),i+=4,k_(e,r.selectionStartColumn,i),i+=4,k_(e,r.positionLineNumber,i),i+=4,k_(e,r.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const r=T_(e,t);t+=4;for(let o=0;o<r;o++){const s=T_(e,t);t+=4;const a=T_(e,t);t+=4;const l=T_(e,t);t+=4;const c=T_(e,t);t+=4,i.push(new kn(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;k_(t,this.beforeVersionId,i),i+=4,k_(t,this.afterVersionId,i),i+=4,WNe(t,this.beforeEOL,i),i+=1,WNe(t,this.afterEOL,i),i+=1,i=Gl._writeSelections(t,this.beforeCursorState,i),i=Gl._writeSelections(t,this.afterCursorState,i),k_(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=T_(t,i);i+=4;const o=T_(t,i);i+=4;const s=HNe(t,i);i+=1;const a=HNe(t,i);i+=1;const l=[];i=Gl._readSelections(t,i,l);const c=[];i=Gl._readSelections(t,i,c);const u=T_(t,i);i+=4;const d=[];for(let h=0;h<u;h++)i=Wc.read(t,i,d);return new Gl(r,o,s,a,l,c,d)}}class YJe{get type(){return 0}get resource(){return Jn.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(Jn.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(Jn.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(Jn.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 Vsr{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=i2(r.resource);this._editStackElementsMap.set(o,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=i2(e);return this._editStackElementsMap.has(t)}setModel(e){const t=i2(Jn.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=i2(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,r,o){const s=i2(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=i2(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(`${Cg(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Uce(n){return n.getEOL()===`
`?0:1}function _y(n){return n?n instanceof YJe||n instanceof Vsr:!1}class rye{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 YJe(T("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,[],Uce(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,r){const o=this._getOrCreateEditStackElement(e,r),s=this._model.applyEdits(t,!0),a=rye._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),Uce(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Pi(i),null}}}class Hsr{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Wsr(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),f=t.charCodeAt(o);if(h!==f)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 hPe(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 Hsr;for(let g=1;g<=i;g++){const m=n.getLineLength(g),v=n.getLineContent(g),_=m<=65536;let b=!1,y=0,C=0,E=0;for(let k=0,L=m;k<L;k++){const D=_?v.charCodeAt(k):n.getLineCharCode(g,k);if(D===9)E++;else if(D===32)C++;else{b=!0,y=k;break}}if(!b||(E>0?r++:C>1&&o++,Wsr(s,a,v,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const x=d.spacesDiff;x<=c&&u[x]++,s=v,a=y}let h=t;r!==o&&(h=r<o);let f=e;if(h){let g=h?0:.1*i;l.forEach(m=>{const v=u[m];v>g&&(g=v,f=m)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function Yd(n){return(n.metadata&1)>>>0}function ms(n,e){n.metadata=n.metadata&254|e<<0}function Jc(n){return(n.metadata&2)>>>1===1}function ss(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function QJe(n){return(n.metadata&4)>>>2===1}function fPe(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function XJe(n){return(n.metadata&64)>>>6===1}function pPe(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function zsr(n){return(n.metadata&24)>>>3}function gPe(n,e){n.metadata=n.metadata&231|e<<3}function Usr(n){return(n.metadata&32)>>>5===1}function mPe(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class ZJe{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ms(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,fPe(this,!1),pPe(this,!1),gPe(this,1),mPe(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,ss(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;fPe(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),pPe(this,this.options.glyphMarginClassName!==null),gPe(this,this.options.stickiness),mPe(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 ir=new ZJe(null,0,0);ir.parent=ir;ir.left=ir;ir.right=ir;ms(ir,0);class Lte{constructor(){this.root=ir,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,r,o,s){return this.root===ir?[]:Zsr(this,e,t,i,r,o,s)}search(e,t,i,r){return this.root===ir?[]:Xsr(this,e,t,i,r)}collectNodesFromOwner(e){return Ysr(this,e)}collectNodesPostOrder(){return Qsr(this)}insert(e){_Pe(this,e),this._normalizeDeltaIfNecessary()}delete(e){vPe(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=Gsr(this,e,e+t);for(let s=0,a=o.length;s<a;s++){const l=o[s];vPe(this,l)}this._normalizeDeltaIfNecessary(),Ksr(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,qsr(l,e,e+t,i,r),l.maxEnd=l.end,_Pe(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,jsr(this))}}function jsr(n){let e=n.root,t=0;for(;e!==ir;){if(e.left!==ir&&!Jc(e.left)){e=e.left;continue}if(e.right!==ir&&!Jc(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,TS(e),ss(e,!0),ss(e.left,!1),ss(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}ss(n.root,!1)}function r2(n,e,t,i){return n<t?!0:n>t||i===1?!1:i===2?!0:e}function qsr(n,e,t,i,r){const o=zsr(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 f=n.end;let g=!1;e<=d&&f<=t&&Usr(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const v=r?1:l>0?2:0;!h&&r2(d,s,e,v)&&(h=!0),!g&&r2(f,a,e,v)&&(g=!0)}if(u>0&&!r){const v=l>c?2:0;!h&&r2(d,s,e+u,v)&&(h=!0),!g&&r2(f,a,e+u,v)&&(g=!0)}{const v=r?1:0;!h&&r2(d,s,t,v)&&(n.start=e+c,h=!0),!g&&r2(f,a,t,v)&&(n.end=e+c,g=!0)}const m=c-l;h||(n.start=Math.max(0,d+m)),g||(n.end=Math.max(0,f+m)),n.start>n.end&&(n.end=n.start)}function Gsr(n,e,t){let i=n.root,r=0,o=0,s=0,a=0;const l=[];let c=0;for(;i!==ir;){if(Jc(i)){ss(i.left,!1),ss(i.right,!1),i===i.parent.right&&(r-=i.parent.delta),i=i.parent;continue}if(!Jc(i.left)){if(o=r+i.maxEnd,o<e){ss(i,!0);continue}if(i.left!==ir){i=i.left;continue}}if(s=r+i.start,s>t){ss(i,!0);continue}if(a=r+i.end,a>=e&&(i.setCachedOffsets(s,a,0),l[c++]=i),ss(i,!0),i.right!==ir&&!Jc(i.right)){r+=i.delta,i=i.right;continue}}return ss(n.root,!1),l}function Ksr(n,e,t,i){let r=n.root,o=0,s=0,a=0;const l=i-(t-e);for(;r!==ir;){if(Jc(r)){ss(r.left,!1),ss(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),TS(r),r=r.parent;continue}if(!Jc(r.left)){if(s=o+r.maxEnd,s<e){ss(r,!0);continue}if(r.left!==ir){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),ss(r,!0);continue}if(ss(r,!0),r.right!==ir&&!Jc(r.right)){o+=r.delta,r=r.right;continue}}ss(n.root,!1)}function Ysr(n,e){let t=n.root;const i=[];let r=0;for(;t!==ir;){if(Jc(t)){ss(t.left,!1),ss(t.right,!1),t=t.parent;continue}if(t.left!==ir&&!Jc(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[r++]=t),ss(t,!0),t.right!==ir&&!Jc(t.right)){t=t.right;continue}}return ss(n.root,!1),i}function Qsr(n){let e=n.root;const t=[];let i=0;for(;e!==ir;){if(Jc(e)){ss(e.left,!1),ss(e.right,!1),e=e.parent;continue}if(e.left!==ir&&!Jc(e.left)){e=e.left;continue}if(e.right!==ir&&!Jc(e.right)){e=e.right;continue}t[i++]=e,ss(e,!0)}return ss(n.root,!1),t}function Xsr(n,e,t,i,r){let o=n.root,s=0,a=0,l=0;const c=[];let u=0;for(;o!==ir;){if(Jc(o)){ss(o.left,!1),ss(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==ir&&!Jc(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&&QJe(o)&&(d=!1),r&&!XJe(o)&&(d=!1),d&&(c[u++]=o),ss(o,!0),o.right!==ir&&!Jc(o.right)){s+=o.delta,o=o.right;continue}}return ss(n.root,!1),c}function Zsr(n,e,t,i,r,o,s){let a=n.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==ir;){if(Jc(a)){ss(a.left,!1),ss(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Jc(a.left)){if(c=l+a.maxEnd,c<e){ss(a,!0);continue}if(a.left!==ir){a=a.left;continue}}if(u=l+a.start,u>t){ss(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,o);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),r&&QJe(a)&&(g=!1),s&&!XJe(a)&&(g=!1),g&&(h[f++]=a)}if(ss(a,!0),a.right!==ir&&!Jc(a.right)){l+=a.delta,a=a.right;continue}}return ss(n.root,!1),h}function _Pe(n,e){if(n.root===ir)return e.parent=ir,e.left=ir,e.right=ir,ms(e,0),n.root=e,n.root;Jsr(n,e),wC(e.parent);let t=e;for(;t!==n.root&&Yd(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Yd(i)===1?(ms(t.parent,0),ms(i,0),ms(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,WM(n,t)),ms(t.parent,0),ms(t.parent.parent,1),zM(n,t.parent.parent))}else{const i=t.parent.parent.left;Yd(i)===1?(ms(t.parent,0),ms(i,0),ms(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,zM(n,t)),ms(t.parent,0),ms(t.parent.parent,1),WM(n,t.parent.parent))}return ms(n.root,0),e}function Jsr(n,e){let t=0,i=n.root;const r=e.start,o=e.end;for(;;)if(tar(r,o,i.start+t,i.end+t)<0)if(i.left===ir){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===ir){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=ir,e.right=ir,ms(e,1)}function vPe(n,e){let t,i;if(e.left===ir?(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===ir?(t=e.left,i=e):(i=ear(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,ms(t,0),e.detach(),Dte(),TS(t),n.root.parent=ir;return}const r=Yd(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,ms(i,Yd(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==ir&&(i.left.parent=i),i.right!==ir&&(i.right.parent=i)),e.detach(),r){wC(t.parent),i!==e&&(wC(i),wC(i.parent)),Dte();return}wC(t),wC(t.parent),i!==e&&(wC(i),wC(i.parent));let o;for(;t!==n.root&&Yd(t)===0;)t===t.parent.left?(o=t.parent.right,Yd(o)===1&&(ms(o,0),ms(t.parent,1),WM(n,t.parent),o=t.parent.right),Yd(o.left)===0&&Yd(o.right)===0?(ms(o,1),t=t.parent):(Yd(o.right)===0&&(ms(o.left,0),ms(o,1),zM(n,o),o=t.parent.right),ms(o,Yd(t.parent)),ms(t.parent,0),ms(o.right,0),WM(n,t.parent),t=n.root)):(o=t.parent.left,Yd(o)===1&&(ms(o,0),ms(t.parent,1),zM(n,t.parent),o=t.parent.left),Yd(o.left)===0&&Yd(o.right)===0?(ms(o,1),t=t.parent):(Yd(o.left)===0&&(ms(o.right,0),ms(o,1),WM(n,o),o=t.parent.left),ms(o,Yd(t.parent)),ms(t.parent,0),ms(o.left,0),zM(n,t.parent),t=n.root));ms(t,0),Dte()}function ear(n){for(;n.left!==ir;)n=n.left;return n}function Dte(){ir.parent=ir,ir.delta=0,ir.start=0,ir.end=0}function WM(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!==ir&&(t.left.parent=e),t.parent=e.parent,e.parent===ir?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,TS(e),TS(t)}function zM(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!==ir&&(t.right.parent=e),t.parent=e.parent,e.parent===ir?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,TS(e),TS(t)}function JJe(n){let e=n.end;if(n.left!==ir){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==ir){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function TS(n){n.maxEnd=JJe(n)}function wC(n){for(;n!==ir;){const e=JJe(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function tar(n,e,t,i){return n===t?e-i:n-t}class jce{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!==Ri)return oye(this.right);let e=this;for(;e.parent!==Ri&&e.parent.left!==e;)e=e.parent;return e.parent===Ri?Ri:e.parent}prev(){if(this.left!==Ri)return eet(this.left);let e=this;for(;e.parent!==Ri&&e.parent.right!==e;)e=e.parent;return e.parent===Ri?Ri:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Ri=new jce(null,0);Ri.parent=Ri;Ri.left=Ri;Ri.right=Ri;Ri.color=0;function oye(n){for(;n.left!==Ri;)n=n.left;return n}function eet(n){for(;n.right!==Ri;)n=n.right;return n}function sye(n){return n===Ri?0:n.size_left+n.piece.length+sye(n.right)}function aye(n){return n===Ri?0:n.lf_left+n.piece.lineFeedCnt+aye(n.right)}function Ate(){Ri.parent=Ri}function UM(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!==Ri&&(t.left.parent=e),t.parent=e.parent,e.parent===Ri?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function jM(n,e){const t=e.left;e.left=t.right,t.right!==Ri&&(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===Ri?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function X9(n,e){let t,i;if(e.left===Ri?(i=e,t=i.right):e.right===Ri?(i=e,t=i.left):(i=oye(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),Ate(),n.root.parent=Ri;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,IP(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,IP(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!==Ri&&(i.left.parent=i),i.right!==Ri&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,IP(n,i)),e.detach(),t.parent.left===t){const s=sye(t),a=aye(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(IP(n,t.parent),r){Ate();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,UM(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,jM(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,UM(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,jM(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,UM(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,jM(n,t.parent),t=n.root));t.color=0,Ate()}function bPe(n,e){for(IP(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,UM(n,e)),e.parent.color=0,e.parent.parent.color=1,jM(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,jM(n,e)),e.parent.color=0,e.parent.parent.color=1,UM(n,e.parent.parent))}n.root.color=0}function oy(n,e,t,i){for(;e!==n.root&&e!==Ri;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function IP(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=sye(e.left)-e.size_left,i=aye(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 Y0=65535;function tet(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 nar{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?tet(t):t}function iar(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 nar(tet(n),i,r,o,s);return n.length=0,a}class kh{constructor(e,t,i,r,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=r,this.length=o}}class Tx{constructor(e,t){this.buffer=e,this.lineStarts=t}}class rar{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ri&&e.iterate(e.root,i=>(i!==Ri&&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 oar{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 sar{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Tx("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ri,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 kh(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 oar(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Y0,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 Tx(d,uy(d))),o=c,s=u,!0}),s>0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new Tx(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 rar(this,e)}getOffsetAt(e,t){let i=0,r=this.root;for(;r!==Ri;)if(r.left!==Ri&&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!==Ri;)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 Re(i+1,a+1)}return new Re(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ri){const o=this.getOffsetAt(i+1,1),s=r-e-o;return new Re(i+1,s+1)}else t=t.right;return new Re(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!==Ri;){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===Ri)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 f=u+1;f<d;f++)i=this._EOLNormalized?l.substring(c[f],c[f+1]-this._EOLLength):l.substring(c[f],c[f+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],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),m=this.offsetInBuffer(e.piece.bufferIndex,s);let v;const _={line:0,column:0};let b,y;t._wordSeparators?(b=h.buffer.substring(g,m),y=C=>C+g,t.reset(0)):(b=h.buffer,y=C=>C,t.reset(g));do if(v=t.next(b),v){if(y(v.index)>=m)return u;this.positionInBuffer(e,y(v.index)-f,_);const C=this.getLineFeedCnt(e.piece.bufferIndex,o,_),E=_.line===o.line?_.column-o.column+r:_.column+1,x=E+v[0].length;if(d[u++]=yx(new J(i+C,E,i+C,x),v,l),y(v.index)+v[0].length>=m||u>=c)return u}while(v);return u}findMatchesLineByLine(e,t,i,r){const o=[];let s=0;const a=new aL(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,f=l.node;for(;f!==c.node;){const m=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(m>=1){const _=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=_[u.line+m],C=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,C,u,this.positionInBuffer(f,y-b),t,i,r,s,o),s>=r)return o;h+=m}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const _=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,_,e.endLineNumber,v,s,o,i,r),o}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,o,i,r),s>=r)return o;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const m=h===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(h).substring(m,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,m,s,o,i,r),o}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,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,f=h.length,g=i.length;let m=-f;for(;(m=i.indexOf(h,m+f))!==-1;)if((!u||T0e(u,i,g,m,f))&&(a[s++]=new P3(new J(r,m+1+o,r,m+1+f+o),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(i),d&&(a[s++]=yx(new J(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!==Ri){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<Y0){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 kh(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 kh(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 f=r;for(let g=0;g<h.length;g++)f=this.rbInsertRight(f,h[g]);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===Ri)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),f=this.positionInBuffer(o,r.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const g=o.next();X9(this,o),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(o,f),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,f),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!==Ri&&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 kh(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,f=0;for(;c<=u&&(d=c+(u-c)/2|0,f=s[d],d!==u);)if(h=s[d+1],l<f)u=d-1;else if(l>=h)c=d+1;else break;return i?(i.line=d,i.column=l-f,null):{line:d,column:l-f}}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++)X9(this,e[t])}createNewPieces(e){if(e.length>Y0){const u=[];for(;e.length>Y0;){const h=e.charCodeAt(Y0-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Y0-1),e=e.substring(Y0-1)):(f=e.substring(0,Y0),e=e.substring(Y0));const g=uy(f);u.push(new kh(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new Tx(f,g))}const d=uy(e);return u.push(new kh(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 Tx(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 kh(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!==Ri;)if(i.left!==Ri&&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!==Ri;){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!==Ri;)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 kh(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 kh(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 kh(r.bufferIndex,r.start,c,u,d),oy(this,e,d-a,u-l);const h=new kh(r.bufferIndex,i,s,this.getLineFeedCnt(r.bufferIndex,i,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,i)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}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 f=0;f<o.length;f++)o[f]+=r;if(i){const f=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-f}}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 kh(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!==Ri;)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!==Ri;)if(i.left!==Ri&&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!==Ri;){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===Ri||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===Ri||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 kh(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 kh(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++)X9(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)X9(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 kh(r.bufferIndex,o,r.end,a,s),oy(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===Ri)return t(Ri);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===Ri)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 jce(t,1);if(i.left=Ri,i.right=Ri,i.parent=Ri,i.size_left=0,i.lf_left=0,this.root===Ri)this.root=i,i.color=0;else if(e.right===Ri)e.right=i,i.parent=e;else{const o=oye(e.right);o.left=i,i.parent=o}return bPe(this,i),i}rbInsertLeft(e,t){const i=new jce(t,1);if(i.left=Ri,i.right=Ri,i.parent=Ri,i.size_left=0,i.lf_left=0,this.root===Ri)this.root=i,i.color=0;else if(e.left===Ri)e.left=i,i.parent=e;else{const r=eet(e.left);r.right=i,i.parent=r}return bPe(this,i),i}}class dD extends qe{constructor(e,t,i,r,o,s,a){super(),this._onDidChangeContent=this._register(new De),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._pieceTree=new sar(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 J(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++)Rl(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=Gu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=hv(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 v=e[m];a&&v._isTracked&&(a=!1);const _=v.range;if(v.text){let x=!0;s||(x=!x6(v.text),s=x),!r&&x&&(r=CA(v.text)),!o&&x&&(o=WXe(v.text))}let b="",y=0,C=0,E=0;if(v.text){let x;[y,C,E,x]=ES(v.text);const k=this.getEOL();x===0||x===(k===`\r
`?2:1)?b=v.text:b=v.text.replace(/\r\n|\r|\n/g,k)}l[m]={sortIndex:m,identifier:v.identifier||null,range:_,rangeOffset:this.getOffsetAt(_.startLineNumber,_.startColumn),rangeLength:this.getValueLengthInRange(_),text:b,eolCount:y,firstLineLength:C,lastLineLength:E,forceMoveMarkers:!!v.forceMoveMarkers,isAutoWhitespaceEdit:v.isAutoWhitespaceEdit||!1}}l.sort(dD._sortOpsAscending);let c=!1;for(let m=0,v=l.length-1;m<v;m++){const _=l[m].range.getEndPosition(),b=l[m+1].range.getStartPosition();if(b.isBeforeOrEqual(_)){if(b.isBefore(_))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const u=i||t?dD._getInverseEditRanges(l):[],d=[];if(t)for(let m=0;m<l.length;m++){const v=l[m],_=u[m];if(v.isAutoWhitespaceEdit&&v.range.isEmpty())for(let b=_.startLineNumber;b<=_.endLineNumber;b++){let y="";b===_.startLineNumber&&(y=this.getLineContent(v.range.startLineNumber),Gu(y)!==-1)||d.push({lineNumber:b,oldContent:y})}}let h=null;if(i){let m=0;h=[];for(let v=0;v<l.length;v++){const _=l[v],b=u[v],y=this.getValueInRange(_.range),C=_.rangeOffset+m;m+=_.text.length-y.length,h[v]={sortIndex:_.sortIndex,identifier:_.identifier,range:b,text:y,textChange:new Wc(_.rangeOffset,y,C,_.text)}}c||h.sort((v,_)=>v.sortIndex-_.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((m,v)=>v.lineNumber-m.lineNumber),g=[];for(let m=0,v=d.length;m<v;m++){const _=d[m].lineNumber;if(m>0&&d[m-1].lineNumber===_)continue;const b=d[m].oldContent,y=this.getLineContent(_);y.length===0||y===b||Gu(y)!==-1||g.push(_)}}return this._onDidChangeContent.fire(),new her(h,f,g)}_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 J(i.startLineNumber,i.startColumn,r.endLineNumber,r.endColumn);let s=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f<g;f++){const m=e[f],v=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new J(s,a,v.startLineNumber,v.startColumn))),m.text.length>0&&l.push(m.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[u,d,h]=ES(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(dD._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 J(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 J(c,u,c,u+l.firstLineLength):d=new J(c,u,c+h-1,l.lastLineLength+1)}else d=new J(c,u,c,u);i=d.endLineNumber,r=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const i=J.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=J.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class aar{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 Tx(a,l)}const r=new dD(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:r,disposable:r}}}class net{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&&m0e(e)&&(this.BOM=fXi,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=iar(this._tmpLineStarts,e);this.chunks.push(new Tx(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=CA(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=WXe(e)))}finish(e=!0){return this._finish(),new aar(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 lar{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=car(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=hK(this._store,e,i)}}function car(n,e){const t=[];for(let i=0;i<n;i++)t[i]=e;return t}class uar{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 qce{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 uar(e,[t]))}finalize(){return this._tokens}}class dar{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new Gce(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class har extends dar{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=PO(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=PO(this._languageIdCodec,r,this.tokenizationSupport,s,!0,i),l=new Ol(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=PO(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new Ol(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=PO(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=PO(this._languageIdCodec,o,this.tokenizationSupport,a,!1,s).endState;return s}}class Gce{constructor(e){this.lineCount=e,this._tokenizationStateStore=new far,this._invalidEndStatesLineNumbers=new par,this._invalidEndStatesLineNumbers.addRange(new ar(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 ar(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new ar(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[i]=ES(t.text);this.acceptChange(new hr(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new ar(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 far{constructor(){this._lineEndStates=new lar(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 par{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 ar(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new ar(i.start,e):this._ranges.splice(t,1,new ar(i.start,e),new ar(e+1,i.endExclusive))}}addRange(e){ar.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 ar(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 ar(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 PO(n,e,t,i,r,o){let s=null;if(t)try{s=t.tokenizeEncoded(i,r,o.clone())}catch(a){Pi(a)}return s||(s=$K(n.encodeLanguageId(e),o)),Ol.convertToEndOffset(s.tokens,i.length),s}class gar{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,My(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?fXe(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new qce,i=wu.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 hr(e,t))}}const dy=new Uint32Array(0).buffer;class eb{static deleteBeginning(e,t){return e===null||e===dy?e:eb.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 eb.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=Ol.findIndexInTokensArray(r,t),a=s>0?r[s-1<<1]:0,l=r[s<<1];if(i<l){const f=i-t;for(let g=s;g<o;g++)r[g<<1]-=f;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 f=s+1;f<o;f++){const g=r[f<<1]-d;g>u&&(r[c++]=g,r[c++]=r[(f<<1)+1],u=g)}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=Ol.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 r5{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 Ol(xy(r),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=yPe(this._languageIdCodec.encodeLanguageId(e)),new Ol(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=Gc.getLanguageId(r[1])!==e),!o)return dy}if(!r||r.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=yPe(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=hK(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,r,o){const s=r5._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,r);this._ensureLine(t);const a=this._lineTokens[t];return this._lineTokens[t]=s,o?!r5._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 Re(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]=eb.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=eb.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let r=null;i<this._len&&(r=eb.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=eb.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]=eb.insert(this._lineTokens[r],e.column-1,i);return}this._lineTokens[r]=eb.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=eb.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 yPe(n){return(n<<0|0|0|32768|2<<24|1024)>>>0}class lye{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=hK(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=lye._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=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f<a;f++){const g=o.getStartCharacter(f),m=o.getEndCharacter(f),v=o.getMetadata(f),_=((v&1?2048:0)|(v&2?4096:0)|(v&4?8192:0)|(v&8?16384:0)|(v&16?16744448:0)|(v&32?4278190080:0))>>>0,b=~_>>>0;for(;l<s&&t.getEndOffset(l)<=g;)h(t.getEndOffset(l),t.getMetadata(l)),l++;for(l<s&&t.getStartOffset(l)<g&&h(g,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 Ol(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 Lz extends OJe{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 lye(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new De),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new De),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new De),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new mar(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]=ES(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]=Lz._findLanguageBoundaries(r,o),l=E3(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]=Lz._findLanguageBoundaries(r,o-1),d=E3(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 Re(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 mar extends qe{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 Ac),this._tokens=new r5(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new Ac),this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new De),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new De),this.onDidChangeTokens=this._onDidChangeTokens.event,this._attachedViewStates=this._register(new r0e),this._register(Ks.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 _ar(()=>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 Gce(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=Ks.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return Pi(l),[null,null]}return[s,a]},[r,o]=i();if(r&&o?this._tokenizer=new har(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 gar(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),r!=null&&r.backgroundTokenizerShouldOnlyVerifyTokens&&r.createBackgroundTokenizer?(this._debugBackgroundTokens=new r5(this._languageIdCodec),this._debugBackgroundStates=new Gce(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]=ES(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=hr.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 qce,{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 qce;(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 Re(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 _ar extends qe{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Mo(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){ka(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 bar{constructor(){this.changeType=1}}class Cv{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 Cv(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Cv(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 CPe{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class yar{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Car{constructor(e,t,i,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class war{constructor(){this.changeType=5}}class hD{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 hD(i,r,o,s)}}class iet{constructor(e){this.changes=e}}class _T{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=hD.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=_T._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new _T(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 ZK=lr("undoRedoService");class ret{constructor(e,t){this.resource=e,this.elements=t}}class MA{constructor(){this.id=MA._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}MA._ID=0;MA.None=new MA;class wb{constructor(){this.id=wb._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}wb._ID=0;wb.None=new wb;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},Rte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sx;function Ear(n){const e=new net;return e.acceptChunk(n),e.finish()}function xar(n){const e=new net;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function wPe(n,e){let t;return typeof n=="string"?t=Ear(n):uer(n)?t=xar(n):t=n,t.create(e)}let Z9=0;const Tar=999,kar=1e4;class Iar{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 MO=()=>{throw new Error("Invalid change accessor")};let h0=sx=class extends qe{static resolveOptions(e,t){if(t.detectIndentation){const i=hPe(e,t.tabSize,t.insertSpaces);return new Z$({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Z$(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 xm(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 De),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Nar(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new De),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new De),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new De),this._eventEmitter=this._register(new Oar),this._languageSelectionListener=this._register(new Ac),this._deltaDecorationCallCnt=0,this._attachedViews=new Par,Z9++,this.id="$model"+Z9,this.isForSimpleWidget=i.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=Jn.parse("inmemory://model/"+Z9):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=wPe(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=sx.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 Isr(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new wor(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Dsr(this)),this._tokenizationTextModelPart=new Lz(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new J(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>sx.LARGE_FILE_SIZE_THRESHOLD||d>sx.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>sx.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>sx._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=zXe(Z9),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new SPe,this._commandManager=new rye(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 dD([],"",`
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=qe.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 _T(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw ag();const{textBuffer:t,disposable:i}=wPe(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 SPe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new hD([new bar],this._versionId,!1,!1),this._createContentChanged2(new J(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 hD([new war],this._versionId,!1,!1),this._createContentChanged2(new J(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,TS(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>=kar?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 Z$({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=hPe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),Cz(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(HXe.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 Iar(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 J&&!(e instanceof kn)?e:new J(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(Rl(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 Re(1,1);if(r>s)return new Re(s,this.getLineMaxColumn(s));if(o<=1)return new Re(r,1);const a=this.getLineMaxColumn(r);if(o>=a)return new Re(r,a);if(i===1){const l=this._buffer.getLineCharCode(r,o-2);if(Rl(l))return new Re(r,o-1)}return new Re(r,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof Re&&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=Rl(a),u=Rl(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof J&&!(e instanceof kn)&&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=Rl(c),h=Rl(u);return!d&&!h?new J(o,s,a,l):o===a&&s===l?new J(o,s-1,a,l-1):d&&h?new J(o,s-1,a,l+1):d?new J(o,s-1,a,l):new J(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 J(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=Tar){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>J.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)=>J.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!i&&e.indexOf(`
`)<0){const h=new ox(e,i,r,o).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>F9.findMatches(this,new ox(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 ox(e,i,r,o).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new J(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return F9.findNextMatch(this,new ox(e,i,r,o),a,s),h.length>0||(d=new J(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return F9.findNextMatch(this,new ox(e,i,r,o),a,s)}findPreviousMatch(e,t,i,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);return F9.findPreviousMatch(this,new ox(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 hte?e:new hte(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 f=o[d].range,g=f.startLineNumber>c.endLineNumber,m=c.startLineNumber>f.endLineNumber;if(!g&&!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,f=o.length;h<f;h++){const g=o[h].range,m=o[h].text;if(!(c<g.startLineNumber||c>g.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===u&&g.isEmpty()&&m&&m.length>0&&m.charAt(0)===`
`)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===`
`)){d=!1;break}}if(d){const h=new J(c,1,c,u);t.push(new hte(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 J(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 J(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]=ES(d.text);this._onDidChangeDecorations.fire();const f=d.range.startLineNumber,g=d.range.endLineNumber,m=g-f,v=h,_=Math.min(m,v),b=v-m,y=o-l-b+f,C=y,E=y+v,x=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new Re(C,1)),this.getOffsetAt(new Re(E,this.getLineMaxColumn(E))),0),k=Cv.fromDecorations(x),L=new C1(k);for(let D=_;D>=0;D--){const A=f+D,N=y+D;L.takeFromEndWhile(M=>M.lineNumber>N);const P=L.takeFromEndWhile(M=>M.lineNumber===N);a.push(new CPe(A,this.getLineContent(N),P))}if(_<m){const D=f+_;a.push(new yar(D+1,g))}if(_<v){const D=new C1(k),A=f+_,N=v-_,P=o-l-N+A+1,M=[],B=[];for(let F=0;F<N;F++){const U=P+F;B[F]=this.getLineContent(U),D.takeWhile(H=>H.lineNumber<U),M[F]=D.takeWhile(H=>H.lineNumber===U)}a.push(new Car(A+1,f+v,B,M))}l+=b}this._emitContentChangedEvent(new hD(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 CPe(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new iet(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,xPe(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){Pi(o)}return i.addDecoration=MO,i.changeDecoration=MO,i.changeDecorationOptions=MO,i.removeDecoration=MO,i.deltaDecorations=MO,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."),Pi(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:EPe[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(EPe[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 J(a,1,l,c),d=this._getDecorationsInRange(u,i,r,o);return sle(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 sle(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 Cv.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 _=++this._lastDecorationId,b=`${this._instanceId};${_}`;d=new ZJe(b,0,0),this._decorations[b]=d}const h=i[c],f=this._validateRangeRelaxedNoAllocations(h.range),g=xPe(h.options),m=this._buffer.getOffsetAt(f.startLineNumber,f.startColumn),v=this._buffer.getOffsetAt(f.endLineNumber,f.endColumn);d.ownerId=e,d.reset(o,m,v,f),d.setOptions(g),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.startLineNumber),r||this._onDidChangeDecorations.checkAffectedAndFire(g),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 Lar(this.getLineContent(e))+1}};h0._MODEL_SYNC_LIMIT=50*1024*1024;h0.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;h0.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;h0.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;h0.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:pu.tabSize,indentSize:pu.indentSize,insertSpaces:pu.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:pu.trimAutoWhitespace,largeFileOptimizations:pu.largeFileOptimizations,bracketPairColorizationOptions:pu.bracketPairColorizationOptions};h0=sx=Sar([Rte(4,ZK),Rte(5,Es),Rte(6,es)],h0);function Lar(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function Nte(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function Ote(n){return!!n.options.after||!!n.options.before}class SPe{constructor(){this._decorationsTree0=new Lte,this._decorationsTree1=new Lte,this._injectedTextDecorationsTree=new Lte}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){Ote(e)?this._injectedTextDecorationsTree.insert(e):Nte(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Ote(e)?this._injectedTextDecorationsTree.delete(e):Nte(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){Ote(e)?this._injectedTextDecorationsTree.resolveNode(e,t):Nte(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 Q0(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class oet{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Dar extends oet{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:tp.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 Aar{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:nD.Left}}class Rar extends oet{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"?je.fromHex(e):t.getColor(e.id)}}class kS{static from(e){return e instanceof kS?e:new kS(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 Oi{static register(e){return new Oi(e)}static createDynamic(e){return new Oi(e)}constructor(e){var t,i,r,o,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Q0(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?Q0(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 Dar(e.overviewRuler):null,this.minimap=e.minimap?new Rar(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Aar(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Q0(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Q0(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Q0(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Q0(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Q0(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Q0(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Q0(e.afterContentClassName):null,this.after=e.after?kS.from(e.after):null,this.before=e.before?kS.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}}Oi.EMPTY=Oi.register({description:"empty"});const EPe=[Oi.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Oi.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Oi.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Oi.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function xPe(n){return n instanceof Oi?n:Oi.createDynamic(n)}class Nar extends qe{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new De),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 Oar extends qe{constructor(){super(),this._fastEmitter=this._register(new De),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new De),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 Par{constructor(){this._onDidChangeVisibleRanges=new De,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Mar(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 Mar{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(r=>new hr(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class Dz{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new _c(new J(1,1,1,1),0,0,new Re(1,1),0),new _c(new J(1,1,1,1),0,0,new Re(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 Nr(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?kn.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):kn.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 _c(J.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=Dz._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 _c(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 _c(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 _c(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new Re(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new Re(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new J(r.lineNumber,r.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new _c(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class TPe{constructor(e){this.context=e,this.cursors=[new Dz(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 wer(this.cursors,sg(e=>e.viewState.position,Re.compare)).viewState.position}getBottomMostViewPosition(){return Cer(this.cursors,sg(e=>e.viewState.position,Re.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(Nr.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 Dz(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(sg(i=>i.selection,J.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,f=t[u].selection,g=t[c].selection;if(!f.equalsSelection(g)){const m=f.plusRange(g),v=f.selectionStartLineNumber===f.startLineNumber&&f.selectionStartColumn===f.startColumn,_=g.selectionStartLineNumber===g.startLineNumber&&g.selectionStartColumn===g.startColumn;let b;d===this.lastAddedCursorIndex?(b=v,this.lastAddedCursorIndex=h):b=_;let y;b?y=new kn(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):y=new kn(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn),t[c].selection=y;const C=Nr.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 kPe{constructor(e,t,i,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=r}}class Far{constructor(){this.type=0}}class Bar{constructor(){this.type=1}}class $ar{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Var{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class o2{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 J9{constructor(){this.type=5}}class Har{constructor(e){this.type=6,this.isFocused=e}}class War{constructor(){this.type=7}}class e7{constructor(){this.type=8}}class set{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class Kce{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Yce{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class aV{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 zar{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 Uar{constructor(e){this.theme=e,this.type=14}}class jar{constructor(e){this.type=15,this.ranges=e}}class qar{constructor(){this.type=16}}let Gar=class{constructor(){this.type=17}};class Kar extends qe{constructor(){super(),this._onEvent=this._register(new De),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 Yar),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 Yar{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class cye{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 cye(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class uye{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 uye(this.oldHasFocus,e.hasFocus)}}class dye{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 dye(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Qar{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Xar{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Az{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 Az._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new Az(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class Zar{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Jar{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class elr{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class tlr{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class nlr{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class ilr{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class rlr{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class olr extends qe{constructor(e,t,i,r){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new kPe(this._model,this._viewModel,this._coordinatesConverter,r),this._cursors=new TPe(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=_o(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new kPe(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=qM.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=J.fromPositions(a[0],a[0]),e.emitViewEvent(new aV(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,Nr.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof iet){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 TPe(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const o=Nr.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,Nr.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,Nr.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 IPe(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=slr.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 LJe&&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=qM.from(this._model,this);if(s.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Var(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 Az(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[f,g]=o[d],m=c[d],v=m.range.startLineNumber,_=m.range.startColumn-1+f,b=m.range.startColumn-1+g;s.push(new J(v,b+1,v,b+2)),a.push(new J(v,_+1,v,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=qM.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){Pi(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 IPe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new GM(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(Os.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=p0e(t,o),a=t.substr(o,s);this._executeEditOperation(Os.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=s}}else this._executeEditOperation(Os.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 kn(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Os.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(Os.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,r||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(ek.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Kd(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Kd(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class qM{static from(e,t){return new qM(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 IPe{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(J.compareRangesUsingStarts),e.sort(J.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class slr{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 f=0;f<e.selectionsBefore.length;f++)u[f]=[];for(const f of c)f.identifier&&u[f.identifier.major].push(f);const d=(f,g)=>f.identifier.minor-g.identifier.minor,h=[];for(let f=0;f<e.selectionsBefore.length;f++)u[f].length>0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const m=parseInt(g,10),v=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new kn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new kn(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];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,f=!1)=>{J.isEmpty(d)&&h===""||r.push({identifier:{major:t,minor:o++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=kn.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const _=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===_?g=2:g=3}else g=1;const m=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[m]=v,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,u)}catch(d){return Pi(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,r)=>-J.compareRangesUsingEnds(i.range,r.range));const t={};for(let i=1;i<e.length;i++){const r=e[i-1],o=e[i];if(J.getStartPosition(r.range).isBefore(J.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 alr{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class GM{static _capture(e,t){const i=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;i.push(new alr(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return i}constructor(e,t){this._original=GM._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=GM._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(GM._deduceOutcome(this._original[o],i[o]));return r}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,KT(e.text,t.text)),r=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,ez(e.text,t.text)),o=e.text.substring(i,e.text.length-r),s=t.text.substring(i,t.text.length-r);return new cor(o,e.startSelection-i,e.endSelection-i,s,t.startSelection-i,t.endSelection-i)}}var llr=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 LPe={getInitialState:()=>IA,tokenizeEncoded:(n,e,t)=>$K(0,t)};function clr(n,e,t){return llr(this,void 0,void 0,function*(){if(!t)return DPe(e,n.languageIdCodec,LPe);const i=yield Ks.getOrCreate(t);return DPe(e,n.languageIdCodec,i||LPe)})}function ulr(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 f=e.getEndOffset(d);if(f<=i)continue;let g="";for(;l<f&&l<r;l++){const m=n.charCodeAt(l);switch(m){case 9:{let v=o-(l+c)%o;for(c+=v-1;v>0;)s&&u?(g+="&#160;",u=!1):(g+=" ",u=!0),v--;break}case 60:g+="&lt;",u=!1;break;case 62:g+="&gt;",u=!1;break;case 38:g+="&amp;",u=!1;break;case 0:g+="&#00;",u=!1;break;case 65279:case 8232:case 8233:case 133:g+="<22>",u=!1;break;case 13:g+="&#8203",u=!1;break;case 32:s&&u?(g+="&#160;",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(m),u=!1}}if(a+=`<span style="${e.getInlineStyle(d,t)}">${g}</span>`,f>r||l>=r)break}return a+="</div>",a}function DPe(n,e,t){let i='<div class="monaco-tokenized-source">';const r=a0(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);Ol.convertToEndOffset(c.tokens,l.length);const d=new Ol(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f<g;f++){const m=d.getClassName(f),v=d.getEndOffset(f);i+=`<span class="${m}">${JW(l.substring(h,v))}</span>`,h=v}o=c.endState}return i+="</div>",i}class dlr{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 hlr{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 aet=class Qce{constructor(e,t,i,r){this._instanceId=zXe(++Qce.INSTANCE_COUNT),this._pendingChanges=new dlr,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 hlr(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=Qce.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 f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,h-=g);const m=[],v=e+(t-e)/2;let _=-1;for(let E=r;E<=s;E++){if(_===-1){const x=d,k=d+i;(x<=v&&v<k||x>v)&&(_=E)}for(d+=i,m[E-r]=h,h+=i;u===E;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=E;break}}_===-1&&(_=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:g,startLineNumber:r,endLineNumber:s,relativeVerticalOffset:m,centeredLineNumber:_,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}};aet.INSTANCE_COUNT=0;const flr=125;class LP{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 plr extends qe{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new De),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new LP(0,0,0,0),this._scrollable=this._register(new O6({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 cye(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 glr extends qe{constructor(e,t,i){super(),this._configuration=e;const r=this._configuration.options,o=r.get(143),s=r.get(83);this._linesLayout=new aet(t,r.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new plr(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new LP(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)?flr: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 LP(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 LP(t,e.contentWidth,i,this._getContentHeight(t,i,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new SOe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new SOe(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 LP(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 mlr{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 Re(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new Re(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);s=new J(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(r,1);i=new YZe(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 J(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,qW(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],f=h.options;if(!hye(this.model,h))continue;const g=this._getOrCreateViewModelDecoration(h),m=g.range;if(a[l++]=g,f.inlineClassName){const v=new PM(m,f.inlineClassName,f.inlineClassNameAffectsLetterSpacing?3:0),_=Math.max(o,m.startLineNumber),b=Math.min(s,m.endLineNumber);for(let y=_;y<=b;y++)c[y-o].push(v)}if(f.beforeContentClassName&&o<=m.startLineNumber&&m.startLineNumber<=s){const v=new PM(new J(m.startLineNumber,m.startColumn,m.startLineNumber,m.startColumn),f.beforeContentClassName,1);c[m.startLineNumber-o].push(v)}if(f.afterContentClassName&&o<=m.endLineNumber&&m.endLineNumber<=s){const v=new PM(new J(m.endLineNumber,m.endColumn,m.endLineNumber,m.endColumn),f.afterContentClassName,2);c[m.endLineNumber-o].push(v)}}return{decorations:a,inlineDecorations:c}}}function hye(n,e){return!(e.options.hideInCommentTokens&&fye(n,e)||e.options.hideInStringTokens&&pye(n,e))}function fye(n,e){return cet(n,e.range,t=>t===1)}function pye(n,e){return cet(n,e.range,t=>t===2)}function cet(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 Pte(n,e){return n===null?e?Rz.INSTANCE:Nz.INSTANCE:new _lr(n,e)}class _lr{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 Cv(0,0,c+1,this._projectionData.injectionOptions[u],0));s=Cv.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=APe(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 f=0,g=0;for(let m=0;m<l.getOutputLineCount();m++){const v=new Array;d[m]=v;const _=m>0?l.breakOffsets[m-1]:0,b=l.breakOffsets[m];for(;g<c.length;){const y=u[g].content.length,C=c[g]+f,E=C+y;if(C>b)break;if(_<E){const x=u[g];if(x.inlineClassName){const k=m>0?l.wrappedTextIndentLength:0,L=k+Math.max(C-_,0),D=k+Math.min(E-_,b-_);L!==D&&v.push(new Ctr(L,D,x.inlineClassName,x.inlineClassNameAffectsLetterSpacing))}}if(E<=b)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:Ol.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=i;f<i+r;f++){const g=o+f-i;if(!s[g]){a[g]=null;continue}a[g]=this._getViewLineData(h,d?d[f]:null,f)}}_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=APe(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(i)+1,d=c.length+1,h=i+1<this.getViewLineCount(),f=i===0?0:r.breakOffsetsVisibleColumn[i-1];return new P0e(c,h,u,d,f,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 Rz{constructor(){}isVisible(){return!0}setVisible(e){return e?this:Nz.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 P0e(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 Re(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}Rz.INSTANCE=new Rz;class Nz{constructor(){}isVisible(){return!1}setVisible(e){return e?Rz.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")}}Nz.INSTANCE=new Nz;const Mte=[""];function APe(n){if(n>=Mte.length)for(let e=1;e<=n;e++)Mte[e]=vlr(e);return Mte[n]}function vlr(n){return new Array(n+1).join(" ")}class blr{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 Clr(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 C1(Cv.fromDecorations(r));for(let m=0;m<o;m++){const v=a.takeWhile(_=>_.lineNumber===m+1);s.addRequest(i[m],v,t?t[m]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(J.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1<u.length?h+1:o+2;for(let m=0;m<o;m++){const v=m+1;v===g&&(f++,d=u[f].startLineNumber,h=u[f].endLineNumber,g=f+1<u.length?h+1:o+2);const _=v>=d&&v<=h,b=Pte(l[m],!_);c[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new ter(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=ylr(t),r=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(J.compareRangesUsingStarts);if(i.length===r.length){let h=!1;for(let f=0;f<i.length;f++)if(!i[f].equalsRange(r[f])){h=!0;break}if(!h)return!1}const o=i.map(h=>({range:h,options:Oi.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 f=h+1;f===u&&(c++,a=s[c].startLineNumber,l=s[c].endLineNumber,u=c+1<s.length?l+1:this.modelLineProjections.length+2);let g=!1;if(f>=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){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 f=0,g=this.modelLineProjections.length;f<g;f++)h[f]=this.modelLineProjections[f].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 Kce(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=Pte(r[u],!o);l.push(h);const f=h.getViewLineCount();a+=f,c[u]=f}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(l).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,c),new Yce(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=Pte(i,s);this.modelLineProjections[r]=a;const l=this.modelLineProjections[r].getViewLineCount();let c=!1,u=0,d=-1,h=0,f=-1,g=0,m=-1;o>l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,m=g+(o-l)-1,c=!0):o<l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+o-1,h=d+1,f=h+(l-o)-1,c=!0):(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1),this.projectedModelLineLineCounts.setValue(r,l);const v=u<=d?new set(u,d-u+1):null,_=h<=f?new Yce(h,f):null,b=g<=m?new Kce(g,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 RPe(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 Re(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 Re(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 RPe(l,h))}if(!c.isVisible()&&s){const u=new Re(l-1,this.model.getLineMaxColumn(l-1)+1),d=J.fromPositions(s,u);o.push(new NPe(d,a)),a=[],s=null}else c.isVisible()&&!s&&(s=new Re(l,1))}if(s){const l=J.fromPositions(s,this.getModelEndPositionOfViewLine(r));o.push(new NPe(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(f=>{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumber<u.modelLineWrappedLineIdx)return;if(!f.horizontalLine)return f;let g=-1;if(f.column!==-1){const _=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.column);if(_.lineNumber===u.modelLineWrappedLineIdx)g=_.column;else if(_.lineNumber<u.modelLineWrappedLineIdx)g=this.getMinColumnOfViewLine(u);else if(_.lineNumber>u.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===u.modelLineWrappedLineIdx?new Kx(f.visibleColumn,g,f.className,new $M(f.horizontalLine.top,m.column),-1,-1):v.lineNumber<u.modelLineWrappedLineIdx||f.visibleColumn!==-1?void 0:new Kx(f.visibleColumn,g,f.className,new $M(f.horizontalLine.top,this.getMaxColumnOfViewLine(u)),-1,-1)});s.push(h.filter(f=>!!f))}}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 g=l;g<=c;g++){const m=this.modelLineProjections[g];if(m.isVisible()){const v=m.getViewLineNumberOfModelPosition(0,g===l?i.column:1),_=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=_-v+1;let y=0;b>1&&m.getViewLineMinColumn(this.model,g+1,_)===1&&(y=v===0?1:2),s.push(b),a.push(y),u===null&&(u=new Re(g+1,0))}else u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),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 f=0;for(let g=0,m=o.length;g<m;g++){let v=o[g];const _=Math.min(d-f,s[g]),b=a[g];let y;b===2?y=0:b===1?y=1:y=_;for(let C=0;C<_;C++)C===y&&(v=0),h[f++]=v}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 f=d.getViewLineCount()-h,g=!1;if(o+f>t&&(g=!0,f=t-o+1),d.getViewLinesData(this.model,c+1,h,f,o-e,i,l),o+=f,g)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 Re(o+1,u)).equals(i)?new Re(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 J(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 Re(i.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new J(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,r=!1,o=!1){const s=this.model.validatePosition(new Re(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 Re(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 J.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new J(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 J(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 Re(m+1,m===c?s.column:1));else if(d!==null){const _=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new J(d.lineNumber,d.column,m,_),t,i,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new J(d.lineNumber,d.column,a.lineNumber,a.column),t,i,r)),d=null),l.sort((m,v)=>{const _=J.compareRangesUsingStarts(m.range,v.range);return _===0?m.id<v.id?-1:m.id>v.id?1:0:_});const h=[];let f=0,g=null;for(const m of l){const v=m.id;g!==v&&(g=v,h[f++]=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 ylr(n){if(n.length===0)return[];const e=n.slice();e.sort(J.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 J(i,1,r,1)),i=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new J(i,1,r,1)),t}class RPe{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class NPe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class Clr{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 wlr{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Slr(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 Kce(t,i)}onModelLinesInserted(e,t,i,r){return new Yce(t,i)}onModelLineChanged(e,t,i){return[!1,new set(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 P0e(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 Slr{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 Elr=class extends qe{constructor(e,t,i,r,o,s,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new Tlr,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new Kar,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Mo(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=gye.create(this.model),this.model.isTooLargeForTokenization())this._lines=new wlr(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(137),f=u.get(144),g=u.get(136),m=u.get(128);this._lines=new blr(this._editorId,this.model,r,o,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new olr(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new glr(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new zar(u)),this._eventDispatcher.emitOutgoingEvent(new dye(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 mlr(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($6.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new qar)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Uar(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 J(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 Har(e)),this._eventDispatcher.emitOutgoingEvent(new uye(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Far)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Bar)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Re(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new PPe(t,this._viewportStart.startLineDelta)}return new PPe(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 J9),e.emitViewEvent(new e7),e.emitViewEvent(new o2(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 o2(null))),e.emitViewEvent(new $ar(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),t2.shouldRecreate(t)&&(this.cursorConfig=new t2(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 _T?e.rawContentChangedEvent.changes:e.changes,a=e instanceof _T?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 f=d.detail[h];let g=d.injectedTexts[h];g&&(g=g.filter(m=>!m.ownerId||m.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new C1(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new J9),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),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 2:{const h=u.dequeue(),[f,g,m,v]=this._lines.onModelLineChanged(a,d.lineNumber,h);o=f,g&&i.emitViewEvent(g),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),v&&(i.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&o&&(i.emitViewEvent(new e7),i.emitViewEvent(new o2(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 _T&&i.emitOutgoingEvent(new nlr(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 Re(o.fromLineNumber,1)).lineNumber,a=this.coordinatesConverter.convertModelPositionToViewPosition(new Re(o.toLineNumber,this.model.getLineMaxColumn(o.toLineNumber))).lineNumber;t[i]={fromLineNumber:s,toLineNumber:a}}this._eventDispatcher.emitSingleViewEvent(new jar(t)),this._eventDispatcher.emitOutgoingEvent(new rlr(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new War),this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new tlr(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new elr(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new J9),t.emitViewEvent(new e7),t.emitViewEvent(new o2(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new t2(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new ilr(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new o2(e)),this._eventDispatcher.emitOutgoingEvent(new Jar(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 J9),s.emitViewEvent(new e7),s.emitViewEvent(new o2(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 Xar)}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 J(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,f=i[u].endLineNumber;f<s||h>l||(s<h&&(r[o++]=new J(s,a,h-1,this.model.getLineMaxColumn(h-1))),s=f+1,a=1)}return(s<l||s===l&&a<c)&&(r[o++]=new J(s,a,l,c)),r}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new J(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,r=t.completelyVisibleEndLineNumber;return new J(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 Re(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=Gu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=hv(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 np(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 ytr(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,qW(this._configuration.options)),i=new xlr;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(J.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===jf||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new J(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===zh.fontFamily;let c;return l?c=zh.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${zh.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,f=c===o?s-1:d.length;d===""?l+="<br>":l+=ulr(d,u.inflate(),t,h,f,a,eu)}return l}_getColorMap(){const e=Ks.getColorMap(),t=["#000000"];if(e)for(let i=1,r=e.length;i<r;i++)t[i]=je.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 Zar);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 J(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new aV(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new J(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new aV(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,r,o){this._withViewEventsCollector(s=>s.emitViewEvent(new aV(e,!1,i,null,r,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Gar),this._eventDispatcher.emitOutgoingEvent(new Qar))}_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 gye{static create(e){const t=e._setTrackedRange(null,new J(1,1,1,1),1);return new gye(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 Re(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new J(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 xlr{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 V3(e,t,[o,i,r]);this._asMap[e]=a,this.asArray.push(a)}}}class Tlr{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&OPe(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)=>klr(t,i),[]);return OPe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function klr(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 J(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 OPe(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 PPe{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 JK{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 o5;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(o5||(o5={}));(function(n){const e="error",t="warning",i="warn",r="info",o="ignore";function s(l){return l?rL(e,l)?n.Error:rL(t,l)||rL(i,l)?n.Warning:rL(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})(o5||(o5={}));const wa=o5;var eY=wa;const Wa=lr("notificationService");class Ilr{}class KM{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 t7(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 t7(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const r=this.getOutputLineCount()-1;if(e<r&&t===this.getMaxOutputOffset(e))return new t7(e+1,this.getMinOutputOffset(e+1))}return new t7(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&&MPe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let r=i.offsetInInputWithInjections;if(FPe(this.injectionOptions[i.injectedTextIndex].cursorStops))return r;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(MPe(this.injectionOptions[o].cursorStops)||(r-=this.injectionOptions[o].content.length,FPe(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}xK()}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 MPe(n){return n==null?!0:n===nv.Right||n===nv.Both}function FPe(n){return n==null?!0:n===nv.Left||n===nv.Both}class t7{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Re(e+this.outputLineIndex,this.outputOffset+1)}}class mye{static create(e){return new mye(e.get(132),e.get(131))}constructor(e,t){this.classifier=new Llr(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 f=a[d],g=l[d];g&&!g.injectionOptions&&!f?u[d]=Dlr(this.classifier,g,s[d],t,i,c,r,o):u[d]=Alr(this.classifier,s[d],f,t,i,c,r,o)}return Xce.length=0,Zce.length=0,u}}}}class Llr extends sN{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 Xce=[],Zce=[];function Dlr(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=uet(t,i,r,o,s),f=r-h,g=Xce,m=Zce;let v=0,_=0,b=0,y=r;const C=u.length;let E=0;if(E>=0){let x=Math.abs(d[E]-y);for(;E+1<C;){const k=Math.abs(d[E+1]-y);if(k>=x)break;x=k,E++}}for(;E<C;){let x=E<0?0:u[E],k=E<0?0:d[E];_>x&&(x=_,k=b);let L=0,D=0,A=0,N=0;if(k<=y){let M=k,B=x===0?0:t.charCodeAt(x-1),F=x===0?0:n.get(B),U=!0;for(let H=x;H<l;H++){const W=H,q=t.charCodeAt(H);let V,re;if(Rl(q)?(H++,V=0,re=2):(V=n.get(q),re=YM(q,M,i,o)),W>_&&Jce(B,F,q,V,c)&&(L=W,D=M),M+=re,M>y){W>_?(A=W,N=M-re):(A=H+1,N=M),M-D>f&&(L=0),U=!1;break}B=q,F=V}if(U){v>0&&(g[v]=u[u.length-1],m[v]=d[u.length-1],v++);break}}if(L===0){let M=k,B=t.charCodeAt(x),F=n.get(B),U=!1;for(let H=x-1;H>=_;H--){const W=H+1,q=t.charCodeAt(H);if(q===9){U=!0;break}let V,re;if(YT(q)?(H--,V=0,re=2):(V=n.get(q),re=mS(q)?o:1),M<=y){if(A===0&&(A=W,N=M),M<=y-f)break;if(Jce(q,V,B,F,c)){L=W,D=M;break}}M-=re,B=q,F=V}if(L!==0){const H=f-(N-D);if(H<=i){const W=t.charCodeAt(A);let q;Rl(W)?q=2:q=YM(W,N,i,o),H-q<0&&(L=0)}}if(U){E--;continue}}if(L===0&&(L=A,D=N),L<=_){const M=t.charCodeAt(_);Rl(M)?(L=_+2,D=b+2):(L=_+1,D=b+YM(M,b,i,o))}for(_=L,g[v]=L,b=D,m[v]=D,v++,y=D+f;E<0||E<C&&d[E]<D;)E++;let P=Math.abs(d[E]-y);for(;E+1<C;){const M=Math.abs(d[E+1]-y);if(M>=P)break;P=M,E++}}return v===0?null:(g.length=v,m.length=v,Xce=e.breakOffsets,Zce=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=h,e)}function Alr(n,e,t,i,r,o,s,a){const l=Cv.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 KM(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new KM(u,c,[l.length],[],0):null;const h=a==="keepAll",f=uet(l,i,r,o,s),g=r-f,m=[],v=[];let _=0,b=0,y=0,C=r,E=l.charCodeAt(0),x=n.get(E),k=YM(E,0,i,o),L=1;Rl(E)&&(k+=1,E=l.charCodeAt(1),x=n.get(E),L++);for(let D=L;D<d;D++){const A=D,N=l.charCodeAt(D);let P,M;Rl(N)?(D++,P=0,M=2):(P=n.get(N),M=YM(N,k,i,o)),Jce(E,x,N,P,h)&&(b=A,y=k),k+=M,k>C&&((b===0||k-y>g)&&(b=A,y=k-M),m[_]=b,v[_]=y,_++,C=y+g,b=0),E=N,x=P}return _===0&&(!t||t.length===0)?null:(m[_]=d,v[_]=k,new KM(u,c,m,v,f))}function YM(n,e,t,i){return n===9?t-e%t:mS(n)||n<32?i:1}function BPe(n,e){return e-n%e}function Jce(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 uet(n,e,t,i,r){let o=0;if(r!==0){const s=Gu(n);if(s!==-1){for(let l=0;l<s;l++){const c=n.charCodeAt(l)===9?BPe(o,e):1;o+=c}const a=r===3?2:r===2?1:0;for(let l=0;l<a;l++){const c=BPe(o,e);o+=c}o+i>t&&(o=0)}}return o}const Fte=M1("domLineBreaksComputer",{createHTML:n=>n});class _ye{static create(){return new _ye}constructor(){}createLineBreaksComputer(e,t,i,r,o){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>Rlr(s,e,t,i,r,o,a)}}}function Rlr(n,e,t,i,r,o,s){var a;function l(D){const A=s[D];if(A){const N=Cv.applyInjectedText(n[D],A),P=A.map(B=>B.options),M=A.map(B=>B.column-1);return new KM(M,P,[N.length],[],0)}else return null}if(i===-1){const D=[];for(let A=0,N=n.length;A<N;A++)D[A]=l(A);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),f=document.createElement("div");Zc(f,e);const g=new oN(1e4),m=[],v=[],_=[],b=[],y=[];for(let D=0;D<n.length;D++){const A=Cv.applyInjectedText(n[D],s[D]);let N=0,P=0,M=c;if(r!==0)if(N=Gu(A),N===-1)N=0;else{for(let H=0;H<N;H++){const W=A.charCodeAt(H)===9?t-P%t:1;P+=W}const U=Math.ceil(e.spaceWidth*P);U+e.typicalFullwidthCharacterWidth>c?(N=0,P=0):M=c-U}const B=A.substr(N),F=Nlr(B,P,t,M,g,h);m[D]=N,v[D]=P,_[D]=B,b[D]=F[0],y[D]=F[1]}const C=g.build(),E=(a=Fte==null?void 0:Fte.createHTML(C))!==null&&a!==void 0?a:C;f.innerHTML=E,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const x=document.createRange(),k=Array.prototype.slice.call(f.children,0),L=[];for(let D=0;D<n.length;D++){const A=k[D],N=Olr(x,A,_[D],b[D]);if(N===null){L[D]=l(D);continue}const P=m[D],M=v[D]+d,B=y[D],F=[];for(let q=0,V=N.length;q<V;q++)F[q]=B[N[q]];if(P!==0)for(let q=0,V=N.length;q<V;q++)N[q]+=P;let U,H;const W=s[D];W?(U=W.map(q=>q.options),H=W.map(q=>q.column-1)):(U=null,H=null),L[D]=new KM(H,U,N,F,M)}return document.body.removeChild(f),L}function Nlr(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 f=d;d=h+1<s?n.charCodeAt(h+1):0;let g=1,m=1;switch(f){case 9:g=t-a%t,m=g;for(let v=1;v<=g;v++)v<g?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:mS(f)&&m++,f<32?r.appendCharCode(9216+f):r.appendCharCode(f)}l+=g,a+=m}return r.appendString("</span>"),c[n.length]=l,u[n.length]=a,r.appendString("</div>"),[c,u]}function Olr(n,e,t,i){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),o=[];try{eue(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 eue(n,e,t,i,r,o,s,a){if(i===o||(r=r||Bte(n,e,t[i],t[i+1]),s=s||Bte(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=Bte(n,e,t[l],t[l+1]);eue(n,e,t,i,r,l,c,a),eue(n,e,t,l,c,o,s,a)}function Bte(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 Plr extends qe{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new r0e),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)){Pi(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(My(()=>{this._instantiateSome(1)})),this._register(My(()=>{this._instantiateSome(2)})),this._register(My(()=>{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(My(()=>{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){Pi(i)}}}}var Mlr=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},X0=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Flr=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())})},ax;let Blr=0,$lr=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(){_o(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},FA=ax=class extends qe{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,r,o,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=kQi(),this._contributions=this._register(new Plr),this._onDidDispose=this._register(new De),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new $Pe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new $Pe({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Lu(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new De({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Blr,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(_=>{this._onDidChangeConfiguration.fire(_);const b=this._configuration.options;if(_.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 Vlr(this,this._contextKeyService)),this._register(new Hlr(this,this._contextKeyService,h)),this._instantiationService=r.createChild(new JK([bi,this._contextKeyService])),this._modelData=null,this._focusTracker=new Wlr(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=JL.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const _ of JL.getEditorActions()){if(this._actions.has(_.id)){Pi(new Error(`Cannot have two actions with the same id ${_.id}`));continue}const b=new BJe(_.id,_.label,_.alias,(f=_.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(_.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(b.id,b)}const v=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new qZi(this._domElement,{onDragEnter:()=>{},onDragOver:_=>{if(!v())return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b!=null&&b.position&&this.showDropIndicatorAt(b.position)},onDrop:_=>Flr(this,void 0,void 0,function*(){if(!v()||(this.removeDropIndicator(),!_.dataTransfer))return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b!=null&&b.position&&this._onDropIntoEditor.fire({position:b.position,event:_})}),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 Ice(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return L6.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?to.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?ax._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?ax._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?ax._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=>J.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 Cl.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(!Re.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(!J.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 J(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(!Re.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new J(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=kn.isISelection(e),r=J.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 kn(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 J(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(!J.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(J.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(!kn.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,Pi);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 J(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=JL.getEditorCommand(t);return r?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(r.runEditorCommand(o,this,i)).then(void 0,Pi)}),!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 zlr(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,qW(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,qW(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=ax._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){Zc(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 Elr(this._id,this._configuration,e,_ye.create(),mye.create(this._configuration.options),a=>_g(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=T("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(eY.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:T("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 $lr(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 KK(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 $ce(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 J(e.lineNumber,e.column,e.lineNumber,e.column),options:ax.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};FA.dropIntoEditorDecorationOptions=Oi.register({description:"workbench-dnd-target",className:"dnd-target"});FA=ax=Mlr([X0(3,pi),X0(4,io),X0(5,ga),X0(6,bi),X0(7,Vl),X0(8,Wa),X0(9,F1),X0(10,es),X0(11,wn)],FA);class $Pe extends qe{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new De(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new De(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 Lu extends De{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Vlr extends qe{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=de.editorSimpleInput.bindTo(t),this._editorFocus=de.focus.bindTo(t),this._textInputFocus=de.textInputFocus.bindTo(t),this._editorTextFocus=de.editorTextFocus.bindTo(t),this._tabMovesFocus=de.tabMovesFocus.bindTo(t),this._editorReadonly=de.readOnly.bindTo(t),this._inDiffEditor=de.inDiffEditor.bindTo(t),this._editorColumnSelection=de.columnSelection.bindTo(t),this._hasMultipleSelections=de.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=de.hasNonEmptySelection.bindTo(t),this._canUndo=de.canUndo.bindTo(t),this._canRedo=de.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(LA.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(LA.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 Hlr extends qe{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=de.languageId.bindTo(t),this._hasCompletionItemProvider=de.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=de.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=de.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=de.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=de.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=de.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=de.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=de.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=de.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=de.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=de.hasReferenceProvider.bindTo(t),this._hasRenameProvider=de.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=de.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=de.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=de.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=de.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=de.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=de.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=de.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===Qi.walkThroughSnippet)})}}class Wlr extends qe{constructor(e){super(),this._onChange=this._register(new De),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(l0(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 zlr{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 Ulr=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='"),jlr=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 $te(n){return Ulr+encodeURIComponent(n.toString())+jlr}const qlr=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),Glr=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 Klr(n){return qlr+encodeURIComponent(n.toString())+Glr}t_((n,e)=>{const t=n.getColor(Mb);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${$te(t)}") repeat-x bottom left; }`);const i=n.getColor(Mf);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${$te(i)}") repeat-x bottom left; }`);const r=n.getColor(sh);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${$te(r)}") repeat-x bottom left; }`);const o=n.getColor(gnr);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Klr(o)}") no-repeat bottom left; }`);const s=n.getColor(krr);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var Ylr=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},Qlr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Xlr=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 tue=class extends qe{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new De),this._onCodeEditorAdd=this._register(new De),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new De),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new De),this._onDiffEditorAdd=this._register(new De),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new De),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Td,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 Xlr(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 _i(t)}};tue=Ylr([Qlr(0,Vl)],tue);var Zlr=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},VPe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Jlr=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 Oz=class extends tue{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)=>Jlr(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===Qi.http||o===Qi.https)return gZe(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}};Oz=Zlr([VPe(0,bi),VPe(1,Vl)],Oz);Cr(io,Oz,0);const cN=lr("layoutService");var det=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},het=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Pz=class{get dimension(){return this._dimension||(this._dimension=iN(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=on.None,this.offset={top:0,quickPickTop:0}}};Pz=det([het(0,io)],Pz);let nue=class extends Pz{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};nue=det([het(1,io)],nue);Cr(cN,Pz,1);const V6=lr("dialogService");var ecr=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},HPe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},n7=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 i7(n){return n.scheme===Qi.file?n.fsPath:n.path}let fet=0;class r7{constructor(e,t,i,r,o,s,a){this.id=++fet,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 WPe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class zPe{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(T({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(T({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 tcr{constructor(e,t,i,r,o,s,a){this.id=++fet,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 zPe),this.removedResources.has(t)||this.removedResources.set(t,new WPe(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 zPe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new WPe(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class pet{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 ret(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 Vte{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 get=new pet("","");get.locked=!0;let iue=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=MA.None,i=wb.None){if(e.type===0){const r=i7(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new r7(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=i7(a),c=this.getUriComparisonKey(a);r.has(c)||(r.add(c),o.push(l),s.push(c))}o.length===1?this._pushElement(new r7(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new tcr(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 pet(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=i7(o.resource),a=this.getUriComparisonKey(o.resource),l=new r7(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=i7(o.resource),a=this.getUriComparisonKey(o.resource),l=new r7(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 ret(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 wb){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){Pi(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 n7(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return qe.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?qe.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(qe.None);const i=e.actual.prepareUndoRedo();return i?i0e(i)?t(i):i.then(r=>t(r)):t(qe.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||get);return new Vte(t)}_tryToSplitAndUndo(e,t,i,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(r),new o7(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new o7}_checkWorkspaceUndo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,T({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,T({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,T({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,T({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,T({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 n7(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:wa.Info,message:T("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:T({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:T({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=T({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 Vte([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 wb){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 n7(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:T("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:T({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:T("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 wb){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 o7(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new o7}_checkWorkspaceRedo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,T({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,T({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,T({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,T({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,T({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 n7(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=T({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 Vte([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 wb){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{}}}};iue=ecr([HPe(0,V6),HPe(1,Wa)],iue);class o7{constructor(e){this.returnValue=e}}Cr(ZK,iue,1);function Ah(n,e,t){return Math.min(Math.max(n,e),t)}class met{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 ncr{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 vye=lr("environmentService"),nf=lr("openerService");function bye(n,e){return Jn.isUri(n)?rL(n.scheme,e):d0e(n,e+":")}function UPe(n,...e){return e.some(t=>bye(n,t))}function icr(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 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},jPe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Ag=lr("ILanguageFeatureDebounceService");var Mz;(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})(Mz||(Mz={}));class ocr{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class scr{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 uE(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>FK(Mz.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Ah(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 ncr(6),this._cache.set(i,r));const o=Ah(r.update(t),this._min,this._max);return bye(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new met;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Ah(e,this._min,this._max)}}let rue=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=`${Mz.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new scr(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new ocr(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new met;for(const t of this._data.values())e.update(t.default());return e.value}};rue=rcr([jPe(0,hp),jPe(1,vye)],rue);Cr(Ag,rue,1);class QM{static create(e,t){return new QM(e,new Fz(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 J(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 QM(this._startLineNumber,r),new QM(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,r,o]=ES(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 Re(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 Fz{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 J(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 qPe(this._tokens.subarray(4*s,4*a+4))}}return this._getDeltaLine(t)===e?new qPe(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],f=o[d+1],g=o[d+2],m=o[d+3];if((h>e||h===e&&g>=t)&&(h<i||h===i&&f<=r))l=!0;else{if(a===0&&(c=h),l){const v=4*a;o[v]=h-c,o[v+1]=f,o[v+2]=g,o[v+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 f=4*h,g=o[f],m=o[f+1],v=o[f+2],_=o[f+3];if(g>e||g===e&&v>=t){if(g<i||g===i&&m<=r)continue;c!==l&&(c=l,u=0,d=g)}c[u++]=g-d,c[u++]=m,c[u++]=v,c[u++]=_}return[new Fz(new Uint32Array(a)),new Fz(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 f=s[h],g=s[h+1],m=s[h+2];const v=s[h+3];if(f<t||f===t&&m<=i){c++;continue}else if(f===t&&g<i)f===r&&m>o?m-=o-i:m=i;else if(f===t&&g===i)if(f===r&&m>o)m-=o-i;else{u=!0;continue}else if(f<r||f===r&&g<o)if(f===r&&m>o)f=t,g=i,m=g+(m-o);else{u=!0;continue}else if(f>r){if(l===0&&!u){c=a;break}f-=l}else if(f===r&&g>=o)e&&f===0&&(g+=e,m+=e),f-=l,g-=o-i,m-=o-i;else throw new Error("Not possible!");const _=4*c;s[_]=f,s[_+1]=g,s[_+2]=m,s[_+3]=v,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],f=l[d+1],g=l[d+2];if(!(h<e||h===e&&g<t)){if(h===e&&g===t)if(a)g+=1;else continue;else if(h===e&&f<t&&t<g)i===0?g+=r:g=t;else{if(h===e&&f===t&&a)continue;if(h===e)if(h+=i,i===0)f+=r,g+=r;else{const m=g-f;f=o+(f-t),g=f+m}else h+=i}l[d]=h,l[d+1]=f,l[d+2]=g}}}}class qPe{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 acr=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},Hte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let oue=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()===qc.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Gc.getForeground(s)}, fontStyle ${Gc.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()===qc.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()===qc.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()===qc.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${Gc.getForeground(s)}, fontStyle ${Gc.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}).`))}};oue=acr([Hte(1,Vl),Hte(2,Es),Hte(3,hp)],oue);function _et(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),f=0,g=0,m=0,v=0;for(;a<d;){const b=5*a,y=i[b],C=i[b+1],E=l+y|0,x=y===0?c+C|0:C,k=i[b+2],L=x+k|0,D=i[b+3],A=i[b+4];if(L<=x)e.warnInvalidLengthSemanticTokens(E,x+1);else if(m===E&&v>x)e.warnOverlappingSemanticTokens(E,x+1);else{const N=e.getMetadata(D,A,t);N!==2147483647&&(g===0&&(g=E),h[f]=E-g,h[f+1]=x,h[f+2]=L,h[f+3]=N,f+=4,m=E,v=L)}l=E,c=x,a++}f!==h.length&&(h=h.subarray(0,f));const _=QM.create(g,h);s.push(_)}return s}class lcr{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 lcr(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 tY=lr("semanticTokensStylingService");var ccr=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},Wte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let sue=class extends qe{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 oue(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};sue=ccr([Wte(0,Vl),Wte(1,hp),Wte(2,Es)],sue);Cr(tY,sue,1);var GPe=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 s7="**",KPe="/",lV="[/\\\\]",cV="[^/\\\\]",ucr=/\//g;function YPe(n,e){switch(n){case 0:return"";case 1:return`${cV}*?`;default:return`(?:${lV}|${cV}+${lV}${e?`|${lV}${cV}+`:""})*?`}}function QPe(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 vet(n){if(!n)return"";let e="";const t=QPe(n,KPe);if(t.every(i=>i===s7))e=".*";else{let i=!1;t.forEach((r,o)=>{if(r===s7){if(i)return;e+=YPe(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===KPe?d="":d=ep(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${QPe(a,",").map(f=>vet(f)).join("|")})`;e+=h,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=cV;continue;case"*":e+=YPe(1);continue;default:e+=ep(u)}}o<t.length-1&&(t[o+1]!==s7||o+2<t.length)&&(e+=lV)}i=r===s7})}return e}const dcr=/^\*\*\/\*\.[\w\.-]+$/,hcr=/^\*\*\/([\w\.-]+)\/?$/,fcr=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,pcr=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,gcr=/^\*\*((\/[\w\.-]+)+)\/?$/,mcr=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,XPe=new uE(1e4),ZPe=function(){return!1},Zb=function(){return null};function yye(n,e){if(!n)return Zb;let t;typeof n!="string"?t=n.pattern:t=n,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let r=XPe.get(i);if(r)return JPe(r,n);let o;return dcr.test(t)?r=_cr(t.substr(4),t):(o=hcr.exec(zte(t,e)))?r=vcr(o[1],t):(e.trimForExclusions?pcr:fcr).test(t)?r=bcr(t,e):(o=gcr.exec(zte(t,e)))?r=eMe(o[1].substr(1),t,!0):(o=mcr.exec(zte(t,e)))?r=eMe(o[1],t,!1):r=ycr(t),XPe.set(i,r),JPe(r,n)}function JPe(n,e){if(typeof e=="string")return n;const t=function(i,r){return zce(i,e.base,!Xu)?n(S6(i.substr(e.base.length),dv),r):null};return t.allBasenames=n.allBasenames,t.allPaths=n.allPaths,t.basenames=n.basenames,t.patterns=n.patterns,t}function zte(n,e){return e.trimForExclusions&&n.endsWith("/**")?n.substr(0,n.length-2):n}function _cr(n,e){return function(t,i){return typeof t=="string"&&t.endsWith(n)?e:null}}function vcr(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 bcr(n,e){const t=yet(n.slice(1,-1).split(",").map(a=>yye(a,e)).filter(a=>a!==Zb),n),i=t.length;if(!i)return Zb;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 eMe(n,e,t){const i=dv===hl.sep,r=i?n:n.replace(ucr,dv),o=dv+r,s=hl.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 ycr(n){try{const e=new RegExp(`^${vet(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Zb}}function Ccr(n,e,t){return!n||typeof e!="string"?!1:bet(n)(e,void 0,t)}function bet(n,e={}){if(!n)return ZPe;if(typeof n=="string"||wcr(n)){const t=yye(n,e);if(t===Zb)return ZPe;const i=function(r,o){return!!t(r,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Scr(n,e)}function wcr(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Scr(n,e){const t=yet(Object.getOwnPropertyNames(n).map(a=>Ecr(a,n[a],e)).filter(a=>a!==Zb)),i=t.length;if(!i)return Zb;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;f<g;f++){const m=t[f](u,d);if(typeof m=="string")return m;hce(m)&&(h||(h=[]),h.push(m))}return h?(()=>GPe(this,void 0,void 0,function*(){for(const f of h){const g=yield f;if(typeof g=="string")return g}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,f=t.length;h<f;h++){const g=t[h];g.requiresSiblings&&c&&(l||(l=Bw(a)),u||(u=l.substr(0,l.length-WQi(a).length)));const m=g(a,l,u,c);if(typeof m=="string")return m;hce(m)&&(d||(d=[]),d.push(m))}return d?(()=>GPe(this,void 0,void 0,function*(){for(const h of d){const f=yield h;if(typeof f=="string")return f}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 Ecr(n,e,t){if(e===!1)return Zb;const i=yye(n,t);if(i===Zb)return Zb;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 hce(d)?d.then(h=>h?n:null):d?n:null};return o.requiresSiblings=!0,o}}return i}function yet(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 Cet(n,e,t,i,r,o){if(Array.isArray(n)){let s=0;for(const a of n){const l=Cet(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:LXe(a.base)}),h===e.fsPath||Ccr(h,e.fsPath))d=10;else return 0}return d}else return 0}}function wet(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(wet):!!n.exclusive}class tMe{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 sa{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new De,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),_i(()=>{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 tMe(e.uri,e.getLanguageId(),r.uri,r.type):new tMe(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=Cet(s.selector,o.uri,o.languageId,fer(e),o.notebookUri,o.notebookType),wet(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(sa._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:DP(e.selector)&&!DP(t.selector)?1:!DP(e.selector)&&DP(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function DP(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(DP):!!n.isBuiltin}class xcr{constructor(){this.referenceProvider=new sa(this._score.bind(this)),this.renameProvider=new sa(this._score.bind(this)),this.codeActionProvider=new sa(this._score.bind(this)),this.definitionProvider=new sa(this._score.bind(this)),this.typeDefinitionProvider=new sa(this._score.bind(this)),this.declarationProvider=new sa(this._score.bind(this)),this.implementationProvider=new sa(this._score.bind(this)),this.documentSymbolProvider=new sa(this._score.bind(this)),this.inlayHintsProvider=new sa(this._score.bind(this)),this.colorProvider=new sa(this._score.bind(this)),this.codeLensProvider=new sa(this._score.bind(this)),this.documentFormattingEditProvider=new sa(this._score.bind(this)),this.documentRangeFormattingEditProvider=new sa(this._score.bind(this)),this.onTypeFormattingEditProvider=new sa(this._score.bind(this)),this.signatureHelpProvider=new sa(this._score.bind(this)),this.hoverProvider=new sa(this._score.bind(this)),this.documentHighlightProvider=new sa(this._score.bind(this)),this.selectionRangeProvider=new sa(this._score.bind(this)),this.foldingRangeProvider=new sa(this._score.bind(this)),this.linkProvider=new sa(this._score.bind(this)),this.inlineCompletionsProvider=new sa(this._score.bind(this)),this.completionProvider=new sa(this._score.bind(this)),this.linkedEditingRangeProvider=new sa(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new sa(this._score.bind(this)),this.documentSemanticTokensProvider=new sa(this._score.bind(this)),this.documentOnDropEditProvider=new sa(this._score.bind(this)),this.documentPasteEditProvider=new sa(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Cr(wn,xcr,1);const H6=lr("IWorkspaceEditService");class Cye{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Zy.is(t))return Zy.lift(t);if(fD.is(t))return fD.lift(t);throw new Error("Unsupported edit")})}}class Zy extends Cye{static is(e){return e instanceof Zy?!0:xd(e)&&Jn.isUri(e.resource)&&xd(e.textEdit)}static lift(e){return e instanceof Zy?e:new Zy(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 fD extends Cye{static is(e){return e instanceof fD?!0:xd(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof fD?e:new fD(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 Du={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},nY=Object.freeze({id:"editor",order:5,type:"object",title:T("editorConfigurationTitle","Editor"),scope:5}),Bz=Object.assign(Object.assign({},nY),{properties:{"editor.tabSize":{type:"number",default:pu.tabSize,minimum:1,markdownDescription:T("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:T("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:pu.insertSpaces,markdownDescription:T("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:pu.detectIndentation,markdownDescription:T("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:pu.trimAutoWhitespace,description:T("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:pu.largeFileOptimizations,description:T("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:T("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[T("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),T("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),T("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:T("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[T("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),T("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),T("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:T("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:T("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:T("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:T("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:T("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:T("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:T("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:T("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:T("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:T("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:T("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:T("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Du.maxComputationTime,description:T("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Du.maxFileSize,description:T("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Du.renderSideBySide,description:T("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Du.renderSideBySideInlineBreakpoint,description:T("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Du.useInlineViewWhenSpaceIsLimited,description:T("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Du.renderMarginRevertIcon,description:T("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Du.ignoreTrimWhitespace,description:T("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Du.renderIndicators,description:T("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Du.diffCodeLens,description:T("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Du.diffWordWrap,markdownEnumDescriptions:[T("wordWrap.off","Lines will never wrap."),T("wordWrap.on","Lines will wrap at the viewport width."),T("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Du.diffAlgorithm,markdownEnumDescriptions:[T("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),T("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Du.hideUnchangedRegions.enabled,markdownDescription:T("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Du.hideUnchangedRegions.revealLineCount,markdownDescription:T("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Du.hideUnchangedRegions.minimumLineCount,markdownDescription:T("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Du.hideUnchangedRegions.contextLineCount,markdownDescription:T("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Du.experimental.showMoves,markdownDescription:T("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Du.experimental.showEmptyDecorations,description:T("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function Tcr(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of iL){const e=n.schema;if(typeof e<"u")if(Tcr(e))Bz.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(Bz.properties[t]=e[t])}let a7=null;function Eet(){return a7===null&&(a7=Object.create(null),Object.keys(Bz.properties).forEach(n=>{a7[n]=!0})),a7}function kcr(n){return Eet()[`editor.${n}`]||!1}function Icr(n){return Eet()[`diffEditor.${n}`]||!1}const Lcr=Hs.as(Nv.Configuration);Lcr.registerConfiguration(Bz);class Is{static insert(e,t){return{range:new J(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 Ute(n){return Object.isFrozen(n)?n:fYi(n)}class hu{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 hu)return i;const r=new Dcr("");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?zNe(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?zNe(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=gy(this.contents),o=gy(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=>ka(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=fS(u.keys)):o.push(gy(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new hu(r,s,o,a.every(l=>l instanceof hu)?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 fS([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[r];const s=t[r];s&&(typeof o=="object"&&typeof s=="object"?(o=gy(o),this.mergeContents(o,s)):o=s),i[r]=o}return new hu(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&xd(e[i])&&xd(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=gy(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const r=o=>{o&&(i?this.mergeContents(i,o):i=gy(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),LJi(this.contents,e),yS.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>ka(i.identifiers,az(e))),1))}updateValue(e,t,i){DZe(this.contents,e,t,r=>console.error(r)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),yS.test(e)&&this.overrides.push({identifiers:az(e),keys:Object.keys(this.contents[e]),contents:gce(this.contents[e],r=>console.error(r))})}}class Dcr{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new hu}parseRaw(e,t){this._raw=e;const{contents:i,keys:r,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new hu(i,r,o,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=Hs.as(Nv.Configuration).getConfigurationProperties(),r=this.filter(e,i,!0,t);e=r.raw;const o=gce(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(yS.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],f=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)||(f===void 0||r.scopes===void 0||r.scopes.includes(f))&&!(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(yS.test(r)){const o={};for(const s in e[r])o[s]=e[r][s];i.push({identifiers:az(r),keys:Object.keys(o),contents:gce(o,t)})}return i}}class Acr{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f){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=f}inspect(e,t,i){const r=e.inspect(t,i);return{get value(){return Ute(r.value)},get override(){return Ute(r.override)},get merged(){return Ute(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 iY{constructor(e,t,i,r,o=new hu,s=new hu,a=new gu,l=new hu,c=new gu){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 gu,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 hu,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 Acr(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(Jn.revive(c[0]),this.parseConfigurationModel(c[1])),l),new gu);return new iY(t,i,r,o,new hu,s,a,new hu,new gu)}static parseConfigurationModel(e){return new hu(e.contents,e.keys,e.overrides)}}class Rcr{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=iY.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!Uf(l,c)}return!0}}const $z={kind:0},Ncr={kind:1};function Ocr(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class XM{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=XM.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||!HXi(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&&XM.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:ace(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."),$z;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: ${nMe(a.when)}, source: ${iMe(a)}.`),Ncr):(this._log(`\\ From ${s.length} keybinding entries, matched ${a.command}, when: ${nMe(a.when)}, source: ${iMe(a)}.`),Ocr(a.command,a.commandArgs,a.bubble)):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),$z)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const r=t[i];if(XM._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function nMe(n){return n?`${n.serialize()}`:"no when condition"}function iMe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const Pcr=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Mcr extends qe{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:on.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 De),this._currentChords=[],this._currentChordChecker=new k6,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=vL.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Jm,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"),$z;const[r]=i.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),$z;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 n0e("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(T("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(T("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),FM.enabled&&FM.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],FM.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=vL.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=vL.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 vL(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(T("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(T("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)),Pcr.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 vL{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}}}vL.EMPTY=new vL(null);class rMe{constructor(e,t,i,r,o,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?aue(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=aue(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 aue(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 rY{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]=Vcr(a,l,this.modifierLabels[e])}return r.join(" ")}}const wye=new rY({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:T({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:T({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:T({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:T({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),Fcr=new rY({ctrlKey:T({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:T({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"optKey.long",comment:["This is the long form for the Alt/Option key on the keyboard"]},"Option"),metaKey:T({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:T({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:T({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:T({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:T({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:T({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:T({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),Bcr=new rY({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),$cr=new rY({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 Vcr(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 Hcr extends zXi{constructor(e,t){if(super(),t.length===0)throw ag("chords");this._os=e,this._chords=t}getLabel(){return wye.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return Fcr.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Bcr.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return $cr.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 WXi(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 s5 extends Hcr{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 s5.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=l0e[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 S1)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new S1(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=aue(e.chords.map(r=>this._toKeyCodeChord(r)));return i.length>0?[new s5(i,t)]:[]}}const BA=lr("labelService"),xet=lr("progressService");class Jy{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)})}}Jy.None=Object.freeze({report(){}});const fE=lr("editorProgressService");class Wcr{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 zcr{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?u0e(e,this._value,0,e.length,this._from,this._to):E6(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Ucr{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?u0e(e,this._value,0,e.length,this._from,this._to):E6(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class jcr{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 Ucr(!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 tce(e,this._value.scheme);if(this._states[this._stateIdx]===2)return tce(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return I3(e,this._value.query);if(this._states[this._stateIdx]===5)return I3(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 l7{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 pD{static forUris(e=()=>!1,t=()=>!1){return new pD(new jcr(e,t))}static forStrings(){return new pD(new Wcr)}static forConfigKeys(){return new pD(new zcr)}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 l7,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 l7,r.left.segment=i.value()),o.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new l7,r.right.segment=i.value()),o.push([1,r]),r=r.right;else if(i.hasNext())i.next(),r.mid||(r.mid=new l7,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 tk=lr("contextService");function lue(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&Jn.isUri(e.uri)}function qcr(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!lue(n)&&!Qcr(n)}const Gcr={id:"ext-dev"},Kcr={id:"empty-window"};function Ycr(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:Bw(n)}:e?Gcr:Kcr;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 Qcr(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&Jn.isUri(e.configPath)}class Xcr{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 cue="code-workspace";T("codeWorkspace","Code Workspace");const Tet="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function Zcr(n){return n.id===Tet}var uue;(function(n){n.inspectTokensAction=T("inspectTokens","Developer: Inspect Tokens")})(uue||(uue={}));var Vz;(function(n){n.gotoLineActionLabel=T("gotoLineActionLabel","Go to Line/Column...")})(Vz||(Vz={}));var due;(function(n){n.helpQuickAccessActionLabel=T("helpQuickAccess","Show all Quick Access Providers")})(due||(due={}));var Hz;(function(n){n.quickCommandActionLabel=T("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=T("quickCommandActionHelp","Show And Run Commands")})(Hz||(Hz={}));var a5;(function(n){n.quickOutlineActionLabel=T("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=T("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(a5||(a5={}));var Wz;(function(n){n.editorViewAccessibleLabel=T("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=T("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(Wz||(Wz={}));var hue;(function(n){n.toggleHighContrast=T("toggleHighContrast","Toggle High Contrast Theme")})(hue||(hue={}));var fue;(function(n){n.bulkEditServiceSummary=T("bulkEditServiceSummary","Made {0} edits in {1} files")})(fue||(fue={}));const ket=lr("workspaceTrustManagementService"),B1=lr("contextViewService"),n_=lr("contextMenuService");var lu;(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})(lu||(lu={}));function Jcr(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var cw;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(cw||(cw={}));function bL(n,e,t){const i=t.mode===cw.ALIGN?t.offset:t.offset+t.size,r=t.mode===cw.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 $A extends qe{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=qe.None,this.toDisposeOnSetContainer=qe.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Rt(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,md(this.view),this.setContainer(e,t),this._register(_i(()=>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=Rt(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=eur,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Rt("slot"))}else this.container.appendChild(this.view);const r=new yt;$A.BUBBLE_UP_EVENTS.forEach(o=>{r.add(Ba(this.container,o,s=>{this.onDOMEvent(s,!1)}))}),$A.BUBBLE_DOWN_EVENTS.forEach(o=>{r.add(Ba(this.container,o,s=>{this.onDOMEvent(s,!0)},!0))}),this.toDisposeOnSetContainer=r}}show(e){var t,i;this.isVisible()&&this.hide(),kc(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",Ph(this.view),this.toDisposeOnClean=e.render(this.view)||qe.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&&!(bv&&C0e.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(S0e(e)){const d=pl(e),h=OZi(e);t={top:d.top*h,left:d.left*h,width:d.width*h,height:d.height*h}}else Jcr(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=Jd(this.view),r=zx(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:cw.ALIGN};l=bL(window.innerHeight,r,d)+window.pageYOffset,lu.intersects({start:l,end:l+r},{start:d.offset,end:d.offset+d.size})&&(h.mode=cw.AVOID),c=bL(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:cw.ALIGN};c=bL(window.innerWidth,i,d),lu.intersects({start:c,end:c+i},{start:d.offset,end:d.offset+d.size})&&(h.mode=cw.AVOID),l=bL(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=pl(this.container);this.view.style.top=`${l-(this.useFixedPosition?pl(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?pl(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(),md(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Qc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}$A.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];$A.BUBBLE_DOWN_EVENTS=["click"];const eur=`
: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 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},nur=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let pue=class extends qe{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=qe.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new $A(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=_i(()=>{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)}};pue=tur([nur(0,cN)],pue);let VA=[],Sye=[],Iet=[];function c7(n,e=!1){iur(n,!1,e)}function iur(n,e,t){const i=rur(n,e);VA.push(i),i.userConfigured?Iet.push(i):Sye.push(i),t&&!i.userConfigured&&VA.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 rur(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?bet(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(hl.sep)>=0:!1}}function our(){VA=VA.filter(n=>n.userConfigured),Sye=[]}function sur(n,e){return aur(n,e).map(t=>t.id)}function aur(n,e){let t;if(n)switch(n.scheme){case Qi.file:t=n.fsPath;break;case Qi.data:{t=xS.parseMetaData(n).get(xS.META_DATA_LABEL);break}case Qi.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:xa.unknown}];t=t.toLowerCase();const i=Bw(t),r=oMe(t,i,Iet);if(r)return[r,{id:jf,mime:xa.text}];const o=oMe(t,i,Sye);if(o)return[o,{id:jf,mime:xa.text}];if(e){const s=lur(e);if(s)return[s,{id:jf,mime:xa.text}]}return[{id:"unknown",mime:xa.unknown}]}function oMe(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 lur(n){if(m0e(n)&&(n=n.substr(1)),n.length>0)for(let e=VA.length-1;e>=0;e--){const t=VA[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const u7=Object.prototype.hasOwnProperty,sMe="vs.editor.nullLanguage";class cur{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(sMe,0),this._register(jf,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]||sMe}}class l5 extends qe{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new De),this.onDidChange=this._onDidChange.event,l5.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new cur,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(TA.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){l5.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},our();const e=[].concat(TA.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})}),Hs.as(Nv.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;u7.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)c7({id:i,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)c7({id:i,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)c7({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);lXi(l)||c7({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?u7.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return u7.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&u7.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:sur(e,t)}}l5.instanceCount=0;class c5 extends qe{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new De),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new De),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new De({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,c5.instanceCount++,this._registry=this._register(new l5(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){c5.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 oXe(i,null)}createById(e){return new aMe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new aMe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=jf),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),Ks.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}c5.instanceCount=0;class aMe{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 De({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 u5={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:xa.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function Eye(...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}}Let.bind(void 0,!1);const d5=Let.bind(void 0,!0);function Let(n,e,t){if(!t||t.length<e.length)return null;let i;return n?i=d0e(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function Det(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function Aet(n,e){return gue(n.toLowerCase(),e.toLowerCase(),0,0)}function gue(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=gue(n,e,t+1,i+1))?kye({start:i,end:i+1},r):null}return gue(n,e,t,i+1)}function xye(n){return 97<=n&&n<=122}function oY(n){return 65<=n&&n<=90}function Tye(n){return 48<=n&&n<=57}function Ret(n){return n===32||n===9||n===10||n===13}const Net=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>Net.add(n.charCodeAt(0)));function zz(n){return Ret(n)||Net.has(n)}function uur(n,e){return n===e||zz(n)&&zz(e)}function Oet(n){return xye(n)||oY(n)||Tye(n)}function kye(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function Pet(n,e){for(let t=e;t<n.length;t++){const i=n.charCodeAt(t);if(oY(i)||Tye(i)||t>0&&!Oet(n.charCodeAt(t-1)))return t}return n.length}function mue(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=mue(n,e,t+1,i+1);!r&&(o=Pet(e,o))<e.length;)r=mue(n,e,t+1,o),o++;return r===null?null:kye({start:i,end:i+1},r)}}function dur(n){let e=0,t=0,i=0,r=0,o=0;for(let u=0;u<n.length;u++)o=n.charCodeAt(u),oY(o)&&e++,xye(o)&&t++,Oet(o)&&i++,Tye(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 hur(n){const{upperPercent:e,lowerPercent:t}=n;return t===0&&e>.6}function fur(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:r}=n;return t>.2&&e<.8&&i>.6&&r<.2}function pur(n){let e=0,t=0,i=0,r=0;for(let o=0;o<n.length;o++)i=n.charCodeAt(o),oY(i)&&e++,xye(i)&&t++,Ret(i)&&r++;return(e===0||t===0)&&r===0?n.length<=30:e<=5}function Met(n,e){if(!e||(e=e.trim(),e.length===0)||!pur(n)||e.length>60)return null;const t=dur(e);if(!fur(t)){if(!hur(t))return null;e=e.toLowerCase()}let i=null,r=0;for(n=n.toLowerCase();r<e.length&&(i=mue(n,e,0,r))===null;)r=Pet(e,r+1);return i}function gur(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=_ue(n,e,0,r,t))===null;)r=Fet(e,r+1);return i}function _ue(n,e,t,i,r){if(t===n.length)return[];if(i===e.length)return null;if(uur(n.charCodeAt(t),e.charCodeAt(i))){let o=null,s=i+1;if(o=_ue(n,e,t+1,i+1,r),!r)for(;!o&&(s=Fet(e,s))<e.length;)o=_ue(n,e,t+1,s,r),s++;return o?n.charCodeAt(t)!==e.charCodeAt(i)?o:kye({start:i,end:i+1},o):null}else return null}function Fet(n,e){for(let t=e;t<n.length;t++)if(zz(n.charCodeAt(t))||t>0&&zz(n.charCodeAt(t-1)))return t;return n.length}const mur=Eye(d5,Met,Det),_ur=Eye(d5,Met,Aet),lMe=new uE(1e4);function cMe(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=lMe.get(n);i||(i=new RegExp(sXi(n),"i"),lMe.set(n,i));const r=i.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?_ur(n,e):mur(n,e)}function vur(n,e){const t=nk(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?W6(t):null}function bur(n,e,t,i,r,o){const s=Math.min(13,n.length);for(;t<s;t++){const a=nk(n,e,t,i,r,o,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(a)return a}return[0,o]}function W6(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 uw=128;function Iye(){const n=[],e=[];for(let t=0;t<=uw;t++)e[t]=0;for(let t=0;t<=uw;t++)n.push(e.slice(0));return n}function Bet(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const $et=Bet(2*uw),vue=Bet(2*uw),Z0=Iye(),BE=Iye(),d7=Iye();function h7(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!!g0e(t)}}function uMe(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function uV(n,e,t){return e[n]!==t[n]}function yur(n,e,t,i,r,o,s=!1){for(;e<t&&r<o;)n[e]===i[r]&&(s&&($et[e]=r),e+=1),r+=1;return e===t}var gv;(function(n){n.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}n.isDefault=e})(gv||(gv={}));class sY{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}sY.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};function nk(n,e,t,i,r,o,s=sY.default){const a=n.length>uw?uw:n.length,l=i.length>uw?uw:i.length;if(t>=a||o>=l||a-t>l-o||!yur(e,t,a,r,o,l,!0))return;Cur(a,l,t,o,e,r);let c=1,u=1,d=t,h=o;const f=[!1];for(c=1,d=t;d<a;c++,d++){const b=$et[d],y=vue[d],C=d+1<a?vue[d+1]:l;for(u=b-o+1,h=b;h<C;u++,h++){let E=Number.MIN_SAFE_INTEGER,x=!1;h<=y&&(E=wur(n,e,d,t,i,r,h,l,o,Z0[c-1][u-1]===0,f));let k=0;E!==Number.MAX_SAFE_INTEGER&&(x=!0,k=E+BE[c-1][u-1]);const L=h>b,D=L?BE[c][u-1]+(Z0[c][u-1]>0?-5:0):0,A=h>b+1&&Z0[c][u-1]>0,N=A?BE[c][u-2]+(Z0[c][u-2]>0?-5:0):0;if(A&&(!L||N>=D)&&(!x||N>=k))BE[c][u]=N,d7[c][u]=3,Z0[c][u]=0;else if(L&&(!x||D>=k))BE[c][u]=D,d7[c][u]=2,Z0[c][u]=0;else if(x)BE[c][u]=k,d7[c][u]=1,Z0[c][u]=Z0[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[BE[c][u],o];let m=0,v=0;for(;c>=1;){let b=u;do{const y=d7[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]&&!uV(b+o-1,i,r)&&m+1>Z0[c][b]&&(b=u),b===u?m++:m=1,v||(v=b),c--,u=b-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const _=v-a;return g[0]-=_,g}function Cur(n,e,t,i,r,o){let s=n-1,a=e-1;for(;s>=t&&a>=i;)r[s]===o[a]&&(vue[s]=a,s--),a--}function wur(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:uV(s,r,o)&&(s===0||!uV(s-1,r,o))?(d=n[t]===r[s]?7:5,h=!0):h7(o,s)&&(s===0||!h7(o,s-1))?d=5:(h7(o,s-1)||uMe(o,s-1))&&(d=5,h=!0),d>1&&t===i&&(u[0]=!0),h||(h=uV(s,r,o)||h7(o,s-1)||uMe(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 Sur(n,e,t,i,r,o,s){return Eur(n,e,t,i,r,o,!0,s)}function Eur(n,e,t,i,r,o,s,a){let l=nk(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=xur(n,u);if(d){const h=nk(d,d.toLowerCase(),t,i,r,o,a);h&&(h[0]-=3,(!l||h[0]>l[0])&&(l=h))}}}return l}function xur(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 Tur="$(",Lye=new RegExp(`\\$\\(${ei.iconNameExpression}(?:${ei.iconModifierExpression})?\\)`,"g"),kur=new RegExp(`(\\\\)?${Lye.source}`,"g");function Iur(n){return n.replace(kur,(e,t)=>t?e:`\\${e}`)}const Lur=new RegExp(`\\\\${Lye.source}`,"g");function Dur(n){return n.replace(Lur,e=>`\\${e}`)}const Aur=new RegExp(`(\\s)?(\\\\)?${Lye.source}(\\s)?`,"g");function Dye(n){return n.indexOf(Tur)===-1?n:n.replace(Aur,(e,t,i,r)=>i?e:t||r||"")}function Rur(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const jte=new RegExp(`\\$\\(${ei.iconNameCharacter}+\\)`,"g");function AP(n){jte.lastIndex=0;let e="";const t=[];let i=0;for(;;){const r=jte.lastIndex,o=jte.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 qte(n,e,t=!1){const{text:i,iconOffsets:r}=e;if(!r||r.length===0)return cMe(n,i,t);const o=S6(i," "),s=i.length-o.length,a=cMe(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 Kc{constructor(e="",t=!1){var i,r,o;if(this.value=e,typeof this.value!="string")throw ag("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+=Our(this.supportThemeIcons?Iur(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(ep(t),"g");return e.replace(i,(r,o)=>e.charAt(o-1)!=="\\"?`\\${r}`:r)}}function HA(n){return zw(n)?!n.value:Array.isArray(n)?n.every(HA):!0}function zw(n){return n instanceof Kc?!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 Nur(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&&iye(Jn.from(n.baseUri),Jn.from(e.baseUri)))}function Our(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function f7(n){return n.replace(/"/g,"&quot;")}function Gte(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Pur(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 bue=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 Mur(n,e){Rd(e)?n.title=Dye(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class Fur{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var r;return bue(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||Rd(e)||e instanceof HTMLElement)o=e;else if(!S3(e.markdown))o=(r=e.markdown)!==null&&r!==void 0?r:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(T("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new $a;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?zw(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 Vet(n,e,t,i){let r,o;const s=(d,h)=>{var f;const g=o!==void 0;d&&(o==null||o.dispose(),o=void 0),h&&(r==null||r.dispose(),r=void 0),g&&((f=n.onDidHideHover)===null||f===void 0||f.call(n))},a=(d,h,f)=>new Jm(()=>bue(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new Fur(n,f||e,d>0),yield o.update(t,h,i))}),d),l=()=>{if(r)return;const d=new yt,h=m=>s(!1,m.fromElement===e);d.add(at(e,Xt.MOUSE_LEAVE,h,!0));const f=()=>s(!0,!0);d.add(at(e,Xt.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const m=v=>{g.x=v.x+10,v.target instanceof HTMLElement&&v.target.classList.contains("action-label")&&s(!0,!0)};d.add(at(e,Xt.MOUSE_MOVE,m,!0))}d.add(a(n.delay,!1,g)),r=d},c=at(e,Xt.MOUSE_OVER,l,!0);return{show:d=>{s(!1,!0),a(0,d)},hide:()=>{s(!0,!0)},update:(d,h)=>bue(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 Bur(n,e={}){const t=Aye(e);return t.textContent=n,t}function $ur(n,e={}){const t=Aye(e);return Het(t,Hur(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function Aye(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class Vur{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 Het(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(Ba(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=>{Het(r,o,t,i)})}function Hur(n,e){const t={type:1,children:[]};let i=0,r=t;const o=[],s=new Vur(n);for(;!s.eos();){let a=s.next();const l=a==="\\"&&yue(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&Wur(a,e)&&a===s.peek()){s.advance(),r.type===2&&(r=o.pop());const c=yue(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 Wur(n,e){return yue(n,e)!==0}function yue(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 zur=new RegExp(`(\\\\)?\\$\\((${ei.iconNameExpression}(?:${ei.iconModifierExpression})?)\\)`,"g");function Uw(n){const e=new Array;let t,i=0,r=0;for(;(t=zur.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})`:Cue({id:s}))}return i<n.length&&e.push(n.substring(i)),e}function Cue(n){const e=Rt("span");return e.classList.add(...ei.asClassNameArray(n)),e}class Rye{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const wue=new Rye("id#");let Bd={};(function(){function n(e,t){t(Bd)}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(be,Te){for(var se=0;se<Te.length;se++){var Y=Te[se];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(be,Y.key,Y)}}function i(be,Te,se){return Te&&t(be.prototype,Te),se&&t(be,se),Object.defineProperty(be,"prototype",{writable:!1}),be}function r(be,Te){if(be){if(typeof be=="string")return o(be,Te);var se=Object.prototype.toString.call(be).slice(8,-1);if(se==="Object"&&be.constructor&&(se=be.constructor.name),se==="Map"||se==="Set")return Array.from(be);if(se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(se))return o(be,Te)}}function o(be,Te){(Te==null||Te>be.length)&&(Te=be.length);for(var se=0,Y=new Array(Te);se<Te;se++)Y[se]=be[se];return Y}function s(be,Te){var se=typeof Symbol<"u"&&be[Symbol.iterator]||be["@@iterator"];if(se)return(se=se.call(be)).next.bind(se);if(Array.isArray(be)||(se=r(be))||Te&&be&&typeof be.length=="number"){se&&(be=se);var Y=0;return function(){return Y>=be.length?{done:!0}:{done:!1,value:be[Y++]}}}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(be){e.defaults=be}var c=/[&<>"']/,u=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},g=function(Te){return f[Te]};function m(be,Te){if(Te){if(c.test(be))return be.replace(u,g)}else if(d.test(be))return be.replace(h,g);return be}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _(be){return be.replace(v,function(Te,se){return se=se.toLowerCase(),se==="colon"?":":se.charAt(0)==="#"?se.charAt(1)==="x"?String.fromCharCode(parseInt(se.substring(2),16)):String.fromCharCode(+se.substring(1)):""})}var b=/(^|[^\[])\^/g;function y(be,Te){be=typeof be=="string"?be:be.source,Te=Te||"";var se={replace:function(X,le){return le=le.source||le,le=le.replace(b,"$1"),be=be.replace(X,le),se},getRegex:function(){return new RegExp(be,Te)}};return se}var C=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function x(be,Te,se){if(be){var Y;try{Y=decodeURIComponent(_(se)).replace(C,"").toLowerCase()}catch{return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}Te&&!E.test(se)&&(se=N(Te,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch{return null}return se}var k={},L=/^[^:]+:\/*[^/]*$/,D=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function N(be,Te){k[" "+be]||(L.test(be)?k[" "+be]=be+"/":k[" "+be]=F(be,"/",!0)),be=k[" "+be];var se=be.indexOf(":")===-1;return Te.substring(0,2)==="//"?se?Te:be.replace(D,"$1")+Te:Te.charAt(0)==="/"?se?Te:be.replace(A,"$1")+Te:be+Te}var P={exec:function(){}};function M(be){for(var Te=1,se,Y;Te<arguments.length;Te++){se=arguments[Te];for(Y in se)Object.prototype.hasOwnProperty.call(se,Y)&&(be[Y]=se[Y])}return be}function B(be,Te){var se=be.replace(/\|/g,function(le,te,me){for(var Me=!1,rt=te;--rt>=0&&me[rt]==="\\";)Me=!Me;return Me?"|":" |"}),Y=se.split(/ \|/),X=0;if(Y[0].trim()||Y.shift(),Y.length>0&&!Y[Y.length-1].trim()&&Y.pop(),Y.length>Te)Y.splice(Te);else for(;Y.length<Te;)Y.push("");for(;X<Y.length;X++)Y[X]=Y[X].trim().replace(/\\\|/g,"|");return Y}function F(be,Te,se){var Y=be.length;if(Y===0)return"";for(var X=0;X<Y;){var le=be.charAt(Y-X-1);if(le===Te&&!se)X++;else if(le!==Te&&se)X++;else break}return be.slice(0,Y-X)}function U(be,Te){if(be.indexOf(Te[1])===-1)return-1;for(var se=be.length,Y=0,X=0;X<se;X++)if(be[X]==="\\")X++;else if(be[X]===Te[0])Y++;else if(be[X]===Te[1]&&(Y--,Y<0))return X;return-1}function H(be){be&&be.sanitize&&!be.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 W(be,Te){if(Te<1)return"";for(var se="";Te>1;)Te&1&&(se+=be),Te>>=1,be+=be;return se+be}function q(be,Te,se,Y){var X=Te.href,le=Te.title?m(Te.title):null,te=be[1].replace(/\\([\[\]])/g,"$1");if(be[0].charAt(0)!=="!"){Y.state.inLink=!0;var me={type:"link",raw:se,href:X,title:le,text:te,tokens:Y.inlineTokens(te)};return Y.state.inLink=!1,me}return{type:"image",raw:se,href:X,title:le,text:m(te)}}function V(be,Te){var se=be.match(/^(\s+)(?:```)/);if(se===null)return Te;var Y=se[1];return Te.split(`
`).map(function(X){var le=X.match(/^\s+/);if(le===null)return X;var te=le[0];return te.length>=Y.length?X.slice(Y.length):X}).join(`
`)}var re=function(){function be(se){this.options=se||e.defaults}var Te=be.prototype;return Te.space=function(Y){var X=this.rules.block.newline.exec(Y);if(X&&X[0].length>0)return{type:"space",raw:X[0]}},Te.code=function(Y){var X=this.rules.block.code.exec(Y);if(X){var le=X[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:X[0],codeBlockStyle:"indented",text:this.options.pedantic?le:F(le,`
`)}}},Te.fences=function(Y){var X=this.rules.block.fences.exec(Y);if(X){var le=X[0],te=V(le,X[3]||"");return{type:"code",raw:le,lang:X[2]?X[2].trim():X[2],text:te}}},Te.heading=function(Y){var X=this.rules.block.heading.exec(Y);if(X){var le=X[2].trim();if(/#$/.test(le)){var te=F(le,"#");(this.options.pedantic||!te||/ $/.test(te))&&(le=te.trim())}return{type:"heading",raw:X[0],depth:X[1].length,text:le,tokens:this.lexer.inline(le)}}},Te.hr=function(Y){var X=this.rules.block.hr.exec(Y);if(X)return{type:"hr",raw:X[0]}},Te.blockquote=function(Y){var X=this.rules.block.blockquote.exec(Y);if(X){var le=X[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:X[0],tokens:this.lexer.blockTokens(le,[]),text:le}}},Te.list=function(Y){var X=this.rules.block.list.exec(Y);if(X){var le,te,me,Me,rt,It,Qt,pe,We,ne,Se,Ie,Ke=X[1].trim(),Je=Ke.length>1,ot={type:"list",raw:"",ordered:Je,start:Je?+Ke.slice(0,-1):"",loose:!1,items:[]};Ke=Je?"\\d{1,9}\\"+Ke.slice(-1):"\\"+Ke,this.options.pedantic&&(Ke=Je?Ke:"[*+-]");for(var wt=new RegExp("^( {0,3}"+Ke+")((?:[ ][^\\n]*)?(?:\\n|$))");Y&&(Ie=!1,!(!(X=wt.exec(Y))||this.rules.block.hr.test(Y)));){if(le=X[0],Y=Y.substring(le.length),pe=X[2].split(`
`,1)[0],We=Y.split(`
`,1)[0],this.options.pedantic?(Me=2,Se=pe.trimLeft()):(Me=X[2].search(/[^ ]/),Me=Me>4?1:Me,Se=pe.slice(Me),Me+=X[1].length),It=!1,!pe&&/^ *$/.test(We)&&(le+=We+`
`,Y=Y.substring(We.length+1),Ie=!0),!Ie)for(var pn=new RegExp("^ {0,"+Math.min(3,Me-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),Kn=new RegExp("^ {0,"+Math.min(3,Me-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Cn=new RegExp("^ {0,"+Math.min(3,Me-1)+"}(?:```|~~~)"),hn=new RegExp("^ {0,"+Math.min(3,Me-1)+"}#");Y&&(ne=Y.split(`
`,1)[0],pe=ne,this.options.pedantic&&(pe=pe.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Cn.test(pe)||hn.test(pe)||pn.test(pe)||Kn.test(Y)));){if(pe.search(/[^ ]/)>=Me||!pe.trim())Se+=`
`+pe.slice(Me);else if(!It)Se+=`
`+pe;else break;!It&&!pe.trim()&&(It=!0),le+=ne+`
`,Y=Y.substring(ne.length+1)}ot.loose||(Qt?ot.loose=!0:/\n *\n *$/.test(le)&&(Qt=!0)),this.options.gfm&&(te=/^\[[ xX]\] /.exec(Se),te&&(me=te[0]!=="[ ] ",Se=Se.replace(/^\[[ xX]\] +/,""))),ot.items.push({type:"list_item",raw:le,task:!!te,checked:me,loose:!1,text:Se}),ot.raw+=le}ot.items[ot.items.length-1].raw=le.trimRight(),ot.items[ot.items.length-1].text=Se.trimRight(),ot.raw=ot.raw.trimRight();var bn=ot.items.length;for(rt=0;rt<bn;rt++){this.lexer.state.top=!1,ot.items[rt].tokens=this.lexer.blockTokens(ot.items[rt].text,[]);var Wn=ot.items[rt].tokens.filter(function(er){return er.type==="space"}),Ei=Wn.every(function(er){for(var ur=er.raw.split(""),Jr=0,$i=s(ur),xs;!(xs=$i()).done;){var wr=xs.value;if(wr===`
`&&(Jr+=1),Jr>1)return!0}return!1});!ot.loose&&Wn.length&&Ei&&(ot.loose=!0,ot.items[rt].loose=!0)}return ot}},Te.html=function(Y){var X=this.rules.block.html.exec(Y);if(X){var le={type:"html",raw:X[0],pre:!this.options.sanitizer&&(X[1]==="pre"||X[1]==="script"||X[1]==="style"),text:X[0]};if(this.options.sanitize){var te=this.options.sanitizer?this.options.sanitizer(X[0]):m(X[0]);le.type="paragraph",le.text=te,le.tokens=this.lexer.inline(te)}return le}},Te.def=function(Y){var X=this.rules.block.def.exec(Y);if(X){X[3]&&(X[3]=X[3].substring(1,X[3].length-1));var le=X[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:le,raw:X[0],href:X[2],title:X[3]}}},Te.table=function(Y){var X=this.rules.block.table.exec(Y);if(X){var le={type:"table",header:B(X[1]).map(function(Qt){return{text:Qt}}),align:X[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:X[3]&&X[3].trim()?X[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(le.header.length===le.align.length){le.raw=X[0];var te=le.align.length,me,Me,rt,It;for(me=0;me<te;me++)/^ *-+: *$/.test(le.align[me])?le.align[me]="right":/^ *:-+: *$/.test(le.align[me])?le.align[me]="center":/^ *:-+ *$/.test(le.align[me])?le.align[me]="left":le.align[me]=null;for(te=le.rows.length,me=0;me<te;me++)le.rows[me]=B(le.rows[me],le.header.length).map(function(Qt){return{text:Qt}});for(te=le.header.length,Me=0;Me<te;Me++)le.header[Me].tokens=this.lexer.inline(le.header[Me].text);for(te=le.rows.length,Me=0;Me<te;Me++)for(It=le.rows[Me],rt=0;rt<It.length;rt++)It[rt].tokens=this.lexer.inline(It[rt].text);return le}}},Te.lheading=function(Y){var X=this.rules.block.lheading.exec(Y);if(X)return{type:"heading",raw:X[0],depth:X[2].charAt(0)==="="?1:2,text:X[1],tokens:this.lexer.inline(X[1])}},Te.paragraph=function(Y){var X=this.rules.block.paragraph.exec(Y);if(X){var le=X[1].charAt(X[1].length-1)===`
`?X[1].slice(0,-1):X[1];return{type:"paragraph",raw:X[0],text:le,tokens:this.lexer.inline(le)}}},Te.text=function(Y){var X=this.rules.block.text.exec(Y);if(X)return{type:"text",raw:X[0],text:X[0],tokens:this.lexer.inline(X[0])}},Te.escape=function(Y){var X=this.rules.inline.escape.exec(Y);if(X)return{type:"escape",raw:X[0],text:m(X[1])}},Te.tag=function(Y){var X=this.rules.inline.tag.exec(Y);if(X)return!this.lexer.state.inLink&&/^<a /i.test(X[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(X[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(X[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(X[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:X[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(X[0]):m(X[0]):X[0]}},Te.link=function(Y){var X=this.rules.inline.link.exec(Y);if(X){var le=X[2].trim();if(!this.options.pedantic&&/^</.test(le)){if(!/>$/.test(le))return;var te=F(le.slice(0,-1),"\\");if((le.length-te.length)%2===0)return}else{var me=U(X[2],"()");if(me>-1){var Me=X[0].indexOf("!")===0?5:4,rt=Me+X[1].length+me;X[2]=X[2].substring(0,me),X[0]=X[0].substring(0,rt).trim(),X[3]=""}}var It=X[2],Qt="";if(this.options.pedantic){var pe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(It);pe&&(It=pe[1],Qt=pe[3])}else Qt=X[3]?X[3].slice(1,-1):"";return It=It.trim(),/^</.test(It)&&(this.options.pedantic&&!/>$/.test(le)?It=It.slice(1):It=It.slice(1,-1)),q(X,{href:It&&It.replace(this.rules.inline._escapes,"$1"),title:Qt&&Qt.replace(this.rules.inline._escapes,"$1")},X[0],this.lexer)}},Te.reflink=function(Y,X){var le;if((le=this.rules.inline.reflink.exec(Y))||(le=this.rules.inline.nolink.exec(Y))){var te=(le[2]||le[1]).replace(/\s+/g," ");if(te=X[te.toLowerCase()],!te||!te.href){var me=le[0].charAt(0);return{type:"text",raw:me,text:me}}return q(le,te,le[0],this.lexer)}},Te.emStrong=function(Y,X,le){le===void 0&&(le="");var te=this.rules.inline.emStrong.lDelim.exec(Y);if(te&&!(te[3]&&le.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 me=te[1]||te[2]||"";if(!me||me&&(le===""||this.rules.inline.punctuation.exec(le))){var Me=te[0].length-1,rt,It,Qt=Me,pe=0,We=te[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(We.lastIndex=0,X=X.slice(-1*Y.length+Me);(te=We.exec(X))!=null;)if(rt=te[1]||te[2]||te[3]||te[4]||te[5]||te[6],!!rt){if(It=rt.length,te[3]||te[4]){Qt+=It;continue}else if((te[5]||te[6])&&Me%3&&!((Me+It)%3)){pe+=It;continue}if(Qt-=It,!(Qt>0)){if(It=Math.min(It,It+Qt+pe),Math.min(Me,It)%2){var ne=Y.slice(1,Me+te.index+It);return{type:"em",raw:Y.slice(0,Me+te.index+It+1),text:ne,tokens:this.lexer.inlineTokens(ne)}}var Se=Y.slice(2,Me+te.index+It-1);return{type:"strong",raw:Y.slice(0,Me+te.index+It+1),text:Se,tokens:this.lexer.inlineTokens(Se)}}}}}},Te.codespan=function(Y){var X=this.rules.inline.code.exec(Y);if(X){var le=X[2].replace(/\n/g," "),te=/[^ ]/.test(le),me=/^ /.test(le)&&/ $/.test(le);return te&&me&&(le=le.substring(1,le.length-1)),le=m(le,!0),{type:"codespan",raw:X[0],text:le}}},Te.br=function(Y){var X=this.rules.inline.br.exec(Y);if(X)return{type:"br",raw:X[0]}},Te.del=function(Y){var X=this.rules.inline.del.exec(Y);if(X)return{type:"del",raw:X[0],text:X[2],tokens:this.lexer.inlineTokens(X[2])}},Te.autolink=function(Y,X){var le=this.rules.inline.autolink.exec(Y);if(le){var te,me;return le[2]==="@"?(te=m(this.options.mangle?X(le[1]):le[1]),me="mailto:"+te):(te=m(le[1]),me=te),{type:"link",raw:le[0],text:te,href:me,tokens:[{type:"text",raw:te,text:te}]}}},Te.url=function(Y,X){var le;if(le=this.rules.inline.url.exec(Y)){var te,me;if(le[2]==="@")te=m(this.options.mangle?X(le[0]):le[0]),me="mailto:"+te;else{var Me;do Me=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(Me!==le[0]);te=m(le[0]),le[1]==="www."?me="http://"+te:me=te}return{type:"link",raw:le[0],text:te,href:me,tokens:[{type:"text",raw:te,text:te}]}}},Te.inlineText=function(Y,X){var le=this.rules.inline.text.exec(Y);if(le){var te;return this.lexer.state.inRawBlock?te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):m(le[0]):le[0]:te=m(this.options.smartypants?X(le[0]):le[0]),{type:"text",raw:le[0],text:te}}},be}(),oe={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:P,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};oe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,oe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,oe.def=y(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex(),oe.bullet=/(?:[*+-]|\d{1,9}[.)])/,oe.listItemStart=y(/^( *)(bull) */).replace("bull",oe.bullet).getRegex(),oe.list=y(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex(),oe._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",oe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,oe.html=y(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe.paragraph=y(oe._paragraph).replace("hr",oe.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",oe._tag).getRegex(),oe.blockquote=y(oe.blockquote).replace("paragraph",oe.paragraph).getRegex(),oe.normal=M({},oe),oe.gfm=M({},oe.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),oe.gfm.table=y(oe.gfm.table).replace("hr",oe.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",oe._tag).getRegex(),oe.gfm.paragraph=y(oe._paragraph).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",oe.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",oe._tag).getRegex(),oe.pedantic=M({},oe.normal,{html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oe._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:P,paragraph:y(oe.normal._paragraph).replace("hr",oe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:P,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:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Q.punctuation=y(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex(),Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Q.escapedEmSt=/\\\*|\\_/g,Q._comment=y(oe._comment).replace("(?:-->|$)","-->").getRegex(),Q.emStrong.lDelim=y(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex(),Q.emStrong.rDelimAst=y(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex(),Q.emStrong.rDelimUnd=y(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex(),Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Q._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])?)+(?![-_])/,Q.autolink=y(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex(),Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Q.tag=y(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex(),Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Q.link=y(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex(),Q.reflink=y(Q.reflink).replace("label",Q._label).replace("ref",oe._label).getRegex(),Q.nolink=y(Q.nolink).replace("ref",oe._label).getRegex(),Q.reflinkSearch=y(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex(),Q.normal=M({},Q),Q.pedantic=M({},Q.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",Q._label).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()}),Q.gfm=M({},Q.normal,{escape:y(Q.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Q.gfm.url=y(Q.gfm.url,"i").replace("email",Q.gfm._extended_email).getRegex(),Q.breaks=M({},Q.gfm,{br:y(Q.br).replace("{2,}","*").getRegex(),text:y(Q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function Ne(be){return be.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Ve(be){var Te="",se,Y,X=be.length;for(se=0;se<X;se++)Y=be.charCodeAt(se),Math.random()>.5&&(Y="x"+Y.toString(16)),Te+="&#"+Y+";";return Te}var Ye=function(){function be(se){this.tokens=[],this.tokens.links=Object.create(null),this.options=se||e.defaults,this.options.tokenizer=this.options.tokenizer||new re,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 Y={block:oe.normal,inline:Q.normal};this.options.pedantic?(Y.block=oe.pedantic,Y.inline=Q.pedantic):this.options.gfm&&(Y.block=oe.gfm,this.options.breaks?Y.inline=Q.breaks:Y.inline=Q.gfm),this.tokenizer.rules=Y}be.lex=function(Y,X){var le=new be(X);return le.lex(Y)},be.lexInline=function(Y,X){var le=new be(X);return le.inlineTokens(Y)};var Te=be.prototype;return Te.lex=function(Y){Y=Y.replace(/\r\n|\r/g,`
`),this.blockTokens(Y,this.tokens);for(var X;X=this.inlineQueue.shift();)this.inlineTokens(X.src,X.tokens);return this.tokens},Te.blockTokens=function(Y,X){var le=this;X===void 0&&(X=[]),this.options.pedantic?Y=Y.replace(/\t/g," ").replace(/^ +$/gm,""):Y=Y.replace(/^( *)(\t+)/gm,function(Qt,pe,We){return pe+" ".repeat(We.length)});for(var te,me,Me,rt;Y;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Qt){return(te=Qt.call({lexer:le},Y,X))?(Y=Y.substring(te.raw.length),X.push(te),!0):!1}))){if(te=this.tokenizer.space(Y)){Y=Y.substring(te.raw.length),te.raw.length===1&&X.length>0?X[X.length-1].raw+=`
`:X.push(te);continue}if(te=this.tokenizer.code(Y)){Y=Y.substring(te.raw.length),me=X[X.length-1],me&&(me.type==="paragraph"||me.type==="text")?(me.raw+=`
`+te.raw,me.text+=`
`+te.text,this.inlineQueue[this.inlineQueue.length-1].src=me.text):X.push(te);continue}if(te=this.tokenizer.fences(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.heading(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.hr(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.blockquote(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.list(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.html(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.def(Y)){Y=Y.substring(te.raw.length),me=X[X.length-1],me&&(me.type==="paragraph"||me.type==="text")?(me.raw+=`
`+te.raw,me.text+=`
`+te.raw,this.inlineQueue[this.inlineQueue.length-1].src=me.text):this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.lheading(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(Me=Y,this.options.extensions&&this.options.extensions.startBlock&&function(){var Qt=1/0,pe=Y.slice(1),We=void 0;le.options.extensions.startBlock.forEach(function(ne){We=ne.call({lexer:this},pe),typeof We=="number"&&We>=0&&(Qt=Math.min(Qt,We))}),Qt<1/0&&Qt>=0&&(Me=Y.substring(0,Qt+1))}(),this.state.top&&(te=this.tokenizer.paragraph(Me))){me=X[X.length-1],rt&&me.type==="paragraph"?(me.raw+=`
`+te.raw,me.text+=`
`+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=me.text):X.push(te),rt=Me.length!==Y.length,Y=Y.substring(te.raw.length);continue}if(te=this.tokenizer.text(Y)){Y=Y.substring(te.raw.length),me=X[X.length-1],me&&me.type==="text"?(me.raw+=`
`+te.raw,me.text+=`
`+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=me.text):X.push(te);continue}if(Y){var It="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return this.state.top=!0,X},Te.inline=function(Y,X){return X===void 0&&(X=[]),this.inlineQueue.push({src:Y,tokens:X}),X},Te.inlineTokens=function(Y,X){var le=this;X===void 0&&(X=[]);var te,me,Me,rt=Y,It,Qt,pe;if(this.tokens.links){var We=Object.keys(this.tokens.links);if(We.length>0)for(;(It=this.tokenizer.rules.inline.reflinkSearch.exec(rt))!=null;)We.includes(It[0].slice(It[0].lastIndexOf("[")+1,-1))&&(rt=rt.slice(0,It.index)+"["+W("a",It[0].length-2)+"]"+rt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(It=this.tokenizer.rules.inline.blockSkip.exec(rt))!=null;)rt=rt.slice(0,It.index)+"["+W("a",It[0].length-2)+"]"+rt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(It=this.tokenizer.rules.inline.escapedEmSt.exec(rt))!=null;)rt=rt.slice(0,It.index)+"++"+rt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;Y;)if(Qt||(pe=""),Qt=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Se){return(te=Se.call({lexer:le},Y,X))?(Y=Y.substring(te.raw.length),X.push(te),!0):!1}))){if(te=this.tokenizer.escape(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.tag(Y)){Y=Y.substring(te.raw.length),me=X[X.length-1],me&&te.type==="text"&&me.type==="text"?(me.raw+=te.raw,me.text+=te.text):X.push(te);continue}if(te=this.tokenizer.link(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(te.raw.length),me=X[X.length-1],me&&te.type==="text"&&me.type==="text"?(me.raw+=te.raw,me.text+=te.text):X.push(te);continue}if(te=this.tokenizer.emStrong(Y,rt,pe)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.codespan(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.br(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.del(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.autolink(Y,Ve)){Y=Y.substring(te.raw.length),X.push(te);continue}if(!this.state.inLink&&(te=this.tokenizer.url(Y,Ve))){Y=Y.substring(te.raw.length),X.push(te);continue}if(Me=Y,this.options.extensions&&this.options.extensions.startInline&&function(){var Se=1/0,Ie=Y.slice(1),Ke=void 0;le.options.extensions.startInline.forEach(function(Je){Ke=Je.call({lexer:this},Ie),typeof Ke=="number"&&Ke>=0&&(Se=Math.min(Se,Ke))}),Se<1/0&&Se>=0&&(Me=Y.substring(0,Se+1))}(),te=this.tokenizer.inlineText(Me,Ne)){Y=Y.substring(te.raw.length),te.raw.slice(-1)!=="_"&&(pe=te.raw.slice(-1)),Qt=!0,me=X[X.length-1],me&&me.type==="text"?(me.raw+=te.raw,me.text+=te.text):X.push(te);continue}if(Y){var ne="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(ne);break}else throw new Error(ne)}}return X},i(be,null,[{key:"rules",get:function(){return{block:oe,inline:Q}}}]),be}(),ye=function(){function be(se){this.options=se||e.defaults}var Te=be.prototype;return Te.code=function(Y,X,le){var te=(X||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(Y,te);me!=null&&me!==Y&&(le=!0,Y=me)}return Y=Y.replace(/\n$/,"")+`
`,te?'<pre><code class="'+this.options.langPrefix+m(te,!0)+'">'+(le?Y:m(Y,!0))+`</code></pre>
`:"<pre><code>"+(le?Y:m(Y,!0))+`</code></pre>
`},Te.blockquote=function(Y){return`<blockquote>
`+Y+`</blockquote>
`},Te.html=function(Y){return Y},Te.heading=function(Y,X,le,te){if(this.options.headerIds){var me=this.options.headerPrefix+te.slug(le);return"<h"+X+' id="'+me+'">'+Y+"</h"+X+`>
`}return"<h"+X+">"+Y+"</h"+X+`>
`},Te.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Te.list=function(Y,X,le){var te=X?"ol":"ul",me=X&&le!==1?' start="'+le+'"':"";return"<"+te+me+`>
`+Y+"</"+te+`>
`},Te.listitem=function(Y){return"<li>"+Y+`</li>
`},Te.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Te.paragraph=function(Y){return"<p>"+Y+`</p>
`},Te.table=function(Y,X){return X&&(X="<tbody>"+X+"</tbody>"),`<table>
<thead>
`+Y+`</thead>
`+X+`</table>
`},Te.tablerow=function(Y){return`<tr>
`+Y+`</tr>
`},Te.tablecell=function(Y,X){var le=X.header?"th":"td",te=X.align?"<"+le+' align="'+X.align+'">':"<"+le+">";return te+Y+("</"+le+`>
`)},Te.strong=function(Y){return"<strong>"+Y+"</strong>"},Te.em=function(Y){return"<em>"+Y+"</em>"},Te.codespan=function(Y){return"<code>"+Y+"</code>"},Te.br=function(){return this.options.xhtml?"<br/>":"<br>"},Te.del=function(Y){return"<del>"+Y+"</del>"},Te.link=function(Y,X,le){if(Y=x(this.options.sanitize,this.options.baseUrl,Y),Y===null)return le;var te='<a href="'+m(Y)+'"';return X&&(te+=' title="'+X+'"'),te+=">"+le+"</a>",te},Te.image=function(Y,X,le){if(Y=x(this.options.sanitize,this.options.baseUrl,Y),Y===null)return le;var te='<img src="'+Y+'" alt="'+le+'"';return X&&(te+=' title="'+X+'"'),te+=this.options.xhtml?"/>":">",te},Te.text=function(Y){return Y},be}(),He=function(){function be(){}var Te=be.prototype;return Te.strong=function(Y){return Y},Te.em=function(Y){return Y},Te.codespan=function(Y){return Y},Te.del=function(Y){return Y},Te.html=function(Y){return Y},Te.text=function(Y){return Y},Te.link=function(Y,X,le){return""+le},Te.image=function(Y,X,le){return""+le},Te.br=function(){return""},be}(),Pe=function(){function be(){this.seen={}}var Te=be.prototype;return Te.serialize=function(Y){return Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Te.getNextSafeSlug=function(Y,X){var le=Y,te=0;if(this.seen.hasOwnProperty(le)){te=this.seen[Y];do te++,le=Y+"-"+te;while(this.seen.hasOwnProperty(le))}return X||(this.seen[Y]=te,this.seen[le]=0),le},Te.slug=function(Y,X){X===void 0&&(X={});var le=this.serialize(Y);return this.getNextSafeSlug(le,X.dryrun)},be}(),Ge=function(){function be(se){this.options=se||e.defaults,this.options.renderer=this.options.renderer||new ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He,this.slugger=new Pe}be.parse=function(Y,X){var le=new be(X);return le.parse(Y)},be.parseInline=function(Y,X){var le=new be(X);return le.parseInline(Y)};var Te=be.prototype;return Te.parse=function(Y,X){X===void 0&&(X=!0);var le="",te,me,Me,rt,It,Qt,pe,We,ne,Se,Ie,Ke,Je,ot,wt,pn,Kn,Cn,hn,bn=Y.length;for(te=0;te<bn;te++){if(Se=Y[te],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Se.type]&&(hn=this.options.extensions.renderers[Se.type].call({parser:this},Se),hn!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Se.type))){le+=hn||"";continue}switch(Se.type){case"space":continue;case"hr":{le+=this.renderer.hr();continue}case"heading":{le+=this.renderer.heading(this.parseInline(Se.tokens),Se.depth,_(this.parseInline(Se.tokens,this.textRenderer)),this.slugger);continue}case"code":{le+=this.renderer.code(Se.text,Se.lang,Se.escaped);continue}case"table":{for(We="",pe="",rt=Se.header.length,me=0;me<rt;me++)pe+=this.renderer.tablecell(this.parseInline(Se.header[me].tokens),{header:!0,align:Se.align[me]});for(We+=this.renderer.tablerow(pe),ne="",rt=Se.rows.length,me=0;me<rt;me++){for(Qt=Se.rows[me],pe="",It=Qt.length,Me=0;Me<It;Me++)pe+=this.renderer.tablecell(this.parseInline(Qt[Me].tokens),{header:!1,align:Se.align[Me]});ne+=this.renderer.tablerow(pe)}le+=this.renderer.table(We,ne);continue}case"blockquote":{ne=this.parse(Se.tokens),le+=this.renderer.blockquote(ne);continue}case"list":{for(Ie=Se.ordered,Ke=Se.start,Je=Se.loose,rt=Se.items.length,ne="",me=0;me<rt;me++)wt=Se.items[me],pn=wt.checked,Kn=wt.task,ot="",wt.task&&(Cn=this.renderer.checkbox(pn),Je?wt.tokens.length>0&&wt.tokens[0].type==="paragraph"?(wt.tokens[0].text=Cn+" "+wt.tokens[0].text,wt.tokens[0].tokens&&wt.tokens[0].tokens.length>0&&wt.tokens[0].tokens[0].type==="text"&&(wt.tokens[0].tokens[0].text=Cn+" "+wt.tokens[0].tokens[0].text)):wt.tokens.unshift({type:"text",text:Cn}):ot+=Cn),ot+=this.parse(wt.tokens,Je),ne+=this.renderer.listitem(ot,Kn,pn);le+=this.renderer.list(ne,Ie,Ke);continue}case"html":{le+=this.renderer.html(Se.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(Se.tokens));continue}case"text":{for(ne=Se.tokens?this.parseInline(Se.tokens):Se.text;te+1<bn&&Y[te+1].type==="text";)Se=Y[++te],ne+=`
`+(Se.tokens?this.parseInline(Se.tokens):Se.text);le+=X?this.renderer.paragraph(ne):ne;continue}default:{var Wn='Token with "'+Se.type+'" type was not found.';if(this.options.silent){console.error(Wn);return}else throw new Error(Wn)}}}return le},Te.parseInline=function(Y,X){X=X||this.renderer;var le="",te,me,Me,rt=Y.length;for(te=0;te<rt;te++){if(me=Y[te],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[me.type]&&(Me=this.options.extensions.renderers[me.type].call({parser:this},me),Me!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(me.type))){le+=Me||"";continue}switch(me.type){case"escape":{le+=X.text(me.text);break}case"html":{le+=X.html(me.text);break}case"link":{le+=X.link(me.href,me.title,this.parseInline(me.tokens,X));break}case"image":{le+=X.image(me.href,me.title,me.text);break}case"strong":{le+=X.strong(this.parseInline(me.tokens,X));break}case"em":{le+=X.em(this.parseInline(me.tokens,X));break}case"codespan":{le+=X.codespan(me.text);break}case"br":{le+=X.br();break}case"del":{le+=X.del(this.parseInline(me.tokens,X));break}case"text":{le+=X.text(me.text);break}default:{var It='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(It);return}else throw new Error(It)}}}return le},be}();function Fe(be,Te,se){if(typeof be>"u"||be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");if(typeof Te=="function"&&(se=Te,Te=null),Te=M({},Fe.defaults,Te||{}),H(Te),se){var Y=Te.highlight,X;try{X=Ye.lex(be,Te)}catch(rt){return se(rt)}var le=function(It){var Qt;if(!It)try{Te.walkTokens&&Fe.walkTokens(X,Te.walkTokens),Qt=Ge.parse(X,Te)}catch(pe){It=pe}return Te.highlight=Y,It?se(It):se(null,Qt)};if(!Y||Y.length<3||(delete Te.highlight,!X.length))return le();var te=0;Fe.walkTokens(X,function(rt){rt.type==="code"&&(te++,setTimeout(function(){Y(rt.text,rt.lang,function(It,Qt){if(It)return le(It);Qt!=null&&Qt!==rt.text&&(rt.text=Qt,rt.escaped=!0),te--,te===0&&le()})},0))}),te===0&&le();return}function me(rt){if(rt.message+=`
Please report this to https://github.com/markedjs/marked.`,Te.silent)return"<p>An error occurred:</p><pre>"+m(rt.message+"",!0)+"</pre>";throw rt}try{var Me=Ye.lex(be,Te);if(Te.walkTokens){if(Te.async)return Promise.all(Fe.walkTokens(Me,Te.walkTokens)).then(function(){return Ge.parse(Me,Te)}).catch(me);Fe.walkTokens(Me,Te.walkTokens)}return Ge.parse(Me,Te)}catch(rt){me(rt)}}Fe.options=Fe.setOptions=function(be){return M(Fe.defaults,be),l(Fe.defaults),Fe},Fe.getDefaults=a,Fe.defaults=e.defaults,Fe.use=function(){for(var be=arguments.length,Te=new Array(be),se=0;se<be;se++)Te[se]=arguments[se];var Y=M.apply(void 0,[{}].concat(Te)),X=Fe.defaults.extensions||{renderers:{},childTokens:{}},le;Te.forEach(function(te){if(te.extensions&&(le=!0,te.extensions.forEach(function(Me){if(!Me.name)throw new Error("extension name required");if(Me.renderer){var rt=X.renderers?X.renderers[Me.name]:null;rt?X.renderers[Me.name]=function(){for(var It=arguments.length,Qt=new Array(It),pe=0;pe<It;pe++)Qt[pe]=arguments[pe];var We=Me.renderer.apply(this,Qt);return We===!1&&(We=rt.apply(this,Qt)),We}:X.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'");X[Me.level]?X[Me.level].unshift(Me.tokenizer):X[Me.level]=[Me.tokenizer],Me.start&&(Me.level==="block"?X.startBlock?X.startBlock.push(Me.start):X.startBlock=[Me.start]:Me.level==="inline"&&(X.startInline?X.startInline.push(Me.start):X.startInline=[Me.start]))}Me.childTokens&&(X.childTokens[Me.name]=Me.childTokens)})),te.renderer&&function(){var Me=Fe.defaults.renderer||new ye,rt=function(pe){var We=Me[pe];Me[pe]=function(){for(var ne=arguments.length,Se=new Array(ne),Ie=0;Ie<ne;Ie++)Se[Ie]=arguments[Ie];var Ke=te.renderer[pe].apply(Me,Se);return Ke===!1&&(Ke=We.apply(Me,Se)),Ke}};for(var It in te.renderer)rt(It);Y.renderer=Me}(),te.tokenizer&&function(){var Me=Fe.defaults.tokenizer||new re,rt=function(pe){var We=Me[pe];Me[pe]=function(){for(var ne=arguments.length,Se=new Array(ne),Ie=0;Ie<ne;Ie++)Se[Ie]=arguments[Ie];var Ke=te.tokenizer[pe].apply(Me,Se);return Ke===!1&&(Ke=We.apply(Me,Se)),Ke}};for(var It in te.tokenizer)rt(It);Y.tokenizer=Me}(),te.walkTokens){var me=Fe.defaults.walkTokens;Y.walkTokens=function(Me){var rt=[];return rt.push(te.walkTokens.call(this,Me)),me&&(rt=rt.concat(me.call(this,Me))),rt}}le&&(Y.extensions=X),Fe.setOptions(Y)})},Fe.walkTokens=function(be,Te){for(var se=[],Y=function(){var me=le.value;switch(se=se.concat(Te.call(Fe,me)),me.type){case"table":{for(var Me=s(me.header),rt;!(rt=Me()).done;){var It=rt.value;se=se.concat(Fe.walkTokens(It.tokens,Te))}for(var Qt=s(me.rows),pe;!(pe=Qt()).done;)for(var We=pe.value,ne=s(We),Se;!(Se=ne()).done;){var Ie=Se.value;se=se.concat(Fe.walkTokens(Ie.tokens,Te))}break}case"list":{se=se.concat(Fe.walkTokens(me.items,Te));break}default:Fe.defaults.extensions&&Fe.defaults.extensions.childTokens&&Fe.defaults.extensions.childTokens[me.type]?Fe.defaults.extensions.childTokens[me.type].forEach(function(Ke){se=se.concat(Fe.walkTokens(me[Ke],Te))}):me.tokens&&(se=se.concat(Fe.walkTokens(me.tokens,Te)))}},X=s(be),le;!(le=X()).done;)Y();return se},Fe.parseInline=function(be,Te){if(typeof be>"u"||be===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");Te=M({},Fe.defaults,Te||{}),H(Te);try{var se=Ye.lexInline(be,Te);return Te.walkTokens&&Fe.walkTokens(se,Te.walkTokens),Ge.parseInline(se,Te)}catch(Y){if(Y.message+=`
Please report this to https://github.com/markedjs/marked.`,Te.silent)return"<p>An error occurred:</p><pre>"+m(Y.message+"",!0)+"</pre>";throw Y}},Fe.Parser=Ge,Fe.parser=Ge.parse,Fe.Renderer=ye,Fe.TextRenderer=He,Fe.Lexer=Ye,Fe.lexer=Ye.lex,Fe.Tokenizer=re,Fe.Slugger=Pe,Fe.parse=Fe;var bt=Fe.options,Mt=Fe.setOptions,Ft=Fe.use,Yt=Fe.walkTokens,ln=Fe.parseInline,Et=Fe,mt=Ge.parse,Lt=Ye.lex;e.Lexer=Ye,e.Parser=Ge,e.Renderer=ye,e.Slugger=Pe,e.TextRenderer=He,e.Tokenizer=re,e.getDefaults=a,e.lexer=Lt,e.marked=Fe,e.options=bt,e.parse=Et,e.parseInline=ln,e.parser=mt,e.setOptions=Mt,e.use=Ft,e.walkTokens=Yt,Object.defineProperty(e,"__esModule",{value:!0})})})();Bd.Lexer||exports.Lexer;Bd.Parser||exports.Parser;Bd.Renderer||exports.Renderer;Bd.Slugger||exports.Slugger;Bd.TextRenderer||exports.TextRenderer;Bd.Tokenizer||exports.Tokenizer;Bd.getDefaults||exports.getDefaults;Bd.lexer||exports.lexer;var Sb=Bd.marked||exports.marked;Bd.options||exports.options;Bd.parse||exports.parse;Bd.parseInline||exports.parseInline;Bd.parser||exports.parser;Bd.setOptions||exports.setOptions;Bd.use||exports.use;Bd.walkTokens||exports.walkTokens;function Uur(n){return JSON.stringify(n,jur)}function Sue(n){let e=JSON.parse(n);return e=Eue(e),e}function jur(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function Eue(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return Jn.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof NK||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t<n.length;++t)n[t]=Eue(n[t],e+1);else for(const t in n)Object.hasOwnProperty.call(n,t)&&(n[t]=Eue(n[t],e+1))}return n}const Kte=Object.freeze({image:(n,e,t)=>{let i=[],r=[];return n&&({href:n,dimensions:i}=Pur(n),r.push(`src="${f7(n)}"`)),t&&r.push(`alt="${f7(t)}"`),e&&r.push(`title="${f7(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=Gte(t)),e=typeof e=="string"?f7(Gte(e)):"",n=Gte(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 aY(n,e={},t={}){var i,r;const o=new yt;let s=!1;const a=Aye(e),l=function(_){let b;try{b=Sue(decodeURIComponent(_))}catch{}return b?(b=uXe(b,y=>{if(n.uris&&n.uris[y])return Jn.revive(n.uris[y])}),encodeURIComponent(JSON.stringify(b))):_},c=function(_,b){const y=n.uris&&n.uris[_];let C=Jn.revive(y);return b?_.startsWith(Qi.data+":")?_:(C||(C=Jn.parse(_)),lZe.uriToBrowserUri(C).toString(!0)):!C||Jn.parse(_).toString()===C.toString()?_:(C.query&&(C=C.with({query:l(C.query)})),C.toString())},u=new Sb.Renderer;u.image=Kte.image,u.link=Kte.link,u.paragraph=Kte.paragraph;const d=[],h=[];if(e.codeBlockRendererSync?u.code=(_,b)=>{const y=wue.nextId(),C=e.codeBlockRendererSync(dMe(b),_);return h.push([y,C]),`<div class="code" data-code="${y}">${JW(_)}</div>`}:e.codeBlockRenderer&&(u.code=(_,b)=>{const y=wue.nextId(),C=e.codeBlockRenderer(dMe(b),_);return d.push(C.then(E=>[y,E])),`<div class="code" data-code="${y}">${JW(_)}</div>`}),e.actionHandler){const _=function(C){let E=C.target;if(!(E.tagName!=="A"&&(E=E.parentElement,!E||E.tagName!=="A")))try{let x=E.dataset.href;x&&(n.baseUri&&(x=Yte(Jn.from(n.baseUri),x)),e.actionHandler.callback(x,C))}catch(x){Pi(x)}finally{C.preventDefault()}},b=e.actionHandler.disposables.add(new cr(a,"click")),y=e.actionHandler.disposables.add(new cr(a,"auxclick"));e.actionHandler.disposables.add(on.any(b.event,y.event)(C=>{const E=new Zp(C);!E.leftButton&&!E.middleButton||_(E)})),e.actionHandler.disposables.add(at(a,"keydown",C=>{const E=new ls(C);!E.equals(10)&&!E.equals(3)||_(E)}))}n.supportHtml||(t.sanitizer=_=>(n.isTrusted?_.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?_:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let f=(i=n.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),n.supportThemeIcons&&(f=Dur(f));let g;if(e.fillInIncompleteTokens){const _=Object.assign(Object.assign({},Sb.defaults),t),b=Sb.lexer(f,_),y=Jur(b);g=Sb.parser(y,_)}else g=Sb.parse(f,t);n.supportThemeIcons&&(g=Uw(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const v=new DOMParser().parseFromString(xue(n,g),"text/html");if(v.body.querySelectorAll("img").forEach(_=>{const b=_.getAttribute("src");if(b){let y=b;try{n.baseUri&&(y=Yte(Jn.from(n.baseUri),y))}catch{}_.src=c(y,!0)}}),v.body.querySelectorAll("a").forEach(_=>{const b=_.getAttribute("href");if(_.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))_.replaceWith(..._.childNodes);else{let y=c(b,!1);n.baseUri&&(y=Yte(Jn.from(n.baseUri),b)),_.dataset.href=y}}),a.innerHTML=xue(n,v.body.innerHTML),d.length>0)Promise.all(d).then(_=>{var b,y;if(s)return;const C=new Map(_),E=a.querySelectorAll("div[data-code]");for(const x of E){const k=C.get((b=x.dataset.code)!==null&&b!==void 0?b:"");k&&Ic(x,k)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const _=new Map(h),b=a.querySelectorAll("div[data-code]");for(const y of b){const C=_.get((r=y.dataset.code)!==null&&r!==void 0?r:"");C&&Ic(y,C)}}if(e.asyncRenderCallback)for(const _ of a.getElementsByTagName("img")){const b=o.add(at(_,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,o.dispose()}}}function dMe(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function Yte(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?cPe(n,e).toString():cPe(XK(n),e).toString()}function xue(n,e){const{config:t,allowedSchemes:i}=Gur(n);oZe("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=UZi(i);try{return rZe(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{sZe("uponSanitizeAttribute"),r.dispose()}}const qur=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Gur(n){const e=[Qi.http,Qi.https,Qi.mailto,Qi.data,Qi.file,Qi.vscodeFileResource,Qi.vscodeRemote,Qi.vscodeRemoteResource];return n.isTrusted&&e.push(Qi.command),{config:{ALLOWED_TAGS:[...jZi],ALLOWED_ATTR:qur,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function Kur(n){return typeof n=="string"?n:Yur(n)}function Yur(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Sb.parse(t,{renderer:Xur.value}).replace(/&(#\d+|[a-zA-Z]+);/g,r=>{var o;return(o=Qur.get(r))!==null&&o!==void 0?o:r});return xue({isTrusted:!1},i).toString()}const Qur=new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]),Xur=new cE(()=>{const n=new Sb.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 Nye(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function Zur(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 tdr(n);if(i.includes("**"))return sdr(n);if(i.match(/\*\w/))return ndr(n);if(i.match(/(^|\s)__\w/))return adr(n);if(i.match(/(^|\s)_\w/))return idr(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return rdr(n);if(i.match(/(^|\s)\[\w/))return odr(n)}}function Jur(n){let e,t;for(e=0;e<n.length;e++){const i=n[e];if(i.type==="paragraph"&&i.raw.match(/(\n|^)```/)){t=edr(n.slice(e));break}if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=ldr(n.slice(e));break}if(e===n.length-1&&i.type==="paragraph"){const r=Zur(i);if(r){t=[r];break}}}if(t){const i=[...n.slice(0,e),...t];return i.links=n.links,i}return n}function edr(n){const e=Nye(n);return Sb.lexer(e+"\n```")}function tdr(n){return nI(n,"`")}function ndr(n){return nI(n,"*")}function idr(n){return nI(n,"_")}function rdr(n){return nI(n,")")}function odr(n){return nI(n,"](about:blank)")}function sdr(n){return nI(n,"**")}function adr(n){return nI(n,"__")}function nI(n,e){const t=Nye(Array.isArray(n)?n:[n]);return Sb.lexer(t+e)[0]}function ldr(n){const e=Nye(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 Sb.lexer(a)}}class cdr{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(r=>r.splice(e,t,i))}}class s2 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function hMe(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=lu.intersect(n,i.range);lu.isEmpty(r)||t.push({range:r,size:i.size})}return t}function Tue({start:n,end:e},t){return{start:n+t,end:e+t}}function udr(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 ddr(...n){return udr(n.reduce((e,t)=>e.concat(t),[]))}class fMe{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=hMe({start:0,end:e},this.groups),s=hMe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:Tue(l.range,r),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=ddr(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 hdr(n){var e;try{(e=n.parentElement)===null||e===void 0||e.removeChild(n)}catch{}}class fdr{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=Rt(".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"),hdr(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 $1=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 $E={CurrentDragAndDropData:void 0},zv={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 z6{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class pdr{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class gdr{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 mdr(n,e){return Array.isArray(n)&&Array.isArray(e)?ka(n,e):n===e}class _dr{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 Rg{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:tte(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=zv){var o,s,a,l,c,u,d,h,f,g,m,v,_;if(this.virtualDelegate=t,this.domId=`list_id_${++Rg.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Um(50),this.splicing=!1,this.dragOverAnimationStopDisposable=qe.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=qe.None,this.onDragLeaveTimeout=qe.None,this.disposables=new yt,this._onDidChangeContentHeight=new De,this._onDidChangeContentWidth=new De,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 fMe((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 fdr(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:zv.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new _dr(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=r.transformOptimization)!==null&&a!==void 0?a:zv.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Yo.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new O6({forceIntegerValues:!0,smoothScrollDuration:(l=r.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>_g(y)})),this.scrollableElement=this.disposables.add(new Y0e(this.rowsContainer,{alwaysConsumeMouseWheel:(c=r.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:zv.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=r.verticalScrollMode)!==null&&u!==void 0?u:zv.verticalScrollMode,useShadows:(d=r.useShadows)!==null&&d!==void 0?d:zv.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(at(this.rowsContainer,Qo.Change,y=>this.onTouchChange(y))),this.disposables.add(at(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(at(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(at(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(at(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(at(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=r.setRowLineHeight)!==null&&h!==void 0?h:zv.setRowLineHeight,this.setRowHeight=(f=r.setRowHeight)!==null&&f!==void 0?f:zv.setRowHeight,this.supportDynamicHeights=(g=r.supportDynamicHeights)!==null&&g!==void 0?g:zv.supportDynamicHeights,this.dnd=(m=r.dnd)!==null&&m!==void 0?m:this.disposables.add(zv.dnd),this.layout((v=r.initialSize)===null||v===void 0?void 0:v.height,(_=r.initialSize)===null||_===void 0?void 0:_.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=lu.intersect(r,o),a=new Map;for(let x=s.end-1;x>=s.start;x--){const k=this.items[x];if(k.dragStartDisposable.dispose(),k.checkedDisposable.dispose(),k.row){let L=a.get(k.templateId);L||(L=[],a.set(k.templateId,L));const D=this.renderers.get(k.templateId);D&&D.disposeElement&&D.disposeElement(k.element,x,k.row.templateData,k.size),L.push(k.row)}k.row=null}const l={start:e+t,end:this.items.length},c=lu.intersect(l,r),u=lu.relativeComplement(l,r),d=i.map(x=>({id:String(this.itemId++),element:x,templateId:this.virtualDelegate.getTemplateId(x),size:this.virtualDelegate.getHeight(x),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(x),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:qe.None,checkedDisposable:qe.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new fMe(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 f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=Tue(c,f),v=lu.intersect(g,m);for(let x=v.start;x<v.end;x++)this.updateItemInDOM(this.items[x],x);const _=lu.relativeComplement(m,g);for(const x of _)for(let k=x.start;k<x.end;k++)this.removeItemFromDOM(k);const b=u.map(x=>Tue(x,f)),C=[{start:e,end:e+i.length},...b].map(x=>lu.intersect(g,x)),E=this.getNextToLastElement(C);for(const x of C)for(let k=x.start;k<x.end;k++){const L=this.items[k],D=a.get(L.templateId),A=D==null?void 0:D.pop();this.insertItemInDOM(k,E,A)}for(const x of a.values())for(const k of x)this.cache.release(k);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(x=>x.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=_g(()=>{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:PZi(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:tte(this.domNode)})}render(e,t,i,r,o,s=!1){const a=this.getRenderRange(t,i),l=lu.relativeComplement(a,e),c=lu.relativeComplement(e,a),u=this.getNextToLastElement(l);if(s){const d=lu.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=at(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=tte(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 on.map(this.disposables.add(new cr(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return on.map(this.disposables.add(new cr(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return on.filter(on.map(this.disposables.add(new cr(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return on.map(this.disposables.add(new cr(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return on.map(this.disposables.add(new cr(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return on.map(this.disposables.add(new cr(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return on.any(on.map(this.disposables.add(new cr(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),on.map(this.disposables.add(new cr(this.domNode,Qo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return on.map(this.disposables.add(new cr(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return on.map(this.disposables.add(new cr(this.rowsContainer,Qo.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(u5.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=Rt(".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 z6(s),$E.CurrentDragAndDropData=new pdr(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(),$E.CurrentDragAndDropData&&$E.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if($E.CurrentDragAndDropData)this.currentDragData=$E.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new gdr}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=fS(r).filter(o=>o>=-1&&o<this.length).sort((o,s)=>o-s),r=r[0]===-1?[-1]:r,mdr(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=_i(()=>{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=_i(()=>{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=bS(()=>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,$E.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,$E.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=qe.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=uZe(this.domNode).top;this.dragOverAnimationDisposable=zZi(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=bS(()=>{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=lu.relativeComplement(r,l);for(const h of u)for(let f=h.start;f<h.end;f++)this.items[f].row&&this.removeItemFromDOM(f);const d=lu.relativeComplement(l,r);for(const h of d)for(let f=h.start;f<h.end;f++){const g=f+1,m=g<this.items.length?this.items[g].row:null,v=m?m.domNode:null;this.insertItemInDOM(f,v)}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,f=this.elementTop(o)-s+h;this.setScrollTop(f,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()}}Rg.InstanceCount=0;$1([Ha],Rg.prototype,"onMouseClick",null);$1([Ha],Rg.prototype,"onMouseDblClick",null);$1([Ha],Rg.prototype,"onMouseMiddleClick",null);$1([Ha],Rg.prototype,"onMouseDown",null);$1([Ha],Rg.prototype,"onMouseOver",null);$1([Ha],Rg.prototype,"onMouseOut",null);$1([Ha],Rg.prototype,"onContextMenu",null);$1([Ha],Rg.prototype,"onTouchStart",null);$1([Ha],Rg.prototype,"onTap",null);var iI=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},pMe=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 vdr{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 Uz=class{get name(){return this._trait}get renderer(){return new vdr(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new De,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(mMe),t)}_set(e,t,i){const r=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=kue(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),r}get(){return this.indexes}contains(e){return y3(this.sortedIndexes,e,mMe)>=0}dispose(){_o(this._onChange)}};iI([Ha],Uz.prototype,"renderer",null);class bdr extends Uz{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 Qte{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 jw(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function yL(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:yL(n.parentElement)}function Wet(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:Wet(n.parentElement)}class zet{get onKeyDown(){return on.chain(this.disposables.add(new cr(this.view.domNode,"keydown")).event,e=>e.filter(t=>!jw(t.target)).map(t=>new ls(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new yt,this.multipleSelectionDisposables=new yt,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&&(br?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(cd(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()}}iI([Ha],zet.prototype,"onKeyDown",null);var Eb;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Eb||(Eb={}));var CL;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(CL||(CL={}));const ydr=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 Cdr{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=CL.Idle,this.mode=Eb.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new yt,this.disposables=new yt,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:Eb.Automatic}enable(){if(this.enabled)return;let e=!1;const t=on.chain(this.enabledDisposables.add(new cr(this.view.domNode,"keydown")).event,o=>o.filter(s=>!jw(s.target)).filter(()=>this.mode===Eb.Automatic||this.triggered).map(s=>new ls(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>ji.stop(s,!0)).map(s=>s.browserEvent.key)),i=on.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);on.reduce(on.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&&vu(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=CL.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,r=this.state===CL.Idle?1:0;this.state=CL.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(d5(e,l)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}const c=vur(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"||d5(e,l)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class wdr{constructor(e,t){this.list=e,this.view=t,this.disposables=new yt;const i=on.chain(this.disposables.add(new cr(t.domNode,"keydown")).event,o=>o.filter(s=>!jw(s.target)).map(s=>new ls(s)));on.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 Uet(n){return br?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function jet(n){return n.browserEvent.shiftKey}function Sdr(n){return n instanceof MouseEvent&&n.button===2}const gMe={isSelectionSingleChangeEvent:Uet,isSelectionRangeChangeEvent:jet};class qet{constructor(e){this.list=e,this.disposables=new yt,this._onPointer=new De,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||gMe),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(Yo.addTarget(e.getHTMLElement()))),on.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||gMe))}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){yL(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(jw(e.browserEvent.target)||yL(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||jw(e.browserEvent.target)||yL(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),Sdr(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(jw(e.browserEvent.target)||yL(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=cd(r,o+1),a=this.list.getSelection(),l=Tdr(kue(a,[i]),i);if(l.length===0)return;const c=kue(s,kdr(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 Get{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=fT(e.listFocusAndSelectionOutline,fT(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=fT(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 Edr={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:je.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:je.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:je.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},xdr={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Tdr(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 kue(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 kdr(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 mMe=(n,e)=>n-e;class Idr{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 Ldr{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 Ddr{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 i_{get onDidChangeFocus(){return on.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return on.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=on.chain(this.disposables.add(new cr(this.view.domNode,"keydown")).event,o=>o.map(s=>new ls(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>ji.stop(s,!0)).filter(()=>!1)),i=on.chain(this.disposables.add(new cr(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(s=>new ls(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>ji.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=on.chain(this.view.onContextMenu,o=>o.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new Zp(l),browserEvent:l})));return on.any(t,i,r)}get onKeyDown(){return this.disposables.add(new cr(this.view.domNode,"keydown")).event}get onDidFocus(){return on.signal(this.disposables.add(new cr(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,r,o=xdr){var s,a,l,c;this.user=e,this._options=o,this.focus=new Uz("focused"),this.anchor=new Uz("anchor"),this.eventBufferer=new s0e,this._ariaLabel="",this.disposables=new yt,this._onDidDispose=new De,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 bdr(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new Ldr(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(f=>new Idr(f.templateId,[...d,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new Ddr(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 f=vg(this.view.domNode);this.styleController=new Get(f,this.view.domId)}if(this.spliceable=new cdr([new Qte(this.focus,this.view,o.identityProvider),new Qte(this.selection,this.view,o.identityProvider),new Qte(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 wdr(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new zet(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||ydr;this.typeNavigationController=new Cdr(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),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 Rg(e,t,i,r)}createMouseController(e){return new qet(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 s2(this.user,`Invalid start index: ${e}`);if(t<0)throw new s2(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 s2(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 s2(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return oXe(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 s2(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 pMe(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 vS(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return pMe(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 vS(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 s2(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(pS(t)){const s=o-this.view.renderHeight;this.view.setScrollTop(s*Ah(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()}}iI([Ha],i_.prototype,"onDidChangeFocus",null);iI([Ha],i_.prototype,"onDidChangeSelection",null);iI([Ha],i_.prototype,"onContextMenu",null);iI([Ha],i_.prototype,"onKeyDown",null);iI([Ha],i_.prototype,"onDidFocus",null);const Yx=Rt,Ket="selectOption.entry.template";class Adr{get templateId(){return Ket}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ft(e,Yx(".option-text")),t.detail=ft(e,Yx(".option-detail")),t.decoratorRight=ft(e,Yx(".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 xb extends qe{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=xb.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 De,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 Ket}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=Rt(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ft(this.selectDropDownContainer,Yx(".select-box-details-pane"));const t=ft(this.selectDropDownContainer,Yx(".select-box-dropdown-container-width-control")),i=ft(t,Yx(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ft(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=vg(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(at(this.selectDropDownContainer,Xt.DRAG_START,r=>{ji.stop(r,!0)}))}registerListeners(){this._register(Ba(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(at(this.selectElement,Xt.CLICK,t=>{ji.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(at(this.selectElement,Xt.MOUSE_DOWN,t=>{ji.stop(t)}));let e;this._register(at(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(at(this.selectElement,"touchend",t=>{ji.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(at(this.selectElement,Xt.KEY_DOWN,t=>{const i=new ls(t);let r=!1;br?(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(),ji.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){ka(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=fT(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=pl(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-xb.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,f=Math.floor((o-r-d)/this.getHeight()),g=Math.floor((s-r-d)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.top<xb.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||f<1&&g<1?!1:(f<xb.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&g>f&&this.options.length>f?(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<xb.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||this._dropDownPosition===0&&f<1||this._dropDownPosition===1&&g<1)return this.hideSelectDropDown(!0),!1;if(this._dropDownPosition===0){if(this._isVisible&&f+g<1)return this.hideSelectDropDown(!0),!1;h>o&&(u=f*this.getHeight())}else h>s&&(u=g*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=Jd(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ft(e,Yx(".select-box-dropdown-list-container")),this.listRenderer=new Adr,this.selectList=new i_("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:()=>T({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>br?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new cr(this.selectDropDownListContainer,"keydown")),i=on.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(o=>new ls(o)));this._register(on.chain(i,r=>r.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(on.chain(i,r=>r.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(at(this.selectList.getHTMLElement(),Xt.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(at(this.selectDropDownContainer,Xt.FOCUS_OUT,r=>{!this._isVisible||Qc(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;ji.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=aY({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){ji.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){ji.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){ji.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&&(ji.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){ji.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){ji.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){ji.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){ji.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]),ji.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}xb.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32;xb.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2;xb.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class Rdr extends qe{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 De),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(Yo.addTarget(this.selectElement)),[Qo.Tap].forEach(e=>{this._register(at(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ba(this.selectElement,"click",e=>{ji.stop(e,!0)})),this._register(Ba(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ba(this.selectElement,"keydown",e=>{let t=!1;br?(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||!ka(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 Ndr extends e_{constructor(e,t,i,r,o){super(),br&&!(o!=null&&o.useCustomDrawn)?this.selectBoxDelegate=new Rdr(e,t,r,o):this.selectBoxDelegate=new xb(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 z_ extends qe{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Nd&&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 SA)),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(Yo.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,mg&&this._register(at(e,Xt.DRAG_START,r=>{var o;return(o=r.dataTransfer)===null||o===void 0?void 0:o.setData(u5.TEXT,this._action.label)}))),this._register(at(t,Qo.Tap,r=>this.onClick(r,!0))),this._register(at(t,Xt.MOUSE_DOWN,r=>{i||ji.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),br&&this._register(at(t,Xt.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(at(t,Xt.CLICK,r=>{ji.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(at(t,Xt.DBLCLICK,r=>{ji.stop(r,!0)})),[Xt.MOUSE_UP,Xt.MOUSE_OUT].forEach(r=>{this._register(at(t,r,o=>{ji.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;ji.stop(e,!0);const r=Ef(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=Vet(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 WA extends z_{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=ft(this.element,Rt("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(ft(this.element,Rt("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===ic.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=T({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 Odr extends z_{constructor(e,t,i,r,o,s,a){super(e,t),this.selectBox=new Ndr(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 Pdr extends SA{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new De),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ft(e,Rt(".monaco-dropdown")),this._label=ft(this._element,Rt(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[Xt.CLICK,Xt.MOUSE_DOWN,Qo.Tap])this._register(at(this.element,o,s=>ji.stop(s,!0)));for(const o of[Xt.MOUSE_DOWN,Qo.Tap])this._register(at(this._label,o,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(at(this._label,Xt.KEY_UP,o=>{const s=new ls(o);(s.equals(3)||s.equals(10))&&(ji.stop(o,!0),this.visible?this.hide():this.show())}));const r=i(this._label);r&&this._register(r),this._register(Yo.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 Mdr extends Pdr{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 jz extends z_{constructor(e,t,i,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new De),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=ft(o,Rt("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 Mdr(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 Fdr(n){return n?n.condition!==void 0:!1}var RP=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())})},gD;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(gD||(gD={}));var wL;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(wL||(wL={}));class mD extends qe{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new qT),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=wL.None,this.cache=new Map,this.flushDelayer=this._register(new wZe(mD.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===wL.Closed)return;let i=!1;Ef(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 Ef(i)?t:i}getBoolean(e,t){const i=this.get(e);return Ef(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Ef(i)?t:parseInt(i,10)}set(e,t,i=!1){return RP(this,void 0,void 0,function*(){if(this.state===wL.Closed)return;if(Ef(t))return this.delete(e,i);const r=xd(t)||Array.isArray(t)?Uur(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 RP(this,void 0,void 0,function*(){if(!(this.state===wL.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 RP(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 RP(this,void 0,void 0,function*(){return this.options.hint===gD.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}mD.DEFAULT_FLUSH_DELAY=100;class Xte{constructor(){this.onDidChangeItemsExternal=on.None,this.items=new Map}updateItems(e){var t,i;return RP(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 dV="__$__targetStorageMarker",r_=lr("storageService");var qz;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(qz||(qz={}));function Bdr(n){const e=n.get(dV);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class lY extends qe{constructor(e={flushInterval:lY.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new qT),this._onDidChangeTarget=this._register(new qT),this._onWillSaveState=this._register(new De),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return on.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===dV){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(Ef(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(dV,JSON.stringify(a),r)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(dV,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?Bdr(t):Object.create(null)}}lY.DEFAULT_FLUSH_INTERVAL=60*1e3;class $dr extends lY{constructor(){super(),this.applicationStorage=this._register(new mD(new Xte,{hint:gD.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new mD(new Xte,{hint:gD.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new mD(new Xte,{hint:gD.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 Vdr(n,e){const t=Object.assign({},e);for(const i in n){const r=n[i];t[i]=r!==void 0?an(r):void 0}return t}const Hdr={keybindingLabelBackground:an(ynr),keybindingLabelForeground:an(Cnr),keybindingLabelBorder:an(wnr),keybindingLabelBottomBorder:an(Snr),keybindingLabelShadow:an(Ob)},Wdr={buttonForeground:an(bP),buttonSeparator:an(snr),buttonBackground:an(yP),buttonHoverBackground:an(anr),buttonSecondaryForeground:an(cnr),buttonSecondaryBackground:an(Lce),buttonSecondaryHoverBackground:an(unr),buttonBorder:an(lnr)},zdr={progressBarBackground:an(fnr)},Gz={inputActiveOptionBorder:an(V0e),inputActiveOptionForeground:an(H0e),inputActiveOptionBackground:an(Ux)};an(nir),an(rir),an(iir);an(ca),an(Fb),an(Ob),an(fr),an(yir),an(Cir),an(wir),an(Ytr);const Kz={inputBackground:an(eJe),inputForeground:an(tJe),inputBorder:an(nJe),inputValidationInfoBorder:an(Ztr),inputValidationInfoBackground:an(Qtr),inputValidationInfoForeground:an(Xtr),inputValidationWarningBorder:an(tnr),inputValidationWarningBackground:an(Jtr),inputValidationWarningForeground:an(enr),inputValidationErrorBorder:an(rnr),inputValidationErrorBackground:an(nnr),inputValidationErrorForeground:an(inr)},Udr={listFilterWidgetBackground:an(Ynr),listFilterWidgetOutline:an(Qnr),listFilterWidgetNoMatchesOutline:an(Xnr),listFilterWidgetShadow:an(Znr),inputBoxStyles:Kz,toggleStyles:Gz},Yet={badgeBackground:an(nV),badgeForeground:an(dnr),badgeBorder:an(fr)};an(fir),an(hir),an(AOe),an(AOe),an(pir);const rI={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:an($nr),listFocusForeground:an(Vnr),listFocusOutline:an(Hnr),listActiveSelectionBackground:an(Hy),listActiveSelectionForeground:an(Vb),listActiveSelectionIconForeground:an(EP),listFocusAndSelectionOutline:an(Wnr),listFocusAndSelectionBackground:an(Hy),listFocusAndSelectionForeground:an(Vb),listInactiveSelectionBackground:an(znr),listInactiveSelectionIconForeground:an(jnr),listInactiveSelectionForeground:an(Unr),listInactiveFocusBackground:an(qnr),listInactiveFocusOutline:an(Gnr),listHoverBackground:an(oJe),listHoverForeground:an(sJe),listDropBackground:an(Knr),listSelectionOutline:an(vs),listHoverOutline:an(vs),treeIndentGuidesStroke:an(xP),treeInactiveIndentGuidesStroke:an(Jnr),tableColumnsBorder:an(eir),tableOddRowsBackgroundColor:an(tir)};function uN(n){return Vdr(n,rI)}const jdr={selectBackground:an(Pb),selectListBackground:an(onr),selectForeground:an(By),decoratorRightForeground:an(iJe),selectBorder:an(cL),focusBorder:an(Pf),listFocusBackground:an(qx),listInactiveSelectionIconForeground:an(uL),listFocusForeground:an(jx),listFocusOutline:qtr(vs,je.transparent.toString()),listHoverBackground:an(oJe),listHoverForeground:an(sJe),listHoverOutline:an(vs),selectListBorder:an(Bb),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},qdr={shadowColor:an(Ob),borderColor:an(oir),foregroundColor:an(sir),backgroundColor:an(air),selectionForegroundColor:an(lir),selectionBackgroundColor:an(cir),selectionBorderColor:an(uir),separatorColor:an(dir),scrollbarShadow:an(hnr),scrollbarSliderBackground:an(CP),scrollbarSliderHoverBackground:an(wP),scrollbarSliderActiveBackground:an(SP)};var cY=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},rh=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Qet=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 Gdr(n,e,t,i){const r=n.getActions(e),o=Py.getInstance(),s=o.keyStatus.altKey||(eu||Xu)&&o.keyStatus.shiftKey;Zet(r,t,s,i?a=>a===i:a=>a==="navigation")}function Xet(n,e,t,i,r,o){const s=n.getActions(e);Zet(s,t,!1,typeof i=="string"?l=>l===i:i,r,o)}function Zet(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 ic)):(d=a,d.length>0&&d.push(new ic));for(let h of u){t&&(h=h instanceof Wm&&h.alt?h.alt:h);const f=d.push(h);h instanceof EA&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=i(c)?s:a,f=u.actions;r(u,c,h.length)&&h.splice(d,1,...f)}}let ik=class extends WA{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 Ac),this._altKey=Py.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Qet(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(at(e,"mouseleave",r=>{t=!1,i()})),this._register(at(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?T("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?T("titleAndKb","{0} ({1})",s,l):s;o=T("titleAndKbAndAlt",`{0}
[{1}] {2}`,o,wye.modifierLabels[Of].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&&Fdr(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(ei.isThemeIcon(r)){const o=ei.asClassNameArray(r);i.classList.add(...o),this._itemClassDispose.value=_i(()=>{i.classList.remove(...o)})}else{const o=RA(this._themeService.getColorTheme().type)?_S(r.dark):_S(r.light),s=Rt("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=xm(_i(()=>{i.classList.remove("icon"),Ic(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};ik=cY([rh(2,Go),rh(3,Wa),rh(4,bi),rh(5,Vl),rh(6,n_),rh(7,F1)],ik);let Iue=class extends jz{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:ei.isThemeIcon(e.item.icon)?ei.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),ko(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!ei.isThemeIcon(i)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=RA(this._themeService.getColorTheme().type)?_S(i.dark):_S(i.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};Iue=cY([rh(2,Go),rh(3,n_),rh(4,Vl)],Iue);let Lue=class extends z_{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 f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(m=>f===m.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(ik,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=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 SA});this._dropdown=new jz(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof Wm&&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(ik,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends SA{runAction(i,r){return Qet(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(fZe(this._container,Rt(".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=Rt(".action-container");this._defaultAction.render(ft(this._container,t)),this._register(at(t,Xt.KEY_DOWN,r=>{const o=new ls(r);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=Rt(".dropdown-action-container");this._dropdown.render(ft(this._container,i)),this._register(at(i,Xt.KEY_DOWN,r=>{var o;const s=new ls(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()}};Lue=cY([rh(2,Go),rh(3,Wa),rh(4,n_),rh(5,k0),rh(6,pi),rh(7,r_)],Lue);let Due=class extends Odr{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===ic.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,jdr,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=an(cL)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};Due=cY([rh(1,B1)],Due);function Kdr(n,e,t){return e instanceof Wm?n.createInstance(ik,e,t):e instanceof R3?e.item.isSelection?n.createInstance(Due,e):e.item.rememberDefaultAction?n.createInstance(Lue,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(Iue,e,t):void 0}var Ydr=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 wg extends qe{constructor(e,t={}){var i,r,o,s,a,l;super(),this._actionRunnerDisposables=this._register(new yt),this.viewItemDisposables=this._register(new r0e),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new De),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new De({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new De),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new De),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 SA,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(at(this.domNode,Xt.KEY_DOWN,d=>{const h=new ls(d);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():u&&(h.equals(u[0])||h.equals(u[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof z_&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(at(this.domNode,Xt.KEY_UP,d=>{const h=new ls(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(l0(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Tm()===this.domNode||!Qc(Tm(),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 z_&&i.isEnabled());t instanceof z_&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof z_&&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(Qc(Tm(),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=pS(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 WA(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,at(s,Xt.CONTEXT_MENU,c=>{ji.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof z_&&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=_o(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),kc(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===ic.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===ic.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;S3(o.focus)||(s=!1),this.options.focusOnlyEnabledItems&&S3(o.isEnabled)&&!o.isEnabled()&&(s=!1),o.action.id===ic.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 z_){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return Ydr(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=_o(this.viewItems),this.getContainer().remove(),super.dispose()}}const Aue=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Zte=/(&amp;)?(&amp;)([^\s&])/g;var Yz;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(Yz||(Yz={}));class _D extends wg{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,...br||Xu?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new yt),this.initializeOrUpdateStyleSheet(e,r),this._register(Yo.addTarget(o)),at(o,Xt.KEY_DOWN,l=>{new ls(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(at(o,Xt.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){ji.stop(l,!0);const u=this.mnemonics.get(c);if(u.length===1&&(u[0]instanceof _Me&&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)}}})),Xu&&this._register(at(o,Xt.KEY_DOWN,l=>{const c=new ls(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),ji.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),ji.stop(l,!0))})),this._register(at(this.domNode,Xt.MOUSE_OUT,l=>{const c=l.relatedTarget;Qc(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(at(this.actionsList,Xt.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!Qc(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(Yo.addTarget(this.actionsList)),this._register(at(this.actionsList,Qo.Tap,l=>{let c=l.initialTarget;if(!(!c||!Qc(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 P6(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(at(o,Qo.Change,l=>{ji.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(at(a,Xt.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 vMe)).forEach((l,c,u)=>{l.updatePositionInSet(c+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(rz(e)?this.styleSheet=vg(e):(_D.globalStyleSheet||(_D.globalStyleSheet=vg()),this.styleSheet=_D.globalStyleSheet)),this.styleSheet.textContent=Xdr(t,rz(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 ic)return new vMe(t.context,e,{icon:!0},this.menuStyles);if(e instanceof EA){const r=new _Me(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 Jet(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 Jet extends z_{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=Aue.exec(o);s&&(this.mnemonic=(s[1]?s[1]:s[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new Mo(()=>{this.element&&(this._register(at(this.element,Xt.MOUSE_UP,o=>{if(ji.stop(o,!0),mg){if(new Zp(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(at(this.element,Xt.CONTEXT_MENU,o=>{ji.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ft(this.element,Rt("a.action-menu-item")),this._action.id===ic.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=ft(this.item,Rt("span.menu-item-check"+ei.asCSSSelector(jt.menuSelection))),this.check.setAttribute("role","none"),this.label=ft(this.item,Rt("span.action-label")),this.options.label&&this.options.keybinding&&(ft(this.item,Rt("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){kc(this.label);let t=Dye(this.action.label);if(t){const i=Qdr(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const r=Aue.exec(t);if(r){t=JW(t),Zte.lastIndex=0;let o=Zte.exec(t);for(;o&&o[1];)o=Zte.exec(t);const s=a=>a.replace(/&amp;&amp;/g,"&amp;");o?this.label.append(S6(s(t.substr(0,o.index))," "),Rt("u",{"aria-hidden":"true"},o[3]),BXe(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 _Me extends Jet{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 yt),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:Yz.Right,this.showScheduler=new Mo(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Mo(()=>{this.element&&!Qc(Tm(),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=ft(this.item,Rt("span.submenu-indicator"+ei.asCSSSelector(jt.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(at(this.element,Xt.KEY_UP,t=>{const i=new ls(t);(i.equals(17)||i.equals(3))&&(ji.stop(t,!0),this.createSubmenu(!0))})),this._register(at(this.element,Xt.KEY_DOWN,t=>{const i=new ls(t);Tm()===this.item&&(i.equals(17)||i.equals(3))&&ji.stop(t,!0)})),this._register(at(this.element,Xt.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(at(this.element,Xt.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(at(this.element,Xt.FOCUS_OUT,t=>{this.element&&!Qc(Tm(),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){ji.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=bL(e.width,t.width,{position:r===Yz.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=bL(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=ft(this.element,Rt("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 _D(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new mK],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 Kr(window.innerWidth,window.innerHeight),Kr.lift(s),o,this.expandDirection);this.submenuContainer.style.left=`${l-s.left}px`,this.submenuContainer.style.top=`${a-s.top}px`,this.submenuDisposables.add(at(this.submenuContainer,Xt.KEY_UP,c=>{new ls(c).equals(15)&&(ji.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(at(this.submenuContainer,Xt.KEY_DOWN,c=>{new ls(c).equals(15)&&ji.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 vMe extends WA{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 Qdr(n){const e=Aue,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function bMe(n){const e=OXe()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function Xdr(n,e){let t=`
.monaco-menu {
font-size: 13px;
border-radius: 5px;
min-width: 160px;
}
${bMe(jt.menuSelection)}
${bMe(jt.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 Zdr{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=S0e(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(Rt(".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=at(this.block,Xt.MOUSE_DOWN,u=>u.stopPropagation()));const l=new yt,c=e.actionRunner||new SA;return c.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new _D(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},qdr),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(at(window,Xt.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(at(window,Xt.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const d=new Zp(u);let h=d.target;if(!d.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),xm(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&&(Tm()===this.lastContainer||Qc(Tm(),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&&!Av(e.error)&&this.notificationService.error(e.error)}}var Jdr=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},a2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Rue=class extends qe{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Zdr(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 De),this._onDidHideContextMenu=this._store.add(new De)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Nue.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()}})),Py.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};Rue=Jdr([a2(0,dp),a2(1,Wa),a2(2,B1),a2(3,Go),a2(4,k0),a2(5,bi)],Rue);var Nue;(function(n){function e(i){return i&&i.menuId instanceof ue}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);Gdr(u,a,c),u.dispose()}return i.getActions?ic.join(i.getActions(),c):c}})}n.transform=t})(Nue||(Nue={}));var Qz;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(Qz||(Qz={}));var Oye=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},Xz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},kx=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 Oue=class{constructor(e){this._commandService=e}open(e,t){return kx(this,void 0,void 0,function*(){if(!bye(e,Qi.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Jn.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=Sue(decodeURIComponent(e.query))}catch{try{i=Sue(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};Oue=Oye([Xz(0,ga)],Oue);let Pue=class{constructor(e){this._editorService=e}open(e,t){return kx(this,void 0,void 0,function*(){typeof e=="string"&&(e=Jn.parse(e));const{selection:i,uri:r}=icr(e);return e=r,e.scheme===Qi.file&&(e=Bsr(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?Qz.USER:Qz.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};Pue=Oye([Xz(0,io)],Pue);let Mue=class{constructor(e,t){this._openers=new Td,this._validators=new Td,this._resolvers=new Td,this._resolvedUriTargets=new gu(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Td,this._defaultExternalOpener={openExternal:i=>kx(this,void 0,void 0,function*(){return UPe(i,Qi.http,Qi.https)?gZe(i):window.location.href=i,!0})},this._openers.push({open:(i,r)=>kx(this,void 0,void 0,function*(){return r!=null&&r.openExternal||UPe(i,Qi.mailto,Qi.http,Qi.https,Qi.vsls)?(yield this._doOpenExternal(i,r),!0):!1})}),this._openers.push(new Oue(t)),this._openers.push(new Pue(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return kx(this,void 0,void 0,function*(){const r=typeof e=="string"?Jn.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 kx(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 kx(this,void 0,void 0,function*(){const i=typeof e=="string"?Jn.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},or.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},or.None)})}dispose(){this._validators.clear()}};Mue=Oye([Xz(0,io),Xz(1,ga)],Mue);const o_=lr("editorWorkerService");var Xs;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Xs||(Xs={}));(function(n){function e(s,a){return a-s}n.compare=e;const t=Object.create(null);t[n.Error]=T("sev.error","Error"),t[n.Warning]=T("sev.warning","Warning"),t[n.Info]=T("sev.info","Info");function i(s){return t[s]||""}n.toString=i;function r(s){switch(s){case wa.Error:return n.Error;case wa.Warning:return n.Warning;case wa.Info:return n.Info;case wa.Ignore:return n.Hint}}n.fromSeverity=r;function o(s){switch(s){case n.Error:return wa.Error;case n.Warning:return wa.Warning;case n.Info:return wa.Info;case n.Hint:return wa.Ignore}}n.toSeverity=o})(Xs||(Xs={}));var Zz;(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(Xs.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})(Zz||(Zz={}));const D0=lr("markerService");function ehr(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 thr(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var nhr=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},yMe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Fue=class extends qe{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new De),this._markerDecorations=new gu,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 ihr(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===Qi.inMemory||e.uri.scheme===Qi.internal||e.uri.scheme===Qi.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)}};Fue=nhr([yMe(0,Ls),yMe(1,D0)],Fue);class ihr extends qe{constructor(e){super(),this.model=e,this._map=new Fer,this._register(_i(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=ehr(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=J.lift(t);if(t.severity===Xs.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 J(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 J(i.startLineNumber,r,i.endLineNumber,i.endColumn),t.startColumn=r)}return i}_createDecorationOption(e){let t,i,r,o,s;switch(e.severity){case Xs.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",r=0;break;case Xs.Info:t="squiggly-info",i=Ys(Drr),r=10,s={color:Ys(gir),position:Uh.Inline};break;case Xs.Warning:t="squiggly-warning",i=Ys(Lrr),r=20,s={color:Ys(mir),position:Uh.Inline};break;case Xs.Error:default:t="squiggly-error",i=Ys(Irr),r=30,s={color:Ys(_ir),position:Uh.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:tp.Right},minimap:s,zIndex:r,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}var rhr=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},FO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},T2;function VE(n){return n.toString()}class ohr{constructor(e,t,i){this.model=e,this._modelEventListeners=new yt,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>i(e,r)))}dispose(){this._modelEventListeners.dispose()}}const shr=Xu||br?1:2;class ahr{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 Jz=T2=class extends qe{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 De),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new De),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new De),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=pu.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(r=f),r<1&&(r=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let s=pu.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=shr;const l=e.eol;l===`\r
`?a=2:l===`
`&&(a=1);let c=pu.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let u=pu.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(u=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=pu.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=pu.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:Of===3||Of===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=T2._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);T2._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&&Uf(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(VE(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(VE(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(VE(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 h0(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(VE(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 f of u.past)_y(f)&&f.matchesResource(i)&&f.setModel(s);for(const f of u.future)_y(f)&&f.matchesResource(i)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,f=>_y(f)&&f.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=VE(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new ohr(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,jf,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=VE(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Qi.file||e.scheme===Qi.vscodeRemote||e.scheme===Qi.vscodeUserData||e.scheme===Qi.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=VE(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=T2.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 ahr(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);T2._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new uY}};Jz.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;Jz=T2=rhr([FO(0,pr),FO(1,jZe),FO(2,ZK),FO(3,Es),FO(4,es)],Jz);class uY{canComputeSHA1(e){return e.getValueLength()<=uY.MAX_MODEL_SIZE}computeSHA1(e){const t=new BK,i=e.createSnapshot();let r;for(;r=i.read();)t.update(r);return t.digest()}}uY.MAX_MODEL_SIZE=10*1024*1024;class lhr{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:qe.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 $a,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 chr{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 uhr(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new chr(n,e.accessibilityProvider)})}class dhr{constructor(e,t,i,r,o={}){const s=()=>this.model,a=r.map(l=>new lhr(l,s));this.list=new i_(e,t,i,a,uhr(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 on.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 on.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 on.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,cd(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 dN=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 hhr=!1;var eU;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(eU||(eU={}));let fhr=4;const phr=new De;let ghr=300;const mhr=new De;class Pye{constructor(){this.disposables=new yt}get onPointerMove(){return this.disposables.add(new cr(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new cr(window,"mouseup")).event}dispose(){this.disposables.dispose()}}dN([Ha],Pye.prototype,"onPointerMove",null);dN([Ha],Pye.prototype,"onPointerUp",null);class Mye{get onPointerMove(){return this.disposables.add(new cr(this.el,Qo.Change)).event}get onPointerUp(){return this.disposables.add(new cr(this.el,Qo.End)).event}constructor(e){this.el=e,this.disposables=new yt}dispose(){this.disposables.dispose()}}dN([Ha],Mye.prototype,"onPointerMove",null);dN([Ha],Mye.prototype,"onPointerUp",null);class tU{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}dN([Ha],tU.prototype,"onPointerMove",null);dN([Ha],tU.prototype,"onPointerUp",null);const CMe="pointer-events-disabled";class cu extends qe{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=ft(this.el,Rt(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(_i(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new cr(this._orthogonalStartDragHandle,"mouseenter")).event(()=>cu.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new cr(this._orthogonalStartDragHandle,"mouseleave")).event(()=>cu.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=ft(this.el,Rt(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(_i(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new cr(this._orthogonalEndDragHandle,"mouseenter")).event(()=>cu.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new cr(this._orthogonalEndDragHandle,"mouseleave")).event(()=>cu.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=ghr,this.hoverDelayer=this._register(new Um(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new De),this._onDidStart=this._register(new De),this._onDidChange=this._register(new De),this._onDidReset=this._register(new De),this._onDidEnd=this._register(new De),this.orthogonalStartSashDisposables=this._register(new yt),this.orthogonalStartDragHandleDisposables=this._register(new yt),this.orthogonalEndSashDisposables=this._register(new yt),this.orthogonalEndDragHandleDisposables=this._register(new yt),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=ft(e,Rt(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),br&&this.el.classList.add("mac");const r=this._register(new cr(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new Pye),this));const o=this._register(new cr(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new cr(this.el,"mouseenter")).event;this._register(s(()=>cu.onMouseEnter(this)));const a=this._register(new cr(this.el,"mouseleave")).event;this._register(a(()=>cu.onMouseLeave(this))),this._register(Yo.addTarget(this.el));const l=this._register(new cr(this.el,Qo.Start)).event;this._register(l(d=>this.onPointerStart(d,new Mye(this.el)),this));const c=this._register(new cr(this.el,Qo.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=fhr,this._register(phr.event(d=>{this.size=d,this.layout()}))),this._register(mhr.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",hhr),this.layout()}onPointerStart(e,t){ji.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new tU(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new tU(t))),!this.state)return;const r=document.getElementsByTagName("iframe");for(const g of r)g.classList.add(CMe);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=vg(this.el),u=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=br?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=br?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new yt;u(),i||this.onDidEnablementChange.event(u,null,d);const h=g=>{ji.stop(g,!1);const m={startX:o,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(m)},f=g=>{ji.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const m of r)m.classList.remove(CMe)};t.onPointerMove(h,null,d),t.onPointerUp(f,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&&cu.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&cu.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){cu.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 _hr={separatorBorder:je.transparent};class ett{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=Ah(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 vhr extends ett{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class bhr extends ett{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 nU;(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})(nU||(nU={}));class ttt extends qe{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 De),this._onDidSashReset=this._register(new De),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=ft(this.el,Rt(".sash-container")),this.viewContainer=Rt(".split-view-container"),this.scrollable=this._register(new O6({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:_g})),this.scrollableElement=this._register(new Y0e(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 cr(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)})),ft(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||_hr),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=Fh(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=Ah(Math.round(a*e/r),s.minimumSize,s.maximumSize))}}else{const r=cd(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=xm(at(document.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),at(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.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,f;if(!l){const g=cd(r,-1),m=cd(r+1,this.viewItems.length),v=g.reduce((L,D)=>L+(this.viewItems[D].minimumSize-c[D]),0),_=g.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(v,y),E=Math.min(b,_),x=this.findFirstSnapIndex(g),k=this.findFirstSnapIndex(m);if(typeof x=="number"){const L=this.viewItems[x],D=Math.floor(L.viewMinimumSize/2);h={index:x,limitDelta:L.visible?C-D:C+D,size:L.size}}if(typeof k=="number"){const L=this.viewItems[k],D=Math.floor(L.viewMinimumSize/2);f={index:k,limitDelta:L.visible?E+D:E-D,size:L.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,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,f=this.viewItems.map(y=>y.size),g=h?t:t+1,m=this.viewItems[g],v=m.size-m.maximumSize,_=m.size-m.minimumSize,b=h?t-1:t+1;this.resize(b,-d,f,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=Ah(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=cd(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=Ah(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=Ah(i,a.minimumSize,a.maximumSize);const r=cd(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=Rt(".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=_i(()=>this.viewContainer.removeChild(o)),l=xm(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 vhr(o,e,c,l):new bhr(o,e,c,l);if(this.viewItems.splice(i,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new cu(this.sashContainer,{getHorizontalSashTop:L=>this.getSashPosition(L),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new cu(this.sashContainer,{getVerticalSashLeft:L=>this.getSashPosition(L),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?L=>({sash:f,start:L.startY,current:L.currentY,alt:L.altKey}):L=>({sash:f,start:L.startX,current:L.currentX,alt:L.altKey}),v=on.map(f.onDidStart,g)(this.onSashStart,this),b=on.map(f.onDidChange,g)(this.onSashChange,this),C=on.map(f.onDidEnd,()=>this.sashItems.findIndex(L=>L.sash===f))(this.onSashEnd,this),E=f.onDidReset(()=>{const L=this.sashItems.findIndex(M=>M.sash===f),D=cd(L,-1),A=cd(L+1,this.viewItems.length),N=this.findFirstSnapIndex(D),P=this.findFirstSnapIndex(A);typeof N=="number"&&!this.viewItems[N].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(L)}),x=xm(v,b,C,E,f),k={sash:f,disposable:x};this.sashItems.splice(i-1,0,k)}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=cd(e,-1),d=cd(e+1,this.viewItems.length);if(o)for(const k of o)Hee(u,k),Hee(d,k);if(r)for(const k of r)I9(u,k),I9(d,k);const h=u.map(k=>this.viewItems[k]),f=u.map(k=>i[k]),g=d.map(k=>this.viewItems[k]),m=d.map(k=>i[k]),v=u.reduce((k,L)=>k+(this.viewItems[L].minimumSize-i[L]),0),_=u.reduce((k,L)=>k+(this.viewItems[L].maximumSize-i[L]),0),b=d.length===0?Number.POSITIVE_INFINITY:d.reduce((k,L)=>k+(i[L]-this.viewItems[L].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((k,L)=>k+(i[L]-this.viewItems[L].maximumSize),0),C=Math.max(v,y,s),E=Math.min(b,_,a);let x=!1;if(l){const k=this.viewItems[l.index],L=t>=l.limitDelta;x=L!==k.visible,k.setVisible(L,l.size)}if(!x&&c){const k=this.viewItems[c.index],L=t<c.limitDelta;x=L!==k.visible,k.setVisible(L,c.size)}if(x)return this.resize(e,t,i,r,o,s,a);t=Ah(t,C,E);for(let k=0,L=t;k<h.length;k++){const D=h[k],A=Ah(f[k]+L,D.minimumSize,D.maximumSize),N=A-f[k];L-=N,D.size=A}for(let k=0,L=t;k<g.length;k++){const D=g[k],A=Ah(m[k]-L,D.minimumSize,D.maximumSize),N=A-m[k];L+=N,D.size=A}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-t;const r=cd(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)Hee(r,a);for(const a of o)I9(r,a);typeof e=="number"&&I9(r,e);for(let a=0;i!==0&&a<r.length;a++){const l=this.viewItems[r[a]],c=Ah(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 f=cd(l,-1),g=cd(l+1,this.viewItems.length),m=this.findFirstSnapIndex(f),v=this.findFirstSnapIndex(g),_=typeof m=="number"&&!this.viewItems[m].visible,b=typeof v=="number"&&!this.viewItems[v].visible;_&&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(),_o(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class U6{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=U6.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=ft(e,Rt(".monaco-table-tr")),i=[],r=[];for(let s=0;s<this.columns.length;s++){const a=this.renderers[s],l=ft(t,Rt(".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]);kc(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}U6.TemplateId="row";function yhr(n){return{getHeight(e){return n.getHeight(e)},getTemplateId(){return U6.TemplateId}}}class Chr{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:on.None}constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new De,this.onDidLayout=this._onDidLayout.event,this.element=Rt(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}layout(e){this._onDidLayout.fire([this.index,e])}}class dY{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_${++dY.InstanceCount}`,this.disposables=new yt,this.cachedWidth=0,this.cachedHeight=0,this.domNode=ft(t,Rt(`.monaco-table.${this.domId}`));const a=r.map((u,d)=>new Chr(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 ttt(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 U6(r,o,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new i_(e,this.domNode,yhr(i),[c],s)),on.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((f,g)=>f+g.weight,0),h=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=vg(this.domNode),this.style(Edr)}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()}}dY.InstanceCount=0;class hN extends e_{constructor(e){super(),this._onChange=this._register(new De),this.onChange=this._onChange.event,this._onKeyDown=this._register(new De),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(...ei.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 whr=T("caseDescription","Match Case"),Shr=T("wordsDescription","Match Whole Word"),Ehr=T("regexDescription","Use Regular Expression");class ntt extends hN{constructor(e){super({icon:jt.caseSensitive,title:whr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class itt extends hN{constructor(e){super({icon:jt.wholeWord,title:Shr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class rtt extends hN{constructor(e){super({icon:jt.regex,title:Ehr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class xhr{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 Thr{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 xhr(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 BO=Rt;let khr=class extends e_{constructor(e,t,i){var r;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new De),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new De),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=ft(e,BO(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=ft(this.element,BO(".ibwrapper"));if(this.input=ft(s,BO(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=ft(s,BO("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new gJe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ft(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new cr(document,"selectionchange")),l=on.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 wg(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:zx(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"&&Uf(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 ${fT(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=Jd(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{var o,s;if(!this.message)return null;e=ft(r,BO(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?$ur(this.message.content,a):Bur(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}`:"",ft(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=T("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=T("alertWarningMessage","Warning: {0}",this.message.content):i=T("alertInfoMessage","Info: {0}",this.message.content),vu(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 ${fT(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=zx(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 ott extends khr{constructor(e,t,i){const r=T({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 De),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new De),this.onDidBlur=this._onDidBlur.event,this.history=new Thr(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??"",wS(this.value?this.value:T("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,wS(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 Ihr=T("defaultLabel","input");class stt extends e_{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Ac),this.additionalToggles=[],this._onDidOptionChange=this._register(new De),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new De),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new De),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new De),this._onKeyUp=this._register(new De),this._onCaseSensitiveKeyDown=this._register(new De),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new De),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||Ihr,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 ott(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 rtt(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 itt(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 ntt(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 f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),ji.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(at(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(at(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 yt;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 Jv;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Jv||(Jv={}));var Qx;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(Qx||(Qx={}));class Tf extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class Fye{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 Bye(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function h5(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function Jte(n){return typeof n.collapsible=="boolean"}class Lhr{constructor(e,t,i,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new s0e,this._onDidChangeCollapseState=new De,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new De,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new De,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Um(CZe),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=rr.empty(),r={}){if(e.length===0)throw new Tf(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=rr.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 bb({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+i)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(v,_,b)=>{if(s>0)for(let y=0;y<b;y++)v--,_--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[_].children,o,s-1)};let g=Math.min(l.children.length,u+i),m=c.length;for(const v of d.changes.sort((_,b)=>b.originalStart-_.originalStart))f(g,m,g-(v.originalStart+v.originalLength)),g=v.originalStart,m=v.modifiedStart-u,this.spliceSimple([...h,g],v.originalLength,rr.slice(c,m,m+v.modifiedLength),o);f(g,m,g)}spliceSimple(e,t,i=rr.empty(),{onDidCreateNode:r,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=rr.map(i,k=>this.createTreeNode(k,a,a.visible?1:0,c,d,r)),f=e[e.length-1],g=a.children.length>0;let m=0;for(let k=f;k>=0&&k<a.children.length;k--){const L=a.children[k];if(L.visible){m=L.visibleChildIndex;break}}const v=[];let _=0,b=0;for(const k of h)v.push(k),b+=k.renderNodeCount,k.visible&&(k.visibleChildIndex=m+_++);const y=sNe(a.children,f,t,v);s?a.lastDiffIds?sNe(a.lastDiffIds,f,t,v.map(k=>s.getId(k.element).toString())):a.lastDiffIds=a.children.map(k=>s.getId(k.element).toString()):a.lastDiffIds=void 0;let C=0;for(const k of y)k.visible&&C++;if(C!==0)for(let k=f+v.length;k<a.children.length;k++){const L=a.children[k];L.visible&&(L.visibleChildIndex-=C)}if(a.visibleChildrenCount+=_-C,c&&u){const k=y.reduce((L,D)=>L+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-k),this.list.splice(l,k,d)}if(y.length>0&&o){const k=L=>{o(L),L.children.forEach(k)};y.forEach(k)}this._onDidSplice.fire({insertedNodes:v,deletedNodes:y});const E=a.children.length>0;g!==E&&this.setCollapsible(e.slice(0,-1),E);let x=a;for(;x;){if(x.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}x=x.parent}}rerender(e){if(e.length===0)throw new Tf(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&&!Jte(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:(Jte(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})),!Jte(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||rr.empty(),u=r&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,o,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.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):Bye(i)?(e.filterData=i.data,h5(i.visibility)):(e.filterData=void 0,h5(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 Tf(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 Tf(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 Tf(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?[]:iYi(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(t.children.length!==0)return t.children[0].element}}globalThis&&globalThis.__awaiter;class Dhr extends z6{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function ene(n){return n instanceof z6?new Dhr(n):n}class Ahr{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=qe.None,this.disposables=new yt}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,ene(e),t)}onDragOver(e,t,i,r,o=!0){const s=this.dnd.onDragOver(ene(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=bS(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!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,f=typeof s=="boolean"?void 0:s.effect;return{accept:h,effect:f,feedback:[i]}}return s}if(s.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),m=h.getNode(g),v=g&&h.getListIndex(g);return this.onDragOver(e,m,v,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:cd(u,u+d)})}drop(e,t,i,r){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(ene(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 Rhr(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Ahr(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 $ye{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 f5;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(f5||(f5={}));class Nhr{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new yt,this.onDidChange=on.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class p5{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=p5.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=qe.None,this.disposables=new yt,this.templateId=e.templateId,this.updateOptions(s),on.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=Ah(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!==f5.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 yt;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=ft(e,Rt(".monaco-tl-row")),i=ft(t,Rt(".monaco-tl-indent")),r=ft(t,Rt(".monaco-tl-twistie")),o=ft(t,Rt(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:r,indentGuidesDisposable:qe.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=p5.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(...ei.asClassNameArray(jt.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(...ei.asClassNameArray(jt.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(kc(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new yt,r=this.modelProvider();for(;;){const o=r.getNodeLocation(e),s=r.getParentNodeLocation(o);if(!s)break;const a=r.getNode(s),l=Rt(".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(_i(()=>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(),_o(this.disposables)}}p5.DefaultIndent=8;class Ohr{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 yt,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:Bye(s)?i=h5(s.visibility):i=s,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:gv.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:gv.Default,visibility:i};let l;if(this.tree.findMatchType===rk.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=nk(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===Hb.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:gv.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){_o(this.disposables)}}var Hb;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Hb||(Hb={}));var rk;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(rk||(rk={}));let Phr=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 De,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new De,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new De,this._onDidChangeOpenState=new De,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new yt,this.disposables=new yt,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Hb.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:rk.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:T("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===Hb.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!gv.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 wMe(n){let e=Qx.Unknown;return nte(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Qx.Twistie:nte(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Qx.Element:nte(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Qx.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function hV(n,e){e(n),n.children.forEach(t=>hV(t,e))}class tne{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 De,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&ka(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=>hV(u,c)),this.set([...l.values()]);return}const i=new Set,r=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>hV(l,r));const o=new Map,s=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>hV(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 Mhr extends qet{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(Wet(e.browserEvent.target)||jw(e.browserEvent.target)||yL(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 Fhr extends i_{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 Mhr(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(fS([...super.getFocus(),...r])),o.length>0&&super.setSelection(fS([...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 att{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 on.filter(on.map(this.view.onMouseDblClick,wMe),e=>e.target!==Qx.Filter)}get onPointer(){return on.map(this.view.onPointer,wMe)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return on.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:Hb.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:rk.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 s0e,this.onDidChangeFindOpenState=on.None,this.disposables=new yt,this._onWillRefilter=new De,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new De;const a=new $ye(i),l=new fNe,c=new fNe,u=this.disposables.add(new Nhr(c.event)),d=new L0e;this.renderers=r.map(v=>new p5(v,()=>this.model,l.event,u,d,o));for(const v of this.renderers)this.disposables.add(v);let h;o.keyboardNavigationLabelProvider&&(h=new Ohr(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new tne(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new tne(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new tne(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new Fhr(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},Rhr(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=on.forEach(this.model.onDidSplice,v=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(v),this.selection.onDidModelSplice(v)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new De),m=this.disposables.add(new Um(0));if(this.disposables.add(on.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{m.trigger(()=>{const v=new Set;for(const _ of this.focus.getNodes())v.add(_);for(const _ of this.selection.getNodes())v.add(_);g.fire([...v.values()])})})),c.input=g.event,o.keyboardSupport!==!1){const v=on.chain(this.view.onKeyDown,_=>_.filter(b=>!jw(b.target)).map(b=>new ls(b)));on.chain(v,_=>_.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),on.chain(v,_=>_.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),on.chain(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 v=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new Phr(this,this.model,this.view,h,o.contextViewProvider,v),this.focusNavigationFilter=_=>this.findController.shouldAllowFocus(_),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=on.None,this.onDidChangeFindMatchType=on.None;this.styleElement=vg(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===f5.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===f5.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),pS(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(){_o(this.disposables),this.view.dispose()}}class Vye{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Lhr(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=rr.empty(),i={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),i)}_setChildren(e,t=rr.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=rr.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),rr.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===Jv.Collapsed||t.collapsed===Jv.PreserveOrCollapsed?s=!0:t.collapsed===Jv.Expanded||t.collapsed===Jv.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===Jv.PreserveOrCollapsed||t.collapsed===Jv.PreserveOrExpanded?o=i.collapsed:t.collapsed===Jv.Collapsed?o=!0:t.collapsed===Jv.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 Tf(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Tf(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Tf(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 Tf(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function fV(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:rr.map(rr.from(n.children),fV),collapsible:n.collapsible,collapsed:n.collapsed}}function pV(n){const e=[n.element],t=n.incompressible||!1;let i,r;for(;[r,i]=rr.consume(rr.from(n.children),2),!(r.length!==1||r[0].incompressible);)n=r[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:rr.map(rr.concat(r,i),pV),collapsible:n.collapsible,collapsed:n.collapsed}}function Bue(n,e=0){let t;return e<n.element.elements.length-1?t=[Bue(n,e+1)]:t=rr.map(rr.from(n.children),i=>Bue(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 SMe(n){return Bue(n,0)}function ltt(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:rr.map(rr.from(n.children),i=>ltt(i,e,t))})}const Bhr=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class $hr{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 Vye(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=rr.empty(),i){const r=i.diffIdentityProvider&&Bhr(i.diffIdentityProvider);if(e===null){const g=rr.map(t,this.enabled?pV:fV);this._setChildren(null,g,{diffIdentityProvider:r,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Tf(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=SMe(s),u=ltt(c,e,t),d=(this.enabled?pV:fV)(u),h=i.diffIdentityProvider?(g,m)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(m):void 0;if(ka(d.element.elements,s.element.elements,h)){this._setChildren(o,d.children||rr.empty(),{diffIdentityProvider:r,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:r,diffDepth:s.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,r=rr.map(i,SMe),o=rr.map(r,e?pV:fV);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 Tf(this.user,`Tree element not found: ${e}`);return t}}const Vhr=n=>n[n.length-1];class Hye{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new Hye(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 Hhr(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 Whr(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 zhr{get onDidSplice(){return on.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 on.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return on.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||Vhr;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new Fye(o=>new Hye(r,o)),this.model=new $hr(e,Hhr(this.nodeMapper,t),Whr(r,i))}setChildren(e,t=rr.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 Uhr=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 Wye extends att{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,r,o={}){super(e,t,i,r,o),this.user=e}setChildren(e,t=rr.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 Vye(e,t,i)}}class ctt{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}}Uhr([Ha],ctt.prototype,"compressedTreeNodeProvider",null);function jhr(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 utt extends Wye{constructor(e,t,i,r,o={}){const s=()=>this,a=r.map(l=>new ctt(s,l));super(e,t,i,a,jhr(s,o))}setChildren(e,t=rr.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new zhr(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 uC=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 nne(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function $ue(n,e){return e.parent?e.parent===n?!0:$ue(n,e.parent):!1}function qhr(n,e){return n===e||$ue(n,e)||$ue(e,n)}class zye{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new zye(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 Ghr{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(...ei.asClassNameArray(jt.treeItemLoading)),!0):(t.classList.remove(...ei.asClassNameArray(jt.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 EMe(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function xMe(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class Khr extends z6{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function ine(n){return n instanceof z6?new Khr(n):n}class Yhr{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,ine(e),t)}onDragOver(e,t,i,r,o=!0){return this.dnd.onDragOver(ine(e),t&&t.element,i,r)}drop(e,t,i,r){this.dnd.drop(ine(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 dtt(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 Yhr(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 Vue(n,e){e(n),n.children.forEach(t=>Vue(t,e))}class htt{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return on.map(this.tree.onDidChangeFocus,EMe)}get onDidChangeSelection(){return on.map(this.tree.onDidChangeSelection,EMe)}get onMouseDblClick(){return on.map(this.tree.onMouseDblClick,xMe)}get onPointer(){return on.map(this.tree.onPointer,xMe)}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 De,this._onDidChangeNodeSlowState=new De,this.nodeMapper=new Fye(a=>new zye(a)),this.disposables=new yt,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=nne({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 $ye(i),a=r.map(c=>new Ghr(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=dtt(o)||{};return new Wye(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 uC(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 uC(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Tf(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield on.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 uC(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Tf(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield on.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 on.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 on.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 Tf(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,r){return uC(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,r)})}refreshNode(e,t,i){return uC(this,void 0,void 0,function*(){let r;if(this.subTreeRefreshPromises.forEach((o,s)=>{!r&&qhr(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 uC(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 fce.settled(o.map(s=>this.doRefreshSubTree(s,t,i)))}finally{r()}})}doRefreshNode(e,t,i){return uC(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(rr.empty());else{const o=this.doGetChildren(e);if(aNe(o))r=Promise.resolve(o);else{const s=vS(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),Av(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 aNe(i)?this.processChildren(i):(t=Sl(()=>uC(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(Pi))}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=nne({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(),f=a.get(h);if(f){const m=f.node;return s.delete(m.element),this.nodes.delete(m.element),this.nodes.set(u,m),m.element=u,m.hasChildren=d,i?f.collapsed?(m.children.forEach(v=>Vue(v,_=>this.nodes.delete(_.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 g=nne({element:u,parent:e,id:h,hasChildren:d});return r&&r.viewState.focus&&r.viewState.focus.indexOf(h)>-1&&r.focus.push(g),r&&r.viewState.selection&&r.viewState.selection.indexOf(h)>-1&&r.selection.push(g),r&&r.viewState.expanded&&r.viewState.expanded.indexOf(h)>-1?l.push(g):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const u of s.values())Vue(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?rr.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 Uye{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 Uye(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 Qhr{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(...ei.asClassNameArray(jt.treeItemLoading)),!0):(t.classList.remove(...ei.asClassNameArray(jt.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=_o(this.disposables)}}function Xhr(n){const e=n&&dtt(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 Zhr extends htt{constructor(e,t,i,r,o,s,a={}){super(e,t,i,o,s,a),this.compressionDelegate=r,this.compressibleNodeMapper=new Fye(l=>new Uye(l)),this.filter=a.filter}createTree(e,t,i,r,o){const s=new $ye(i),a=r.map(c=>new Qhr(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=Xhr(o)||{};return new utt(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 f=new Set;for(const g of h){const m=this.tree.getCompressedTreeNode(g===this.root?null:g);if(m.element)for(const v of m.element.elements)f.add(i(v.element))}return f},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 f=h.element;if(f)for(let g=0;g<f.elements.length;g++){const m=i(f.elements[g].element),v=f.elements[f.elements.length-1].element;o.has(m)&&a.indexOf(v)===-1&&(a.push(v),l=!0),s.has(m)&&c.indexOf(v)===-1&&(c.push(v),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=rr.filter(e,t=>{const i=this.filter.filter(t,1),r=Jhr(i);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function Jhr(n){return typeof n=="boolean"?n?1:0:Bye(n)?h5(n.visibility):h5(n)}class efr extends att{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 Vye(e,t,i)}}new sn("isMac",br,T("isMac","Whether the operating system is macOS"));new sn("isLinux",Xu,T("isLinux","Whether the operating system is Linux"));const hY=new sn("isWindows",eu,T("isWindows","Whether the operating system is Windows")),ftt=new sn("isWeb",sE,T("isWeb","Whether the platform is a web browser"));new sn("isMacNative",br&&!sE,T("isMacNative","Whether the operating system is macOS on a non-browser platform"));new sn("isIOS",bv,T("isIOS","Whether the operating system is iOS"));new sn("isMobile",wYi,T("isMobile","Whether the platform is a mobile web browser"));new sn("isDevelopment",!1,!0);new sn("productQualityType","",T("productQualityType","Quality type of VS Code"));const ptt="inputFocus";new sn(ptt,!1,T("inputFocus","Whether keyboard focus is inside an input box"));var V1=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},cs=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Ng=lr("listService");class tfr{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new yt,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 Get(vg(),"").style(rI)),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),xm(e.onDidFocus(()=>this.setLastFocusedList(e)),_i(()=>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 g5=new sn("listScrollAtBoundary","none");ht.or(g5.isEqualTo("top"),g5.isEqualTo("both"));ht.or(g5.isEqualTo("bottom"),g5.isEqualTo("both"));const gtt=new sn("listFocus",!0),fY=new sn("listSupportsMultiselect",!0),mtt=ht.and(gtt,ht.not(ptt)),jye=new sn("listHasSelectionOrFocus",!1),qye=new sn("listDoubleSelection",!1),Gye=new sn("listMultiSelection",!1),pY=new sn("listSelectionNavigation",!1),nfr=new sn("listSupportsFind",!0),Kye=new sn("treeElementCanCollapse",!1),ifr=new sn("treeElementHasParent",!1),Yye=new sn("treeElementCanExpand",!1),rfr=new sn("treeElementHasChild",!1),ofr=new sn("treeFindOpen",!1),_tt="listTypeNavigationMode",vtt="listAutomaticKeyboardNavigation";function gY(n,e){const t=n.createScoped(e.getHTMLElement());return gtt.bindTo(t),t}function mY(n,e){const t=g5.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 oI="workbench.list.multiSelectModifier",gV="workbench.list.openMode",cg="workbench.list.horizontalScrolling",Qye="workbench.list.defaultFindMode",Xye="workbench.list.typeNavigationMode",iU="workbench.list.keyboardNavigation",wv="workbench.list.scrollByPage",Zye="workbench.list.defaultFindMatchType",m5="workbench.tree.indent",rU="workbench.tree.renderIndentGuides",Sv="workbench.list.smoothScrolling",f0="workbench.list.mouseWheelScrollSensitivity",p0="workbench.list.fastScrollSensitivity",oU="workbench.tree.expandMode";function g0(n){return n.getValue(oI)==="alt"}class sfr extends qe{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=g0(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(oI)&&(this.useAltAsMultipleSelectionModifier=g0(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Uet(e)}isSelectionRangeChangeEvent(e){return jet(e)}}function _Y(n,e){var t;const i=n.get(pr),r=n.get(Go),o=new yt;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(Sv),mouseWheelScrollSensitivity:i.getValue(f0),fastScrollSensitivity:i.getValue(p0),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new sfr(i)),keyboardNavigationEventFilter:cfr(r),scrollByPage:!!i.getValue(wv)}),o]}let Hue=class extends i_{constructor(e,t,i,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(cg),[d,h]=c.invokeFunction(_Y,o);super(e,t,i,r,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables.add(h),this.contextKeyService=gY(s,this),this.disposables.add(mY(this.contextKeyService,this)),this.listSupportsMultiSelect=fY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),pY.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=jye.bindTo(this.contextKeyService),this.listDoubleSelection=qye.bindTo(this.contextKeyService),this.listMultiSelection=Gye.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=g0(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||m.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||m.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(oI)&&(this._useAltAsMultipleSelectionModifier=g0(l));let m={};if(g.affectsConfiguration(cg)&&this.horizontalScrolling===void 0){const v=!!l.getValue(cg);m=Object.assign(Object.assign({},m),{horizontalScrolling:v})}if(g.affectsConfiguration(wv)){const v=!!l.getValue(wv);m=Object.assign(Object.assign({},m),{scrollByPage:v})}if(g.affectsConfiguration(Sv)){const v=!!l.getValue(Sv);m=Object.assign(Object.assign({},m),{smoothScrolling:v})}if(g.affectsConfiguration(f0)){const v=l.getValue(f0);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(p0)){const v=l.getValue(p0);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:v})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new btt(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?uN(e):rI)}};Hue=V1([cs(5,bi),cs(6,Ng),cs(7,pr),cs(8,pi)],Hue);let TMe=class extends dhr{constructor(e,t,i,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(cg),[d,h]=c.invokeFunction(_Y,o);super(e,t,i,r,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables=new yt,this.disposables.add(h),this.contextKeyService=gY(s,this),this.disposables.add(mY(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=fY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),pY.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=g0(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(oI)&&(this._useAltAsMultipleSelectionModifier=g0(l));let m={};if(g.affectsConfiguration(cg)&&this.horizontalScrolling===void 0){const v=!!l.getValue(cg);m=Object.assign(Object.assign({},m),{horizontalScrolling:v})}if(g.affectsConfiguration(wv)){const v=!!l.getValue(wv);m=Object.assign(Object.assign({},m),{scrollByPage:v})}if(g.affectsConfiguration(Sv)){const v=!!l.getValue(Sv);m=Object.assign(Object.assign({},m),{smoothScrolling:v})}if(g.affectsConfiguration(f0)){const v=l.getValue(f0);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(p0)){const v=l.getValue(p0);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:v})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new btt(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?uN(e):rI)}dispose(){this.disposables.dispose(),super.dispose()}};TMe=V1([cs(5,bi),cs(6,Ng),cs(7,pr),cs(8,pi)],TMe);let kMe=class extends dY{constructor(e,t,i,r,o,s,a,l,c,u){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!c.getValue(cg),[h,f]=u.invokeFunction(_Y,s);super(e,t,i,r,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables.add(f),this.contextKeyService=gY(a,this),this.disposables.add(mY(this.contextKeyService,this)),this.listSupportsMultiSelect=fY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),pY.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=jye.bindTo(this.contextKeyService),this.listDoubleSelection=qye.bindTo(this.contextKeyService),this.listMultiSelection=Gye.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=g0(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(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||v.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(m=>{m.affectsConfiguration(oI)&&(this._useAltAsMultipleSelectionModifier=g0(c));let v={};if(m.affectsConfiguration(cg)&&this.horizontalScrolling===void 0){const _=!!c.getValue(cg);v=Object.assign(Object.assign({},v),{horizontalScrolling:_})}if(m.affectsConfiguration(wv)){const _=!!c.getValue(wv);v=Object.assign(Object.assign({},v),{scrollByPage:_})}if(m.affectsConfiguration(Sv)){const _=!!c.getValue(Sv);v=Object.assign(Object.assign({},v),{smoothScrolling:_})}if(m.affectsConfiguration(f0)){const _=c.getValue(f0);v=Object.assign(Object.assign({},v),{mouseWheelScrollSensitivity:_})}if(m.affectsConfiguration(p0)){const _=c.getValue(p0);v=Object.assign(Object.assign({},v),{fastScrollSensitivity:_})}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new afr(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?uN(e):rI)}dispose(){this.disposables.dispose(),super.dispose()}};kMe=V1([cs(6,bi),cs(7,Ng),cs(8,pr),cs(9,pi)],kMe);class Jye extends qe{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new De),this.onDidOpen=this._onDidOpen.event,this._register(on.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(gV))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(gV)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(gV))!=="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 btt extends Jye{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class afr extends Jye{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class lfr extends Jye{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function cfr(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 IMe=class extends Wye{constructor(e,t,i,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(j6,o);super(e,t,i,r,u),this.disposables.add(h),this.internals=new ok(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};IMe=V1([cs(5,pi),cs(6,bi),cs(7,Ng),cs(8,pr)],IMe);let LMe=class extends utt{constructor(e,t,i,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(j6,o);super(e,t,i,r,u),this.disposables.add(h),this.internals=new ok(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)}};LMe=V1([cs(5,pi),cs(6,bi),cs(7,Ng),cs(8,pr)],LMe);let DMe=class extends efr{constructor(e,t,i,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(j6,s);super(e,t,i,r,o,d),this.disposables.add(f),this.internals=new ok(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)}};DMe=V1([cs(6,pi),cs(7,bi),cs(8,Ng),cs(9,pr)],DMe);let Wue=class extends htt{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(j6,s);super(e,t,i,r,o,d),this.disposables.add(f),this.internals=new ok(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)}};Wue=V1([cs(6,pi),cs(7,bi),cs(8,Ng),cs(9,pr)],Wue);let AMe=class extends Zhr{constructor(e,t,i,r,o,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(j6,a);super(e,t,i,r,o,s,h),this.disposables.add(g),this.internals=new ok(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};AMe=V1([cs(7,pi),cs(8,bi),cs(9,Ng),cs(10,pr)],AMe);function ytt(n){const e=n.getValue(Qye);if(e==="highlight")return Hb.Highlight;if(e==="filter")return Hb.Filter;const t=n.getValue(iU);if(t==="simple"||t==="highlight")return Hb.Highlight;if(t==="filter")return Hb.Filter}function Ctt(n){const e=n.getValue(Zye);if(e==="fuzzy")return rk.Fuzzy;if(e==="contiguous")return rk.Contiguous}function j6(n,e){var t;const i=n.get(pr),r=n.get(B1),o=n.get(bi),s=n.get(pi),a=()=>{const f=o.getContextKeyValue(_tt);if(f==="automatic")return Eb.Automatic;if(f==="trigger"||o.getContextKeyValue(vtt)===!1)return Eb.Trigger;const m=i.getValue(Xye);if(m==="automatic")return Eb.Automatic;if(m==="trigger")return Eb.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(cg),[c,u]=s.invokeFunction(_Y,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(rU);return{getTypeNavigationMode:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(m5)=="number"?i.getValue(m5):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(Sv),defaultFindMode:ytt(i),defaultFindMatchType:Ctt(i),horizontalScrolling:l,scrollByPage:!!i.getValue(wv),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(oU)==="doubleClick",contextViewProvider:r,findWidgetStyles:Udr})}}let ok=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,r,o,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=gY(o,e),this.disposables.push(mY(this.contextKeyService,e)),this.listSupportsMultiSelect=fY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),pY.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=nfr.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=jye.bindTo(this.contextKeyService),this.hasDoubleSelection=qye.bindTo(this.contextKeyService),this.hasMultiSelection=Gye.bindTo(this.contextKeyService),this.treeElementCanCollapse=Kye.bindTo(this.contextKeyService),this.treeElementHasParent=ifr.bindTo(this.contextKeyService),this.treeElementCanExpand=Yye.bindTo(this.contextKeyService),this.treeElementHasChild=rfr.bindTo(this.contextKeyService),this.treeFindOpen=ofr.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=g0(a),this.updateStyleOverrides(r);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(_tt),d.add(vtt),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(oI)&&(this._useAltAsMultipleSelectionModifier=g0(a)),h.affectsConfiguration(m5)){const g=a.getValue(m5);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(rU)&&t.renderIndentGuides===void 0){const g=a.getValue(rU);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(Sv)){const g=!!a.getValue(Sv);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(Qye)||h.affectsConfiguration(iU)){const g=ytt(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(Xye)||h.affectsConfiguration(iU)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(Zye)){const g=Ctt(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(cg)&&t.horizontalScrolling===void 0){const g=!!a.getValue(cg);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(wv)){const g=!!a.getValue(wv);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(oU)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(oU)==="doubleClick"})),h.affectsConfiguration(f0)){const g=a.getValue(f0);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(p0)){const g=a.getValue(p0);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new lfr(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?uN(e):rI)}dispose(){this.disposables=_o(this.disposables)}};ok=V1([cs(4,bi),cs(5,Ng),cs(6,pr)],ok);const ufr=Hs.as(Nv.Configuration);ufr.registerConfiguration({id:"workbench",order:7,title:T("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[oI]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[T("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),T("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:T({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.")},[gV]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:T({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.")},[cg]:{type:"boolean",default:!1,description:T("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[wv]:{type:"boolean",default:!1,description:T("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[m5]:{type:"number",default:8,minimum:4,maximum:40,description:T("tree indent setting","Controls tree indentation in pixels.")},[rU]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:T("render tree indent guides","Controls whether the tree should render indent guides.")},[Sv]:{type:"boolean",default:!1,description:T("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[f0]:{type:"number",default:1,markdownDescription:T("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[p0]:{type:"number",default:5,markdownDescription:T("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[Qye]:{type:"string",enum:["highlight","filter"],enumDescriptions:[T("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),T("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:T("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[iU]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[T("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),T("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),T("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:T("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:T("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[Zye]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[T("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),T("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:T("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[oU]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:T("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.")},[Xye]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:T("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 zue;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(zue||(zue={}));const sI={Quickaccess:"workbench.contributions.quickaccess"};class dfr{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),_i(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return o0([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Hs.add(sI.Quickaccess,new dfr);const hfr={ctrlCmd:!1,alt:!1};var _5;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(_5||(_5={}));var R_;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(R_||(R_={}));const Ov=lr("quickInputService");var ffr=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},RMe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Uue=class extends qe{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Hs.as(sI.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 f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===zue.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new yt,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:R_.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new DK,c.add(on.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,o,s,e,i==null?void 0:i.providerOptions));const h=c.add(new $a);if(o&&c.add(o.provide(u,h.token,i==null?void 0:i.providerOptions)),on.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 yt,a=this.visibleQuickAccess={picker:e,descriptor:i,value:r};return s.add(_i(()=>{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]}};Uue=ffr([RMe(0,Ov),RMe(1,pi)],Uue);je.white.toString(),je.white.toString();class jue extends qe{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new De),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(Yo.addTarget(this._element)),[Xt.CLICK,Qo.Tap].forEach(o=>{this._register(at(this._element,o,s=>{if(!this.enabled){ji.stop(s);return}this._onDidClick.fire(s)}))}),this._register(at(this._element,Xt.KEY_DOWN,o=>{const s=new ls(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&&ji.stop(s,!0)})),this._register(at(this._element,Xt.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(at(this._element,Xt.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(l0(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 Uw(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||zw(this._label)&&zw(e)&&Nur(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(zw(e)){const r=aY(e,{inline:!0});r.dispose();const o=(t=r.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const s=rZe(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=s}else Ic(i)}else this.options.supportIcons?Ic(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=Kur(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 que{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=ft(e,Rt(".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=GT(this.countFormat,this.count),this.element.title=GT(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 NMe="done",OMe="active",rne="infinite",one="infinite-long-running",PMe="discrete";class vY extends qe{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Mo(()=>Ph(this.element),0)),this.longRunningScheduler=this._register(new Mo(()=>this.infiniteLongRunning(),vY.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(OMe,rne,one,PMe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(NMe),this.element.classList.contains(rne)?(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(PMe,NMe,one),this.element.classList.add(OMe,rne),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(one)}getContainer(){return this.element}}vY.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const pfr=Rt;class gfr extends qe{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>at(this.findInput.inputBox.inputElement,Xt.KEY_DOWN,s=>{o(new ls(s))}),this.onMouseDown=o=>at(this.findInput.inputBox.inputElement,Xt.MOUSE_DOWN,s=>{o(new Zp(s))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=ft(this.parent,pfr(".quick-input-box")),this.findInput=this._register(new stt(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===wa.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===wa.Info?1:e===wa.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===wa.Info?1:e===wa.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class qw{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=ft(e,Rt("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",r){e||(e=""),r&&(e=qw.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Uf(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(...Uw(s)):e.push(s),t=i.start}const r=this.text.substring(t,i.end),o=Rt("span.highlight",void 0,...this.supportIcons?Uw(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(...Uw(i)):e.push(i)}Ic(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 sne{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 sU extends qe{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new sne(ft(e,Rt(".monaco-icon-label")))),this.labelContainer=ft(this.domNode.element,Rt(".monaco-icon-label-container"));const i=ft(this.labelContainer,Rt("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new vfr(i,!!t.supportIcons):this.nameNode=new mfr(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 qw?(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)?qw.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)Mur(e,t);else{const r=Vet(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 sne(ft(this.labelContainer,Rt("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new qw(ft(t.element,Rt("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new sne(ft(t.element,Rt("span.label-description"))))}return this.descriptionNode}}class mfr{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Uf(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=ft(this.container,Rt("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}`;ft(this.container,Rt("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},r)),i<e.length-1&&ft(this.container,Rt("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function _fr(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=>lu.intersect(o,a)).filter(a=>!lu.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,s})}class vfr{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Uf(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 qw(ft(this.container,Rt("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=_fr(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=Rt("a.label-name",{id:l,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new qw(ft(this.container,c),{supportIcons:this.supportIcons}).set(s,a,void 0,t==null?void 0:t.labelEscapeNewLines),o<e.length-1&&ft(c,Rt("span.label-separator",void 0,i))}}}}const p7=Rt,bfr={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class q6{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const r=this.options.keybindingLabelForeground;this.domNode=ft(e,p7(".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&&q6.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++)ft(this.domNode,p7("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(){kc(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const r=wye.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){ft(e,this.createKeyElement(t,i?".highlight":"")),r&&ft(e,p7("span.monaco-keybinding-key-separator",void 0,r))}renderUnbound(e){ft(e,this.createKeyElement(T("unbound","Unbound")))}createKeyElement(e,t=""){const i=p7("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&&Uf(e.firstPart,t.firstPart)&&Uf(e.chordPart,t.chordPart)}}const MMe=new cE(()=>{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function yfr(n,e,t=!1){const i=n||"",r=e||"",o=MMe.value.collator.compare(i,r);return MMe.value.collatorIsNumeric&&o===0&&i!==r?i<r?-1:1:o}function Cfr(n,e,t){const i=n.toLowerCase(),r=e.toLowerCase(),o=wfr(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=yfr(i,r);return l!==0?l:i.localeCompare(r)}function wfr(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 Sfr=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 wtt{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Sfr([Ha],wtt.prototype,"toString",null);const Efr=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function xfr(n){const e=[];let t=0,i;for(;i=Efr.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 wtt(e)}const ane={},Tfr=new Rye("quick-input-button-icon-");function Gue(n){if(!n)return;let e;const t=n.dark.toString();return ane[t]?e=ane[t]:(e=Tfr.nextId(),dce(`.${e}, .hc-light .${e}`,`background-image: ${_S(n.light||n.dark)}`),dce(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${_S(n.dark)}`),ane[t]=e),e}function kfr(n,e,t){Ic(e);const i=xfr(n);let r=0;for(const o of i.nodes)if(typeof o=="string")e.append(...Uw(o));else{let s=o.title;!s&&o.href.startsWith("command:")?s=T("executeCommand","Click to execute command '{0}'",o.href.substring(8)):s||(s=o.href);const a=Rt("a",{href:o.href,title:s,tabIndex:r++},o.label);a.style.textDecoration="underline";const l=f=>{BZi(f)&&ji.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new cr(a,Xt.CLICK)).event,u=t.disposables.add(new cr(a,Xt.KEY_DOWN)).event,d=on.chain(u,f=>f.filter(g=>{const m=new ls(g);return m.equals(10)||m.equals(3)}));t.disposables.add(Yo.addTarget(a));const h=t.disposables.add(new cr(a,Qo.Tap)).event;on.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var Stt=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},FMe=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 C_=Rt;class Ifr{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?on.map(on.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):on.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 cE(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=AP(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(m=>Rur(m)).filter(m=>!!m).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}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 G6{constructor(e){this.themeService=e}get templateId(){return G6.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ft(e,C_(".quick-input-list-entry"));const i=ft(t.entry,C_("label.quick-input-list-label"));t.toDisposeTemplate.push(Ba(i,Xt.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=ft(i,C_("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Ba(t.checkbox,Xt.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const r=ft(i,C_(".quick-input-list-rows")),o=ft(r,C_(".quick-input-list-row")),s=ft(r,C_(".quick-input-list-row"));t.label=new sU(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=fZe(t.label.element,C_(".quick-input-list-icon"));const a=ft(o,C_(".quick-input-list-entry-keybinding"));t.keybinding=new q6(a,Of);const l=ft(s,C_(".quick-input-list-label-meta"));return t.detail=new sU(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=ft(t.entry,C_(".quick-input-list-separator")),t.actionBar=new wg(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(g=>i.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const g=RA(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,m=Jn.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=_S(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 f=l.buttons;f&&f.length?(i.actionBar.push(f.map((g,m)=>{let v=g.iconClass||(g.iconPath?Gue(g.iconPath):void 0);return g.alwaysVisible&&(v=v?`${v} always-visible`:"always-visible"),{id:`id-${m}`,class:v,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=_o(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=_o(e.toDisposeElement),e.toDisposeTemplate=_o(e.toDisposeTemplate)}}G6.ID="listelement";class Lfr{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return G6.ID}}var Yl;(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"})(Yl||(Yl={}));class e1e{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 De,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new De,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new De,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new De,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new De,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new De,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new De,this.onKeyDown=this._onKeyDown.event,this._onLeave=new De,this.onLeave=this._onLeave.event,this._listElementChecked=new De,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ft(this.parent,C_(".quick-input-list"));const o=new Lfr,s=new Rfr;if(this.list=i.createList("QuickInput",this.container,o,[new G6(r)],{identityProvider:{getId:a=>{var l,c,u,d,h,f,g,m;return(m=(f=(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&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.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 ls(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(br?a.metaKey:a.ctrlKey)&&this.list.setFocus(cd(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(at(this.container,Xt.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 wZe(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>FMe(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Qc(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>FMe(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(u){if(!Av(u))throw u}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;Qc(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 on.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return on.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=_o(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 Ifr(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===Yl.Second&&this.list.length<2&&(e=Yl.First),e){case Yl.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case Yl.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case Yl.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case Yl.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 Yl.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 Yl.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case Yl.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=qte(e,AP(o.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=Dfr(t,AP(o.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=qte(e,AP(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=qte(e,AP(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 f=o.index&&this.inputElements[o.index-1];r=f&&f.type==="separator"?f: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)=>Afr(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=_o(this.elementDisposables),this.disposables=_o(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 yt;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)}}Stt([Ha],e1e.prototype,"onDidChangeFocus",null);Stt([Ha],e1e.prototype,"onDidChangeSelection",null);function Dfr(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return BMe(n,t);const r=S6(t," "),o=t.length-r.length,s=BMe(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 BMe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function Afr(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:Cfr(n.saneSortLabel,e.saneSortLabel,t)}class Rfr{getWidgetAriaLabel(){return T("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 $Me=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 Kue={iconClass:ei.asClassName(jt.quickInputBack),tooltip:T("quickInput.back","Back"),handle:-1};class K6 extends qe{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=K6.noPromptMessage,this._severity=wa.Ignore,this.onDidTriggerButtonEmitter=this._register(new De),this.onDidHideEmitter=this._register(new De),this.onDisposeEmitter=this._register(new De),this.visibleDisposables=this._register(new yt),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&&!bv;this._ignoreFocusOut=e&&!bv,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=_5.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?Ic(this.ui.widget,this._widget):Ic(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Jm,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===Kue);this.ui.leftActionBar.push(s.map((l,c)=>{const u=new Nd(`id-${c}`,"",l.iconClass||Gue(l.iconPath),!0,()=>$Me(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!==Kue);this.ui.rightActionBar.push(a.map((l,c)=>{const u=new Nd(`id-${c}`,"",l.iconClass||Gue(l.iconPath),!0,()=>$Me(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 hN))!==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,Ic(this.ui.message),kfr(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?T("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==wa.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()}}K6.noPromptMessage=T("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class v5 extends K6{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new De),this.onWillAcceptEmitter=this._register(new De),this.onDidAcceptEmitter=this._register(new De),this.onDidCustomEmitter=this._register(new De),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=R_.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new De),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new De),this.onDidTriggerItemButtonEmitter=this._register(new De),this.onDidTriggerSeparatorButtonEmitter=this._register(new De),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?hfr: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(Yl.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(Yl.Next),this.canSelectMany&&this.ui.list.domFocus(),ji.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Yl.Previous):this.ui.list.focus(Yl.Last),this.canSelectMany&&this.ui.list.domFocus(),ji.stop(e,!0);break;case 12:this.ui.list.focus(Yl.NextPage),this.canSelectMany&&this.ui.list.domFocus(),ji.stop(e,!0);break;case 11:this.ui.list.focus(Yl.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),ji.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(Yl.First),ji.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Yl.Last),ji.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&&ka(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&&ka(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&&ka(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 at(this.ui.container,Xt.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new ls(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||v5.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 R_.NONE:this._itemActivation=R_.FIRST;break;case R_.SECOND:this.ui.list.focus(Yl.Second),this._itemActivation=R_.FIRST;break;case R_.LAST:this.ui.list.focus(Yl.Last),this._itemActivation=R_.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(Yl.First)),this.keepScrollPosition&&(this.scrollTop=e)}}v5.DEFAULT_ARIA_LABEL=T("quickInputBox.ariaLabel","Type to narrow down results.");class Nfr extends K6{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new De),this.onDidAcceptEmitter=this._register(new De),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 Ih=Rt;class bY extends qe{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new De),this.onDidCustomEmitter=this._register(new De),this.onDidTriggerButtonEmitter=this._register(new De),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new De),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new De),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(at(window,Xt.KEY_DOWN,e,!0)),this._register(at(window,Xt.KEY_UP,e,!0)),this._register(at(window,Xt.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=ft(this.parentElement,Ih(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=vg(e),i=ft(e,Ih(".quick-input-titlebar")),r=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new wg(i,r));o.domNode.classList.add("quick-input-left-action-bar");const s=ft(i,Ih(".quick-input-title")),a=this._register(new wg(i,r));a.domNode.classList.add("quick-input-right-action-bar");const l=ft(e,Ih(".quick-input-header")),c=ft(l,Ih("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",T("quickInput.checkAll","Toggle all checkboxes")),this._register(Ba(c,Xt.CHANGE,M=>{const B=c.checked;N.setAllVisibleChecked(B)})),this._register(at(c,Xt.CLICK,M=>{(M.x||M.y)&&f.setFocus()}));const u=ft(l,Ih(".quick-input-description")),d=ft(l,Ih(".quick-input-and-message")),h=ft(d,Ih(".quick-input-filter")),f=this._register(new gfr(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=ft(h,Ih(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new que(g,{countFormat:T({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),v=ft(h,Ih(".quick-input-count"));v.setAttribute("aria-live","polite");const _=new que(v,{countFormat:T({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=ft(l,Ih(".quick-input-action")),y=this._register(new jue(b,this.styles.button));y.label=T("ok","OK"),this._register(y.onDidClick(M=>{this.onDidAcceptEmitter.fire()}));const C=ft(l,Ih(".quick-input-action")),E=this._register(new jue(C,this.styles.button));E.label=T("custom","Custom"),this._register(E.onDidClick(M=>{this.onDidCustomEmitter.fire()}));const x=ft(d,Ih(`#${this.idPrefix}message.quick-input-message`)),k=this._register(new vY(e,this.styles.progressBar));k.getContainer().classList.add("quick-input-progress");const L=ft(e,Ih(".quick-input-html-widget"));L.tabIndex=-1;const D=ft(e,Ih(".quick-input-description")),A=this.idPrefix+"list",N=this._register(new e1e(e,A,this.options,this.themeService));f.setAttribute("aria-controls",A),this._register(N.onDidChangeFocus(()=>{var M;f.setAttribute("aria-activedescendant",(M=N.getActiveDescendant())!==null&&M!==void 0?M:"")})),this._register(N.onChangedAllVisibleChecked(M=>{c.checked=M})),this._register(N.onChangedVisibleCount(M=>{m.setCount(M)})),this._register(N.onChangedCheckedCount(M=>{_.setCount(M)})),this._register(N.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof v5&&this.controller.canSelectMany&&N.clearFocus()},0)}));const P=l0(e);return this._register(P),this._register(at(e,Xt.FOCUS,M=>{Qc(M.relatedTarget,e)||(this.previousFocusElement=M.relatedTarget instanceof HTMLElement?M.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(_5.Blur),this.previousFocusElement=void 0})),this._register(at(e,Xt.FOCUS,M=>{f.setFocus()})),this._register(Ba(e,Xt.KEY_DOWN,M=>{if(!Qc(M.target,L))switch(M.keyCode){case 3:ji.stop(M,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:ji.stop(M,!0),this.hide(_5.Gesture);break;case 2:if(!M.altKey&&!M.ctrlKey&&!M.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(Qc(M.target,this.getUI().widget))break;B.push(".quick-input-html-widget")}const F=e.querySelectorAll(B.join(", "));M.shiftKey&&M.target===F[0]?(ji.stop(M,!0),N.clearFocus()):!M.shiftKey&&Qc(M.target,F[F.length-1])&&(ji.stop(M,!0),F[0].focus())}break;case 10:M.ctrlKey&&(ji.stop(M,!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:f,visibleCountContainer:g,visibleCount:m,countContainer:v,count:_,okContainer:b,ok:y,message:x,customButtonContainer:C,customButton:E,list:N,progressBar:k,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:M=>this.show(M),hide:()=>this.hide(),setVisibilities:M=>this.setVisibilities(M),setEnabled:M=>this.setEnabled(M),setContextKey:M=>this.options.setContextKey(M),linkOpenerDelegate:M=>this.options.linkOpenerDelegate(M)},this.updateStyles(),this.ui}pick(e,t={},i=or.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(),f=h.splice(d,1),g=a.activeItems.filter(v=>v!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),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(()=>{_o(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 v5(e)}createInputBox(){const e=this.getUI();return new Nfr(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="",Ic(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(wa.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Ic(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();Kue.tooltip=r?T("quickInput.backWithKeybinding","Back ({0})",r):T("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=!Qc(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,bY.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"}}bY.MAX_WIDTH=600;var Ofr=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},g7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Yue=class extends drr{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(Uue))),this._quickAccess}constructor(e,t,i,r){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this._onShow=this._register(new De),this._onHide=this._register(new De),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(nf).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,s,a,l,c)=>this.instantiationService.createInstance(Hue,o,s,a,l,c),styles:this.computeStyles()},r=this._register(new bY(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 sn(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=or.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:an(LOe),quickInputForeground:an(_nr),quickInputTitleBackground:an(vnr),widgetBorder:an($0e),widgetShadow:an(Ob)},inputBox:Kz,toggle:Gz,countBadge:Yet,button:Wdr,progressBar:zdr,keybindingLabel:Hdr,list:uN({listBackground:LOe,listFocusBackground:qx,listFocusForeground:jx,listInactiveFocusForeground:jx,listInactiveSelectionIconForeground:uL,listInactiveFocusBackground:qx,listFocusOutline:vs,listInactiveFocusOutline:vs}),pickerGroup:{pickerGroupBorder:an(bnr),pickerGroupForeground:an(iJe)}}}};Yue=Ofr([g7(0,pi),g7(1,bi),g7(2,Vl),g7(3,cN)],Yue);var Ett=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},SL=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Que=class extends Yue{constructor(e,t,i,r,o){super(t,i,r,new nue(e.getContainerDomNode(),o)),this.host=void 0;const s=zA.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)}};Que=Ett([SL(1,pi),SL(2,bi),SL(3,Vl),SL(4,io)],Que);let Xue=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(Que,e);this.mapEditorToService.set(e,t),gS(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=or.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};Xue=Ett([SL(0,pi),SL(1,io)],Xue);class zA{static get(e){return e.getContribution(zA.ID)}constructor(e){this.editor=e,this.widget=new yY(this.editor)}dispose(){this.widget.dispose()}}zA.ID="editor.controller.quickInput";class yY{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return yY.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}yY.ID="editor.contrib.quickInputWidget";Hr(zA.ID,zA,4);class Pfr{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 Mfr(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 Pfr(o.token||"",i,s,a,l)}return e}function Ffr(n,e){n.sort((u,d)=>{const h=Wfr(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 $fr;for(const u of e)o.getId(u);const s=o.getId(i),a=o.getId(r),l=new t1e(t,s,a),c=new n1e(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 xtt(o,c)}const Bfr=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class $fr{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const t=e.match(Bfr);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]=je.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class xtt{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(Mfr(e),t)}static createFromParsedTokenTheme(e,t){return Ffr(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=Hfr(t);i=(r.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const Vfr=/\b(comment|string|regex|regexp)\b/;function Hfr(n){const e=n.match(Vfr);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 Wfr(n,e){return n<e?-1:n>e?1:0}class t1e{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 t1e(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 n1e{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 n1e(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,i,r)}}function zfr(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 Ufr={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:{[Pl]:"#FFFFFE",[mm]:"#000000",[rJe]:"#E5EBF1",[M6]:"#D3D3D3",[F6]:"#939393",[W0e]:"#ADD6FF4D"}},jfr={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:{[Pl]:"#1E1E1E",[mm]:"#D4D4D4",[rJe]:"#3A3D41",[M6]:"#404040",[F6]:"#707070",[W0e]:"#ADD6FF26"}},qfr={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:{[Pl]:"#000000",[mm]:"#FFFFFF",[M6]:"#FFFFFF",[F6]:"#FFFFFF"}},Gfr={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:{[Pl]:"#FFFFFF",[mm]:"#292929",[M6]:"#292929",[F6]:"#292929"}},Kfr={IconContribution:"base.contributions.icons"};var VMe;(function(n){function e(t,i){let r=t.defaults;for(;ei.isThemeIcon(r);){const o=aI.getIcon(r.id);if(!o)return;r=o.defaults}return r}n.getDefinition=e})(VMe||(VMe={}));var HMe;(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=>Rd(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Rd(o.format)&&Rd(o.location)))return{weight:r(i.weight),style:r(i.style),src:i.src.map(o=>({format:o.format,location:Jn.parse(o.location)}))}}n.fromJSONObject=t})(HMe||(HMe={}));class Yfr{constructor(){this._onDidChange=new De,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:T("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:T("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${ei.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(;ei.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}|${ei.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of r.filter(s=>!ei.isThemeIcon(s.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join(`
`)}}const aI=new Yfr;Hs.add(Kfr.IconContribution,aI);function La(n,e,t,i){return aI.registerIcon(n,e,t,i)}function Ttt(){return aI}function Qfr(){const n=OXe();for(const e in n){const t="\\"+n[e].toString(16);aI.registerIcon(e,{fontCharacter:t})}}Qfr();const ktt="vscode://schemas/icons",Itt=Hs.as(MK.JSONContribution);Itt.registerSchema(ktt,aI.getIconSchema());const WMe=new Mo(()=>Itt.notifySchemaChanged(ktt),200);aI.onDidChange(()=>{WMe.isScheduled()||WMe.schedule()});const Ltt=La("widget-close",jt.close,T("widgetClose","Icon for the close action in widgets."));La("goto-previous-location",jt.arrowUp,T("previousChangeIcon","Icon for goto previous editor location."));La("goto-next-location",jt.arrowDown,T("nextChangeIcon","Icon for goto next editor location."));ei.modify(jt.sync,"spin");ei.modify(jt.loading,"spin");function Xfr(n){const e=new yt,t=e.add(new De),i=Ttt();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 Dtt,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: ${PNe(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(f=>`${_S(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${PNe(l)};${u}${d} font-display: block; }`)}return a.join(`
`)}}}class Dtt{getIcon(e){const t=Ttt();let i=e.defaults;for(;ei.isThemeIcon(i);){const r=t.getIcon(i.id);if(!r)return;i=r.defaults}return i}}const Ty="vs",vD="vs-dark",vT="hc-black",bT="hc-light",Att=Hs.as(JZe.ColorContribution),Zfr=Hs.as(mJe.ThemingContribution);class Rtt{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(mV(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,je.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Zue(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,je.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=Att.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Ty:return Jp.LIGHT;case vT:return Jp.HIGH_CONTRAST_DARK;case bT:return Jp.HIGH_CONTRAST_LIGHT;default:return Jp.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=Zue(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=xtt.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=Gc.getForeground(o),a=Gc.getFontStyle(o);return{foreground:s,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function mV(n){return n===Ty||n===vD||n===vT||n===bT}function Zue(n){switch(n){case Ty:return Ufr;case vD:return jfr;case vT:return qfr;case bT:return Gfr}}function m7(n){const e=Zue(n);return new Rtt(n,e)}class Jfr extends qe{constructor(){super(),this._onColorThemeChange=this._register(new De),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new De),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new Dtt,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Ty,m7(Ty)),this._knownThemes.set(vD,m7(vD)),this._knownThemes.set(vT,m7(vT)),this._knownThemes.set(bT,m7(bT));const e=this._register(Xfr(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Ty),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),jXe("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return rz(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=vg(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),qe.None}_registerShadowDomContainer(e){const t=vg(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(!mV(t.base)&&!mV(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new Rtt(e,t)),mV(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(Ty),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!==pv(this._theme.type)){let t;RA(this._theme.type)?t=e?vT:vD:t=e?bT:Ty,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)}};Zfr.getThemingParticipants().forEach(s=>s(this._theme,i,this._environment));const r=[];for(const s of Att.getColors()){const a=this._theme.getColor(s.id,!0);a&&r.push(`${B0e(s.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${r.join(`
`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(zfr(o)),this._themeCSS=e.join(`
`),this._updateCSS(),Ks.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 fp=lr("themeService");var epr=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},lne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Jue=class extends qe{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new De,this._onDidChangeReducedMotion=new De,this._accessibilityModeEnabledContext=A6.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(at(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}};Jue=epr([lne(0,bi),lne(1,cN),lne(2,pr)],Jue);var CY=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},sk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},k2,SC;let ede=class{constructor(e,t){this._commandService=e,this._hiddenStates=new aU(t)}createMenu(e,t,i){return new nde(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};ede=CY([sk(0,ga),sk(1,r_)],ede);let aU=k2=class{constructor(e){this._storageService=e,this._disposables=new yt,this._onDidChange=new De,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(k2._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,k2._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(k2._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&&rYi(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(k2._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};aU._key="menu.hiddenCommands";aU=k2=CY([sk(0,r_)],aU);let tde=SC=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=Sc.getMenuItems(this._id);let t;e.sort(SC._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(SC._fillInKbExprKeys(e.when,this._structureContextKeys),oL(e)){if(e.command.precondition&&SC._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;SC._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Sc.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=oL(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=tpr(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new Wm(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new SC(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=ic.join(...u.map(h=>h[1]));d.length>0&&s.push(new R3(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:SC._compareTitles(oL(e)?e.command.title:e.title,oL(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)}};tde=SC=CY([sk(3,ga),sk(4,bi)],tde);let nde=class{constructor(e,t,i,r,o){this._disposables=new yt,this._menuInfo=new tde(e,t,i.emitEventsForSubmenuChanges,r,o);const s=new Mo(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Sc.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new yt),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new SXe({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()}};nde=CY([sk(3,ga),sk(4,bi)],nde);function tpr(n,e,t){const i=YXi(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,o=ZL({id:`hide/${n.id}/${i}`,label:T("hide.label","Hide '{0}'",r),run(){t.updateHidden(n,i,!0)}}),s=ZL({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 npr=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},zMe=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 ide=class extends qe{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(w1||qXe)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new DK;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>HE(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(at(this.layoutService.container,"click",e)),this._register(at(this.layoutService.container,"keydown",e)))}writeText(e,t){return HE(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(Rt("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 HE(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 HE(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return HE(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return HE(this,void 0,void 0,function*(){this.resources=e})}readResources(){return HE(this,void 0,void 0,function*(){return this.resources})}};ide=npr([zMe(0,cN),zMe(1,hp)],ide);const H1=lr("clipboardService");var ipr=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},rpr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ZM="data-keybinding-context";let i1e=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 UA extends i1e{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}UA.INSTANCE=new UA;class b5 extends i1e{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=pD.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 jMe(o))}else{const o=[];for(const s of r.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...rr.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new jMe(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(b5._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(b5._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)}}b5._keyPrefix="config.";class opr{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 UMe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class jMe{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 spr{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 apr(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class Ntt extends qe{constructor(e){super(),this._onDidChangeContext=this._register(new qT({merge:t=>new spr(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 opr(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 lpr(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 UMe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new UMe(e))}getContext(e){return this._isDisposed?UA.INSTANCE:this.getContextValuesContainer(cpr(e))}dispose(){super.dispose(),this._isDisposed=!0}}let rde=class extends Ntt{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new b5(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?UA.INSTANCE:this._contexts.get(e)||UA.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 i1e(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};rde=ipr([rpr(0,pr)],rde);class lpr extends Ntt{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Ac),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(ZM)){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(ZM,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;apr(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(ZM),super.dispose())}getContextValuesContainer(e){return this._isDisposed?UA.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 cpr(n){for(;n;){if(n.hasAttribute(ZM)){const e=n.getAttribute(ZM);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function upr(n,e,t){n.get(bi).createKey(String(e),dpr(t))}function dpr(n){return uXe(n,e=>{if(typeof e=="object"&&e.$mid===1)return Jn.revive(e).toString();if(e instanceof Jn)return e.toString()})}yr.registerCommand("_setContext",upr);yr.registerCommand({id:"getContextKeyInfo",handler(){return[...sn.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:T("getContextKeyInfo","A command that returns information about context keys"),args:[]}});yr.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of sn.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 hpr=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class qMe{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 hpr(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 fpr=!1;class GMe 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 lU{constructor(e=new JK,t=!1,i,r=fpr){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=r,this._activeInstantiations=new Set,this._services.set(pi,this),this._globalGraph=r?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new qMe(s=>s):void 0}createChild(e){return new lU(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=eh.traceInvocation(this._enableTracing,e);let r=!1;try{return e({get:s=>{if(r)throw n0e("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 lb?(i=eh.traceCreation(this._enableTracing,e.ctor),r=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=eh.traceCreation(this._enableTracing,e),r=this._createInstance(e,t,i)),i.stop(),r}_createInstance(e,t=[],i){const r=tv.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 lb)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 lb?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 qMe(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 GMe(o);for(const c of tv.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 lb){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 GMe(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof lb){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 lb)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 lU(void 0,this._strict,this,this._enableTracing);s._globalGraphImplicitDependency=String(e);const a=new Map,l=new Q$(()=>{const c=s._createInstance(t,i,o);for(const[u,d]of a){const h=c[u];if(typeof h=="function")for(const f of d)h.apply(c,f)}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 f=a.get(u);return f||(f=new Td,a.set(u,f)),(m,v,_)=>{const b=f.push([m,v,_]);return _i(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 eh{static traceInvocation(e,t){return e?new eh(2,t.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):eh._None}static traceCreation(e,t){return e?new eh(1,t.name):eh._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new eh(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;eh._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 ${eh._totals.toFixed(2)}ms)`];(e>2||t)&&eh.all.add(r.join(`
`))}}eh.all=new Set;eh._None=new class extends eh{constructor(){super(0,null)}stop(){}branch(){return this}};eh._totals=0;const ppr=new Set([Qi.inMemory,Qi.vscodeSourceControl,Qi.walkThrough,Qi.walkThroughSnippet]);class gpr{constructor(){this._byResource=new gu,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 gu,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:rr.empty():Jn.isUri(e)?(o=(r=this._byResource.get(e))===null||r===void 0?void 0:r.values())!==null&&o!==void 0?o:rr.empty():rr.map(rr.concat(...this._byOwner.values()),s=>s[1])}}class mpr{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new gu,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(ppr.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Xs.Error?t.errors+=1:i===Xs.Warning?t.warnings+=1:i===Xs.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 RC{constructor(){this._onMarkerChanged=new SXe({delay:0,merge:RC._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new gpr,this._stats=new mpr(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(rXe(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const o of i){const s=RC._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:f}=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:f}}changeAll(e,t){const i=[],r=this._data.values(e);if(r)for(const o of r){const s=rr.first(o);s&&(i.push(s.resource),this._data.delete(s.resource,e))}if(yu(t)){const o=new gu;for(const{resource:s,marker:a}of t){const l=RC._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(RC._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(RC._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(RC._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 gu;for(const i of e)for(const r of i)t.set(r,!0);return Array.from(t.keys())}}class _pr extends qe{constructor(){super(...arguments),this._configurationModel=new hu}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new hu;const e=Hs.as(Nv.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 Y6=lr("audioCue");class Xi{static register(e){return new Xi(e.fileName)}constructor(e){this.fileName=e}}Xi.error=Xi.register({fileName:"error.mp3"});Xi.warning=Xi.register({fileName:"warning.mp3"});Xi.foldedArea=Xi.register({fileName:"foldedAreas.mp3"});Xi.break=Xi.register({fileName:"break.mp3"});Xi.quickFixes=Xi.register({fileName:"quickFixes.mp3"});Xi.taskCompleted=Xi.register({fileName:"taskCompleted.mp3"});Xi.taskFailed=Xi.register({fileName:"taskFailed.mp3"});Xi.terminalBell=Xi.register({fileName:"terminalBell.mp3"});Xi.diffLineInserted=Xi.register({fileName:"diffLineInserted.mp3"});Xi.diffLineDeleted=Xi.register({fileName:"diffLineDeleted.mp3"});Xi.diffLineModified=Xi.register({fileName:"diffLineModified.mp3"});Xi.chatRequestSent=Xi.register({fileName:"chatRequestSent.mp3"});Xi.chatResponsePending=Xi.register({fileName:"chatResponsePending.mp3"});Xi.chatResponseReceived1=Xi.register({fileName:"chatResponseReceived1.mp3"});Xi.chatResponseReceived2=Xi.register({fileName:"chatResponseReceived2.mp3"});Xi.chatResponseReceived3=Xi.register({fileName:"chatResponseReceived3.mp3"});Xi.chatResponseReceived4=Xi.register({fileName:"chatResponseReceived4.mp3"});class vpr{constructor(e){this.randomOneOf=e}}class Pr{static register(e){const t=new vpr("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Pr(t,e.name,e.settingsKey);return Pr._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}Pr._audioCues=new Set;Pr.error=Pr.register({name:T("audioCues.lineHasError.name","Error on Line"),sound:Xi.error,settingsKey:"audioCues.lineHasError"});Pr.warning=Pr.register({name:T("audioCues.lineHasWarning.name","Warning on Line"),sound:Xi.warning,settingsKey:"audioCues.lineHasWarning"});Pr.foldedArea=Pr.register({name:T("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:Xi.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Pr.break=Pr.register({name:T("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:Xi.break,settingsKey:"audioCues.lineHasBreakpoint"});Pr.inlineSuggestion=Pr.register({name:T("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:Xi.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Pr.terminalQuickFix=Pr.register({name:T("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:Xi.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Pr.onDebugBreak=Pr.register({name:T("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:Xi.break,settingsKey:"audioCues.onDebugBreak"});Pr.noInlayHints=Pr.register({name:T("audioCues.noInlayHints","No Inlay Hints on Line"),sound:Xi.error,settingsKey:"audioCues.noInlayHints"});Pr.taskCompleted=Pr.register({name:T("audioCues.taskCompleted","Task Completed"),sound:Xi.taskCompleted,settingsKey:"audioCues.taskCompleted"});Pr.taskFailed=Pr.register({name:T("audioCues.taskFailed","Task Failed"),sound:Xi.taskFailed,settingsKey:"audioCues.taskFailed"});Pr.terminalCommandFailed=Pr.register({name:T("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:Xi.error,settingsKey:"audioCues.terminalCommandFailed"});Pr.terminalBell=Pr.register({name:T("audioCues.terminalBell","Terminal Bell"),sound:Xi.terminalBell,settingsKey:"audioCues.terminalBell"});Pr.notebookCellCompleted=Pr.register({name:T("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:Xi.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Pr.notebookCellFailed=Pr.register({name:T("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:Xi.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Pr.diffLineInserted=Pr.register({name:T("audioCues.diffLineInserted","Diff Line Inserted"),sound:Xi.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Pr.diffLineDeleted=Pr.register({name:T("audioCues.diffLineDeleted","Diff Line Deleted"),sound:Xi.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Pr.diffLineModified=Pr.register({name:T("audioCues.diffLineModified","Diff Line Modified"),sound:Xi.diffLineModified,settingsKey:"audioCues.diffLineModified"});Pr.chatRequestSent=Pr.register({name:T("audioCues.chatRequestSent","Chat Request Sent"),sound:Xi.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Pr.chatResponseReceived=Pr.register({name:T("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Xi.chatResponseReceived1,Xi.chatResponseReceived2,Xi.chatResponseReceived3,Xi.chatResponseReceived4]}});Pr.chatResponsePending=Pr.register({name:T("audioCues.chatResponsePending","Chat Response Pending"),sound:Xi.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class bpr extends qe{constructor(e,t=[]){super(),this.logger=new XXi([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 Ott=[];function wY(n){Ott.push(n)}function ypr(){return Ott.slice(0)}var pE=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},yc=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},bD=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 Cpr{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new De}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let ode=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new wQi(new Cpr(t))):Promise.reject(new Error("Model not found"))}};ode=pE([yc(0,Ls)],ode);class SY{show(){return SY.NULL_PROGRESS_RUNNER}showWhile(e,t){return bD(this,void 0,void 0,function*(){yield e})}}SY.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class wpr{withProgress(e,t,i){return t({report:()=>{}})}}class Spr{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class Epr{confirm(e){return bD(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 bD(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 bD(this,void 0,void 0,function*(){yield this.prompt({type:wa.Error,message:e,detail:t})})}}class y5{info(e){return this.notify({severity:wa.Info,message:e})}warn(e){return this.notify({severity:wa.Warning,message:e})}error(e){return this.notify({severity:wa.Error,message:e})}notify(e){switch(e.severity){case wa.Error:console.error(e.message);break;case wa.Warning:console.warn(e.message);break;default:console.log(e.message);break}return y5.NO_OP}prompt(e,t,i,r){return y5.NO_OP}status(e,t){return qe.None}}y5.NO_OP=new Ilr;let sde=class{constructor(e){this._onWillExecuteCommand=new De,this._onDidExecuteCommand=new De,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=yr.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)}}};sde=pE([yc(0,pi)],sde);let jA=class extends Mcr{constructor(e,t,i,r,o,s){super(e,t,i,r,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new yt;g.add(at(f,Xt.KEY_DOWN,m=>{const v=new ls(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(at(f,Xt.KEY_UP,m=>{const v=new ls(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new xpr(f,g))},l=f=>{for(let g=0;g<this._domNodeListeners.length;g++){const m=this._domNodeListeners[g];m.domNode===f&&(this._domNodeListeners.splice(g,1),m.dispose())}},c=f=>{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,r){return xm(yr.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(i=>{var r;return{keybinding:lce(i.keybinding,Of),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(),_i(()=>{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(uh.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new XM(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 rMe(void 0,o.command,o.commandArgs,s,t,null,!1);else{const l=s5.resolveKeybinding(a,Of);for(const c of l)i[r++]=new rMe(c,o.command,o.commandArgs,s,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new S1(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new s5([t],Of)}};jA=pE([yc(0,bi),yc(1,ga),yc(2,dp),yc(3,Wa),yc(4,hp),yc(5,io)],jA);class xpr extends qe{constructor(e,t){super(),this.domNode=e,this._register(t)}}function KMe(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof Jn)}class Ptt{constructor(){this._onDidChangeConfiguration=new De,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new _pr;this._configuration=new iY(e.reload(),new hu,new hu,new hu),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,r=KMe(e)?e:KMe(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 Rcr({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 ade=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new De,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(o,s)=>r.affectsConfiguration(s)})})}getValue(e,t,i){const r=Re.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)}};ade=pE([yc(0,pr),yc(1,Ls),yc(2,Es)],ade);let lde=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:Xu||br?`
`:`\r
`}};lde=pE([yc(0,pr)],lde);class Tpr{publicLog2(){}}class C5{constructor(){const e=Jn.from({scheme:C5.SCHEME,authority:"model",path:"/"});this.workspace={id:Tet,folders:[new Xcr({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===C5.SCHEME?this.workspace.folders[0]:null}}C5.SCHEME="inmemory";function cU(n,e,t){if(!e||!(n instanceof Ptt))return;const i=[];Object.keys(e).forEach(r=>{kcr(r)&&i.push([`editor.${r}`,e[r]]),t&&Icr(r)&&i.push([`diffEditor.${r}`,e[r]])}),i.length>0&&n.updateValues(i)}let cde=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return bD(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:Cye.convert(e),r=new Map;for(const a of i){if(!(a instanceof Zy))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(Is.replaceMove(J.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:GT(fue.bulkEditServiceSummary,o,s),isApplied:o>0}})}};cde=pE([yc(0,Ls)],cde);class kpr{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Cg(e)}}let ude=class extends pue{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)}};ude=pE([yc(0,cN),yc(1,io)],ude);class Ipr{constructor(){this._neverEmitter=new De,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class Lpr extends c5{constructor(){super()}}class Dpr extends bpr{constructor(){super(new QXi)}}let dde=class extends Rue{constructor(e,t,i,r,o,s){super(e,t,i,r,o,s),this.configure({blockMouse:!1})}};dde=pE([yc(0,dp),yc(1,Wa),yc(2,B1),yc(3,Go),yc(4,k0),yc(5,bi)],dde);class Apr{playAudioCue(e,t){return bD(this,void 0,void 0,function*(){})}}Cr(pr,Ptt,0);Cr(A0e,ade,0);Cr(jZe,lde,0);Cr(tk,C5,0);Cr(BA,kpr,0);Cr(dp,Tpr,0);Cr(V6,Epr,0);Cr(vye,Spr,0);Cr(Wa,y5,0);Cr(D0,RC,0);Cr(Es,Lpr,0);Cr(fp,Jfr,0);Cr(hp,Dpr,0);Cr(Ls,Jz,0);Cr(F0e,Fue,0);Cr(bi,rde,0);Cr(xet,wpr,0);Cr(fE,SY,0);Cr(r_,$dr,0);Cr(o_,Sce,0);Cr(H6,cde,0);Cr(ket,Ipr,0);Cr(vh,ode,0);Cr(F1,Jue,0);Cr(Ng,tfr,0);Cr(ga,sde,0);Cr(Go,jA,0);Cr(Ov,Xue,0);Cr(B1,ude,0);Cr(nf,Mue,0);Cr(H1,ide,0);Cr(n_,dde,0);Cr(k0,ede,0);Cr(Y6,Apr,0);var ui;(function(n){const e=new JK;for(const[l,c]of UNe())e.set(l,c);const t=new lU(e,!0);e.set(pi,t);function i(l){r||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof lb?t.invokeFunction(u=>u.get(l)):c}n.get=i;let r=!1;const o=new De;function s(l){if(r)return t;r=!0;for(const[u,d]of UNe())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=lr(u);e.get(d)instanceof lb&&e.set(d,l[u])}const c=ypr();for(const u of c)try{t.createInstance(u)}catch(d){Pi(d)}return o.fire(),t}n.initialize=s;function a(l){if(r)return l();const c=new yt,u=c.add(o.event(()=>{u.dispose(),c.add(l())}));return c}n.withServices=a})(ui||(ui={}));let Rpr;function e1(){return Rpr}let Mtt;function Npr(n){Mtt=n}class Ftt{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 Mtt({owner:i,debugName:()=>{const o=lI(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 Q6 extends Ftt{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 ks(n,e){const t=new Btt(n,e);try{n(t)}finally{t.finish()}}function hde(n,e,t){n?e(n):ks(e,t)}class Btt{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=e1())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():lI(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=e1())===null||e===void 0||e.handleEndTransaction()}}function r1e(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=lI(e),r!==void 0))return r;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function lI(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 as(n,e){return typeof n=="string"?new fde(void 0,n,e):new fde(n,void 0,e)}class fde extends Q6{get debugName(){var e;return(e=r1e(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 Btt(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=e1())===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 uU(n,e){return typeof n=="string"?new YMe(void 0,n,e):new YMe(n,void 0,e)}class YMe extends fde{_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 w5=(n,e)=>n===e;function mr(n,e){return e!==void 0?new E5(n,void 0,e,void 0,void 0,void 0,w5):new E5(void 0,void 0,n,void 0,void 0,void 0,w5)}function QMe(n,e){var t;return new E5(n.owner,n.debugName,e,void 0,void 0,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:w5)}function Opr(n,e){var t;return new E5(n.owner,n.debugName,e,n.createEmptyChangeSummary,n.handleChange,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:w5)}function S5(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const r=new yt;return new E5(i,()=>{var o;return(o=lI(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(r.clear(),t(o,r)),void 0,void 0,()=>r.dispose(),w5)}Npr(mr);class E5 extends Q6{get debugName(){var e;return(e=r1e(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=e1())===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=e1())===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 o1e(n,e){return new xY(n.debugName,e,void 0,void 0)}function Zo(n){return new xY(void 0,n,void 0,void 0)}function EY(n,e){return new xY(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function Nh(n){const e=new yt,t=o1e({debugName:()=>lI(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return _i(()=>{t.dispose(),e.dispose()})}class xY{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=lI(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=e1())===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=e1())===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=e1())===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--,A3(()=>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=xY})(Zo||(Zo={}));function dU(n){return new Ppr(n)}class Ppr extends Ftt{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 Mpr(n,e){return new Promise(t=>{let i=!1,r=!1;const o=Zo(s=>{const a=n.read(s);e(a)&&(i?o.dispose():r=!0,t(a))});i=!0,r&&o.dispose()})}function Ec(n,e){return new $tt(n,e)}class $tt extends Q6{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=e1())===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&&ks(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 lI(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=$tt})(Ec||(Ec={}));function kf(n,e){return new Fpr(n,e)}class Fpr extends Q6{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{ks(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 Vtt(n){return typeof n=="string"?new XMe(n):new XMe(void 0,n)}class XMe extends Q6{get debugName(){var e;return(e=r1e(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){ks(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 x5(n){const e=new Bpr(!0);return n.addObserver(e),n.reportChanges(),_i(()=>{n.removeObserver(e)})}class Bpr{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 Htt(){return!!TXe.VSCODE_DEV}function $pr(n){if(Htt()){const e=Vpr();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function Vpr(){_7||(_7=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of _7){const i=t(e);if(i)return i}}),_7}let _7;function Hpr(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 hU(n,e){const t=new yt,i=n.createDecorationsCollection();return t.add(o1e({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function v7(n,e){return n.appendChild(e),_i(()=>{n.removeChild(e)})}class Wpr extends qe{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new ZZe(e,t)),this._width=as(this,this.elementSizeObserver.getWidth()),this._height=as(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>ks(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 ZMe(n,e){let t=n.get(),i=t,r=t;const o=as("animatedValue",t);let s=-1;const a=300;let l;e.add(EY({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(zpr(u,i,t-i,a)),u<a?l=requestAnimationFrame(c):r=t,o.set(r,void 0)}return o}function zpr(n,e,t,i){return n===i?e+t:t*(-Math.pow(2,-10*n/i)+1)+e}class Wtt extends qe{constructor(e,t,i){super(),this._register(new TY(e,i)),this._register(Gw(i,{height:t.actualHeight,top:t.actualTop}))}}class fU{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=as(this,void 0),this._actualHeight=as(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 TY{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${TY._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}TY._counter=0;function Gw(n,e){return Zo(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 NC(n,e){return Upr([n],e),n}function Upr(n,e){Htt()&&kf("reload",i=>$pr(r=>{if([...Object.values(r)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function pU(n,e,t){const i=new yt,r=[];return i.add(Zo(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(EY({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 jpr extends $a{dispose(){super.dispose(!0)}}var s1e=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},a1e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},qpr=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 Gpr=La("diff-review-insert",jt.add,T("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),Kpr=La("diff-review-remove",jt.remove,T("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),Ypr=La("diff-review-close",jt.close,T("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let dw=class extends qe{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=S5(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(pde,this._diffs,this._editors,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(gde,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(x5(this.model))}next(){ks(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){ks(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){ks(e=>{this._setVisible(!1,e)})}};dw._ttPolicy=M1("diffReview",{createHTML:n=>n});dw=s1e([a1e(8,pi)],dw);let pde=class extends qe{constructor(e,t,i,r,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=r,this._audioCueService=o,this._groups=as(this,[]),this._currentGroupIdx=as(this,0),this._currentElementIdx=as(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(Zo(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=Qpr(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());ks(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(Zo(s=>{const a=this.currentElement.read(s);(a==null?void 0:a.type)===_d.Deleted?this._audioCueService.playAudioCue(Pr.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===_d.Added&&this._audioCueService.playAudioCue(Pr.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Zo(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==_d.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(J.fromPositions(new Re(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||hde(t,r=>{this._currentGroupIdx.set(ar.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||ks(i=>{this._currentElementIdx.set(ar.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&&ks(r=>{this._currentElementIdx.set(i,r)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===_d.Deleted?(this._editors.original.setSelection(J.fromPositions(new Re(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==_d.Header&&(this._editors.modified.setSelection(J.fromPositions(new Re(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};pde=s1e([a1e(4,Y6)],pde);const $O=3;function Qpr(n,e,t){const i=[];for(const r of nXe(n,(o,s)=>s.modified.startLineNumber-o.modified.endLineNumberExclusive<2*$O)){const o=[];o.push(new Zpr);const s=new hr(Math.max(1,r[0].original.startLineNumber-$O),Math.min(r[r.length-1].original.endLineNumberExclusive+$O,e+1)),a=new hr(Math.max(1,r[0].modified.startLineNumber-$O),Math.min(r[r.length-1].modified.endLineNumberExclusive+$O,t+1));iXe(r,(u,d)=>{const h=new hr(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new hr(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new tgr(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{o.push(new Jpr(d,g))}),d.modified.forEach(g=>{o.push(new egr(d,g))}))});const l=r[0].modified.join(r[r.length-1].modified),c=r[0].original.join(r[r.length-1].original);i.push(new Xpr(new c0(l,c),o))}return i}var _d;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(_d||(_d={}));class Xpr{constructor(e,t){this.range=e,this.lines=t}}class Zpr{constructor(){this.type=_d.Header}}class Jpr{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=_d.Deleted,this.modifiedLineNumber=void 0}}class egr{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=_d.Added,this.originalLineNumber=void 0}}class tgr{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=_d.Unchanged}}let gde=class extends qe{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 wg(a)),this._register(Zo(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Nd("diffreview.close",T("label.close","Close"),"close-diff-review "+ei.asClassName(Ypr),!0,()=>qpr(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 P6(this._content,{})),Ic(this.domNode,this._scrollbar.getDomNode(),a),this._register(_i(()=>{Ic(this.domNode)})),this._register(Gw(this.domNode,{width:this._width,height:this._height})),this._register(Gw(this._content,{width:this._width,height:this._height})),this._register(Nh((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Ba(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",T("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Zc(r,i.get(50)),Ic(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===_d.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const m=u.range,v=this._model.currentGroupIndex.get(),_=this._model.groups.get().length,b=x=>x===0?T("no_lines_changed","no lines changed"):x===1?T("one_line_changed","1 line changed"):T("more_lines_changed","{0} lines changed",x),y=b(m.original.length),C=b(m.modified.length);g.setAttribute("aria-label",T({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}",v+1,_,m.original.startLineNumber,y,m.modified.startLineNumber,C));const E=document.createElement("div");E.className="diff-review-cell diff-review-summary",E.appendChild(document.createTextNode(`${v+1}/${_}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),g.appendChild(E),h=g}else h=this._createRow(d,c,this._width.get(),t,o,a,i,s,l);r.appendChild(h);const f=mr(g=>this._model.currentElement.read(g)===d);e.add(Zo(g=>{const m=f.read(g);h.tabIndex=m?0:-1,m&&h.focus()})),e.add(at(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),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",m="";const v="diff-review-spacer";let _=null;switch(e.type){case _d.Added:g="diff-review-row line-insert",m=" char-insert",_=Gpr;break;case _d.Deleted:g="diff-review-row line-delete",m=" char-delete",_=Kpr;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,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 E=document.createElement("span");E.style.width=f+"px",E.style.minWidth=f+"px",E.style.paddingRight="10px",E.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?E.appendChild(document.createTextNode(String(e.modifiedLineNumber))):E.innerText=" ",y.appendChild(E);const x=document.createElement("span");if(x.className=v,_){const D=document.createElement("span");D.className=ei.asClassName(_),D.innerText="  ",x.appendChild(D)}else x.innerText="  ";y.appendChild(x);let k;if(e.modifiedLineNumber!==void 0){let D=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);dw._ttPolicy&&(D=dw._ttPolicy.createHTML(D)),y.insertAdjacentHTML("beforeend",D),k=l.getLineContent(e.modifiedLineNumber)}else{let D=this._getLineHtml(o,r,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);dw._ttPolicy&&(D=dw._ttPolicy.createHTML(D)),y.insertAdjacentHTML("beforeend",D),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=T("blankLine","blank"));let L="";switch(e.type){case _d.Unchanged:e.originalLineNumber===e.modifiedLineNumber?L=T({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",k,e.originalLineNumber):L=T("equalLine","{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case _d.Added:L=T("insertLine","+ {0} modified line {1}",k,e.modifiedLineNumber);break;case _d.Deleted:L=T("deleteLine","- {0} original line {1}",k,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=Ol.createEmpty(s,o),c=np.isBasicASCII(s,e.mightContainNonBasicASCII()),u=np.containsRTL(s,c,e.mightContainRTL());return VK(new dE(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)!==xf.OFF,null)).html}};gde=s1e([a1e(5,Es)],gde);const ngr=La("diff-insert",jt.add,T("diffInsertIcon","Line decoration for inserts in the diff editor.")),ztt=La("diff-remove",jt.remove,T("diffRemoveIcon","Line decoration for removals in the diff editor.")),JMe=Oi.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+ei.asClassName(ngr),marginClassName:"gutter-insert"}),e4e=Oi.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+ei.asClassName(ztt),marginClassName:"gutter-delete"}),t4e=Oi.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),n4e=Oi.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),i4e=Oi.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),igr=Oi.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),rgr=Oi.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),mde=Oi.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),ogr=Oi.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),sgr=Oi.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),agr=Oi.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Kc(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(T("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+ei.asClassName(jt.arrowRight),zIndex:10001});class Kw extends qe{constructor(e,t,i,r,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=r,this._editors=o,this._originalScrollTop=Ec(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ec(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=kf("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=as(this,0),this._modifiedViewZonesChangedSignal=kf("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=kf("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=S5((h,f)=>{var g;this._element.replaceChildren();const m=this._diffModel.read(h),v=(g=m==null?void 0:m.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!v||v.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const _=this._originalEditorLayoutInfo.read(h),b=this._modifiedEditorLayoutInfo.read(h);if(!_||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=v.map(A=>{function N(V,re){const oe=re.getTopForLineNumber(V.startLineNumber,!0),Q=re.getTopForLineNumber(V.endLineNumberExclusive,!0);return(oe+Q)/2}const P=N(A.lineRangeMapping.original,this._editors.original),M=this._originalScrollTop.read(h),B=N(A.lineRangeMapping.modified,this._editors.modified),F=this._modifiedScrollTop.read(h),U=P-M,H=B-F,W=Math.min(P,B),q=Math.max(P,B);return{range:new ar(W,q),from:U,to:H,fromWithoutScroll:P,toWithoutScroll:B,move:A}});y.sort(lYi(sg(A=>A.fromWithoutScroll>A.toWithoutScroll,cYi),sg(A=>A.fromWithoutScroll>A.toWithoutScroll?A.fromWithoutScroll:-A.toWithoutScroll,Yy)));const C=l1e.compute(y.map(A=>A.range)),E=10,x=_.verticalScrollbarWidth,k=(C.getTrackCount()-1)*10+E*2,L=x+k+(b.contentLeft-Kw.movedCodeBlockPadding);let D=0;for(const A of y){const N=C.getTrack(D),P=x+E+N*10,M=15,B=15,F=L,U=b.glyphMarginWidth+b.lineNumbersWidth,H=18,W=document.createElementNS("http://www.w3.org/2000/svg","rect");W.classList.add("arrow-rectangle"),W.setAttribute("x",`${F-U}`),W.setAttribute("y",`${A.to-H/2}`),W.setAttribute("width",`${U}`),W.setAttribute("height",`${H}`),this._element.appendChild(W);const q=document.createElementNS("http://www.w3.org/2000/svg","g"),V=document.createElementNS("http://www.w3.org/2000/svg","path");V.setAttribute("d",`M 0 ${A.from} L ${P} ${A.from} L ${P} ${A.to} L ${F-B} ${A.to}`),V.setAttribute("fill","none"),q.appendChild(V);const re=document.createElementNS("http://www.w3.org/2000/svg","polygon");re.classList.add("arrow"),f.add(Zo(oe=>{V.classList.toggle("currentMove",A.move===m.activeMovedText.read(oe)),re.classList.toggle("currentMove",A.move===m.activeMovedText.read(oe))})),re.setAttribute("points",`${F-B},${A.to-M/2} ${F},${A.to} ${F-B},${A.to+M/2}`),q.appendChild(re),this._element.appendChild(q),D++}this.width.set(k,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(_i(()=>this._element.remove())),this._register(Zo(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-Kw.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(x5(this._state));const s=mr(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(m=>({move:m,original:new fU(dU(m.lineRangeMapping.original.startLineNumber-1),18),modified:new fU(dU(m.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(pU(this._editors.original,s.map(h=>h.map(f=>f.original)))),this._register(pU(this._editors.modified,s.map(h=>h.map(f=>f.modified)))),this._register(Nh((h,f)=>{const g=s.read(h);for(const m of g)f.add(new r4e(this._editors.original,m.original,m.move,"original",this._diffModel.get())),f.add(new r4e(this._editors.modified,m.modified,m.move,"modified",this._diffModel.get()))}));const a=Ec(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=Ec(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=kf("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),u=kf("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let d="modified";this._register(EY({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(d="original"),h.didChange(u)&&(d="modified"),!0)},h=>{c.read(h),u.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let m;if(g&&d==="original"){const v=a.read(h);v&&(m=g.movedTexts.find(_=>_.lineRangeMapping.original.contains(v.lineNumber)))}if(g&&d==="modified"){const v=l.read(h);v&&(m=g.movedTexts.find(_=>_.lineRangeMapping.modified.contains(v.lineNumber)))}m!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(m)}))}}Kw.movedCodeBlockPadding=4;class l1e{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=Ser(t,sg(a=>a.intersectWithRangeLength(r),Yy)):(o=t.length,t.push(new I0e))),t[o].addRange(r),i.push(o)}return new l1e(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class r4e extends Wtt{constructor(e,t,i,r,o){const s=gc("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=i,this._kind=r,this._diffModel=o,this._nodes=gc("div.diff-moved-code-block",{style:{marginRight:"4px"}},[gc("div.text-content@textContent"),gc("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=Ec(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Gw(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?T("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):T("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?T("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):T("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new wg(this._nodes.actionBar,{highlightToggledItems:!0})),u=new Nd("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new Nd("","Compare",ei.asClassName(jt.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Zo(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;d.checked=f})),c.push(d,{icon:!1,label:!0})}}class lgr extends qe{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=mr(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 f of s.mappings){if(f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?e4e:n4e}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?JMe:t4e}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:ogr}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:igr});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&u.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?sgr:mde}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&d.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?rgr:i4e});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(r)&&!a&&d.push({range:J.fromPositions(new Re(f.lineRangeMapping.modified.startLineNumber,1)),options:agr})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&u.push({range:g,options:l?e4e:n4e});const m=f.modified.toInclusiveRange();m&&d.push({range:m,options:l?JMe:t4e});for(const v of f.innerChanges||[])u.push({range:v.originalRange,options:mde}),d.push({range:v.modifiedRange,options:i4e})}const h=this._diffModel.read(r).activeMovedText.read(r);for(const f of s.movedTexts)u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[Kw.movedCodeBlockPadding,0,Kw.movedCodeBlockPadding,Kw.movedCodeBlockPadding]}}),d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:d}}),this._register(hU(this._editors.original,this._decorations.map(r=>(r==null?void 0:r.originalDecorations)||[]))),this._register(hU(this._editors.modified,this._decorations.map(r=>(r==null?void 0:r.modifiedDecorations)||[])))}}class cgr extends qe{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=as(this,void 0),this.sashLeft=mr(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 cu(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(Zo(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}},o4e=class extends EL{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}},ugr=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}},dgr=class lx extends EL{static create(e,t,i){const r=new $a(i),o=new lx(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=EL.findId(`provider_${u}`,o),f=new ugr(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const m of g||[])lx._makeOutlineElement(m,f);return f},g=>(tl(g),f)).then(g=>{EL.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);ka(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!i.isCancellationRequested?lx.create(e,t,i):o._compact()).finally(()=>{r.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=EL.findId(e,t),r=new o4e(i,t,e);if(e.children)for(const o of e.children)lx._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=rr.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 o4e?e.push(t.symbol):e.push(...rr.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>J.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return lx._flattenDocumentSymbols(t,e,""),t.sort((i,r)=>Re.compare(J.getStartPosition(i.range),J.getStartPosition(r.range))||Re.compare(J.getEndPosition(r.range),J.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&&lx._flattenDocumentSymbols(e,r.children,r.name)}};var Utt=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},jtt=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hgr=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 _de=class extends qe{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=S5(this,(c,u)=>{const d=this._editors.modifiedModel.read(c);if(d)return u.add(new vde(this._languageFeaturesService,d))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();ks(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();ks(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=S5(this,(c,u)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),m=o.read(c);for(const v of m)if(!v.shouldHideControls(c)){{const _=mr(y=>v.getHiddenOriginalRange(y).startLineNumber-1),b=new fU(_,24);h.push(b),u.add(new s4e(this._editors.original,b,v,v.originalUnchangedRange,!g,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const _=mr(y=>v.getHiddenModifiedRange(y).startLineNumber-1),b=new fU(_,24);f.push(b),u.add(new s4e(this._editors.modified,b,v,v.modifiedUnchangedRange,!1,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new Kc(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(T("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+ei.asClassName(jt.fold),zIndex:10001};this._register(hU(this._editors.original,mr(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:J.fromPositions(new Re(h.originalLineNumber,1)),options:l});return d}))),this._register(hU(this._editors.modified,mr(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:hr.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return d}))),this._register(pU(this._editors.original,s.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(pU(this._editors.modified,s.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(Zo(c=>{const u=o.read(c);this._editors.original.setHiddenAreas(u.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(w3)),this._editors.modified.setHiddenAreas(u.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(w3))})),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 f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(d));if(!f)return;f.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 f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};_de=Utt([jtt(3,wn)],_de);let vde=class extends qe{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=as(this,void 0);const i=kf("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=kf("_textModel.onDidChangeContent",on.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(Nh((o,s)=>hgr(this,void 0,void 0,function*(){i.read(o),r.read(o);const a=s.add(new jpr),l=yield dgr.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(aXe(sg(o=>o.range.endLineNumber-o.range.startLineNumber,Yy))),r.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};vde=Utt([jtt(0,wn)],vde);class s4e extends Wtt{constructor(e,t,i,r,o,s,a,l){const c=gc("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=gc("div.diff-hidden-lines",[gc("div.top@top",{title:T("diff.hiddenLines.top","Click or drag to show more above")}),gc("div.center@content",{style:{display:"flex"}},[gc("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[Rt("a",{title:T("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Uw("$(unfold)"))]),gc("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),gc("div.bottom@bottom",{title:T("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=Ec(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?Ic(this._nodes.first):this._register(Gw(this._nodes.first,{width:u.map(h=>h.contentLeft)}));const d=this._editor;this._register(at(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 f=h.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=at(window,"mousemove",b=>{const C=b.clientY-f;g=g||Math.abs(C)>2;const E=Math.round(C/d.getOption(66)),x=Math.max(0,Math.min(m+E,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(x,void 0)}),_=at(window,"mouseup",b=>{g||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),v.dispose(),_.dispose()})})),this._register(at(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 f=h.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=at(window,"mousemove",b=>{const C=b.clientY-f;g=g||Math.abs(C)>2;const E=Math.round(C/d.getOption(66)),x=Math.max(0,Math.min(m-E,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(x,void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-k))}),_=at(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){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),v.dispose(),_.dispose()})})),this._register(Zo(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,m=T("hiddenLines","{0} hidden lines",g),v=Rt("span",{title:T("diff.hiddenLines.expandAll","Double click to unfold")},m);v.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const _=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(_,h);if(b.length>0){f.push(Rt("span",void 0,"  |  "));for(let y=0;y<b.length;y++){const C=b[y],E=XW.toIcon(C.kind),x=gc("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[Cue(E)," ",C.name,...y===b.length-1?[]:[Cue(jt.chevronRight)]]).root;f.push(x),x.onclick=()=>{this._revealModifiedHiddenLine(C.startLineNumber)}}}}Ic(this._nodes.others,...f)}))}}class Ev{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Ev(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 Ev(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 fgr=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},a4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},pgr=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())})},cx;let gU=cx=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new De,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 pgr(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 yg(new hr(1,2),new hr(1,t.getLineCount()+1),[new CS(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=cx.diffCache.get(a);if(c&&c.context===l)return c.result;const u=wu.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 cx.diffCache.size>10&&cx.diffCache.delete(cx.diffCache.keys().next().value),cx.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()}};gU.diffCache=new Map;gU=cx=fgr([a4e(1,o_),a4e(2,dp)],gU);var ggr=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},mgr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const qtt=lr("diffProviderFactoryService");let bde=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(gU,t)}};bde=ggr([mgr(0,pi)],bde);Cr(qtt,bde,1);var _gr=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},vgr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},l4e=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 yde=class extends qe{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=as(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=as(this,void 0),this.diff=this._diff,this._unchangedRegions=as(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=mr(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(ks(c=>{for(const u of this._unchangedRegions.get().regions)u.collapseAll(c)}),[])),this.movedTextToCompare=as(this,void 0),this._activeMovedText=as(this,void 0),this._hoveredMovedText=as(this,void 0),this.activeMovedText=mr(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 $a,this._diffProvider=mr(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),u=kf("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:u}}),this._register(_i(()=>this._cancellationTokenSource.cancel()));const o=Vtt("contentChangedSignal"),s=this._register(new Mo(()=>o.trigger(void 0),200)),a=(l,c,u)=>{const d=mU.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(u),this._options.hideUnchangedRegionsContextLineCount.read(u)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(_=>e.original.getDecorationRange(_)).filter(_=>!!_).map(_=>hr.fromRange(_)),g=h.modifiedDecorationIds.map(_=>e.modified.getDecorationRange(_)).filter(_=>!!_).map(_=>hr.fromRange(_)),m=e.original.deltaDecorations(h.originalDecorationIds,d.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),v=e.modified.deltaDecorations(h.modifiedDecorationIds,d.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const _ of d)for(let b=0;b<h.regions.length;b++)if(_.originalUnchangedRange.intersectsStrict(f[b])&&_.modifiedUnchangedRange.intersectsStrict(g[b])){_.setHiddenModifiedRange(h.regions[b].getHiddenModifiedRange(void 0),c);break}this._unchangedRegions.set({regions:d,originalDecorationIds:m,modifiedDecorationIds:v},c)};this._register(e.modified.onDidChangeContent(l=>{if(this._diff.get()){const u=zy.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const u=zy.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(Nh((l,c)=>l4e(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),NC(zZe,l),NC(wce,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(v=>{const _=zy.fromModelContentChanges(v.changes);f=Iz(f,_)}));let g=[];c.add(e.modified.onDidChangeContent(v=>{const _=zy.fromModelContentChanges(v.changes);g=Iz(g,_)}));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=bgr(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,ks(v=>{a(m,v),this._lastDiff=m;const _=c1e.fromDiffResult(m);this._diff.set(_,v),this._isDiffUpToDate.set(!0,v);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(b.lineRangeMapping.modified)):void 0,v)}))})))}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 l4e(this,void 0,void 0,function*(){yield Mpr(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=>hr.deserialize(r.range)),i=this._unchangedRegions.get();ks(r=>{for(const o of i.regions)for(const s of t)if(o.modifiedUnchangedRange.intersect(s)){o.setHiddenModifiedRange(s,r);break}})}};yde=_gr([vgr(3,qtt)],yde);function bgr(n,e,t){return{changes:n.changes.map(i=>new yg(i.original,i.modified,i.innerChanges?i.innerChanges.map(r=>ygr(r,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function ygr(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 CS(i,r)}class c1e{static fromDiffResult(e){return new c1e(e.changes.map(t=>new Gtt(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 Gtt{constructor(e){this.lineRangeMapping=e}}class mU{static fromDiffs(e,t,i,r,o){const s=yg.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,f=c+d===t+1&&u+d===i+1;(h||f)&&d>=o+r?(h&&!f&&(d-=o),f&&!h&&(c+=o,u+=o,d-=o),a.push(new mU(c,u,d,0,0))):d>=o*2+r&&(c+=o,u+=o,d-=o*2,a.push(new mU(c,u,d,0,0)))}return a}get originalUnchangedRange(){return hr.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return hr.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,r,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=as(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=as(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=mr(this,s=>this.visibleLineCountTop.read(s)+this.visibleLineCountBottom.read(s)===this.lineCount&&!this.isDragged.read(s)),this.isDragged=as(this,!1),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return hr.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return hr.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 cne=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 Cgr extends qe{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=ei.asClassName(jt.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)&&!bv,f=(g,m)=>{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=i.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:m}),getActions:()=>{const _=[],b=r.modified.isEmpty;return _.push(new Nd("diff.clipboard.copyDeletedContent",b?r.original.length>1?T("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):T("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?T("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):T("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>cne(this,void 0,void 0,function*(){const C=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());yield this._clipboardService.writeText(C)}))),r.original.length>1&&_.push(new Nd("diff.clipboard.copyDeletedLineContent",b?T("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):T("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,()=>cne(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)||_.push(new Nd("diff.inline.revertChange",T("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>cne(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),_},autoSelectFirstItem:!0})};this._register(Ba(this._diffActions,"mousedown",g=>{const{top:m,height:v}=pl(this._diffActions),_=Math.floor(u/3);g.preventDefault(),f(g.posx,m+v+_)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,i){const{top:r}=pl(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 c4e=M1("diffEditorWidget",{createHTML:n=>n});function wgr(n,e,t,i){Zc(i,e.fontInfo);const r=t.length>0,o=new oN(1e4);let s=0,a=0;const l=[];for(let h=0;h<n.lineTokens.length;h++){const f=h+1,g=n.lineTokens[h],m=n.lineBreakData[h],v=$h.filter(t,f,1,Number.MAX_SAFE_INTEGER);if(m){let _=0;for(const b of m.breakOffsets){const y=g.sliceAndInflate(_,b,0);s=Math.max(s,u4e(a,y,$h.extractWrapped(v,_,b),r,n.mightContainNonBasicASCII,n.mightContainRTL,e,o)),a++,_=b}l.push(m.breakOffsets.length)}else l.push(1),s=Math.max(s,u4e(a,g,v,r,n.mightContainNonBasicASCII,n.mightContainRTL,e,o)),a++}s+=e.scrollBeyondLastColumn;const c=o.build(),u=c4e?c4e.createHTML(c):c;i.innerHTML=u;const d=s*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:d,viewLineCounts:l}}class Sgr{constructor(e,t,i,r){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=r}}class u1e{static fromEditor(e){var t;const i=e.getOptions(),r=i.get(50),o=i.get(143);return new u1e(((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 u4e(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=np.isBasicASCII(l,r),u=np.containsRTL(l,c,o),d=D6(new dE(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!==xf.OFF,null),a);return a.appendString("</div>"),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var Egr=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},d4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Cde=class extends qe{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=as(this,0),this._originalScrollOffset=as(this,0),this._originalScrollOffsetAnimated=ZMe(this._originalScrollOffset,this._store),this._modifiedTopPadding=as(this,0),this._modifiedScrollOffset=as(this,0),this._modifiedScrollOffsetAnimated=ZMe(this._modifiedScrollOffset,this._store);let l=!1;const c=as("state",0),u=this._register(new Mo(()=>{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?Ec(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===2):void 0).map((C,E)=>C==null?void 0:C.read(E)),h=new Set,f=new Set,g=mr(C=>{const E=this._diffModel.read(C),x=E==null?void 0:E.diff.read(C);if(!E||!x)return null;c.read(C);const L=this._options.renderSideBySide.read(C);return h4e(this._editors.original,this._editors.modified,x.mappings,h,f,L)}),m=mr(C=>{var E;const x=(E=this._diffModel.read(C))===null||E===void 0?void 0:E.movedTextToCompare.read(C);if(!x)return null;c.read(C);const k=x.changes.map(L=>new Gtt(L));return h4e(this._editors.original,this._editors.modified,k,h,f,!0)});function v(){const C=document.createElement("div");return C.className="diagonal-fill",C}const _=this._register(new yt),b=mr(C=>{var E,x,k,L,D,A,N,P;_.clear();const M=g.read(C)||[],B=[],F=[],U=this._modifiedTopPadding.read(C);U>0&&F.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:U,showInHiddenAreas:!0,suppressMouseDown:!0});const H=this._originalTopPadding.read(C);H>0&&B.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:H,showInHiddenAreas:!0,suppressMouseDown:!0});const W=this._options.renderSideBySide.read(C),q=W||(E=this._editors.modified._getViewModel())===null||E===void 0?void 0:E.createLineBreaksComputer();if(q){for(const ye of M)if(ye.diff)for(let He=ye.originalRange.startLineNumber;He<ye.originalRange.endLineNumberExclusive;He++)q==null||q.addRequest(this._editors.original.getModel().getLineContent(He),null,null)}const V=(x=q==null?void 0:q.finalize())!==null&&x!==void 0?x:[];let re=0;const oe=this._editors.modified.getOption(66),Q=(k=this._diffModel.read(C))===null||k===void 0?void 0:k.movedTextToCompare.read(C),Ne=(D=(L=this._editors.original.getModel())===null||L===void 0?void 0:L.mightContainNonBasicASCII())!==null&&D!==void 0?D:!1,Ve=(N=(A=this._editors.original.getModel())===null||A===void 0?void 0:A.mightContainRTL())!==null&&N!==void 0?N:!1,Ye=u1e.fromEditor(this._editors.modified);for(const ye of M)if(ye.diff&&!W){if(!ye.originalRange.isEmpty){d.read(C);const Pe=document.createElement("div");Pe.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ge=new Sgr(ye.originalRange.mapToLineArray(Yt=>this._editors.original.getModel().tokenization.getLineTokens(Yt)),ye.originalRange.mapToLineArray(Yt=>V[re++]),Ne,Ve),Fe=[];for(const Yt of ye.diff.innerChanges||[])Fe.push(new PM(Yt.originalRange.delta(-(ye.diff.original.startLineNumber-1)),mde.className,0));const bt=wgr(Ge,Ye,Fe,Pe),Mt=document.createElement("div");if(Mt.className="inline-deleted-margin-view-zone",Zc(Mt,Ye.fontInfo),this._options.renderIndicators.read(C))for(let Yt=0;Yt<bt.heightInLines;Yt++){const ln=document.createElement("div");ln.className=`delete-sign ${ei.asClassName(ztt)}`,ln.setAttribute("style",`position:absolute;top:${Yt*oe}px;width:${Ye.lineDecorationsWidth}px;height:${oe}px;right:0;`),Mt.appendChild(ln)}let Ft;_.add(new Cgr(()=>Hx(Ft),Mt,this._editors.modified,ye.diff,this._diffEditorWidget,bt.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Yt=0;Yt<bt.viewLineCounts.length;Yt++){const ln=bt.viewLineCounts[Yt];ln>1&&B.push({afterLineNumber:ye.originalRange.startLineNumber+Yt,domNode:v(),heightInPx:(ln-1)*oe,showInHiddenAreas:!0,suppressMouseDown:!0})}F.push({afterLineNumber:ye.modifiedRange.startLineNumber-1,domNode:Pe,heightInPx:bt.heightInLines*oe,minWidthInPx:bt.minWidthInPx,marginDomNode:Mt,setZoneId(Yt){Ft=Yt},showInHiddenAreas:!0,suppressMouseDown:!0})}const He=document.createElement("div");He.className="gutter-delete",B.push({afterLineNumber:ye.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:ye.modifiedHeightInPx,marginDomNode:He,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const He=ye.modifiedHeightInPx-ye.originalHeightInPx;if(He>0){if(Q!=null&&Q.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ye.originalRange.endLineNumberExclusive-1))continue;B.push({afterLineNumber:ye.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:He,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Pe=function(){const Fe=document.createElement("div");return Fe.className="arrow-revert-change "+ei.asClassName(jt.arrowRight),Rt("div",{},Fe)};if(Q!=null&&Q.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ye.modifiedRange.endLineNumberExclusive-1))continue;let Ge;ye.diff&&ye.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(C)&&(Ge=Pe()),F.push({afterLineNumber:ye.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-He,marginDomNode:Ge,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ye of(P=m.read(C))!==null&&P!==void 0?P:[]){if(!(Q!=null&&Q.lineRangeMapping.original.intersect(ye.originalRange))||!(Q!=null&&Q.lineRangeMapping.modified.intersect(ye.modifiedRange)))continue;const He=ye.modifiedHeightInPx-ye.originalHeightInPx;He>0?B.push({afterLineNumber:ye.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:He,showInHiddenAreas:!0,suppressMouseDown:!0}):F.push({afterLineNumber:ye.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-He,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:B,mod:F}});this._register(Nh(C=>{const E=Ev.capture(this._editors.modified),x=b.read(C);l=!0,this._editors.original.changeViewZones(k=>{for(const L of h)k.removeZone(L);h.clear();for(const L of x.orig){const D=k.addZone(L);L.setZoneId&&L.setZoneId(D),h.add(D)}}),this._editors.modified.changeViewZones(k=>{for(const L of f)k.removeZone(L);f.clear();for(const L of x.mod){const D=k.addZone(L);L.setZoneId&&L.setZoneId(D),f.add(D)}}),l=!1,E.restore(this._editors.modified)})),this._register(_i(()=>{this._editors.original.changeViewZones(C=>{for(const E of h)C.removeZone(E);h.clear()}),this._editors.modified.changeViewZones(C=>{for(const E of f)C.removeZone(E);f.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=Ec(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ec(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Zo(C=>{const E=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));E!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(E,1)})),this._register(Zo(C=>{const E=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));E!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(E,1)})),this._register(Zo(C=>{var E;const x=(E=this._diffModel.read(C))===null||E===void 0?void 0:E.movedTextToCompare.read(C);let k=0;if(x){const L=this._editors.original.getTopForLineNumber(x.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();k=this._editors.modified.getTopForLineNumber(x.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-L}k>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(k,void 0)):k<0?(this._modifiedTopPadding.set(-k,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()-k,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+k,void 0,!0)}))}};Cde=Egr([d4e(5,H1),d4e(6,n_)],Cde);function h4e(n,e,t,i,r,o){const s=new C1(f4e(n,i)),a=new C1(f4e(e,r)),l=n.getOption(66),c=e.getOption(66),u=[];let d=0,h=0;function f(g,m){for(;;){let v=s.peek(),_=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),_&&_.lineNumber>=m&&(_=void 0),!v&&!_)break;const b=v?v.lineNumber-d:Number.MAX_VALUE,y=_?_.lineNumber-h:Number.MAX_VALUE;b<y?(s.dequeue(),_={lineNumber:v.lineNumber-d+h,heightInPx:0}):b>y?(a.dequeue(),v={lineNumber:_.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:hr.ofLength(v.lineNumber,1),modifiedRange:hr.ofLength(_.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+_.heightInPx,diff:void 0})}}for(const g of t){let y=function(C,E){var x,k,L,D;if(C<b||E<_)return;if(v)v=!1;else if(C===b||E===_)return;const A=new hr(b,C),N=new hr(_,E);if(A.isEmpty&&N.isEmpty)return;const P=(k=(x=s.takeWhile(B=>B.lineNumber<C))===null||x===void 0?void 0:x.reduce((B,F)=>B+F.heightInPx,0))!==null&&k!==void 0?k:0,M=(D=(L=a.takeWhile(B=>B.lineNumber<E))===null||L===void 0?void 0:L.reduce((B,F)=>B+F.heightInPx,0))!==null&&D!==void 0?D:0;u.push({originalRange:A,modifiedRange:N,originalHeightInPx:A.length*l+P,modifiedHeightInPx:N.length*c+M,diff:g.lineRangeMapping}),b=C,_=E};const m=g.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,_=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 f(Number.MAX_VALUE,Number.MAX_VALUE),u}function f4e(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 Re(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return Hpr(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var xgr=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},Tgr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},E_;let t1=E_=class extends qe{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=Ec(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),u=mr(f=>{const g=c.read(f),m=g.getColor(Fnr)||(g.getColor(Pnr)||Dce).transparent(2),v=g.getColor(Bnr)||(g.getColor(Mnr)||Ace).transparent(2);return{insertColor:m,removeColor:v}}),d=Ec(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=Ec(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Nh((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const m=oo(document.createElement("div"));m.setClassName("diffViewport"),m.setPosition("absolute");const v=gc("div.diffOverview",{style:{position:"absolute",top:"0px",width:E_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(v7(v,m.domNode)),g.add(Ba(v,Xt.POINTER_DOWN,_=>{this._editors.modified.delegateVerticalScrollbarPointerDown(_)})),g.add(at(v,Xt.MOUSE_WHEEL,_=>{this._editors.modified.delegateScrollFromMouseWheelEvent(_)},{passive:!1})),g.add(v7(this._rootElement,v)),g.add(Nh((_,b)=>{const y=this._diffModel.read(_),C=this._editors.original.createOverviewRuler("original diffOverviewRuler");C&&(b.add(C),b.add(v7(v,C.getDomNode())));const E=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(E&&(b.add(E),b.add(v7(v,E.getDomNode()))),!C||!E)return;const x=kf("viewZoneChanged",this._editors.original.onDidChangeViewZones),k=kf("viewZoneChanged",this._editors.modified.onDidChangeViewZones),L=kf("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),D=kf("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(Zo(A=>{var N;x.read(A),k.read(A),L.read(A),D.read(A);const P=u.read(A),M=(N=y==null?void 0:y.diff.read(A))===null||N===void 0?void 0:N.mappings;function B(H,W,q){const V=q._getViewModel();return V?H.filter(re=>re.length>0).map(re=>{const oe=V.coordinatesConverter.convertModelPositionToViewPosition(new Re(re.startLineNumber,1)),Q=V.coordinatesConverter.convertModelPositionToViewPosition(new Re(re.endLineNumberExclusive,1)),Ne=Q.lineNumber-oe.lineNumber;return new FJe(oe.lineNumber,Q.lineNumber,Ne,W.toString())}):[]}const F=B((M||[]).map(H=>H.lineRangeMapping.original),P.removeColor,this._editors.original),U=B((M||[]).map(H=>H.lineRangeMapping.modified),P.insertColor,this._editors.modified);C==null||C.setZones(F),E==null||E.setZones(U)})),b.add(Zo(A=>{const N=this._rootHeight.read(A),P=this._rootWidth.read(A),M=this._modifiedEditorLayoutInfo.read(A);if(M){const B=E_.ENTIRE_DIFF_OVERVIEW_WIDTH-2*E_.ONE_OVERVIEW_WIDTH;C.setLayout({top:0,height:N,right:B+E_.ONE_OVERVIEW_WIDTH,width:E_.ONE_OVERVIEW_WIDTH}),E.setLayout({top:0,height:N,right:0,width:E_.ONE_OVERVIEW_WIDTH});const F=d.read(A),U=h.read(A),H=this._editors.modified.getOption(102),W=new PA(H.verticalHasArrows?H.arrowSize:0,H.verticalScrollbarSize,0,M.height,U,F);m.setTop(W.getSliderPosition()),m.setHeight(W.getSliderSize())}else m.setTop(0),m.setHeight(0);v.style.height=N+"px",v.style.left=P-E_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",m.setWidth(E_.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};t1.ONE_OVERVIEW_WIDTH=15;t1.ENTIRE_DIFF_OVERVIEW_WIDTH=E_.ONE_OVERVIEW_WIDTH*2;t1=E_=xgr([Tgr(7,Vl)],t1);fe("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},T("diffEditor.move.border","The border color for text that got moved in the diff editor."));fe("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},T("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class kY extends qe{constructor(){super(...arguments),this._id=++kY.idCounter,this._onDidDispose=this._register(new De),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)}}kY.idCounter=0;var kgr=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},p4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let wde=class extends qe{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 De),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),r.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),r.modifiedEditor||{})),this.modifiedModel=Ec(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(EY({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()+t1.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=Dv.revealHorizontalRightPadding.defaultValue+t1.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=T("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,""):""}};wde=kgr([p4e(5,pi),p4e(6,Go)],wde);class Igr{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=mr(this,r=>this._options.read(r).renderSideBySide&&this.diffEditorWidth.read(r)<=this._options.read(r).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=mr(this,r=>this._options.read(r).renderOverviewRuler),this.renderSideBySide=mr(this,r=>this._options.read(r).renderSideBySide&&!(this._options.read(r).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(r))),this.readOnly=mr(this,r=>this._options.read(r).readOnly),this.shouldRenderRevertArrows=mr(this,r=>!(!this._options.read(r).renderMarginRevertIcon||!this.renderSideBySide.read(r)||this.readOnly.read(r))),this.renderIndicators=mr(this,r=>this._options.read(r).renderIndicators),this.enableSplitViewResizing=mr(this,r=>this._options.read(r).enableSplitViewResizing),this.splitViewDefaultRatio=mr(this,r=>this._options.read(r).splitViewDefaultRatio),this.ignoreTrimWhitespace=mr(this,r=>this._options.read(r).ignoreTrimWhitespace),this.maxComputationTimeMs=mr(this,r=>this._options.read(r).maxComputationTime),this.showMoves=mr(this,r=>this._options.read(r).experimental.showMoves&&this.renderSideBySide.read(r)),this.isInEmbeddedEditor=mr(this,r=>this._options.read(r).isInEmbeddedEditor),this.diffWordWrap=mr(this,r=>this._options.read(r).diffWordWrap),this.originalEditable=mr(this,r=>this._options.read(r).originalEditable),this.diffCodeLens=mr(this,r=>this._options.read(r).diffCodeLens),this.accessibilityVerbose=mr(this,r=>this._options.read(r).accessibilityVerbose),this.diffAlgorithm=mr(this,r=>this._options.read(r).diffAlgorithm),this.showEmptyDecorations=mr(this,r=>this._options.read(r).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=mr(this,r=>this._options.read(r).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=mr(this,r=>this._options.read(r).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=mr(this,r=>this._options.read(r).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=mr(this,r=>this._options.read(r).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=mr(this,r=>this._options.read(r).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),g4e(e,Du));this._options=as(this,i)}updateOptions(e){const t=g4e(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 g4e(n,e){var t,i,r,o,s,a,l,c;return{enableSplitViewResizing:Vn(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:DYi(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Vn(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Vn(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:ix(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:ix(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Vn(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Vn(n.renderIndicators,e.renderIndicators),originalEditable:Vn(n.originalEditable,e.originalEditable),diffCodeLens:Vn(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Vn(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Pa(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Pa(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Vn(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Vn((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Vn((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:Vn((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:ix((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:ix((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:ix((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Vn(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Vn(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:ix(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Vn(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var Lgr=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},VO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ak=class extends kY{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=gc("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[gc("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[Rt("span",{},"No Changes")]),gc("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),gc("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),gc("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(uU("diffModel",void 0)),this.onDidChangeModel=on.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new JK([bi,this._contextKeyService])),this._boundarySashes=as(this,void 0),this._accessibleDiffViewerShouldBeVisible=as(this,!1),this._accessibleDiffViewerVisible=mr(this,m=>this._options.onlyShowAccessibleDiffViewer.read(m)?!0:this._accessibleDiffViewerShouldBeVisible.read(m)),this.movedBlocksLinesPart=as(this,void 0),this._layoutInfo=mr(this,m=>{var v,_,b;const y=this._rootSizeObserver.width.read(m),C=this._rootSizeObserver.height.read(m),E=(v=this._sash.read(m))===null||v===void 0?void 0:v.sashLeft.read(m),x=E??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),k=y-x-(this._options.renderOverviewRuler.read(m)?t1.ENTIRE_DIFF_OVERVIEW_WIDTH:0),L=(b=(_=this.movedBlocksLinesPart.read(m))===null||_===void 0?void 0:_.width.read(m))!==null&&b!==void 0?b:0,D=x-L;return this.elements.original.style.width=D+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=k+"px",this.elements.modified.style.left=x+"px",this._editors.original.layout({width:D,height:C}),this._editors.modified.layout({width:k,height:C}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((m,v)=>m==null?void 0:m.diff.read(v)),this.onDidUpdateDiff=on.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(_i(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new Wpr(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new Igr(t,this._rootSizeObserver.width),this._contextKeyService.createKey(de.isEmbeddedDiffEditor.key,!1);const u=de.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(Zo(m=>{u.set(this._options.isInEmbeddedEditor.read(m))}));const d=de.comparingMovedCode.bindTo(this._contextKeyService);this._register(Zo(m=>{var v;d.set(!!(!((v=this._diffModel.read(m))===null||v===void 0)&&v.movedTextToCompare.read(m)))}));const h=de.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(Zo(m=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(m))})),this._editors=this._register(this._instantiationService.createInstance(wde,this.elements.original,this.elements.modified,this._options,i,(m,v,_,b)=>this._createInnerEditor(m,v,_,b))),this._sash=S5(this,(m,v)=>{const _=this._options.renderSideBySide.read(m);if(this.elements.root.classList.toggle("side-by-side",_),!_)return;const b=v.add(new cgr(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,C)=>y-(this._options.renderOverviewRuler.read(C)?t1.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return v.add(Zo(y=>{const C=this._boundarySashes.read(y);C&&b.setBoundarySashes(C)})),b}),this._register(x5(this._sash)),this._register(Nh((m,v)=>{this.unchangedRangesFeature=v.add(this._instantiationService.createInstance(NC(_de,m),this._editors,this._diffModel,this._options))})),this._register(Nh((m,v)=>{v.add(new(NC(lgr,m))(this._editors,this._diffModel,this._options))})),this._register(Nh((m,v)=>{v.add(this._instantiationService.createInstance(NC(Cde,m),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Nh((m,v)=>{v.add(this._instantiationService.createInstance(NC(t1,m),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(_=>_.modifiedEditor),this._options))})),this._register(Nh((m,v)=>{this._accessibleDiffViewer=v.add(this._register(this._instantiationService.createInstance(NC(dw,m),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(_,b)=>this._accessibleDiffViewerShouldBeVisible.set(_,b),this._options.onlyShowAccessibleDiffViewer.map(_=>!_),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((_,b)=>{var y;return(y=_==null?void 0:_.diff.read(b))===null||y===void 0?void 0:y.mappings.map(C=>C.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(m=>m?"hidden":"visible");this._register(Gw(this.elements.modified,{visibility:f})),this._register(Gw(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(x5(this._layoutInfo)),this._register(Nh((m,v)=>{this.movedBlocksLinesPart.set(v.add(new(NC(Kw,m))(this.elements.root,this._diffModel,this._layoutInfo.map(_=>_.originalEditor),this._layoutInfo.map(_=>_.modifiedEditor),this._editors)),void 0)})),this._register(Gw(this.elements.overlay,{width:this._layoutInfo.map((m,v)=>m.originalEditor.width+(this._options.renderSideBySide.read(v)?0:m.modifiedEditor.width)),visibility:mr(m=>{var v,_;return this._options.hideUnchangedRegions.read(m)&&((_=(v=this._diffModel.read(m))===null||v===void 0?void 0:v.diff.read(m))===null||_===void 0?void 0:_.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(m=>{var v,_;if(!m.event.rightButton&&m.target.position&&(!((v=m.target.element)===null||v===void 0)&&v.className.includes("arrow-revert-change"))){const b=m.target.position.lineNumber,y=m.target,C=this._diffModel.get();if(!C)return;const E=(_=C.diff.get())===null||_===void 0?void 0:_.mappings;if(!E)return;const x=E.find(k=>(y==null?void 0:y.detail.afterLineNumber)===k.lineRangeMapping.modified.startLineNumber-1||k.lineRangeMapping.modified.startLineNumber===b);if(!x)return;this.revert(x.lineRangeMapping),m.event.stopPropagation()}})),this._register(on.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,m=>{var v,_;if((m==null?void 0:m.reason)===3){const b=(_=(v=this._diffModel.get())===null||v===void 0?void 0:v.diff.get())===null||_===void 0?void 0:_.mappings.find(y=>y.lineRangeMapping.modified.contains(m.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Pr.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Pr.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(Pr.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((m,v)=>m==null?void 0:m.isDiffUpToDate.read(v));this._register(Nh((m,v)=>{if(g.read(m)===!1){const _=this._editorProgressService.show(!0,1e3);v.add(_i(()=>_.done()))}}))}_createInnerEditor(e,t,i,r){return e.createInstance(FA,t,i,r)}_createDiffEditorContributions(){const e=JL.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Pi(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return L6.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(yde,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),ks(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?Rgr(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=m4e(a.getStartPosition(),l),u=m4e(a.getEndPosition(),l);s=J.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&&ks(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&&ks(i=>{for(const r of t)r.showAll(i)})}};ak=Lgr([VO(3,bi),VO(4,pi),VO(5,io),VO(6,Y6),VO(7,fE)],ak);function m4e(n,e){const t=dz(e,r=>r.original.startLineNumber<=n.lineNumber);if(!t)return J.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const r=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return J.fromPositions(new Re(r,n.column))}if(!t.innerChanges)return J.fromPositions(new Re(t.modified.startLineNumber,1));const i=dz(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const r=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return J.fromPositions(new Re(r,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const r=Dgr(i.originalRange.getEndPosition(),n);return J.fromPositions(Agr(i.modifiedRange.getEndPosition(),r))}}function Dgr(n,e){return n.lineNumber===e.lineNumber?new e5(0,e.column-n.column):new e5(e.lineNumber-n.lineNumber,e.column-1)}function Agr(n,e){return e.lineCount===0?new Re(n.lineNumber,n.column+e.columnCount):new Re(n.lineNumber+e.lineCount,e.columnCount+1)}function Rgr(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 d1e=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},Cs=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Ngr=0,_4e=!1;function Ogr(n){if(!n){if(_4e)return;_4e=!0}Ntr(n||document.body)}let _U=class extends FA{constructor(e,t,i,r,o,s,a,l,c,u,d,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||Wz.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+Wz.accessibilityHelpMessage,super(e,f,{},i,r,o,s,l,c,u,d,h),a instanceof jA?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Ogr(f.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_"+ ++Ngr,o=ht.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"),qe.None;const t=e.id,i=e.label,r=ht.and(ht.equals("editorId",this.getId()),ht.deserialize(e.precondition)),o=e.keybindings,s=ht.and(r,ht.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new yt,d=this.getId()+":"+t;if(u.add(yr.registerCommand(d,c)),a){const f={command:{id:d,title:i},when:r,group:a,order:l};u.add(Sc.appendMenuItem(ue.EditorContext,f))}if(Array.isArray(o))for(const f of o)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new BJe(d,i,i,r,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(_i(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof Oz)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};_U=d1e([Cs(2,pi),Cs(3,io),Cs(4,ga),Cs(5,bi),Cs(6,Go),Cs(7,Vl),Cs(8,Wa),Cs(9,F1),Cs(10,es),Cs(11,wn)],_U);let Sde=class extends _U{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f,g,m){const v=Object.assign({},t);cU(u,v,!1);const _=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const b=v.model;delete v.model,super(e,v,i,r,o,s,a,l,c,d,g,m),this._configurationService=u,this._standaloneThemeService=l,this._register(_);let y;if(typeof b>"u"){const C=f.getLanguageIdByMimeType(v.language)||v.language||jf;y=Ktt(h,f,v.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){cU(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)}};Sde=d1e([Cs(2,pi),Cs(3,io),Cs(4,ga),Cs(5,bi),Cs(6,Go),Cs(7,fp),Cs(8,Wa),Cs(9,pr),Cs(10,F1),Cs(11,Ls),Cs(12,Es),Cs(13,es),Cs(14,wn)],Sde);let Ede=class extends ak{constructor(e,t,i,r,o,s,a,l,c,u,d,h){const f=Object.assign({},t);cU(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&s.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},r,i,o,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){cU(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(_U,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)}};Ede=d1e([Cs(2,pi),Cs(3,bi),Cs(4,io),Cs(5,fp),Cs(6,Wa),Cs(7,pr),Cs(8,n_),Cs(9,fE),Cs(10,H1),Cs(11,Y6)],Ede);function Ktt(n,e,t,i,r){if(t=t||"",!i){const o=t.indexOf(`
`);let s=t;return o!==-1&&(s=t.substring(0,o)),v4e(n,t,e.createByFilepathOrFirstLine(r||null,s),r)}return v4e(n,t,e.createById(i),r)}function v4e(n,e,t,i){return n.createModel(e,t,i)}var Ytt=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 Pgr(n,e,t){return ui.initialize(t||{}).createInstance(Sde,n,e)}function Mgr(n){return ui.get(io).onCodeEditorAdd(t=>{n(t)})}function Fgr(n){return ui.get(io).onDiffEditorAdd(t=>{n(t)})}function Bgr(){return ui.get(io).listCodeEditors()}function $gr(){return ui.get(io).listDiffEditors()}function Vgr(n,e,t){return ui.initialize(t||{}).createInstance(Ede,n,e)}function Hgr(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return yr.registerCommand(n.id,n.run)}function Wgr(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=ht.deserialize(n.precondition),t=(r,...o)=>oc.runEditorCommand(r,o,e,(s,a,l)=>Promise.resolve(n.run(a,...l))),i=new yt;if(i.add(yr.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(Sc.appendMenuItem(ue.EditorContext,r))}if(Array.isArray(n.keybindings)){const r=ui.get(Go);if(!(r instanceof jA))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=ht.and(e,ht.deserialize(n.keybindingContext));i.add(r.addDynamicKeybindings(n.keybindings.map(s=>({keybinding:s,command:n.id,when:o}))))}}return i}function zgr(n){return Qtt([n])}function Qtt(n){const e=ui.get(Go);return e instanceof jA?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:ht.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),qe.None)}function Ugr(n,e,t){const i=ui.get(Es),r=i.getLanguageIdByMimeType(e)||e;return Ktt(ui.get(Ls),i,n,r,t)}function jgr(n,e){const t=ui.get(Es),i=t.getLanguageIdByMimeType(e)||e||jf;n.setLanguage(t.createById(i))}function qgr(n,e,t){n&&ui.get(D0).changeOne(e,n.uri,t)}function Ggr(n){ui.get(D0).changeAll(n,[])}function Kgr(n){return ui.get(D0).read(n)}function Ygr(n){return ui.get(D0).onMarkerChanged(n)}function Qgr(n){return ui.get(Ls).getModel(n)}function Xgr(){return ui.get(Ls).getModels()}function Zgr(n){return ui.get(Ls).onModelAdded(n)}function Jgr(n){return ui.get(Ls).onModelRemoved(n)}function emr(n){return ui.get(Ls).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function tmr(n){return str(ui.get(Ls),ui.get(es),n)}function nmr(n,e){const t=ui.get(Es),i=ui.get(fp);return M0e.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function imr(n,e,t){const i=ui.get(Es);return ui.get(fp).registerEditorContainer(document.body),M0e.colorize(i,n,e,t)}function rmr(n,e,t=4){return ui.get(fp).registerEditorContainer(document.body),M0e.colorizeModelLine(n,e,t)}function omr(n){const e=Ks.get(n);return e||{getInitialState:()=>IA,tokenize:(t,i,r)=>N0e(n,r)}}function smr(n,e){Ks.getOrCreate(e);const t=omr(e),i=a0(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 amr(n,e){ui.get(fp).defineTheme(n,e)}function lmr(n){ui.get(fp).setTheme(n)}function cmr(){rce.clearAllFontInfos()}function umr(n,e){return yr.registerCommand({id:n,handler:e})}function dmr(n){return ui.get(nf).registerOpener({open(t){return Ytt(this,void 0,void 0,function*(){return typeof t=="string"&&(t=Jn.parse(t)),n.open(t)})}})}function hmr(n){return ui.get(io).registerCodeEditorOpenHandler((t,i,r)=>Ytt(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 fmr(){return{create:Pgr,getEditors:Bgr,getDiffEditors:$gr,onDidCreateEditor:Mgr,onDidCreateDiffEditor:Fgr,createDiffEditor:Vgr,addCommand:Hgr,addEditorAction:Wgr,addKeybindingRule:zgr,addKeybindingRules:Qtt,createModel:Ugr,setModelLanguage:jgr,setModelMarkers:qgr,getModelMarkers:Kgr,removeAllMarkers:Ggr,onDidChangeMarkers:Ygr,getModels:Xgr,getModel:Qgr,onDidCreateModel:Zgr,onWillDisposeModel:Jgr,onDidChangeModelLanguage:emr,createWebWorker:tmr,colorizeElement:nmr,colorize:imr,colorizeModelLine:rmr,tokenize:smr,defineTheme:amr,setTheme:lmr,remeasureFonts:cmr,registerCommand:umr,registerLinkOpener:dmr,registerEditorOpener:hmr,AccessibilitySupport:mle,ContentWidgetPositionPreference:wle,CursorChangeReason:Sle,DefaultEndOfLine:Ele,EditorAutoIndentStrategy:Tle,EditorOption:kle,EndOfLinePreference:Ile,EndOfLineSequence:Lle,MinimapPosition:Ble,MouseTargetType:$le,OverlayWidgetPositionPreference:Vle,OverviewRulerLane:Hle,GlyphMarginLane:Dle,RenderLineNumbersType:zle,RenderMinimap:Ule,ScrollbarVisibility:qle,ScrollType:jle,TextEditorCursorBlinkingStyle:Xle,TextEditorCursorStyle:Zle,TrackedRangeStickiness:Jle,WrappingIndent:ece,InjectedTextCursorStops:Rle,PositionAffinity:Wle,ConfigurationChangedEvent:bXe,BareFontInfo:hT,FontInfo:ice,TextModelResolvedOptions:Z$,FindMatch:P3,ApplyUpdateResult:RM,EditorZoom:Hp,EditorType:L6,EditorOptions:Dv}}function pmr(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function b7(n,e){return typeof n=="boolean"?n:e}function b4e(n,e){return typeof n=="string"?n:e}function gmr(n){const e={};for(const t of n)e[t]=!0;return e}function y4e(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=gmr(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 xde(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?_s(n,"language definition does not contain attribute '"+s+"', used at: "+e):_s(n,"attribute reference '"+s+"' must be a string, used at: "+e);return x2(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 mmr(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 _mr(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=y4e(l.split("|"),n.ignoreCase);c=function(d){return a==="~"?u(d):!u(d)}}else if(a==="@"||a==="!@"){const u=n[l];if(!u)throw _s(n,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!pmr(function(h){return typeof h=="string"},u))throw _s(n,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const d=y4e(u,n.ignoreCase);c=function(h){return a==="@"?d(h):!d(h)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const u=xde(n,"^"+l+"$");c=function(d){return a==="~"?u.test(d):!u.test(d)}}else c=function(u,d,h,f){return xde(n,"^"+HC(n,l,d,h,f)+"$").test(u)};else if(l.indexOf("$")<0){const u=Hw(n,l);c=function(d){return a==="=="?d===u:d!==u}}else{const u=Hw(n,l);c=function(d,h,f,g,m){const v=HC(n,u,h,f,g);return a==="=="?d===v:d!==v}}return r===-1?{name:t,value:i,test:function(u,d,h,f){return c(u,u,d,h,f)}}:{name:t,value:i,test:function(u,d,h,f){const g=mmr(u,d,h,r);return c(g||"",u,d,h,f)}}}function Tde(n,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw _s(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 _s(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw _s(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&&!xtr(n,HC(n,r,"",[],""))))throw _s(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]=Tde(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=Tde(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(_mr(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 _s(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 vmr{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 _s(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=xde(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=Tde(e,this.name,t)}}function Xtt(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=b7(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=b7(e.ignoreCase,!1),t.unicode=b7(e.unicode,!1),t.tokenPostfix=b4e(e.tokenPostfix,"."+t.languageId),t.defaultToken=b4e(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 _s(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw _s(t,"include target '"+u+"' is not defined at: "+s);r(s+"."+u,a,e.tokenizer[u])}else{const d=new vmr(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 _s(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 _s(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=b7(c.matchOnlyAtLineStart,!1)),d.setRegex(i,c.regex),d.setAction(i,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw _s(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 _s(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 _s(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:Hw(t,a.open),close:Hw(t,a.close)});else throw _s(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 bmr=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 ymr(n){TA.registerLanguage(n)}function Cmr(){let n=[];return n=n.concat(TA.getLanguages()),n}function wmr(n){return ui.get(Es).languageIdCodec.encodeLanguageId(n)}function Smr(n,e){return ui.withServices(()=>{const i=ui.get(Es).onDidRequestRichLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function Emr(n,e){return ui.withServices(()=>{const i=ui.get(Es).onDidRequestBasicLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function xmr(n,e){if(!ui.get(Es).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return ui.get(es).register(n,e,100)}class Tmr{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 T5.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 gK(r.tokens,r.endState)}}class T5{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 x3(l,a.scopes,t),r=l}return i}static adaptTokenize(e,t,i,r){const o=t.tokenize(i,r),s=T5._toClassicTokens(o.tokens,e);let a;return o.endState.equals(r)?a=r:a=o.endState,new c0e(s,a)}tokenize(e,t,i){return T5.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 f=d.startIndex;c===0?f=0:f<a&&(f=a),o[s++]=f,o[s++]=h,a=f}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 gK(o,s)}}function kmr(n){return typeof n.getInitialState=="function"}function Imr(n){return"tokenizeEncoded"in n}function Ztt(n){return n&&typeof n.then=="function"}function Lmr(n){const e=ui.get(fp);if(n){const t=[null];for(let i=1,r=n.length;i<r;i++)t[i]=je.fromHex(n[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function Jtt(n,e){return Imr(e)?new Tmr(n,e):new T5(n,e,ui.get(Es),ui.get(fp))}function h1e(n,e){const t=new nXi(()=>bmr(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?kmr(i)?Jtt(n,i):new W3(ui.get(Es),ui.get(fp),n,Xtt(n,i),ui.get(pr)):null}));return Ks.registerFactory(n,t)}function Dmr(n,e){if(!ui.get(Es).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return Ztt(e)?h1e(n,{create:()=>e}):Ks.register(n,Jtt(n,e))}function Amr(n,e){const t=i=>new W3(ui.get(Es),ui.get(fp),n,Xtt(n,i),ui.get(pr));return Ztt(e)?h1e(n,{create:()=>e}):Ks.register(n,t(e))}function Rmr(n,e){return ui.get(wn).referenceProvider.register(n,e)}function Nmr(n,e){return ui.get(wn).renameProvider.register(n,e)}function Omr(n,e){return ui.get(wn).signatureHelpProvider.register(n,e)}function Pmr(n,e){return ui.get(wn).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 J(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)),a.range||(a.range=new J(r.lineNumber,r.column,r.lineNumber,r.column)),a})}})}function Mmr(n,e){return ui.get(wn).documentSymbolProvider.register(n,e)}function Fmr(n,e){return ui.get(wn).documentHighlightProvider.register(n,e)}function Bmr(n,e){return ui.get(wn).linkedEditingRangeProvider.register(n,e)}function $mr(n,e){return ui.get(wn).definitionProvider.register(n,e)}function Vmr(n,e){return ui.get(wn).implementationProvider.register(n,e)}function Hmr(n,e){return ui.get(wn).typeDefinitionProvider.register(n,e)}function Wmr(n,e){return ui.get(wn).codeLensProvider.register(n,e)}function zmr(n,e,t){return ui.get(wn).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,o,s,a)=>{const c=ui.get(D0).read({resource:r.uri}).filter(u=>J.areIntersectingOrTouching(u,o));return e.provideCodeActions(r,o,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Umr(n,e){return ui.get(wn).documentFormattingEditProvider.register(n,e)}function jmr(n,e){return ui.get(wn).documentRangeFormattingEditProvider.register(n,e)}function qmr(n,e){return ui.get(wn).onTypeFormattingEditProvider.register(n,e)}function Gmr(n,e){return ui.get(wn).linkProvider.register(n,e)}function Kmr(n,e){return ui.get(wn).completionProvider.register(n,e)}function Ymr(n,e){return ui.get(wn).colorProvider.register(n,e)}function Qmr(n,e){return ui.get(wn).foldingRangeProvider.register(n,e)}function Xmr(n,e){return ui.get(wn).declarationProvider.register(n,e)}function Zmr(n,e){return ui.get(wn).selectionRangeProvider.register(n,e)}function Jmr(n,e){return ui.get(wn).documentSemanticTokensProvider.register(n,e)}function e_r(n,e){return ui.get(wn).documentRangeSemanticTokensProvider.register(n,e)}function t_r(n,e){return ui.get(wn).inlineCompletionsProvider.register(n,e)}function n_r(n,e){return ui.get(wn).inlayHintsProvider.register(n,e)}function i_r(){return{register:ymr,getLanguages:Cmr,onLanguage:Smr,onLanguageEncountered:Emr,getEncodedLanguageId:wmr,setLanguageConfiguration:xmr,setColorMap:Lmr,registerTokensProviderFactory:h1e,setTokensProvider:Dmr,setMonarchTokensProvider:Amr,registerReferenceProvider:Rmr,registerRenameProvider:Nmr,registerCompletionItemProvider:Kmr,registerSignatureHelpProvider:Omr,registerHoverProvider:Pmr,registerDocumentSymbolProvider:Mmr,registerDocumentHighlightProvider:Fmr,registerLinkedEditingRangeProvider:Bmr,registerDefinitionProvider:$mr,registerImplementationProvider:Vmr,registerTypeDefinitionProvider:Hmr,registerCodeLensProvider:Wmr,registerCodeActionProvider:zmr,registerDocumentFormattingEditProvider:Umr,registerDocumentRangeFormattingEditProvider:jmr,registerOnTypeFormattingEditProvider:qmr,registerLinkProvider:Gmr,registerColorProvider:Ymr,registerFoldingRangeProvider:Qmr,registerDeclarationProvider:Xmr,registerSelectionRangeProvider:Zmr,registerDocumentSemanticTokensProvider:Jmr,registerDocumentRangeSemanticTokensProvider:e_r,registerInlineCompletionsProvider:t_r,registerInlayHintsProvider:n_r,DocumentHighlightKind:xle,CompletionItemKind:ble,CompletionItemTag:yle,CompletionItemInsertTextRule:vle,SymbolKind:Yle,SymbolTag:Qle,IndentAction:Ale,CompletionTriggerKind:Cle,SignatureHelpTriggerKind:Kle,InlayHintKind:Nle,InlineCompletionTriggerKind:Ole,CodeActionTriggerType:_le,FoldingRangeKind:kd,SelectedSuggestionInfo:PXe}}const f1e=lr("IEditorCancelService"),ent=new sn("cancellableOperation",!1,T("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Cr(f1e,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(r=>{const o=ent.bindTo(r.get(bi)),s=new Td;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 r_r extends $a{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(f1e).add(e,this))}dispose(){this._unregister(),super.dispose()}}qt(new class extends oc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:ent})}runEditorCommand(n,e){n.get(f1e).cancel(e)}});let tnt=class kde{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?GT("{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 kde))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 kde(e,this.flags))}};class IS extends r_r{constructor(e,t,i,r){super(e,r),this._listener=new yt,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!J.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!J.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 p1e extends $a{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function m0(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===L6.ICodeEditor:!1}function nnt(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===L6.IDiffEditor:!1}function o_r(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function int(n){return m0(n)?n:nnt(n)?n.getModifiedEditor():o_r(n)&&m0(n.activeCodeEditor)?n.activeCodeEditor:null}class qA{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=Ev.capture(e),o=qA._handleEolEdits(e,t);o.length===1&&qA._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(s=>Is.replace(J.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",o.map(s=>Is.replaceMove(J.lift(s.range),s.text))),i&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class C4e{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class s_r{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(C4e.toKey(e))}has(e){return this._set.has(C4e.toKey(e))}}var xv=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 g1e(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=J.plusRange(e,n[r].range);const{startLineNumber:t,endLineNumber:i}=e;t===i?n.length===1?vu(T("hint11","Made 1 formatting edit on line {0}",t)):vu(T("hintn1","Made {0} formatting edits on line {1}",n.length,t)):n.length===1?vu(T("hint1n","Made 1 formatting edit between lines {0} and {1}",t,i)):vu(T("hintnn","Made {0} formatting edits between lines {1} and {2}",n.length,t,i))}function rnt(n,e,t){const i=[],r=new s_r,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 lk{static setFormatterSelector(e){return{dispose:lk._selectors.unshift(e)}}static select(e,t,i){return xv(this,void 0,void 0,function*(){if(e.length===0)return;const r=rr.first(lk._selectors);if(r)return yield r(e,t,i)})}}lk._selectors=new Td;function ont(n,e,t,i,r,o){return xv(this,void 0,void 0,function*(){const s=n.get(pi),{documentRangeFormattingEditProvider:a}=n.get(wn),l=m0(e)?e.getModel():e,c=a.ordered(l),u=yield lk.select(c,l,i);u&&(r.report(u),yield s.invokeFunction(a_r,u,e,t,o))})}function a_r(n,e,t,i,r){var o,s;return xv(this,void 0,void 0,function*(){const a=n.get(o_),l=n.get(hp);let c,u;m0(t)?(c=t.getModel(),u=new IS(t,5,void 0,r)):(c=t,u=new p1e(t,r));const d=[];let h=0;for(const _ of Xbe(i).sort(J.compareRangesUsingStarts))h>0&&J.areIntersectingOrTouching(d[h-1],_)?d[h-1]=J.fromPositions(d[h-1].getStartPosition(),_.getEndPosition()):h=d.push(_);const f=_=>xv(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,_);const C=(yield e.provideDocumentRangeFormattingEdits(c,_,c.getFormattingOptions(),u.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,C),C}),g=(_,b)=>{if(!_.length||!b.length)return!1;const y=_.reduce((C,E)=>J.plusRange(C,E.range),_[0].range);if(!b.some(C=>J.intersectRanges(y,C.range)))return!1;for(const C of _)for(const E of b)if(J.intersectRanges(C.range,E.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(o=e.extensionId)===null||o===void 0?void 0:o.value,d);const _=(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(_)}else{for(const _ of d){if(u.token.isCancellationRequested)return!0;v.push(yield f(_))}for(let _=0;_<d.length;++_)for(let b=_+1;b<d.length;++b){if(u.token.isCancellationRequested)return!0;if(g(v[_],v[b])){const y=J.plusRange(d[_],d[b]),C=yield f(y);d.splice(b,1),d.splice(_,1),d.push(y),v.splice(b,1),v.splice(_,1),v.push(C),_=0,b=0}}}for(const _ of v){if(u.token.isCancellationRequested)return!0;const b=yield a.computeMoreMinimalEdits(c.uri,_);b&&m.push(...b)}}finally{u.dispose()}if(m.length===0)return!1;if(m0(t))qA.execute(t,m,!0),g1e(m),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:_}]=m,b=new kn(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn);c.pushEditOperations([b],m.map(y=>({text:y.text,range:J.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:C}of y)if(J.areIntersectingOrTouching(C,b))return[new kn(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return!0})}function l_r(n,e,t,i,r){return xv(this,void 0,void 0,function*(){const o=n.get(pi),s=n.get(wn),a=m0(e)?e.getModel():e,l=rnt(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield lk.select(l,a,t);c&&(i.report(c),yield o.invokeFunction(c_r,c,e,t,r))})}function c_r(n,e,t,i,r){return xv(this,void 0,void 0,function*(){const o=n.get(o_);let s,a;m0(t)?(s=t.getModel(),a=new IS(t,5,void 0,r)):(s=t,a=new p1e(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(m0(t))qA.execute(t,l,i!==2),i!==2&&(g1e(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,u=new kn(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);s.pushEditOperations([u],l.map(d=>({text:d.text,range:J.lift(d.range),forceMoveMarkers:!0})),d=>{for(const{range:h}of d)if(J.areIntersectingOrTouching(h,u))return[new kn(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function u_r(n,e,t,i,r,o){return xv(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(tl);if(yu(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function d_r(n,e,t,i,r){return xv(this,void 0,void 0,function*(){const o=rnt(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of o){const a=yield Promise.resolve(s.provideDocumentFormattingEdits(t,i,r)).catch(tl);if(yu(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function snt(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(tl).then(l=>n.computeMoreMinimalEdits(t.uri,l))}yr.registerCommand("_executeFormatRangeProvider",function(n,...e){return xv(this,void 0,void 0,function*(){const[t,i,r]=e;ko(Jn.isUri(t)),ko(J.isIRange(i));const o=n.get(vh),s=n.get(o_),a=n.get(wn),l=yield o.createModelReference(t);try{return u_r(s,a,l.object.textEditorModel,J.lift(i),r,or.None)}finally{l.dispose()}})});yr.registerCommand("_executeFormatDocumentProvider",function(n,...e){return xv(this,void 0,void 0,function*(){const[t,i]=e;ko(Jn.isUri(t));const r=n.get(vh),o=n.get(o_),s=n.get(wn),a=yield r.createModelReference(t);try{return d_r(o,s,a.object.textEditorModel,i,or.None)}finally{a.dispose()}})});yr.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return xv(this,void 0,void 0,function*(){const[t,i,r,o]=e;ko(Jn.isUri(t)),ko(Re.isIPosition(i)),ko(typeof r=="string");const s=n.get(vh),a=n.get(o_),l=n.get(wn),c=yield s.createModelReference(t);try{return snt(a,l,c.object.textEditorModel,Re.lift(i),r,o,or.None)}finally{c.dispose()}})});Dv.wrappingIndent.defaultValue=0;Dv.glyphMargin.defaultValue=!1;Dv.autoIndent.defaultValue=3;Dv.overviewRulerLanes.defaultValue=2;lk.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const $d=MXe();$d.editor=fmr();$d.languages=i_r();const ant=$d.CancellationTokenSource,lnt=$d.Emitter,cnt=$d.KeyCode,unt=$d.KeyMod,dnt=$d.Position,hnt=$d.Range,fnt=$d.Selection,pnt=$d.SelectionDirection,gnt=$d.MarkerSeverity,mnt=$d.MarkerTag,_nt=$d.Uri,vnt=$d.Token,bnt=$d.editor,ynt=$d.languages,une=globalThis.MonacoEnvironment;(une!=null&&une.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=$d);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 X6=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:ant,Emitter:lnt,KeyCode:cnt,KeyMod:unt,MarkerSeverity:gnt,MarkerTag:mnt,Position:dnt,Range:hnt,Selection:fnt,SelectionDirection:pnt,Token:vnt,Uri:_nt,editor:bnt,languages:ynt},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 h_r=Object.defineProperty,f_r=Object.getOwnPropertyDescriptor,p_r=Object.getOwnPropertyNames,g_r=Object.prototype.hasOwnProperty,w4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p_r(e))!g_r.call(n,r)&&r!==t&&h_r(n,r,{get:()=>e[r],enumerable:!(i=f_r(e,r))||i.enumerable});return n},m_r=(n,e,t)=>(w4e(n,e,"default"),t&&w4e(t,e,"default")),NP={};m_r(NP,X6);var Cnt={},dne={},wnt=class{constructor(n){ia(this,"_languageId");ia(this,"_loadingTriggered");ia(this,"_lazyLoadPromise");ia(this,"_lazyLoadPromiseResolve");ia(this,"_lazyLoadPromiseReject");this._languageId=n,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(n){return dne[n]||(dne[n]=new wnt(n)),dne[n]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Cnt[this._languageId].loader().then(n=>this._lazyLoadPromiseResolve(n),n=>this._lazyLoadPromiseReject(n))),this._lazyLoadPromise}};function jn(n){const e=n.id;Cnt[e]=n,NP.languages.register(n);const t=wnt.getOrCreate(e);NP.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),NP.languages.onLanguageEncountered(e,async()=>{const i=await t.load();NP.languages.setLanguageConfiguration(e,i.conf)})}jn({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>ie(()=>import("./bundle.e5f08dc1.js"),[])});jn({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>ie(()=>import("./bundle.fc8a734c.js"),[])});jn({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>ie(()=>import("./bundle.c4358445.js"),[])});jn({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>ie(()=>import("./bundle.eaac827b.js"),[])});jn({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>ie(()=>import("./bundle.9f8671bb.js"),[])});jn({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>ie(()=>import("./bundle.ff939f45.js"),[])});jn({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>ie(()=>import("./bundle.4a1da11c.js"),[])});jn({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>ie(()=>import("./bundle.97023918.js"),[])});jn({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>ie(()=>import("./bundle.a410d69a.js"),[])});jn({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>ie(()=>import("./bundle.a410d69a.js"),[])});jn({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>ie(()=>import("./bundle.0765aa28.js"),[])});jn({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>ie(()=>import("./bundle.dba4fa86.js"),[])});jn({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>ie(()=>import("./bundle.f18eed00.js"),[])});jn({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>ie(()=>import("./bundle.4b1a5b20.js"),[])});jn({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>ie(()=>import("./bundle.c70c4314.js"),[])});jn({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>ie(()=>import("./bundle.ff7f0401.js"),[])});jn({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>ie(()=>import("./bundle.3129e183.js"),[])});jn({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>ie(()=>import("./bundle.ac388b4d.js"),[])});jn({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>ie(()=>import("./bundle.049a8a6c.js"),[])});jn({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>ie(()=>import("./bundle.535d9fe2.js"),[])});jn({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>ie(()=>import("./bundle.3574a64f.js"),[]).then(n=>n.TagAutoInterpolationDollar)});jn({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>ie(()=>import("./bundle.3574a64f.js"),[]).then(n=>n.TagAngleInterpolationDollar)});jn({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>ie(()=>import("./bundle.3574a64f.js"),[]).then(n=>n.TagBracketInterpolationDollar)});jn({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>ie(()=>import("./bundle.3574a64f.js"),[]).then(n=>n.TagAngleInterpolationBracket)});jn({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>ie(()=>import("./bundle.3574a64f.js"),[]).then(n=>n.TagBracketInterpolationBracket)});jn({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>ie(()=>import("./bundle.3574a64f.js"),[]).then(n=>n.TagAutoInterpolationDollar)});jn({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>ie(()=>import("./bundle.3574a64f.js"),[]).then(n=>n.TagAutoInterpolationBracket)});jn({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>ie(()=>import("./bundle.d4bfa116.js"),[])});jn({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>ie(()=>import("./bundle.e5a73eb7.js"),[])});jn({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>ie(()=>import("./bundle.7f71598d.js"),[])});jn({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>ie(()=>import("./bundle.8b69c899.js"),[])});jn({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:()=>ie(()=>import("./bundle.12f37ec9.js"),[])});jn({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>ie(()=>import("./bundle.83ae2a3a.js"),[])});jn({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>ie(()=>import("./bundle.4806d9f5.js"),[])});jn({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>ie(()=>import("./bundle.e9b23ebd.js"),["bundle.e9b23ebd.js","bundle.31e0353c.js"])});jn({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>ie(()=>import("./bundle.334b5fb9.js"),[])});jn({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>ie(()=>import("./bundle.ed14cfc6.js"),[])});jn({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>ie(()=>import("./bundle.58d9b66b.js"),[])});jn({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>ie(()=>import("./bundle.8bf535e2.js"),[])});jn({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>ie(()=>import("./bundle.96829d0e.js"),[])});jn({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>ie(()=>import("./bundle.c1243f2d.js"),[])});jn({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>ie(()=>import("./bundle.815f612a.js"),[])});jn({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>ie(()=>import("./bundle.1cddbf33.js"),[])});jn({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>ie(()=>import("./bundle.b23daf51.js"),[])});jn({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>ie(()=>import("./bundle.361940ec.js"),[])});jn({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>ie(()=>import("./bundle.b98f6248.js"),[])});jn({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>ie(()=>import("./bundle.b4d05809.js"),[])});jn({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>ie(()=>import("./bundle.64e6f89b.js"),[])});jn({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>ie(()=>import("./bundle.e1cbffd7.js"),[])});jn({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>ie(()=>import("./bundle.013c6c0b.js"),[])});jn({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>ie(()=>import("./bundle.d9423546.js"),[])});jn({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>ie(()=>import("./bundle.423e077d.js"),[])});jn({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>ie(()=>import("./bundle.fb65b6b4.js"),[])});jn({id:"pla",extensions:[".pla"],loader:()=>ie(()=>import("./bundle.09e93e1b.js"),[])});jn({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>ie(()=>import("./bundle.429bd8e8.js"),[])});jn({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>ie(()=>import("./bundle.0470a494.js"),[])});jn({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>ie(()=>import("./bundle.b433b622.js"),[])});jn({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>ie(()=>import("./bundle.3e557056.js"),[])});jn({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>ie(()=>import("./bundle.b7980504.js"),[])});jn({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>ie(()=>import("./bundle.71b28cf0.js"),[])});jn({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>ie(()=>import("./bundle.eed62033.js"),[])});jn({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>ie(()=>import("./bundle.8ce27f67.js"),[])});jn({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>ie(()=>import("./bundle.7e94b473.js"),[])});jn({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>ie(()=>import("./bundle.aec7cdf4.js"),[])});jn({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>ie(()=>import("./bundle.7d933e7a.js"),[])});jn({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>ie(()=>import("./bundle.a9e4c4cc.js"),[])});jn({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>ie(()=>import("./bundle.c9974e35.js"),[])});jn({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>ie(()=>import("./bundle.9669a673.js"),[])});jn({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>ie(()=>import("./bundle.b221a0fc.js"),[])});jn({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:()=>ie(()=>import("./bundle.9222416a.js"),[])});jn({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>ie(()=>import("./bundle.86110af1.js"),[])});jn({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>ie(()=>import("./bundle.7da24d39.js"),[])});jn({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>ie(()=>import("./bundle.0ca4f4ad.js"),[])});jn({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>ie(()=>import("./bundle.0072896b.js"),[])});jn({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>ie(()=>import("./bundle.bc45fa87.js"),[])});jn({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>ie(()=>import("./bundle.28fc150c.js"),[])});jn({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>ie(()=>import("./bundle.96f7b353.js"),[])});jn({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>ie(()=>import("./bundle.c45997f6.js"),[])});jn({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>ie(()=>import("./bundle.3b85cc8e.js"),[])});jn({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>ie(()=>import("./bundle.2ec460af.js"),[])});jn({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>ie(()=>import("./bundle.2ec460af.js"),[])});jn({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>ie(()=>import("./bundle.37e129b8.js"),[])});jn({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>ie(()=>import("./bundle.1734ec31.js"),[])});jn({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>ie(()=>import("./bundle.31e0353c.js"),[])});jn({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>ie(()=>import("./bundle.77962f32.js"),[])});jn({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>ie(()=>import("./bundle.e67d25e4.js"),[])});jn({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:()=>ie(()=>import("./bundle.53fcdf92.js"),[])});jn({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>ie(()=>import("./bundle.c17d3786.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 __r=Object.defineProperty,v_r=Object.getOwnPropertyDescriptor,b_r=Object.getOwnPropertyNames,y_r=Object.prototype.hasOwnProperty,S4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of b_r(e))!y_r.call(n,r)&&r!==t&&__r(n,r,{get:()=>e[r],enumerable:!(i=v_r(e,r))||i.enumerable});return n},C_r=(n,e,t)=>(S4e(n,e,"default"),t&&S4e(t,e,"default")),fN={};C_r(fN,X6);var m1e=class{constructor(e,t,i){ia(this,"_onDidChange",new fN.Emitter);ia(this,"_options");ia(this,"_modeConfiguration");ia(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)}},_1e={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}},v1e={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},Snt=new m1e("css",_1e,v1e),Ent=new m1e("scss",_1e,v1e),xnt=new m1e("less",_1e,v1e);fN.languages.css={cssDefaults:Snt,lessDefaults:xnt,scssDefaults:Ent};function b1e(){return ie(()=>import("./bundle.07176fb4.js"),[])}fN.languages.onLanguage("less",()=>{b1e().then(n=>n.setupMode(xnt))});fN.languages.onLanguage("scss",()=>{b1e().then(n=>n.setupMode(Ent))});fN.languages.onLanguage("css",()=>{b1e().then(n=>n.setupMode(Snt))});/*!-----------------------------------------------------------------------------
* 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 w_r=Object.defineProperty,S_r=Object.getOwnPropertyDescriptor,E_r=Object.getOwnPropertyNames,x_r=Object.prototype.hasOwnProperty,E4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E_r(e))!x_r.call(n,r)&&r!==t&&w_r(n,r,{get:()=>e[r],enumerable:!(i=S_r(e,r))||i.enumerable});return n},T_r=(n,e,t)=>(E4e(n,e,"default"),t&&E4e(t,e,"default")),IY={};T_r(IY,X6);var k_r=class{constructor(e,t,i){ia(this,"_onDidChange",new IY.Emitter);ia(this,"_options");ia(this,"_modeConfiguration");ia(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)}},I_r={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"},LY={format:I_r,suggest:{},data:{useDefaultDataProvider:!0}};function DY(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===JM,documentFormattingEdits:n===JM,documentRangeFormattingEdits:n===JM}}var JM="html",x4e="handlebars",T4e="razor",Tnt=AY(JM,LY,DY(JM)),L_r=Tnt.defaults,knt=AY(x4e,LY,DY(x4e)),D_r=knt.defaults,Int=AY(T4e,LY,DY(T4e)),A_r=Int.defaults;IY.languages.html={htmlDefaults:L_r,razorDefaults:A_r,handlebarDefaults:D_r,htmlLanguageService:Tnt,handlebarLanguageService:knt,razorLanguageService:Int,registerHTMLLanguageService:AY};function R_r(){return ie(()=>import("./bundle.006606ec.js"),[])}function AY(n,e=LY,t=DY(n)){const i=new k_r(n,e,t);let r;const o=IY.languages.onLanguage(n,async()=>{r=(await R_r()).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 N_r=Object.defineProperty,O_r=Object.getOwnPropertyDescriptor,P_r=Object.getOwnPropertyNames,M_r=Object.prototype.hasOwnProperty,k4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of P_r(e))!M_r.call(n,r)&&r!==t&&N_r(n,r,{get:()=>e[r],enumerable:!(i=O_r(e,r))||i.enumerable});return n},F_r=(n,e,t)=>(k4e(n,e,"default"),t&&k4e(t,e,"default")),Z6={};F_r(Z6,X6);var B_r=class{constructor(e,t,i){ia(this,"_onDidChange",new Z6.Emitter);ia(this,"_diagnosticsOptions");ia(this,"_modeConfiguration");ia(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)}},$_r={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},V_r={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Lnt=new B_r("json",$_r,V_r);Z6.languages.json={jsonDefaults:Lnt};function H_r(){return ie(()=>import("./bundle.73850fcc.js"),[])}Z6.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Z6.languages.onLanguage("json",()=>{H_r().then(n=>n.setupMode(Lnt))});/*!-----------------------------------------------------------------------------
* 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 W_r=Object.defineProperty,z_r=Object.getOwnPropertyDescriptor,U_r=Object.getOwnPropertyNames,j_r=Object.prototype.hasOwnProperty,I4e=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of U_r(e))!j_r.call(n,r)&&r!==t&&W_r(n,r,{get:()=>e[r],enumerable:!(i=z_r(e,r))||i.enumerable});return n},q_r=(n,e,t)=>(I4e(n,e,"default"),t&&I4e(t,e,"default")),G_r="5.0.2",GA={};q_r(GA,X6);var Dnt=(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))(Dnt||{}),Ant=(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))(Ant||{}),Rnt=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(Rnt||{}),Nnt=(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))(Nnt||{}),Ont=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(Ont||{}),Pnt=class{constructor(n,e,t,i,r){ia(this,"_onDidChange",new GA.Emitter);ia(this,"_onDidExtraLibsChange",new GA.Emitter);ia(this,"_extraLibs");ia(this,"_removedExtraLibs");ia(this,"_eagerModelSync");ia(this,"_compilerOptions");ia(this,"_diagnosticsOptions");ia(this,"_workerOptions");ia(this,"_onDidExtraLibsChangeTimeout");ia(this,"_inlayHintsOptions");ia(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)}},K_r=G_r,Mnt={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},Fnt=new Pnt({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Mnt),Bnt=new Pnt({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Mnt),Y_r=()=>RY().then(n=>n.getTypeScriptWorker()),Q_r=()=>RY().then(n=>n.getJavaScriptWorker());GA.languages.typescript={ModuleKind:Dnt,JsxEmit:Ant,NewLineKind:Rnt,ScriptTarget:Nnt,ModuleResolutionKind:Ont,typescriptVersion:K_r,typescriptDefaults:Fnt,javascriptDefaults:Bnt,getTypeScriptWorker:Y_r,getJavaScriptWorker:Q_r};function RY(){return ie(()=>import("./bundle.8c5add99.js"),[])}GA.languages.onLanguage("typescript",()=>RY().then(n=>n.setupTypeScript(Fnt)));GA.languages.onLanguage("javascript",()=>RY().then(n=>n.setupJavaScript(Bnt)));class X_r extends up{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:T("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:jt.map,toggled:ht.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ht.has("isInDiffEditor"),menu:{when:ht.has("isInDiffEditor"),id:ue.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(pr),r=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}ys(X_r);class $nt extends up{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:T("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:ht.has("isInDiffEditor")})}run(e,...t){const i=e.get(pr),r=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",r)}}ys($nt);class Vnt extends up{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:T("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:ht.has("isInDiffEditor")})}run(e,...t){const i=e.get(pr),r=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}ys(Vnt);Sc.appendMenuItem(ue.EditorTitle,{command:{id:new Vnt().desc.id,title:T("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ht.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ht.has("isInDiffEditor")},order:11,group:"1_diff",when:ht.and(de.diffEditorRenderSideBySideInlineBreakpointReached,ht.has("isInDiffEditor"))});Sc.appendMenuItem(ue.EditorTitle,{command:{id:new $nt().desc.id,title:T("showMoves","Show Moved Code Blocks"),icon:jt.move,toggled:nN.create("config.diffEditor.experimental.showMoves",!0),precondition:ht.has("isInDiffEditor")},order:10,group:"1_diff",when:ht.has("isInDiffEditor")});const NY={value:T("diffEditor","Diff Editor"),original:"Diff Editor"};class Z_r extends Rv{constructor(){super({id:"diffEditor.switchSide",title:{value:T("switchSide","Switch Side"),original:"Switch Side"},icon:jt.arrowSwap,precondition:ht.has("isInDiffEditor"),f1:!0,category:NY})}runEditorCommand(e,t,i){const r=gN(e);if(r instanceof ak){if(i&&i.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}ys(Z_r);class J_r extends Rv{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:T("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:jt.close,precondition:de.comparingMovedCode,f1:!1,category:NY,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const r=gN(e);r instanceof ak&&r.exitCompareMove()}}ys(J_r);class evr extends Rv{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:T("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:jt.fold,precondition:ht.has("isInDiffEditor"),f1:!0,category:NY})}runEditorCommand(e,t,...i){const r=gN(e);r instanceof ak&&r.collapseAllUnchangedRegions()}}ys(evr);class tvr extends Rv{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:T("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:jt.unfold,precondition:ht.has("isInDiffEditor"),f1:!0,category:NY})}runEditorCommand(e,t,...i){const r=gN(e);r instanceof ak&&r.showAllUnchangedRegions()}}ys(tvr);const Hnt={value:T("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class pN extends up{constructor(){super({id:pN.id,title:{value:T("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:Hnt,precondition:ht.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=gN(e);t==null||t.accessibleDiffViewerNext()}}pN.id="editor.action.accessibleDiffViewer.next";Sc.appendMenuItem(ue.EditorTitle,{command:{id:pN.id,title:T("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ht.has("isInDiffEditor")},order:10,group:"2_diff",when:ht.and(de.accessibleDiffViewerVisible.negate(),ht.has("isInDiffEditor"))});class J6 extends up{constructor(){super({id:J6.id,title:{value:T("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:Hnt,precondition:ht.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=gN(e);t==null||t.accessibleDiffViewerPrev()}}J6.id="editor.action.accessibleDiffViewer.prev";function gN(n){var e;const t=n.get(io),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=Tm();if(o)for(const s of i){const a=s.getContainerDomNode();if(nvr(a,o))return s}return null}function nvr(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}yr.registerCommandAlias("editor.action.diffReview.next",pN.id);ys(pN);yr.registerCommandAlias("editor.action.diffReview.prev",J6.id);ys(J6);var ivr=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},rvr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},OY=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())})},Ide;const PY=new sn("selectionAnchorSet",!1);let E1=Ide=class{static get(e){return e.getContribution(Ide.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=PY.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(kn.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Kc().appendText(T("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),vu(T("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(kn.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()}};E1.ID="editor.contrib.selectionAnchorController";E1=Ide=ivr([rvr(1,bi)],E1);class ovr extends vn{constructor(){super({id:"editor.action.setSelectionAnchor",label:T("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2080),weight:100}})}run(e,t){var i;return OY(this,void 0,void 0,function*(){(i=E1.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class svr extends vn{constructor(){super({id:"editor.action.goToSelectionAnchor",label:T("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:PY})}run(e,t){var i;return OY(this,void 0,void 0,function*(){(i=E1.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class avr extends vn{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:T("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:PY,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2089),weight:100}})}run(e,t){var i;return OY(this,void 0,void 0,function*(){(i=E1.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class lvr extends vn{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:T("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:PY,kbOpts:{kbExpr:de.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return OY(this,void 0,void 0,function*(){(i=E1.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}Hr(E1.ID,E1,4);Pt(ovr);Pt(svr);Pt(avr);Pt(lvr);const cvr=fe("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},T("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class uvr extends vn{constructor(){super({id:"editor.action.jumpToBracket",label:T("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=km.get(t))===null||i===void 0||i.jumpToBracket()}}class dvr extends vn{constructor(){super({id:"editor.action.selectToBracket",label:T("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=km.get(t))===null||r===void 0||r.selectToBracket(o)}}class hvr extends vn{constructor(){super({id:"editor.action.removeBrackets",label:T("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=km.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class fvr{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class km extends qe{static get(e){return e.getContribution(km.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Mo(()=>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 kn(s.lineNumber,s.column,s.lineNumber,s.column):new kn(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(J.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 kn(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 f=e[d];f.isEmpty()&&(o[s++]=f.getStartPosition())}o.length>1&&o.sort(Re.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d<h;d++){const f=o[d];for(;c<u&&r[c].position.isBefore(f);)c++;if(c<u&&r[c].position.equals(f))a[l++]=r[c];else{let g=t.bracketPairs.matchBracket(f,20),m=km._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!g&&this._matchBrackets==="always"&&(g=t.bracketPairs.findEnclosingBrackets(f,20),m=km._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new fvr(f,g,m)}}this._lastBracketsData=a,this._lastVersionId=i}}km.ID="editor.contrib.bracketMatchingController";km._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Oi.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Ys(cvr),position:tp.Center}});km._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Oi.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});Hr(km.ID,km,1);Pt(dvr);Pt(uvr);Pt(hvr);Sc.appendMenuItem(ue.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:T({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class pvr{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 J(i,r-1,i,r),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new J(i,o,i,o),a)}else{const s=new J(i,o,i,o+1),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new J(i,r,i,r),a)}}computeCursorState(e,t){return this._isMovingLeft?new kn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new kn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class Wnt extends vn{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 pvr(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class gvr extends Wnt{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:T("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:de.writable})}}class mvr extends Wnt{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:T("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:de.writable})}}Pt(gvr);Pt(mvr);class _vr extends vn{constructor(){super({id:"editor.action.transposeLetters",label:T("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:de.writable,kbOpts:{kbExpr:de.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():lo.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),d=lo.leftPosition(i,u),h=lo.leftPosition(i,d),f=i.getValueInRange(J.fromPositions(h,d)),g=i.getValueInRange(J.fromPositions(d,u)),m=J.fromPositions(h,u);r.push(new Hc(m,g+f))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Pt(_vr);var vvr=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 ck="9_cutcopypaste",bvr=uv||document.queryCommandSupported("cut"),znt=uv||document.queryCommandSupported("copy"),yvr=typeof navigator.clipboard>"u"||mg?document.queryCommandSupported("paste"):!0;function y1e(n){return n.register(),n}const Cvr=bvr?y1e(new rN({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:uv?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:ue.MenubarEditMenu,group:"2_ccp",title:T({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:ue.EditorContext,group:ck,title:T("actions.clipboard.cutLabel","Cut"),when:de.writable,order:1},{menuId:ue.CommandPalette,group:"",title:T("actions.clipboard.cutLabel","Cut"),order:1},{menuId:ue.SimpleEditorContext,group:ck,title:T("actions.clipboard.cutLabel","Cut"),when:de.writable,order:1}]})):void 0,wvr=znt?y1e(new rN({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:uv?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:ue.MenubarEditMenu,group:"2_ccp",title:T({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:ue.EditorContext,group:ck,title:T("actions.clipboard.copyLabel","Copy"),order:2},{menuId:ue.CommandPalette,group:"",title:T("actions.clipboard.copyLabel","Copy"),order:1},{menuId:ue.SimpleEditorContext,group:ck,title:T("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Sc.appendMenuItem(ue.MenubarEditMenu,{submenu:ue.MenubarCopy,title:{value:T("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Sc.appendMenuItem(ue.EditorContext,{submenu:ue.EditorContextCopy,title:{value:T("copy as","Copy As"),original:"Copy As"},group:ck,order:3});Sc.appendMenuItem(ue.EditorContext,{submenu:ue.EditorContextShare,title:{value:T("share","Share"),original:"Share"},group:"11_share",order:-1,when:ht.and(ht.notEquals("resourceScheme","output"),de.editorTextFocus)});Sc.appendMenuItem(ue.EditorTitleContext,{submenu:ue.EditorTitleContextShare,title:{value:T("share","Share"),original:"Share"},group:"11_share",order:-1});Sc.appendMenuItem(ue.ExplorerContext,{submenu:ue.ExplorerContextShare,title:{value:T("share","Share"),original:"Share"},group:"11_share",order:-1});const hne=yvr?y1e(new rN({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:uv?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:ue.MenubarEditMenu,group:"2_ccp",title:T({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:ue.EditorContext,group:ck,title:T("actions.clipboard.pasteLabel","Paste"),when:de.writable,order:4},{menuId:ue.CommandPalette,group:"",title:T("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:ue.SimpleEditorContext,group:ck,title:T("actions.clipboard.pasteLabel","Paste"),when:de.writable,order:4}]})):void 0;class Svr extends vn{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:T("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(Nce.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Nce.forceCopyWithSyntaxHighlighting=!1)}}function Unt(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(io).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)=>(kK().execCommand(e),!0)))}Unt(Cvr,"cut");Unt(wvr,"copy");hne&&(hne.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(io),i=n.get(H1),r=t.getFocusedCodeEditor();return r&&r.hasTextFocus()?!r.getContainerDomNode().ownerDocument.execCommand("paste")&&sE?(()=>vvr(void 0,void 0,void 0,function*(){const s=yield i.readText();if(s!==""){const a=Y3.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}),hne.addImplementation(0,"generic-dom",(n,e)=>(kK().execCommand("paste"),!0)));znt&&Pt(Svr);var Evr=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 ci{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+ci.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new ci(this.value+ci.sep+e)}}ci.sep=".";ci.None=new ci("@@none@@");ci.Empty=new ci("");ci.QuickFix=new ci("quickfix");ci.Refactor=new ci("refactor");ci.RefactorExtract=ci.Refactor.append("extract");ci.RefactorInline=ci.Refactor.append("inline");ci.RefactorMove=ci.Refactor.append("move");ci.RefactorRewrite=ci.Refactor.append("rewrite");ci.Notebook=new ci("notebook");ci.Source=new ci("source");ci.SourceOrganizeImports=ci.Source.append("organizeImports");ci.SourceFixAll=ci.Source.append("fixAll");ci.SurroundWith=ci.Refactor.append("surround");var Xh;(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"})(Xh||(Xh={}));function xvr(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>jnt(e,t,n.include))||!n.includeSourceActions&&ci.Source.contains(e))}function Tvr(n,e){const t=e.kind?new ci(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>jnt(t,i,n.include))||!n.includeSourceActions&&t&&ci.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function jnt(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Tb{static fromUser(e,t){return!e||typeof e!="object"?new Tb(t.kind,t.apply,!1):new Tb(Tb.getKindFromUser(e,t.kind),Tb.getApplyFromUser(e,t.apply),Tb.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 ci(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 kvr{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return Evr(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){tl(r)}i&&(this.action.edit=i.edit)}return this})}}var vU=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 qnt="editor.action.codeAction",C1e="editor.action.quickFix",Gnt="editor.action.autoFix",Knt="editor.action.refactor",Ynt="editor.action.sourceAction",w1e="editor.action.organizeImports",S1e="editor.action.fixAll";class e4 extends qe{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return yu(e.diagnostics)?yu(t.diagnostics)?e4.codeActionsPreferredComparator(e,t):-1:yu(t.diagnostics)?1:e4.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(e4.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ci.QuickFix.contains(new ci(e.kind))&&!!e.isPreferred)}}const L4e={actions:[],documentation:void 0};function t4(n,e,t,i,r,o){var s;return vU(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],ci.Notebook]}),c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:i.type},u=new p1e(e,o),d=i.type===2,h=Ivr(n,e,d?l:a),f=new yt,g=h.map(v=>vU(this,void 0,void 0,function*(){try{r.report(v);const _=yield v.provideCodeActions(e,t,c,u.token);if(_&&f.add(_),u.token.isCancellationRequested)return L4e;const b=((_==null?void 0:_.actions)||[]).filter(C=>C&&Tvr(a,C)),y=Dvr(v,b,a.include);return{actions:b.map(C=>new kvr(C,v)),documentation:y}}catch(_){if(Av(_))throw _;return tl(_),L4e}})),m=n.onDidChange(()=>{const v=n.all(e);ka(v,h)||u.cancel()});try{const v=yield Promise.all(g),_=v.map(y=>y.actions).flat(),b=[...o0(v.map(y=>y.documentation)),...Lvr(n,e,i,_)];return new e4(_,b,f)}finally{m.dispose(),u.dispose()}})}function Ivr(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(r=>xvr(t,new ci(r))):!0)}function*Lvr(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 Dvr(n,e,t){if(!n.documentation)return;const i=n.documentation.map(r=>({kind:new ci(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 ci(r.kind)))return o.command}}var bU;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(bU||(bU={}));function Avr(n,e,t,i,r=or.None){var o;return vU(this,void 0,void 0,function*(){const s=n.get(H6),a=n.get(ga),l=n.get(dp),c=n.get(Wa);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!==bU.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=Rvr(u);c.error(typeof d=="string"?d:T("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function Rvr(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}yr.registerCommand("_executeCodeActionProvider",function(n,e,t,i,r){return vU(this,void 0,void 0,function*(){if(!(e instanceof Jn))throw ag();const{codeActionProvider:o}=n.get(wn),s=n.get(Ls).getModel(e);if(!s)throw ag();const a=kn.isISelection(t)?kn.liftSelection(t):J.isIRange(t)?s.validateRange(t):void 0;if(!a)throw ag();const l=typeof i=="string"?new ci(i):void 0,c=yield t4(o,s,a,{type:1,triggerAction:Xh.Default,filter:{includeSourceActions:!0,include:l}},Jy.None,or.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(or.None));try{return yield Promise.all(u),c.validActions.map(h=>h.action)}finally{setTimeout(()=>c.dispose(),100)}})});var Nvr=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},Ovr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Lde;let yU=Lde=class{constructor(e){this.keybindingService=e}getResolver(){const e=new cE(()=>this.keybindingService.getKeybindings().filter(t=>Lde.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===w1e?i={kind:ci.SourceOrganizeImports.value}:t.command===S1e&&(i={kind:ci.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Tb.fromUser(i,{kind:ci.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 ci(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)}};yU.codeActionCommands=[Knt,qnt,Ynt,w1e,S1e];yU=Lde=Nvr([Ovr(0,Go)],yU);fe("symbolIcon.arrayForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.booleanForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},T("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.colorForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.constantForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},T("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},T("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.fileForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.folderForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.keyForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.keywordForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},T("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.moduleForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.namespaceForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.nullForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.numberForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.objectForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.operatorForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.packageForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.propertyForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.referenceForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.snippetForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.stringForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.structForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.textForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.typeParameterForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.unitForeground",{dark:Bt,light:Bt,hcDark:Bt,hcLight:Bt},T("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));fe("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},T("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Qnt=Object.freeze({kind:ci.Empty,title:T("codeAction.widget.id.more","More Actions...")}),Pvr=Object.freeze([{kind:ci.QuickFix,title:T("codeAction.widget.id.quickfix","Quick Fix")},{kind:ci.RefactorExtract,title:T("codeAction.widget.id.extract","Extract"),icon:jt.wrench},{kind:ci.RefactorInline,title:T("codeAction.widget.id.inline","Inline"),icon:jt.wrench},{kind:ci.RefactorRewrite,title:T("codeAction.widget.id.convert","Rewrite"),icon:jt.wrench},{kind:ci.RefactorMove,title:T("codeAction.widget.id.move","Move"),icon:jt.wrench},{kind:ci.SurroundWith,title:T("codeAction.widget.id.surround","Surround With"),icon:jt.symbolSnippet},{kind:ci.Source,title:T("codeAction.widget.id.source","Source Action"),icon:jt.symbolFile},Qnt]);function Mvr(n,e,t){if(!e)return n.map(o=>{var s;return{kind:"action",item:o,group:Qnt,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=Pvr.map(o=>({group:o,actions:[]}));for(const o of n){const s=o.action.kind?new ci(o.action.kind):ci.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 Fvr=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},Bvr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Dde,xL;(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})(xL||(xL={}));let uk=Dde=class extends qe{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new De),this.onClick=this._onClick.event,this._state=xL.Hidden,this._domNode=Rt("div.lightBulbWidget"),this._register(Yo.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(AZi(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:r,height:o}=pl(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(at(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(on.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,r,o,s;this._preferredKbLabel=(r=(i=t.lookupKeybinding(Gnt))===null||i===void 0?void 0:i.getLabel())!==null&&r!==void 0?r:void 0,this._quickFixKbLabel=(s=(o=t.lookupKeybinding(C1e))===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=YK(u,l),h=c.spaceWidth*d>22,f=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new xL.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:Dde._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==xL.Hidden&&(this.state=xL.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(...ei.asClassNameArray(jt.lightBulb)),this._domNode.classList.add(...ei.asClassNameArray(jt.lightbulbAutofix)),this._preferredKbLabel)){this.title=T("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...ei.asClassNameArray(jt.lightbulbAutofix)),this._domNode.classList.add(...ei.asClassNameArray(jt.lightBulb)),this._quickFixKbLabel?this.title=T("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=T("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};uk.ID="editor.contrib.lightbulbWidget";uk._posPref=[0];uk=Dde=Fvr([Bvr(1,Go)],uk);var $vr=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},D4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Xnt=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())})},Ade;let x1=Ade=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new De,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new yt,o=r.add(aY(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)=>Xnt(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=jf);const c=yield clr(this._languageService,r,l),u=document.createElement("span");if(u.innerHTML=(a=(s=Ade._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);Zc(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=>Znt(this._openerService,i,e.isTrusted),disposables:t}}}};x1._ttpTokenizer=M1("tokenizeToString",{createHTML(n){return n}});x1=Ade=$vr([D4e(1,Es),D4e(2,nf)],x1);function Znt(n,e,t){return Xnt(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Vvr(t)})}catch(i){return Pi(i),!1}})}function Vvr(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var Hvr=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},A4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},_V;let jh=_V=class{static get(e){return e.getContribution(_V.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ac,this._messageListeners=new yt,this._mouseOverMessage=!1,this._editor=e,this._visible=_V.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){vu(zw(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=zw(e)?aY(e,{actionHandler:{callback:r=>Znt(this._openerService,r,zw(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new R4e(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(on.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Qc(Tm(),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(at(this._messageWidget.value.getDomNode(),Xt.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(at(this._messageWidget.value.getDomNode(),Xt.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 J(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(R4e.fadeOut(this._messageWidget.value))}};jh.ID="editor.contrib.messageController";jh.MESSAGE_VISIBLE=new sn("messageVisible",!1,T("messageVisible","Whether the editor is currently showing an inline message"));jh=_V=Hvr([A4e(1,bi),A4e(2,nf)],jh);const Wvr=oc.bindToContribution(jh.get);qt(new Wvr({id:"leaveEditorMessage",precondition:jh.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let R4e=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)}};Hr(jh.ID,jh,4);var Jnt=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},Rde=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},zvr=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 eit="acceptSelectedCodeAction",tit="previewSelectedCodeAction";class Uvr{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 Nde=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 q6(e,Of);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=ei.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=an(e.group.icon.color.id))):(i.icon.className=ei.asClassName(jt.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=nit(e.label),i.keybinding.set(e.keybinding),WZi(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(eit))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(tit))===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=T({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=T({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};Nde=Jnt([Rde(1,Go)],Nde);class jvr extends UIEvent{constructor(){super("acceptSelectedAction")}}class N4e extends UIEvent{constructor(){super("previewSelectedAction")}}function qvr(n){if(n.kind==="action")return n.label}let Ode=class extends qe{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 $a),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 i_(e,this.domNode,a,[new Nde(t,this._keybindingService),new Uvr],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:qvr},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?nit(l==null?void 0:l.label):"";return l.disabled&&(c=T({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>T({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(rI),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 N4e:new jvr;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 N4e):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 zvr(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([])}};Ode=Jnt([Rde(4,B1),Rde(5,Go)],Ode);function nit(n){return n.replace(/\r\n|\r|\n/g," ")}var Gvr=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)}};fe("actionBar.toggledBackground",{dark:Ux,light:Ux,hcDark:Ux,hcLight:Ux},T("actionBar.toggledBackground","Background color for toggled action items in action bar."));const dk={Visible:new sn("codeActionMenuVisible",!1,T("codeActionMenuVisible","Whether the action widget list is visible"))},cI=lr("actionWidgetService");let hk=class extends qe{get isVisible(){return dk.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ac)}show(e,t,i,r,o,s,a){const l=dk.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Ode,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 yt,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(at(l,Xt.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(at(u,Xt.POINTER_MOVE,()=>u.remove())),s.add(at(u,Xt.MOUSE_DOWN,()=>u.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(l0(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const i=Rt(e),r=new wg(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)}};hk=Gvr([fne(0,B1),fne(1,bi),fne(2,pi)],hk);Cr(cI,hk,1);const eB=100+1e3;ys(class extends up{constructor(){super({id:"hideCodeActionWidget",title:{value:T("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:dk.Visible,keybinding:{weight:eB,primary:9,secondary:[1033]}})}run(n){n.get(cI).hide()}});ys(class extends up{constructor(){super({id:"selectPrevCodeAction",title:{value:T("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:dk.Visible,keybinding:{weight:eB,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(cI);e instanceof hk&&e.focusPrevious()}});ys(class extends up{constructor(){super({id:"selectNextCodeAction",title:{value:T("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:dk.Visible,keybinding:{weight:eB,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(cI);e instanceof hk&&e.focusNext()}});ys(class extends up{constructor(){super({id:eit,title:{value:T("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:dk.Visible,keybinding:{weight:eB,primary:3,secondary:[2137]}})}run(n){const e=n.get(cI);e instanceof hk&&e.acceptSelected()}});ys(class extends up{constructor(){super({id:tit,title:{value:T("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:dk.Visible,keybinding:{weight:eB,primary:2051}})}run(n){const e=n.get(cI);e instanceof hk&&e.acceptSelected(!0)}});var Kvr=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 iit=new sn("supportedCodeAction","");class Yvr extends qe{constructor(e,t,i,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=r,this._autoTriggerTimer=this._register(new Jm),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=>iye(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Xh.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 Ix;(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(Av(s))return rit;throw s})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(Ix||(Ix={}));const rit=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class Qvr extends qe{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 Ac),this._state=Ix.Empty,this._onDidChangeState=this._register(new De),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=iit.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(Ix.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(Ix.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 Yvr(this._editor,this._markerService,i=>{var r;if(!i){this.setState(Ix.Empty);return}const o=i.selection.getStartPosition(),s=Sl(a=>Kvr(this,void 0,void 0,function*(){var l,c,u,d,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Xh.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(ci.QuickFix))){const g=yield t4(this._registry,e,i.selection,i.trigger,Jy.None,a);if(a.isCancellationRequested)return rit;if(!((u=g.validActions)===null||u===void 0?void 0:u.some(v=>v.action.kind?ci.QuickFix.contains(new ci(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const _=i.selection.getPosition();let b=_,y=Number.MAX_VALUE,C=!1;for(const E of v){const x=E.endColumn,k=E.endLineNumber,L=E.startLineNumber;(k===_.lineNumber||L===_.lineNumber)&&Math.abs(_.column-x)<y&&(y=Math.abs(_.column-x),C=!0,b=new Re(k,x))}if(C){const E={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:ci.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((f=i.trigger.context)===null||f===void 0?void 0:f.notAvailableMessage)||"",position:b}},x=new kn(b.lineNumber,b.column,b.lineNumber,b.column),k=yield t4(this._registry,e,x,E,Jy.None,a),L=[...g.validActions];return k.validActions.length!==0&&(k.validActions.forEach(D=>{D.highlightRange=D.action.isPreferred}),L.push(...k.validActions)),{validActions:L,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return t4(this._registry,e,i.selection,i.trigger,Jy.None,a)}));i.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new Ix.Triggered(i.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Xh.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 Xvr=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},J0=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HO=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())})},vV;const Zvr="quickfix-edit-highlight";let LS=vV=class extends qe{static get(e){return e.getContribution(vV.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 Ac),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Qvr(this._editor,o.codeActionProvider,t,i,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new cE(()=>{const d=this._editor.getContribution(uk.ID);return d&&this._register(d.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),d}),this._resolver=r.createInstance(yU),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=jh.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 HO(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(Avr,e,bU.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Xh.QuickFix,filter:{}})}})}update(e){var t,i,r,o,s,a,l;return HO(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){Pi(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=jh.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=jh.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 HO(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=Re.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,u)=>HO(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)=>HO(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:vV.DECORATION}];r.set(h);const f=c.action.diagnostics[0],g=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||d===void 0?void 0:d.word;wS(T("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Mvr(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=pl(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:T("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:T("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),r}};LS.ID="editor.contrib.codeActionController";LS.DECORATION=Oi.register({description:"quickfix-highlight",className:Zvr});LS=vV=Xvr([J0(1,D0),J0(2,bi),J0(3,pi),J0(4,wn),J0(5,fE),J0(6,ga),J0(7,pr),J0(8,cI),J0(9,pi)],LS);t_((n,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor($b));const i=n.getColor(sw);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${pv(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function tB(n){return ht.regex(iit.keys()[0],new RegExp("(\\s|^)"+ep(n.value)+"\\b"))}const E1e={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:T("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:T("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[T("args.schema.apply.first","Always apply the first returned code action."),T("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),T("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:T("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function uI(n,e,t,i,r=Xh.Default){if(n.hasModel()){const o=LS.get(n);o==null||o.manualTriggerAtCurrentPosition(e,r,t,i)}}class Jvr extends vn{constructor(){super({id:C1e,label:T("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ht.and(de.writable,de.hasCodeActionsProvider),kbOpts:{kbExpr:de.textInputFocus,primary:2137,weight:100}})}run(e,t){return uI(t,T("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Xh.QuickFix)}}class ebr extends oc{constructor(){super({id:qnt,precondition:ht.and(de.writable,de.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:E1e}]}})}runEditorCommand(e,t,i){const r=Tb.fromUser(i,{kind:ci.Empty,apply:"ifSingle"});return uI(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?T("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):T("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):r.preferred?T("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):T("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class tbr extends vn{constructor(){super({id:Knt,label:T("refactor.label","Refactor..."),alias:"Refactor...",precondition:ht.and(de.writable,de.hasCodeActionsProvider),kbOpts:{kbExpr:de.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ht.and(de.writable,tB(ci.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:E1e}]}})}run(e,t,i){const r=Tb.fromUser(i,{kind:ci.Refactor,apply:"never"});return uI(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?T("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):T("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):r.preferred?T("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):T("editor.action.refactor.noneMessage","No refactorings available"),{include:ci.Refactor.contains(r.kind)?r.kind:ci.None,onlyIncludePreferredActions:r.preferred},r.apply,Xh.Refactor)}}class nbr extends vn{constructor(){super({id:Ynt,label:T("source.label","Source Action..."),alias:"Source Action...",precondition:ht.and(de.writable,de.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ht.and(de.writable,tB(ci.Source))},description:{description:"Source Action...",args:[{name:"args",schema:E1e}]}})}run(e,t,i){const r=Tb.fromUser(i,{kind:ci.Source,apply:"never"});return uI(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?T("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):T("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):r.preferred?T("editor.action.source.noneMessage.preferred","No preferred source actions available"):T("editor.action.source.noneMessage","No source actions available"),{include:ci.Source.contains(r.kind)?r.kind:ci.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Xh.SourceAction)}}class ibr extends vn{constructor(){super({id:w1e,label:T("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ht.and(de.writable,tB(ci.SourceOrganizeImports)),kbOpts:{kbExpr:de.textInputFocus,primary:1581,weight:100}})}run(e,t){return uI(t,T("editor.action.organize.noneMessage","No organize imports action available"),{include:ci.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Xh.OrganizeImports)}}class rbr extends vn{constructor(){super({id:S1e,label:T("fixAll.label","Fix All"),alias:"Fix All",precondition:ht.and(de.writable,tB(ci.SourceFixAll))})}run(e,t){return uI(t,T("fixAll.noneMessage","No fix all action available"),{include:ci.SourceFixAll,includeSourceActions:!0},"ifSingle",Xh.FixAll)}}class obr extends vn{constructor(){super({id:Gnt,label:T("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ht.and(de.writable,tB(ci.QuickFix)),kbOpts:{kbExpr:de.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return uI(t,T("editor.action.autoFix.noneMessage","No auto fixes available"),{include:ci.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Xh.AutoFix)}}Hr(LS.ID,LS,3);Hr(uk.ID,uk,4);Pt(Jvr);Pt(tbr);Pt(nbr);Pt(ibr);Pt(obr);Pt(rbr);qt(new ebr);Hs.as(Nv.Configuration).registerConfiguration(Object.assign(Object.assign({},nY),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:T("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));Hs.as(Nv.Configuration).registerConfiguration(Object.assign(Object.assign({},nY),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:T("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var O4e=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 Pde{constructor(){this.lenses=[],this._disposables=new yt}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 oit(n,e,t){return O4e(this,void 0,void 0,function*(){const i=n.ordered(e),r=new Map,o=new Pde,s=i.map((a,l)=>O4e(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){tl(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})}yr.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;ko(Jn.isUri(t)),ko(typeof i=="number"||!i);const{codeLensProvider:r}=n.get(wn),o=n.get(Ls).getModel(t);if(!o)throw ag();const s=[],a=new yt;return oit(r,o,or.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,or.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var sbr=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},abr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const sit=lr("ICodeLensCache");class P4e{constructor(e,t){this.lineCount=e,this.data=t}}let Mde=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new uE(20,.75);const t="codelens/cache";My(()=>e.remove(t,1));const i="codelens/cache2",r=e.get(i,1,"{}");this._deserialize(r),on.once(e.onWillSaveState)(o=>{o.reason===qz.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 Pde;r.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new P4e(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 J(a,1,a,11)});const s=new Pde;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new P4e(r.lineCount,s))}}catch{}}};Mde=sbr([abr(0,r_)],Mde);Cr(sit,Mde,1);class lbr{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 MY{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${MY._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=Uw(s.command.title.trim());s.command.id?(i.push(Rt("a",{id:String(o),title:s.command.tooltip,role:"button"},...a)),this._commands.set(String(o),s.command)):i.push(Rt("span",{title:s.command.tooltip},...a)),o+1<e.length&&i.push(Rt("span",void 0," | "))}}r?(Ic(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Ic(this._domNode,Rt("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}}MY._idPool=0;class pne{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 M4e=Oi.register({collapseOnReplaceEdit:!0,description:"codelens"});class F4e{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:M4e},d=>this._decorationIds[u]=d),a?a=J.plusRange(a,c.symbol.range):a=J.lift(c.symbol.range)}),this._viewZone=new lbr(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 MY(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&&J.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:M4e},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 cbr=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},WO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ait=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 KA=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 yt,this._localToDispose=new yt,this._lenses=[],this._oldCodeLensModels=new yt,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Mo(()=>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",zh.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(bS(()=>{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 Mo(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=Sl(s=>oit(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()},Pi)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(_i(()=>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 pne;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(_i(()=>{if(this._editor.getModel()){const r=Ev.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 pne;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=Ev.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new pne;let u=0,d=0;for(;d<i.length&&u<this._lenses.length;){const h=i[d][0].symbol.range.startLineNumber,f=this._lenses[u].getLineNumber();f<h?(this._lenses[u].dispose(c,l),this._lenses.splice(u,1)):f===h?(this._lenses[u].updateCodeLensSymbols(i[d],c),d++,u++):(this._lenses.splice(u,0,new F4e(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 F4e(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=Sl(a=>{const l=i.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(m=>{d[g]=m},tl):(d[g]=f.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=>{Pi(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return ait(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})}};KA.ID="css.editor.codeLens";KA=cbr([WO(1,wn),WO(2,Ag),WO(3,ga),WO(4,Wa),WO(5,sit)],KA);Hr(KA.ID,KA,1);Pt(class extends vn{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:de.hasCodeLensProvider,label:T("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return ait(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Ov),r=e.get(ga),o=e.get(Wa),s=t.getSelection().positionLineNumber,a=t.getContribution(KA.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:T("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=yield a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var m;return g.symbol.range.startLineNumber===s&&((m=g.symbol.command)===null||m===void 0?void 0:m.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{yield r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}})}});var ubr=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},gne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dbr=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 x1e{constructor(e,t){this._editorWorkerClient=new R0e(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return dbr(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 je(new vr(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?je.Format.CSS.formatRGB(a):je.Format.CSS.formatRGBA(a),c=s?je.Format.CSS.formatHSL(a):je.Format.CSS.formatHSLA(a),u=s?je.Format.CSS.formatHex(a):je.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 Fde=class extends qe{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new x1e(e,t)))}};Fde=ubr([gne(0,Ls),gne(1,es),gne(2,wn)],Fde);wY(Fde);var nB=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 lit(n,e,t,i=!0){return nB(this,void 0,void 0,function*(){return T1e(new hbr,n,e,t,i)})}function cit(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class hbr{constructor(){}compute(e,t,i,r){return nB(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 fbr{constructor(){}compute(e,t,i,r){return nB(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 pbr{constructor(e){this.colorInfo=e}compute(e,t,i,r){return nB(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(t,this.colorInfo,or.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)})}}function T1e(n,e,t,i,r){return nB(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 x1e)s=u;else try{(yield n.compute(u,t,i,a))&&(o=!0)}catch(d){tl(d)}}return o?a:s&&r?(yield n.compute(s,t,i,a),a):[]})}function uit(n,e){const{colorProvider:t}=n.get(wn),i=n.get(Ls).getModel(e);if(!i)throw ag();const r=n.get(pr).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}yr.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof Jn))throw ag();const{model:i,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=uit(n,t);return T1e(new fbr,r,i,or.None,o)});yr.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:r,range:o}=i;if(!(r instanceof Jn)||!Array.isArray(t)||t.length!==4||!J.isIRange(o))throw ag();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=uit(n,r),[c,u,d,h]=t;return T1e(new pbr({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,or.None,l)});var gbr=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},mne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},B4e=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())})},Bde;const dit=Object.create({});let DS=Bde=class extends qe{constructor(e,t,i,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new yt),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new R6(this._editor),this._decoratorLimitReporter=new mbr,this._colorDecorationClassRefs=this._register(new yt),this._debounceInformation=r.for(i.colorProvider,"Document Colors",{min:Bde.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 Jm,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return B4e(this,void 0,void 0,function*(){this._computePromise=Sl(e=>B4e(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new wu(!1),r=yield lit(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){Pi(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:Oi.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 vr(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:UXe,inlineClassName:`${h.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:dit}}})}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(J.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)}};DS.ID="editor.contrib.colorDetector";DS.RECOMPUTE_TIME=1e3;DS=Bde=gbr([mne(1,pr),mne(2,wn),mne(3,Ag)],DS);class mbr{constructor(){this._onDidChange=new De,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}Hr(DS.ID,DS,1);class _br{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 De,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new De,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new De,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 If=Rt;class vbr extends qe{constructor(e,t,i,r=!1){super(),this.model=t,this.showingStandaloneColorPicker=r,this._closeButton=null,this._domNode=If(".colorpicker-header"),ft(e,this._domNode),this._pickedColorNode=ft(this._domNode,If(".picked-color")),ft(this._pickedColorNode,If("span.codicon.codicon-color-mode")),this._pickedColorPresentation=ft(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=T("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=ft(this._domNode,If(".original-color")),this._originalColorNode.style.backgroundColor=je.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(_z)||je.white,this._register(i.onDidColorThemeChange(s=>{this.backgroundColor=s.getColor(_z)||je.white})),this._register(at(this._pickedColorNode,Xt.CLICK,()=>this.model.selectNextColorPresentation())),this._register(at(this._originalColorNode,Xt.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=je.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 bbr(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=je.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 bbr extends qe{constructor(e){super(),this._onClicked=this._register(new De),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ft(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ft(this._button,t),ft(t,If(".button"+ei.asCSSSelector(La("color-picker-close",jt.close,T("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class ybr extends qe{constructor(e,t,i,r=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=If(".colorpicker-body"),ft(e,this._domNode),this._saturationBox=new Cbr(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 wbr(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 Sbr(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 Ebr(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 je(new Nb(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new je(new Nb(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new je(new Nb(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 Cbr extends qe{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new De,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new De,this.onColorFlushed=this._onColorFlushed.event,this._domNode=If(".saturation-wrap"),ft(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ft(this._domNode,this._canvas),this.selection=If(".saturation-selection"),ft(this._domNode,this.selection),this.layout(),this._register(at(this._domNode,Xt.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 aN);const t=pl(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=at(e.target.ownerDocument,Xt.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 je(new Nb(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=je.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 hit extends qe{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new De,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new De,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=ft(e,If(".standalone-strip")),this.overlay=ft(this.domNode,If(".standalone-overlay"))):(this.domNode=ft(e,If(".strip")),this.overlay=ft(this.domNode,If(".overlay"))),this.slider=ft(this.domNode,If(".slider")),this.slider.style.top="0px",this._register(at(this.domNode,Xt.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 aN),i=pl(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=at(e.target.ownerDocument,Xt.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 wbr extends hit{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 je(new vr(t,i,r,1)),s=new je(new vr(t,i,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class Sbr extends hit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Ebr extends qe{constructor(e){super(),this._onClicked=this._register(new De),this.onClicked=this._onClicked.event,this._button=ft(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 xbr extends e_{constructor(e,t,i,r,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(L3.onDidChange(()=>this.layout()));const s=If(".colorpicker-widget");e.appendChild(s),this.header=this._register(new vbr(s,this.model,r,o)),this.body=this._register(new ybr(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var fit=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},pit=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},YA=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 Tbr{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 CU=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Ka.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return YA(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const r=DS.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 git(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return mit(this,this._editor,this._themeService,t,e)}};CU=fit([pit(1,Vl)],CU);class kbr{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r}}let k5=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return YA(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!DS.get(this._editor))return null;const o=yield lit(i,this._editor.getModel(),or.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;J.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:yield git(this,this._editor.getModel(),l,c),foundInEditor:u}})}updateEditorModel(e){return YA(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new J(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield bV(this._editor.getModel(),t,this._color,i,e),i=_it(this._editor,i,t))})}renderHoverParts(e,t){return mit(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};k5=fit([pit(1,Vl)],k5);function git(n,e,t,i){return YA(this,void 0,void 0,function*(){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new vr(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new je(c),d=yield cit(e,t,i,or.None),h=new _br(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),n instanceof CU?new Tbr(n,J.lift(t.range),h,i):new kbr(n,J.lift(t.range),h,i)})}function mit(n,e,t,i,r){if(i.length===0||!e.hasModel())return qe.None;if(r.setMinimumDimensions){const h=e.getOption(66)+8;r.setMinimumDimensions(new Kr(302,h))}const o=new yt,s=i[0],a=e.getModel(),l=s.model,c=o.add(new xbr(r.fragment,l,e.getOption(141),t,n instanceof k5));r.setColorPicker(c);let u=!1,d=new J(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(n instanceof k5){const h=i[0].model.color;n.color=h,bV(a,l,h,d,s),o.add(l.onColorFlushed(f=>{n.color=f}))}else o.add(l.onColorFlushed(h=>YA(this,void 0,void 0,function*(){yield bV(a,l,h,d,s),u=!0,d=_it(e,d,l,r)})));return o.add(l.onDidChangeColor(h=>{bV(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function _it(n,e,t,i){let r,o;if(t.presentation.textEdit){r=[t.presentation.textEdit],o=new J(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 bV(n,e,t,i,r){return YA(this,void 0,void 0,function*(){const o=yield cit(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,or.None);e.colorPresentations=o||[]})}function $de(n,e){return!!n[e]}class _ne{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=$de(e.event,t.triggerModifier),this.hasSideBySideModifier=$de(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class $4e{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=$de(e,t.triggerModifier)}}class y7{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 V4e(n){return n==="altKey"?br?new y7(57,"metaKey",6,"altKey"):new y7(5,"ctrlKey",6,"altKey"):br?new y7(6,"altKey",57,"metaKey"):new y7(6,"altKey",5,"ctrlKey")}class FY extends qe{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new De),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new De),this.onExecute=this._onExecute.event,this._onCancel=this._register(new De),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=V4e(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=V4e(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 _ne(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new _ne(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new _ne(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new $4e(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new $4e(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 Ibr=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 AS=class extends FA{constructor(e,t,i,r,o,s,a,l,c,u,d,h,f){super(e,Object.assign(Object.assign({},r.getRawOptions()),{overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()}),i,o,s,a,l,c,u,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){fK(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};AS=Ibr([ey(4,pi),ey(5,io),ey(6,ga),ey(7,bi),ey(8,Vl),ey(9,Wa),ey(10,F1),ey(11,es),ey(12,wn)],AS);const H4e=new je(new vr(0,122,204)),Lbr={showArrow:!0,showFrame:!0,className:"",frameColor:H4e,arrowColor:H4e,keepEditorSelection:!1},Dbr="vs.editor.contrib.zoneWidget";class Abr{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 Rbr{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class BY{constructor(e){this._editor=e,this._ruleName=BY._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),NNe(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(){NNe(this._ruleName),dce(`.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:J.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}BY._IdGenerator=new Rye(".arrow-decoration-");class Nbr{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new yt,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=gy(t),fK(this.options,Lbr,!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 BY(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=J.isIRange(e)?J.lift(e):J.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Oi.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 Abr(s,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new Rbr(Dbr+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 J(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 cu(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 vit=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},bit=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const yit=lr("IPeekViewService");Cr(yit,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 dh;(function(n){n.inPeekEditor=new sn("inReferenceSearchEditor",!0,T("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(dh||(dh={}));let I5=class{constructor(e,t){e instanceof AS&&dh.inPeekEditor.bindTo(t)}dispose(){}};I5.ID="editor.contrib.referenceController";I5=vit([bit(1,bi)],I5);Hr(I5.ID,I5,0);function Obr(n){const e=n.get(io).getFocusedCodeEditor();return e instanceof AS?e.getParentEditor():e}const Pbr={headerBackgroundColor:je.white,primaryHeadingColor:je.fromHex("#333333"),secondaryHeadingColor:je.fromHex("#6c6c6cb3")};let wU=class extends Nbr{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new De,this.onDidClose=this._onDidClose.event,fK(this.options,Pbr,!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=Rt(".head"),this._bodyElement=Rt(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=Rt(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Ba(this._titleElement,"click",o=>this._onTitleClick(o))),ft(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=Rt("span.filename"),this._secondaryHeading=Rt("span.dirname"),this._metaHeading=Rt("span.meta"),ft(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=Rt(".peekview-actions");ft(this._headElement,i);const r=this._getActionBarOptions();this._actionbarWidget=new wg(i,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Nd("peekview.close",T("label.close","Close"),ei.asClassName(jt.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Kdr.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:kc(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Ph(this._metaHeading)):md(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`)}};wU=vit([bit(2,pi)],wU);const Mbr=fe("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:je.black,hcLight:je.white},T("peekViewTitleBackground","Background color of the peek view title area.")),Cit=fe("peekViewTitleLabel.foreground",{dark:je.white,light:je.black,hcDark:je.white,hcLight:mm},T("peekViewTitleForeground","Color of the peek view title.")),wit=fe("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},T("peekViewTitleInfoForeground","Color of the peek view title info.")),Fbr=fe("peekView.border",{dark:sh,light:sh,hcDark:fr,hcLight:fr},T("peekViewBorder","Color of the peek view borders and arrow.")),Bbr=fe("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:je.black,hcLight:je.white},T("peekViewResultsBackground","Background color of the peek view result list."));fe("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:je.white,hcLight:mm},T("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));fe("peekViewResult.fileForeground",{dark:je.white,light:"#1E1E1E",hcDark:je.white,hcLight:mm},T("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));fe("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},T("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));fe("peekViewResult.selectionForeground",{dark:je.white,light:"#6C6C6C",hcDark:je.white,hcLight:mm},T("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const hw=fe("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:je.black,hcLight:je.white},T("peekViewEditorBackground","Background color of the peek view editor."));fe("peekViewEditorGutter.background",{dark:hw,light:hw,hcDark:hw,hcLight:hw},T("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));fe("peekViewEditorStickyScroll.background",{dark:hw,light:hw,hcDark:hw,hcLight:hw},T("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));fe("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},T("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));fe("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},T("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));fe("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:vs,hcLight:vs},T("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var $br=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 RS{constructor(e,t,i,r){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=r,this.id=wue.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?T({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,Cg(this.uri),this.range.startLineNumber,this.range.startColumn):T("aria.oneReference","in {0} on line {1} at column {2}",Cg(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Vbr{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 J(r,l.startColumn,r,o),u=new J(s,a,s,1073741824),d=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class L5{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new gu}dispose(){_o(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?T("aria.fileReferences.1","1 symbol in {0}, full path {1}",Cg(this.uri),this.uri.fsPath):T("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Cg(this.uri),this.uri.fsPath)}resolve(e){return $br(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 Vbr(i))}catch(i){Pi(i)}return this})}}class qh{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new De,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(qh._compareReferences);let r;for(const o of e)if((!r||!bs.isEqual(r.uri,o.uri,!0))&&(r=new L5(this,o.uri),this.groups.push(r)),r.children.length===0||qh._compareReferences(o,r.children[r.children.length-1])!==0){const s=new RS(i===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){_o(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new qh(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?T("aria.result.0","No results found"):this.references.length===1?T("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?T("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):T("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:KT(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()&&J.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 bs.compare(e.uri,t.uri)||J.compareRangesUsingStarts(e.range,t.range)}}var $Y=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},VY=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Vde;let Hde=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof qh||e instanceof L5}getChildren(e){if(e instanceof qh)return e.groups;if(e instanceof L5)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Hde=$Y([VY(0,vh)],Hde);class Hbr{getHeight(){return 23}getTemplateId(e){return e instanceof L5?D5.id:iB.id}}let Wde=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof RS){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Cg(e.uri)}};Wde=$Y([VY(0,Go)],Wde);class Wbr{getId(e){return e instanceof RS?e.id:e.uri}}let zde=class extends qe{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new sU(i,{supportHighlights:!0})),this.badge=new que(ft(i,Rt(".count")),{},Yet),e.appendChild(i)}set(e,t){const i=XK(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(T("referencesCount","{0} references",r)):this.badge.setTitleFormat(T("referenceCount","{0} reference",r))}};zde=$Y([VY(1,BA)],zde);let D5=Vde=class{constructor(e){this._instantiationService=e,this.templateId=Vde.id}renderTemplate(e){return this._instantiationService.createInstance(zde,e)}renderElement(e,t,i){i.set(e.element,W6(e.filterData))}disposeTemplate(e){e.dispose()}};D5.id="FileReferencesRenderer";D5=Vde=$Y([VY(0,pi)],D5);class zbr{constructor(e){this.label=new qw(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(`${Cg(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!gv.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,W6(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class iB{constructor(){this.templateId=iB.id}renderTemplate(e){return new zbr(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}iB.id="OneReferenceRenderer";class Ubr{getWidgetAriaLabel(){return T("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var jbr=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)}},W4e=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 HY{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new yt,this._callOnModelChange=new yt,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:HY.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(!J.equalsRange(o,r.range)){if(J.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()}}HY.DecorationOptions=Oi.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class qbr{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 Gbr extends Wue{}let Ude=class extends wU{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 yt,this._callOnDispose=new yt,this._onDidSelectReference=new De,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Kr(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(),_o(this._preview),_o(this._previewNotAvailableMessage),_o(this._tree),_o(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Fbr)||je.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Mbr)||je.transparent,primaryHeadingColor:e.getColor(Cit),secondaryHeadingColor:e.getColor(wit)})}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=ft(e,Rt("div.messages")),md(this._messageContainer),this._splitView=new ttt(e,{orientation:1}),this._previewContainer=ft(e,Rt("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(AS,this._previewContainer,t,{},this.editor),md(this._previewContainer),this._previewNotAvailableMessage=new h0(T("missingPreviewMessage","no preview available"),jf,h0.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=ft(e,Rt("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new Ubr,keyboardNavigationLabelProvider:this._instantiationService.createInstance(Wde),identityProvider:new Wbr,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Bbr}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Ba(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Gbr,"ReferencesWidget",this._treeContainer,new Hbr,[this._instantiationService.createInstance(D5),this._instantiationService.createInstance(iB)],this._instantiationService.createInstance(Hde),i),this._splitView.addView({onDidChange:on.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},nU.Distribute),this._splitView.addView({onDidChange:on.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)}},nU.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 RS&&(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")}),md(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Kr(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=T("noResults","No results"),Ph(this._messageContainer),Promise.resolve(void 0)):(md(this._messageContainer),this._decorationsManager=new HY(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"),Ph(this._treeContainer),Ph(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 RS)return e;if(e instanceof L5&&e.children.length>0)return e.children[0]}revealReference(e){return W4e(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return W4e(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Qi.inMemory?this.setTitle(Psr(e.uri),this._uriLabel.getUriLabel(XK(e.uri))):this.setTitle(T("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}_o(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=J.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()})}};Ude=jbr([ty(3,Vl),ty(4,vh),ty(5,pi),ty(6,yit),ty(7,BA),ty(8,ZK),ty(9,Go),ty(10,Es),ty(11,es)],Ude);var Kbr=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},l2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},z4e=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())})},yV;const dI=new sn("referenceSearchVisible",!1,T("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let NS=yV=class{static get(e){return e.getContribution(yV.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 yt,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=dI.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=qbr.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Ude,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(T("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(T("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new Re(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 z4e(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 z4e(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=J.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=yV.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,Sl(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,Pi(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)}};NS.ID="editor.contrib.referencesController";NS=yV=Kbr([l2(2,bi),l2(3,io),l2(4,Wa),l2(5,pi),l2(6,r_),l2(7,pr)],NS);function hI(n,e){const t=Obr(n);if(!t)return;const i=NS.get(t);i&&e(i)}uh.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:gl(2089,60),when:ht.or(dI,dh.inPeekEditor),handler(n){hI(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});uh.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:ht.or(dI,dh.inPeekEditor),handler(n){hI(n,e=>{e.goToNextOrPreviousReference(!0)})}});uh.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:ht.or(dI,dh.inPeekEditor),handler(n){hI(n,e=>{e.goToNextOrPreviousReference(!1)})}});yr.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");yr.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");yr.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");yr.registerCommand("closeReferenceSearch",n=>hI(n,e=>e.closeWidget()));uh.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:ht.and(dh.inPeekEditor,ht.not("config.editor.stablePeek"))});uh.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:ht.and(dI,ht.not("config.editor.stablePeek"))});uh.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ht.and(dI,mtt,Kye.negate(),Yye.negate()),handler(n){var e;const i=(e=n.get(Ng).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof RS&&hI(n,r=>r.revealReference(i[0]))}});uh.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ht.and(dI,mtt,Kye.negate(),Yye.negate()),handler(n){var e;const i=(e=n.get(Ng).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof RS&&hI(n,r=>r.openReference(i[0],!0,!0))}});yr.registerCommand("openReference",n=>{var e;const i=(e=n.get(Ng).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof RS&&hI(n,r=>r.openReference(i[0],!1,!0))});var Sit=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},OP=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const k1e=new sn("hasSymbols",!1,T("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),WY=lr("ISymbolNavigationService");let jde=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=k1e.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 qde(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(iye(d.uri,a.uri))c=!0,u=u||J.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=xm(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:J.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?T("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):T("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};jde=Sit([OP(0,bi),OP(1,io),OP(2,Wa),OP(3,Go)],jde);Cr(WY,jde,1);qt(new class extends oc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:k1e,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(WY).revealNext(e)}});uh.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:k1e,primary:9,handler(n){n.get(WY).reset()}});let qde=class{constructor(e){this._listener=new Map,this._disposables=new yt,this._onDidChange=new De,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(),_o(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,xm(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)}};qde=Sit([OP(0,io)],qde);var I1e=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 rB(n,e,t,i){return I1e(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{tl(l)})),s=yield Promise.all(o);return o0(s.flat())})}function zY(n,e,t,i){return rB(e,t,n,(r,o,s)=>r.provideDefinition(o,s,i))}function Eit(n,e,t,i){return rB(e,t,n,(r,o,s)=>r.provideDeclaration(o,s,i))}function xit(n,e,t,i){return rB(e,t,n,(r,o,s)=>r.provideImplementation(o,s,i))}function Tit(n,e,t,i){return rB(e,t,n,(r,o,s)=>r.provideTypeDefinition(o,s,i))}function UY(n,e,t,i,r){return rB(e,t,n,(o,s,a)=>I1e(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 oB(n){return I1e(this,void 0,void 0,function*(){const e=yield n(),t=new qh(e,""),i=t.references.map(r=>r.link);return t.dispose(),i})}L0("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(wn),r=zY(i.definitionProvider,e,t,or.None);return oB(()=>r)});L0("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(wn),r=Tit(i.typeDefinitionProvider,e,t,or.None);return oB(()=>r)});L0("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(wn),r=Eit(i.declarationProvider,e,t,or.None);return oB(()=>r)});L0("_executeReferenceProvider",(n,e,t)=>{const i=n.get(wn),r=UY(i.referenceProvider,e,t,!1,or.None);return oB(()=>r)});L0("_executeImplementationProvider",(n,e,t)=>{const i=n.get(wn),r=xit(i.implementationProvider,e,t,or.None);return oB(()=>r)});var Im=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())})},zO,UO,jO,C7,w7,S7,E7,x7;Sc.appendMenuItem(ue.EditorContext,{submenu:ue.EditorContextPeek,title:T("peek.submenu","Peek"),group:"navigation",order:100});class QA{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof QA||Re.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Wu extends Rv{static all(){return Wu._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of rr.wrap(t.menu))(i.id===ue.EditorContext||i.id===ue.EditorContextPeek)&&(i.when=ht.and(e.precondition,i.when));return t}constructor(e,t){super(Wu._patchConfig(t)),this.configuration=e,Wu._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Wa),s=e.get(io),a=e.get(fE),l=e.get(WY),c=e.get(wn),u=e.get(pi),d=t.getModel(),h=t.getPosition(),f=QA.is(i)?i:new QA(d,h),g=new IS(t,5),m=LK(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(v=>Im(this,void 0,void 0,function*(){var _;if(!v||g.token.isCancellationRequested)return;vu(v.ariaMessage);let b;if(v.referenceAt(d.uri,h)){const C=this._getAlternativeCommand(t);!Wu._activeAlternativeCommands.has(C)&&Wu._allSymbolNavigationCommands.has(C)&&(b=Wu._allSymbolNavigationCommands.get(C))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const C=d.getWordAtPosition(h);(_=jh.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(C),h)}}else if(y===1&&b)Wu._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(C=>b.runEditorCommand(C,t,i,r).finally(()=>{Wu._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,r)}),v=>{o.error(v)}).finally(()=>{g.dispose()});return a.showWhile(m,250),m}_onResult(e,t,i,r,o){return Im(this,void 0,void 0,function*(){const s=this._getGoToPreference(i);if(!(i instanceof AS)&&(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 Im(this,void 0,void 0,function*(){let s;if(JQi(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:J.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=NS.get(e);r&&e.hasModel()?r.toggleWidget(i??e.getSelection(),Sl(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Wu._allSymbolNavigationCommands=new Map;Wu._activeAlternativeCommands=new Set;class sB extends Wu{_getLocationModel(e,t,i,r){return Im(this,void 0,void 0,function*(){return new qh(yield zY(e.definitionProvider,t,i,r),T("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?T("noResultWord","No definition found for '{0}'",e.word):T("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}ys((zO=class extends sB{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:zO.id,title:{value:T("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:T({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:ht.and(de.hasDefinitionProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:[{when:de.editorTextFocus,primary:70,weight:100},{when:ht.and(de.editorTextFocus,ftt),primary:2118,weight:100}],menu:[{id:ue.EditorContext,group:"navigation",order:1.1},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),yr.registerCommandAlias("editor.action.goToDeclaration",zO.id)}},zO.id="editor.action.revealDefinition",zO));ys((UO=class extends sB{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:UO.id,title:{value:T("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ht.and(de.hasDefinitionProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:[{when:de.editorTextFocus,primary:gl(2089,70),weight:100},{when:ht.and(de.editorTextFocus,ftt),primary:gl(2089,2118),weight:100}]}),yr.registerCommandAlias("editor.action.openDeclarationToTheSide",UO.id)}},UO.id="editor.action.revealDefinitionAside",UO));ys((jO=class extends sB{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:jO.id,title:{value:T("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ht.and(de.hasDefinitionProvider,dh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:ue.EditorContextPeek,group:"peek",order:2}}),yr.registerCommandAlias("editor.action.previewDeclaration",jO.id)}},jO.id="editor.action.peekDefinition",jO));class kit extends Wu{_getLocationModel(e,t,i,r){return Im(this,void 0,void 0,function*(){return new qh(yield Eit(e.declarationProvider,t,i,r),T("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?T("decl.noResultWord","No declaration found for '{0}'",e.word):T("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}ys((C7=class extends kit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:C7.id,title:{value:T("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:T({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:ht.and(de.hasDeclarationProvider,de.isInWalkThroughSnippet.toNegated()),menu:[{id:ue.EditorContext,group:"navigation",order:1.3},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?T("decl.noResultWord","No declaration found for '{0}'",e.word):T("decl.generic.noResults","No declaration found")}},C7.id="editor.action.revealDeclaration",C7));ys(class extends kit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:T("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ht.and(de.hasDeclarationProvider,dh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),menu:{id:ue.EditorContextPeek,group:"peek",order:3}})}});class Iit extends Wu{_getLocationModel(e,t,i,r){return Im(this,void 0,void 0,function*(){return new qh(yield Tit(e.typeDefinitionProvider,t,i,r),T("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?T("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):T("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}ys((w7=class extends Iit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:w7.ID,title:{value:T("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:T({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:ht.and(de.hasTypeDefinitionProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:0,weight:100},menu:[{id:ue.EditorContext,group:"navigation",order:1.4},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},w7.ID="editor.action.goToTypeDefinition",w7));ys((S7=class extends Iit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:S7.ID,title:{value:T("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ht.and(de.hasTypeDefinitionProvider,dh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),menu:{id:ue.EditorContextPeek,group:"peek",order:4}})}},S7.ID="editor.action.peekTypeDefinition",S7));class Lit extends Wu{_getLocationModel(e,t,i,r){return Im(this,void 0,void 0,function*(){return new qh(yield xit(e.implementationProvider,t,i,r),T("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?T("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):T("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}ys((E7=class extends Lit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:E7.ID,title:{value:T("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:T({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:ht.and(de.hasImplementationProvider,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:2118,weight:100},menu:[{id:ue.EditorContext,group:"navigation",order:1.45},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},E7.ID="editor.action.goToImplementation",E7));ys((x7=class extends Lit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:x7.ID,title:{value:T("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ht.and(de.hasImplementationProvider,dh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:3142,weight:100},menu:{id:ue.EditorContextPeek,group:"peek",order:5}})}},x7.ID="editor.action.peekImplementation",x7));class Dit extends Wu{_getNoResultFoundMessage(e){return e?T("references.no","No references found for '{0}'",e.word):T("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}ys(class extends Dit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:T("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:T({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:ht.and(de.hasReferenceProvider,dh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),keybinding:{when:de.editorTextFocus,primary:1094,weight:100},menu:[{id:ue.EditorContext,group:"navigation",order:1.45},{id:ue.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,r){return Im(this,void 0,void 0,function*(){return new qh(yield UY(e.referenceProvider,t,i,!0,r),T("ref.title","References"))})}});ys(class extends Dit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:T("references.action.label","Peek References"),original:"Peek References"},precondition:ht.and(de.hasReferenceProvider,dh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated()),menu:{id:ue.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,r){return Im(this,void 0,void 0,function*(){return new qh(yield UY(e.referenceProvider,t,i,!1,r),T("ref.title","References"))})}});class Ybr extends Wu{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:T("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:ht.and(dh.notInPeekEditor,de.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,r){return Im(this,void 0,void 0,function*(){return new qh(this._references,T("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&T("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""}}yr.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:Jn},{name:"position",description:"The position at which to start",constraint:Re.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)=>Im(void 0,void 0,void 0,function*(){ko(Jn.isUri(e)),ko(Re.isIPosition(t)),ko(Array.isArray(i)),ko(typeof r>"u"||typeof r=="string"),ko(typeof s>"u"||typeof s=="boolean");const a=n.get(io),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(m0(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends Ybr{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},i,r);c.get(pi).invokeFunction(u.run.bind(u),l)})})});yr.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:Jn},{name:"position",description:"The position at which to start",constraint:Re.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)=>Im(void 0,void 0,void 0,function*(){n.get(ga).executeCommand("editor.action.goToLocations",e,t,i,r,void 0,!0)})});yr.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{ko(Jn.isUri(e)),ko(Re.isIPosition(t));const i=n.get(wn),r=n.get(io);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!m0(o)||!o.hasModel())return;const s=NS.get(o);if(!s)return;const a=Sl(c=>UY(i.referenceProvider,o.getModel(),Re.lift(t),!1,c).then(u=>new qh(u,T("ref.title","References")))),l=new J(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});yr.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var Qbr=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},vne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},U4e=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())})},PP;let fk=PP=class{constructor(e,t,i,r){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=r,this.toUnhook=new yt,this.toUnhookForKeyboard=new yt,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new FY(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=>{Pi(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(PP.ID)}startFindDefinitionFromCursor(e){return U4e(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 U4e(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 tnt(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Sl(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){Pi(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?J.lift(o[0].originSelectionRange):new J(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=J.plusRange(a,l));this.addDecoration(a,new Kc().appendText(T("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 Kc().appendCodeblock(h||"",d):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let r=i.range;return r.endLineNumber-r.startLineNumber>=PP.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+PP.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<r;o++){const s=e.getLineFirstNonWhitespaceColumn(o);if(i===s)break}return new J(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 kS)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?zY(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 sB({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(bi);return dh.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};fk.ID="editor.contrib.gotodefinitionatposition";fk.MAX_SOURCE_PREVIEW_LINES=8;fk=PP=Qbr([vne(1,vh),vne(2,Es),vne(3,wn)],fk);Hr(fk.ID,fk,2);const T7=Rt;class Ait extends qe{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 P6(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class L1e extends qe{static render(e,t,i){return new L1e(e,t,i)}constructor(e,t,i){super(),this.actionContainer=ft(e,T7("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ft(this.actionContainer,T7("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ft(this.action,T7(`span.icon.${t.iconClass}`));const r=ft(this.action,T7("span"));r.textContent=i?`${t.label} (${i})`:t.label,this._register(at(this.actionContainer,Xt.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(at(this.actionContainer,Xt.KEY_DOWN,o=>{const s=new ls(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 Xbr(n,e){return n&&e?T("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?T("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var Zbr=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())})},Jbr=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 e0r=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class Rit extends qe{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new De),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Mo(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Mo(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Mo(()=>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=tJi(e=>this._computer.computeAsync(e)),Zbr(this,void 0,void 0,function*(){var e,t,i,r;try{try{for(var o=!0,s=Jbr(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){Pi(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 e0r(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 bne{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 CV{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 fI=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class D1e{constructor(){this._onDidWillResize=new De,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new De,this.onDidResize=this._onDidResize.event,this._sashListener=new yt,this._size=new Kr(0,0),this._minSize=new Kr(0,0),this._maxSize=new Kr(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new cu(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new cu(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new cu(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:eU.North}),this._southSash=new cu(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:eU.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(on.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(on.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(on.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(on.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 Kr(t,e);Kr.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 t0r=30,n0r=24;class i0r extends qe{constructor(e,t=new Kr(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new D1e),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Kr.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 Kr(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?Re.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:pl(t).top+i.top-t0r}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const r=pl(t),o=iN(t.ownerDocument.body),s=r.top+i.top+i.height;return o.height-s-n0r}_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 A1e=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},Xx=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wV,Kv;const j4e=Rt;let SU=wV=class extends qe{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Yw,this._editor)),this._participants=[];for(const r of fI.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new xU(this._editor,this._participants),this._hoverOperation=this._register(new Rit(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 Nit(this._computer.anchor,o,r.isComplete))})),this._register(Ba(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(Ks.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 bne(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 bne(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 bne(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}=wV.computeHoverRanges(this._editor,e.range,t),s=new yt,a=s.add(new EU(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 f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}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:wV._DECORATION_OPTIONS}]),s.add(_i(()=>{h.clear()}))}this._widget.showAt(l,new o0r(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 Re(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=J.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 Re(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new Re(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()}};SU._DECORATION_OPTIONS=Oi.register({description:"content-hover-highlight",className:"hoverHighlight"});SU=wV=A1e([Xx(1,pi),Xx(2,Go)],SU);class Nit{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 r0r(this,this.anchor,t,this.isComplete)}}class r0r extends Nit{constructor(e,t,i,r){super(t,i,r),this.original=e}filter(e){return this.original.filter(e)}}class o0r{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 q4e=30,yne=10,s0r=6;let Yw=Kv=class extends i0r{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 Kr(a,s);super(e,l),this._configurationService=i,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new Ait),this._minimumSize=l,this._hoverVisibleKey=de.hoverVisible.bindTo(t),this._hoverFocusedKey=de.hoverFocused.bindTo(t),ft(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(l0(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 Kv.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 Kv._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Kv._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){Kv._applyMaxDimensions(this._hover.contentsDomNode,e,t),Kv._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-yne))}_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 Kr(i,r),this._setHoverWidgetMaxDimensions(i,r)}_resize(e){var t,i;Kv._lastDimensions=new Kr(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=s0r;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=yne),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?iN(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=pl(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=G4e(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const r=G4e(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,Kv._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Kv._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=zx(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=Xbr(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 Kr(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(Jd(i),Math.min(o,e)),this._setContentsDomNodeDimensions(Jd(r),Math.min(o,e-yne))}setMinimumDimensions(e){this._minimumSize=new Kr(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 Kr(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=zx(t),r=Jd(t);if(this._resizableNode.layout(i,r),this._setHoverWidgetDimensions(r,i),i=zx(t),r=Jd(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=zx(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-q4e})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+q4e})}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})}};Yw.ID="editor.contrib.resizableContentHoverWidget";Yw._lastDimensions=new Kr(0,0);Yw=Kv=A1e([Xx(1,bi),Xx(2,pr),Xx(3,F1),Xx(4,Go)],Yw);let EU=class extends qe{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=j4e("div.hover-row.status-bar"),this.actionsElement=ft(this.hoverElement,j4e("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(L1e.render(this.actionsElement,e,i))}append(e){const t=ft(this.actionsElement,e);return this._hasContent=!0,t}};EU=A1e([Xx(0,Go)],EU);class xU{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 Ka.EMPTY;const i=xU._getLineDecorations(this._editor,t);return Ka.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,i,e):Ka.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=xU._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return o0(t)}}function G4e(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 K4e=Rt;class yD extends qe{constructor(e,t,i){super(),this._renderDisposeables=this._register(new yt),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new Ait),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new x1({editor:this._editor},t,i)),this._computer=new a0r(this._editor),this._hoverOperation=this._register(new Rit(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 yD.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=K4e("div.hover-row.markdown-hover"),s=ft(o,K4e("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`}}yD.ID="editor.contrib.modesGlyphHoverWidget";class a0r{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||HA(o)||i.push(...Xbe(o).map(e))}return i}}var l0r=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 c0r{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function u0r(n,e,t,i,r){return l0r(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,r));if(o&&h0r(o))return new c0r(n,o,e)}catch(o){tl(o)}})}function R1e(n,e,t,i){const o=n.ordered(e).map((s,a)=>u0r(s,a,e,t,i));return Ka.fromPromises(o).coalesce()}function d0r(n,e,t,i){return R1e(n,e,t,i).map(r=>r.hover).toPromise()}L0("_executeHoverProvider",(n,e,t)=>{const i=n.get(wn);return d0r(i.hoverProvider,e,t,or.None)});function h0r(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var f0r=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},k7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Y4e=Rt;class Y_{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 TU=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 Y_(this,e.range,[new Kc().appendText(T("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 Y_(this,e.range,[{value:T("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 Y_(this,e.range,[{value:T("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const m=g.range.startLineNumber===r?g.range.startColumn:1,v=g.range.endLineNumber===r?g.range.endColumn:o,_=g.options.hoverMessage;if(!_||HA(_))continue;g.options.beforeContentClassName&&(f=!0);const b=new J(e.range.startLineNumber,m,e.range.startLineNumber,v);s.push(new Y_(this,b,Xbe(_),f,a++))}return s}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Ka.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Ka.EMPTY;const o=new Re(e.range.startLineNumber,e.range.startColumn);return R1e(this._languageFeaturesService.hoverProvider,r,o,i).filter(s=>!HA(s.hover.contents)).map(s=>{const a=s.hover.range?J.lift(s.hover.range):e.range;return new Y_(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return Oit(e,t,this._editor,this._languageService,this._openerService)}};TU=f0r([k7(1,Es),k7(2,nf),k7(3,pr),k7(4,wn)],TU);function Oit(n,e,t,i,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new yt;for(const s of e)for(const a of s.contents){if(HA(a))continue;const l=Y4e("div.hover-row.markdown-hover"),c=ft(l,Y4e("div.hover-contents")),u=o.add(new x1({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 Pit=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},kU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Q4e{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Gde=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new De,this.onDidChange=this._onDidChange.event,this._dispoables=new yt,this._markers=[],this._nextIdx=-1,Jn.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=I3(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=J.compareRangesUsingStarts(a,l)||Xs.compare(a.severity,l.severity):c=Xs.compare(a.severity,l.severity)||J.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Jn.isUri(e)?e:void 0,severities:Xs.Error|Xs.Warning|Xs.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 Q4e(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=y3(this._markers,{resource:e.uri},(s,a)=>I3(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;s<this._markers.length;s++){let a=J.lift(this._markers[s]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new J(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(J.containsPosition(this._markers[i],t))return new Q4e(this._markers[i],i+1,this._markers.length)}}};Gde=Pit([kU(1,D0),kU(2,pr)],Gde);const Mit=lr("IMarkerNavigationService");let Kde=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Td}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new Gde(e,this._markerService,this._configService)}};Kde=Pit([kU(0,D0),kU(1,pr)],Kde);Cr(Mit,Kde,1);var Yde;(function(n){function e(t){switch(t){case wa.Ignore:return"severity-ignore "+ei.asClassName(jt.info);case wa.Info:return ei.asClassName(jt.info);case wa.Warning:return ei.asClassName(jt.warning);case wa.Error:return ei.asClassName(jt.error);default:return""}}n.className=e})(Yde||(Yde={}));var p0r=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},c2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Qde;class g0r{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 yt,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(Ba(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new gJe(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(){_o(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=a0(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);kc(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 f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=Rt("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=ft(this._codeLink,Rt("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(kc(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),yu(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 f of r){const g=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(m),g.appendChild(v),this._lines+=1,h.appendChild(g)}}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 Xs.Error:t=T("Error","Error");break;case Xs.Warning:t=T("Warning","Warning");break;case Xs.Info:t=T("Info","Info");break;case Xs.Hint:t=T("Hint","Hint");break}let i=T("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 XA=Qde=class extends wU{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 yt,this._onDidSelectRelatedInformation=new De,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Xs.Warning,this._backgroundColor=je.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(b0r);let t=Xde,i=m0r;this._severity===Xs.Warning?(t=SV,i=_0r):this._severity===Xs.Info&&(t=Zde,i=v0r);const r=e.getColor(t),o=e.getColor(i);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(Cit),secondaryHeadingColor:e.getColor(wit)})}_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(Qde.TitleMenu,this._contextKeyService);Xet(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=ft(e,Rt(""))}_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 g0r(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=J.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?T("problems","{0} of {1} problems",t,i):T("change","{0} of {1} problem",t,i);this.setTitle(Cg(a.uri),l)}this._icon.className=`codicon ${Yde.className(Xs.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()}};XA.TitleMenu=new ue("gotoErrorTitleMenu");XA=Qde=p0r([c2(1,Vl),c2(2,nf),c2(3,k0),c2(4,pi),c2(5,bi),c2(6,BA)],XA);const X4e=q3(Mb,pnr),Z4e=q3(Mf,U3),J4e=q3(sh,j3),Xde=fe("editorMarkerNavigationError.background",{dark:X4e,light:X4e,hcDark:fr,hcLight:fr},T("editorMarkerNavigationError","Editor marker navigation widget error color.")),m0r=fe("editorMarkerNavigationError.headerBackground",{dark:Bn(Xde,.1),light:Bn(Xde,.1),hcDark:null,hcLight:null},T("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),SV=fe("editorMarkerNavigationWarning.background",{dark:Z4e,light:Z4e,hcDark:fr,hcLight:fr},T("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),_0r=fe("editorMarkerNavigationWarning.headerBackground",{dark:Bn(SV,.1),light:Bn(SV,.1),hcDark:"#0C141F",hcLight:Bn(SV,.2)},T("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Zde=fe("editorMarkerNavigationInfo.background",{dark:J4e,light:J4e,hcDark:fr,hcLight:fr},T("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),v0r=fe("editorMarkerNavigationInfo.headerBackground",{dark:Bn(Zde,.1),light:Bn(Zde,.1),hcDark:null,hcLight:null},T("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),b0r=fe("editorMarkerNavigation.background",{dark:Pl,light:Pl,hcDark:Pl,hcLight:Pl},T("editorMarkerNavigationBackground","Editor marker navigation widget background."));var y0r=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},I7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Fit=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())})},MP;let OS=MP=class{static get(e){return e.getContribution(MP.ID)}constructor(e,t,i,r,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new yt,this._editor=e,this._widgetVisible=Bit.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(XA,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)||!J.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:J.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 Re(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 Fit(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=MP.get(s))===null||i===void 0||i.close(),(r=MP.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};OS.ID="editor.contrib.markerController";OS=MP=y0r([I7(1,Mit),I7(2,bi),I7(3,io),I7(4,pi)],OS);class jY extends vn{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return Fit(this,void 0,void 0,function*(){t.hasModel()&&((i=OS.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Qw extends jY{constructor(){super(!0,!1,{id:Qw.ID,label:Qw.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:578,weight:100},menuOpts:{menuId:XA.TitleMenu,title:Qw.LABEL,icon:La("marker-navigation-next",jt.arrowDown,T("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Qw.ID="editor.action.marker.next";Qw.LABEL=T("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class yT extends jY{constructor(){super(!1,!1,{id:yT.ID,label:yT.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:1602,weight:100},menuOpts:{menuId:XA.TitleMenu,title:yT.LABEL,icon:La("marker-navigation-previous",jt.arrowUp,T("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}yT.ID="editor.action.marker.prev";yT.LABEL=T("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class C0r extends jY{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:T("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:de.focus,primary:66,weight:100},menuOpts:{menuId:ue.MenubarGoMenu,title:T({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class w0r extends jY{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:T("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:de.focus,primary:1090,weight:100},menuOpts:{menuId:ue.MenubarGoMenu,title:T({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Hr(OS.ID,OS,4);Pt(Qw);Pt(yT);Pt(C0r);Pt(w0r);const Bit=new sn("markersNavigationVisible",!1),S0r=oc.bindToContribution(OS.get);qt(new S0r({id:"closeMarkersNavigation",precondition:Bit,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:de.focus,primary:9,secondary:[1033]}}));var E0r=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},Cne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const em=Rt;class x0r{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 e3e={type:1,filter:{include:ci.QuickFix},triggerAction:Xh.QuickFixHover};let Jde=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 J(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new x0r(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return qe.None;const i=new yt;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const r=t.length===1?t[0]:t.sort((o,s)=>Xs.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),i}renderMarkerHover(e,t){const i=em("div.hover-row"),r=ft(i,em("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=ft(r,em("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=em("span");if(o){const g=ft(u,em("span"));g.innerText=o}const d=ft(u,em("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(at(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=ft(d,em("span"));h.innerText=a.value;const f=ft(r,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=ft(r,em("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(yu(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=ft(r,em("div"));g.style.marginTop="8px";const m=ft(g,em("a"));m.innerText=`${Cg(d)}(${h}, ${f}): `,m.style.cursor="pointer",t.add(at(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(Pi)}));const v=ft(g,em("span"));v.innerText=u,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===Xs.Error||t.marker.severity===Xs.Warning||t.marker.severity===Xs.Info)&&e.statusBar.addAction({label:T("view problem","View Problem"),commandId:Qw.ID,run:()=>{var r;e.hide(),(r=OS.get(this._editor))===null||r===void 0||r.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const r=e.statusBar.append(em("div"));this.recentMarkerCodeActionsInfo&&(Zz.makeKey(this.recentMarkerCodeActionsInfo.marker)===Zz.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=T("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?qe.None:i.add(bS(()=>r.textContent=T("checkingForQuickFixes","Checking for quick fixes..."),200));r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(_i(()=>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=T("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;i.add(_i(()=>{l||a.dispose()})),e.statusBar.addAction({label:T("quick fixes","Quick Fix..."),commandId:C1e,run:c=>{l=!0;const u=LS.get(this._editor),d=pl(c);e.hide(),u==null||u.showCodeActions(e3e,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},Pi)}}getCodeActions(e){return Sl(t=>t4(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new J(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),e3e,Jy.None,t))}};Jde=E0r([Cne(1,F0e),Cne(2,nf),Cne(3,wn)],Jde);const $it="editor.action.inlineSuggest.commit",Vit="editor.action.inlineSuggest.showPrevious",Hit="editor.action.inlineSuggest.showNext";var T0r=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 k0r extends qe{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new LQi),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new yt),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new A5(()=>{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 wg(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===A5.ID)return this.toggleMenuActionViewItem=new jz(r,r.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:ei.asClassNameArray((s=i.moreIcon)!==null&&s!==void 0?s:jt.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 EA){const a=new jz(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 A5 extends Nd{constructor(e,t){t=t||T("moreActions","More Actions..."),super(A5.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return T0r(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}A5.ID="toolbar.toggle.more";var I0r=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},qO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ehe=class extends k0r{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 yt);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 f=0;f<a.length;f++){const g=a[f];!(g instanceof Wm)&&!(g instanceof R3)||g.hideActions&&(c.push(g.hideActions.toggle),g.hideActions.toggle.checked&&u++,g.hideActions.isHidden&&(h=!0,a[f]=void 0,((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==0&&(d[f]=g)))}if(((s=this._options)===null||s===void 0?void 0:s.overflowBehavior)!==void 0){const f=thr(new Set(this._options.overflowBehavior.exempted),rr.map(a,v=>v==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let m=0;for(let v=0;v<a.length;v++){const _=a[v];_&&(m++,!f.has(_.id)&&m>=g&&(a[v]=void 0,d[v]=_))}}oNe(a),oNe(d),super.setActions(a,ic.join(d,l)),c.length>0&&this._sessionDisposables.add(at(this.getElement(),"contextmenu",f=>{var g,m,v,_,b;const y=new Zp(f),C=this.getItemAction(y.target);if(!C)return;y.preventDefault(),y.stopPropagation();let E=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){E=!0;for(let L=0;L<c.length;L++)if(c[L].checked){c[L]=ZL({id:C.id,label:C.label,checked:!0,enabled:!1,run(){}});break}}let x;if(!E&&(C instanceof Wm||C instanceof R3)){if(!C.hideActions)return;x=C.hideActions.hide}else x=ZL({id:"label",label:T("hide","Hide"),enabled:!1,run(){}});const k=ic.join([x],c);!((m=this._options)===null||m===void 0)&&m.resetMenu&&!i&&(i=[this._options.resetMenu]),h&&i&&(k.push(new ic),k.push(ZL({id:"resetThisMenu",label:T("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>k,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(_=this._options)===null||_===void 0?void 0:_.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};ehe=I0r([qO(2,k0),qO(3,bi),qO(4,n_),qO(5,Go),qO(6,dp)],ehe);var N1e=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},Q_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},EV;let the=class extends qe{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Ec(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=mr(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 Re(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(Nh((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(PS,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(_i(()=>e.removeContentWidget(a))),o.add(Zo(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==Qy.Explicit&&s.triggerExplicitly()}))}))}};the=N1e([Q_(2,pi)],the);const L0r=La("inline-suggestion-hints-next",jt.chevronRight,T("parameterHintsNextIcon","Icon for show next parameter hint.")),D0r=La("inline-suggestion-hints-previous",jt.chevronLeft,T("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let PS=EV=class extends qe{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const r=new Nd(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=T({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${EV.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=gc("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[gc("div@toolBar")]),this.previousAction=this.createCommandAction(Vit,T("previous","Previous"),ei.asClassName(D0r)),this.availableSuggestionCountAction=new Nd("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Hit,T("next","Next"),ei.asClassName(L0r)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(ue.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Mo(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Mo(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(nhe,this.nodes.toolBar,ue.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof Wm)return l.createInstance(R0r,h,void 0);if(h===this.availableSuggestionCountAction){const g=new A0r(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{EV._dropDownVisible=h})),this._register(Zo(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(Zo(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Zo(h=>{const f=this._extraCommands.read(h);if(ka(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof Wm&&g.push(_);g.length>0&&g.unshift(new ic),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};PS._dropDownVisible=!1;PS.id=0;PS=EV=N1e([Q_(6,ga),Q_(7,pi),Q_(8,Go),Q_(9,bi),Q_(10,k0)],PS);class A0r extends WA{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 R0r=class extends ik{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=gc("div.keybinding").root;new q6(t,Of,Object.assign({disableTitle:!0},bfr)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},nhe=class extends ehe{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=[];Xet(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){ka(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ka(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};nhe=N1e([Q_(3,k0),Q_(4,bi),Q_(5,n_),Q_(6,Go),Q_(7,dp)],nhe);var N0r=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},L7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ihe;const O0r=!1;let hh=ihe=class extends qe{static get(e){return e.getContribution(ihe.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 yt,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Mo(()=>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===Yw.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===yD.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===Yw.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===Yw.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===yD.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&&!O0r||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 yD(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)||PS.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(SU,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()}};hh.ID="editor.contrib.hover";hh=ihe=N0r([L7(1,pi),L7(2,nf),L7(3,Es),L7(4,Go)],hh);class P0r extends vn{constructor(){super({id:"editor.action.showHover",label:T({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:de.editorTextFocus,primary:gl(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const r=hh.get(t);if(!r)return;const o=t.getPosition(),s=new J(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 M0r extends vn{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:T({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=hh.get(t);if(!i)return;const r=t.getPosition();if(!r)return;const o=new J(r.lineNumber,r.column,r.lineNumber,r.column),s=fk.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{i.showContentHover(o,1,1,!0)})}}class F0r extends vn{constructor(){super({id:"editor.action.scrollUpHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:16,weight:100}})}run(e,t){const i=hh.get(t);i&&i.scrollUp()}}class B0r extends vn{constructor(){super({id:"editor.action.scrollDownHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:18,weight:100}})}run(e,t){const i=hh.get(t);i&&i.scrollDown()}}class $0r extends vn{constructor(){super({id:"editor.action.scrollLeftHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:15,weight:100}})}run(e,t){const i=hh.get(t);i&&i.scrollLeft()}}class V0r extends vn{constructor(){super({id:"editor.action.scrollRightHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:17,weight:100}})}run(e,t){const i=hh.get(t);i&&i.scrollRight()}}class H0r extends vn{constructor(){super({id:"editor.action.pageUpHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=hh.get(t);i&&i.pageUp()}}class W0r extends vn{constructor(){super({id:"editor.action.pageDownHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=hh.get(t);i&&i.pageDown()}}class z0r extends vn{constructor(){super({id:"editor.action.goToTopHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=hh.get(t);i&&i.goToTop()}}class U0r extends vn{constructor(){super({id:"editor.action.goToBottomHover",label:T({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:de.hoverFocused,kbOpts:{kbExpr:de.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=hh.get(t);i&&i.goToBottom()}}Hr(hh.ID,hh,2);Pt(P0r);Pt(M0r);Pt(F0r);Pt(B0r);Pt($0r);Pt(V0r);Pt(H0r);Pt(W0r);Pt(z0r);Pt(U0r);fI.register(TU);fI.register(Jde);t_((n,e)=>{const t=n.getColor(Lnr);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 rhe extends qe{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!==dit||!i.range)return;const r=this._editor.getContribution(hh.ID);if(r&&!r.isColorPickerVisible){const o=new J(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}rhe.ID="editor.contrib.colorContribution";Hr(rhe.ID,rhe,2);fI.register(CU);var Wit=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},U_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},t3e=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())})},ohe,she;let MS=ohe=class extends qe{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=de.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=de.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 IU(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(ohe.ID)}};MS.ID="editor.contrib.standaloneColorPickerController";MS=ohe=Wit([U_(1,bi),U_(2,Ls),U_(3,Go),U_(4,pi),U_(5,wn),U_(6,es)],MS);Hr(MS.ID,MS,1);const n3e=8,j0r=22;let IU=she=class extends qe{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 De),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(k5,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(l0(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const m=(g=f.target.element)===null||g===void 0?void 0:g.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return she.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 t3e(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new q0r(t.result,t.foundInEditor))})}_computeAsync(e){return t3e(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 x1e(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 EU(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-j0r-n3e,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+n3e+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};IU.ID="editor.contrib.standaloneColorPickerWidget";IU=she=Wit([U_(3,pi),U_(4,Ls),U_(5,Go),U_(6,wn),U_(7,es)],IU);class q0r{constructor(e,t){this.value=e,this.foundInEditor=t}}class G0r extends Rv{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:T("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:T({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:ue.CommandPalette}]})}runEditorCommand(e,t){var i;(i=MS.get(t))===null||i===void 0||i.showOrFocus()}}class K0r extends vn{constructor(){super({id:"editor.action.hideColorPicker",label:T({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:de.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=MS.get(t))===null||i===void 0||i.hide()}}class Y0r extends vn{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:T({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:de.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=MS.get(t))===null||i===void 0||i.insertColor()}}Pt(K0r);Pt(Y0r);ys(G0r);class fw{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 f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(i,u-1-i.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),_=h.substring(0,g);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(f=-1,g=-1)}let m;f!==-1&&g!==-1?(r&&f+t.length<d.length&&d.charCodeAt(f+t.length)===32&&(t=t+" "),r&&g>0&&h.charCodeAt(g-1)===32&&(i=" "+i,g-=1),m=fw._createRemoveBlockCommentOperations(new J(a,f+t.length+1,c,g+1),t,i)):(m=fw._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const r=[];return J.isEmpty(e)?r.push(Is.delete(new J(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(r.push(Is.delete(new J(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Is.delete(new J(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),r}static _createAddBlockCommentOperations(e,t,i,r){const o=[];return J.isEmpty(e)?o.push(Is.replace(new J(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Is.insert(new Re(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Is.insert(new Re(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 kn(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 kn(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 f=r[d],g=o+d;if(g===o&&a){f.ignore=!0;continue}const m=i.getLineContent(g),v=Gu(m);if(v===-1){f.ignore=s,f.commentStrOffset=m.length;continue}if(c=!1,f.ignore=!1,f.commentStrOffset=v,u&&!fw._haystackHasNeedleAtOffset(m,f.commentStr,v)&&(e===0?u=!1:e===1||(f.ignore=!0)),u&&t){const _=v+f.commentStrLength;_<m.length&&m.charCodeAt(_)===32&&(f.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 Re(r.positionLineNumber,r.positionColumn);for(let a=0,l=o.length;a<l;a++)t.addEditOperation(o[a].range,o[a].text),J.isEmpty(o[a].range)&&J.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?fw._createRemoveBlockCommentOperations(new J(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=Gu(c);u===-1&&(u=c.length),l=fw._createAddBlockCommentOperations(new J(i.startLineNumber,u+1,i.startLineNumber,c.length+1),s,a,this._insertSpace)}else l=fw._createAddBlockCommentOperations(new J(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 J(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 kn(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(Is.delete(new J(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(Is.insert(new Re(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,f=t[l].commentStrOffset;d<o&&h<f;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 O1e extends vn{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(es);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)=>J.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 Q0r extends O1e{constructor(){super(0,{id:"editor.action.commentLine",label:T("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"5_insert",title:T({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class X0r extends O1e{constructor(){super(1,{id:"editor.action.addCommentLine",label:T("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2081),weight:100}})}}class Z0r extends O1e{constructor(){super(2,{id:"editor.action.removeCommentLine",label:T("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2099),weight:100}})}}class J0r extends vn{constructor(){super({id:"editor.action.blockComment",label:T("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"5_insert",title:T({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(es);if(!t.hasModel())return;const r=t.getOption(23),o=[],s=t.getSelections();for(const a of s)o.push(new fw(a,r.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}Pt(Q0r);Pt(X0r);Pt(Z0r);Pt(J0r);var eyr=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},WE=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ahe;let ZA=ahe=class{static get(e){return e.getContribution(ahe.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 yt,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&&ZT(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?ue.SimpleEditorContext:ue.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 R3){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(i.push(new EA(c.id,c.label,u)),l++)}else i.push(c),l++;l&&i.push(new ic)}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=pl(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)&&!bv;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 WA(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new WA(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()||Zcr(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 EA(`menu-action-${++i}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},m=[];for(const v of f)m.push(r({label:v.label,checked:h===v.value,run:g(v.value)}));return o(c,m)},a=[];a.push(r({label:T("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new ic),a.push(r({label:T("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(T("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:T("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:T("context.minimap.size.fill","Fill"),value:"fill"},{label:T("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(T("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:T("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:T("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!bv;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()}};ZA.ID="editor.contrib.contextmenu";ZA=ahe=eyr([WE(1,n_),WE(2,B1),WE(3,bi),WE(4,Go),WE(5,k0),WE(6,pr),WE(7,tk)],ZA);class tyr extends vn{constructor(){super({id:"editor.action.showContextMenu",label:T("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=ZA.get(t))===null||i===void 0||i.showContextMenu()}}Hr(ZA.ID,ZA,2);Pt(tyr);class wne{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 Sne{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class pk extends qe{static get(e){return e.getContribution(pk.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 wne(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new Sne(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 Sne(new wne(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 Sne(new wne(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}}pk.ID="editor.contrib.cursorUndoRedoController";class nyr extends vn{constructor(){super({id:"cursorUndo",label:T("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var r;(r=pk.get(t))===null||r===void 0||r.cursorUndo()}}class iyr extends vn{constructor(){super({id:"cursorRedo",label:T("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var r;(r=pk.get(t))===null||r===void 0||r.cursorRedo()}}Hr(pk.ID,pk,0);Pt(nyr);Pt(iyr);class ryr{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 J(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 kn(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 kn(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 kn(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 kn(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 kn(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 u2(n){return br?n.altKey:n.ctrlKey}class n1 extends qe{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)||(u2(e)&&(this._modifierPressed=!0),this._mouseDown&&u2(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(u2(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===n1.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}u2(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 Re(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 kn(o,s,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new kn(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(u2(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(n1.ID,new ryr(this._dragSelection,t,u2(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 J(e.lineNumber,e.column,e.lineNumber,e.column),options:n1._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()}}n1.ID="editor.contrib.dragAndDrop";n1.TRIGGER_KEY_VALUE=br?6:5;n1._DECORATION_OPTIONS=Oi.register({description:"dnd-target",className:"dnd-target"});Hr(n1.ID,n1,2);const qY=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 zit=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 P1e(n){return{asString:()=>zit(this,void 0,void 0,function*(){return n}),asFile:()=>{},value:typeof n=="string"?n:void 0}}function oyr(n,e,t){const i={id:qY(),name:n,uri:e,data:t};return{asString:()=>zit(this,void 0,void 0,function*(){return""}),asFile:()=>i,value:void 0}}class Uit{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 rr.some(this,([i,r])=>r.asFile())&&t.push("files"),qit(LU(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 LU(e)}}function LU(n){return n.toLowerCase()}function jit(n,e){return qit(LU(n),e.map(LU))}function qit(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 GY=Object.freeze({create:n=>fS(n.map(e=>e.toString())).join(`\r
`),split:n=>n.split(`\r
`),parse:n=>GY.split(n).filter(e=>!e.startsWith("#"))}),i3e={EDITORS:"CodeEditors",FILES:"CodeFiles"};class syr{}const ayr={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Hs.add(ayr.DragAndDropContribution,new syr);class R5{constructor(){}static getInstance(){return R5.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}R5.INSTANCE=new R5;var lyr=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 Git(n){const e=new Uit;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,P1e(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(i,cyr(r))}}return e}function cyr(n){const e=n.path?Jn.parse(n.path):void 0;return oyr(n.name,e,()=>lyr(this,void 0,void 0,function*(){return new Uint8Array(yield n.arrayBuffer())}))}const uyr=Object.freeze([i3e.EDITORS,i3e.FILES,u5.RESOURCES,u5.INTERNAL_URI_LIST]);function Kit(n,e=!1){const t=Git(n),i=t.get(u5.INTERNAL_URI_LIST);if(i)t.replace(xa.uriList,i);else if(e||!t.has(xa.uriList)){const r=[];for(const o of n.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(Jn.file(a).toString()):r.push(Jn.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(xa.uriList,P1e(GY.create(r)))}for(const r of uyr)t.delete(r);return t}function dyr(n,e,t){var i,r;return{edits:[...e.map(o=>new Zy(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 Yit(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 hyr=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},fyr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},pyr=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 gyr=Oi.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:UXe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class KY extends qe{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=Rt(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Rt("span.icon");this.domNode.append(t),t.classList.add(...ei.asClassNameArray(jt.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(at(this.domNode,Xt.CLICK,r=>{this.delegate.cancel()}))}getId(){return KY.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)}}KY.baseId="editor.widget.inlineProgressWidget";let DU=class extends qe{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ac),this._currentWidget=new Ac,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return pyr(this,void 0,void 0,function*(){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=bS(()=>{const o=J.fromPositions(e);this._currentDecorations.set([{range:o,options:gyr}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(KY,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()}};DU=hyr([fyr(2,pi)],DU);var Qit=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},n4=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},r3e=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())})},lhe;let AU=lhe=class extends qe{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(_i(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(_i(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(on.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=Rt(".post-edit-widget"),this.button=this._register(new jue(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(at(this.domNode,Xt.CLICK,()=>this.showSelector()))}getId(){return lhe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=pl(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>ZL({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};AU.baseId="editor.widget.postEditWidget";AU=lhe=Qit([n4(7,n_),n4(8,bi),n4(9,Go)],AU);let RU=class extends qe{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 Ac),this._register(on.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,i,r){var o,s;return r3e(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(v=>new Zy(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,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],f=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let g,m;try{g=yield this._bulkEditService.apply(d,{editor:this._editor,token:r}),m=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}i&&g.isApplied&&t.allEdits.length>1&&this.show(m??h,t,v=>r3e(this,void 0,void 0,function*(){const _=this._editor.getModel();_&&(yield _.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,r))}))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(AU,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()}};RU=Qit([n4(4,pi),n4(5,H6)],RU);var myr=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},d2=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())})},che;const Xit="editor.changePasteType",Zit=new sn("pasteWidgetVisible",!1,T("pasteWidgetVisible","Whether the paste widget is showing")),Ene="application/vnd.code.copyMetadata";let gk=che=class extends qe{static get(e){return e.getContribution(che.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(at(l,"copy",c=>this.handleCopy(c))),this._register(at(l,"cut",c=>this.handleCopy(c))),this._register(at(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new DU("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(RU,"pasteIntoEditor",e,Zit,{id:Xit,label:T("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},kK().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()||(sE&&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 J(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,eu),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(_=>!!_.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=Git(e.clipboardData),g=h.flatMap(_=>{var b;return(b=_.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=qY();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:g,defaultPastePayload:d});const v=Sl(_=>ny(this,void 0,void 0,function*(){const b=o0(yield Promise.all(h.map(y=>ny(this,void 0,void 0,function*(){try{return yield y.prepareDocumentPaste(r,a,f,_)}catch(C){console.error(C);return}}))));b.reverse();for(const y of b)for(const[C,E]of y)f.replace(C,E);return f}));(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:m,dataTransferPromise:v}}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=Kit(e.clipboardData);a.delete(Ene);const l=[...e.clipboardData.types,...(i=s==null?void 0:s.providerCopyMimeTypes)!==null&&i!==void 0?i:[],xa.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(u=>{var d;return(d=u.pasteMimeTypes)===null||d===void 0?void 0:d.some(h=>jit(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=Sl(s=>ny(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new IS(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(i,r,c.token),c.token.isCancellationRequested)return;const u=e.filter(h=>o3e(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(),T("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,t,i,r,o){const s=Sl(a=>ny(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new IS(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(r,o,u.token),u.token.isCancellationRequested)return;let d=t.filter(m=>o3e(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 f;if(e)f=h.at(0);else{const m=yield this._quickInputService.pick(h.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:T("pasteAsPickerPlaceholder","Select Paste Action")});f=m==null?void 0:m.edit}if(!f)return;const g=dyr(c.uri,i,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:T("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(Ene,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(Ene);if(i)try{return JSON.parse(i)}catch{return}const[r,o]=Oce.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(xa.uriList)){const o=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;o.length&&e.append(xa.uriList,P1e(GY.create(o)))}})}getPasteEdits(e,t,i,r,o){return ny(this,void 0,void 0,function*(){const s=yield LK(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=o0(s??[]);return Yit(a)})}applyDefaultPasteHandler(e,t,i){var r,o,s;return ny(this,void 0,void 0,function*(){const a=(r=e.get(xa.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)})}};gk.ID="editor.contrib.copyPasteActionController";gk=che=myr([d2(1,pi),d2(2,H6),d2(3,H1),d2(4,wn),d2(5,Ov),d2(6,xet)],gk);function o3e(n,e){var t;return!!(!((t=n.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var M1e=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},N5=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},JA=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 F1e=T("builtIn","Built-in");class B1e{provideDocumentPasteEdits(e,t,i,r){return JA(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 JA(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 Jit extends B1e{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[xa.text],this.pasteMimeTypes=[xa.text]}getEdit(e,t){return JA(this,void 0,void 0,function*(){const i=e.get(xa.text);if(!i||e.has(xa.uriList))return;const r=yield i.asString();return{handledMimeType:xa.text,label:T("text.label","Insert Plain Text"),detail:F1e,insertText:r}})}}class ert extends B1e{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[xa.uriList],this.pasteMimeTypes=[xa.uriList]}getEdit(e,t){return JA(this,void 0,void 0,function*(){const i=yield trt(e);if(!i.length||t.isCancellationRequested)return;let r=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Qi.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=i.length>1?T("defaultDropProvider.uriList.uris","Insert Uris"):T("defaultDropProvider.uriList.uri","Insert Uri"):s=i.length>1?T("defaultDropProvider.uriList.paths","Insert Paths"):T("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:xa.uriList,insertText:o,label:s,detail:F1e}})}}let NU=class extends B1e{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[xa.uriList],this.pasteMimeTypes=[xa.uriList]}getEdit(e,t){return JA(this,void 0,void 0,function*(){const i=yield trt(e);if(!i.length||t.isCancellationRequested)return;const r=o0(i.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?$sr(s.uri,o):void 0}));if(r.length)return{handledMimeType:xa.uriList,insertText:r.join(" "),label:i.length>1?T("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):T("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:F1e}})}};NU=M1e([N5(0,tk)],NU);function trt(n){return JA(this,void 0,void 0,function*(){const e=n.get(xa.uriList);if(!e)return[];const t=yield e.asString(),i=[];for(const r of GY.parse(t))try{i.push({uri:Jn.parse(r),originalText:r})}catch{}return i})}let uhe=class extends qe{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new Jit)),this._register(e.documentOnDropEditProvider.register("*",new ert)),this._register(e.documentOnDropEditProvider.register("*",new NU(t)))}};uhe=M1e([N5(0,wn),N5(1,tk)],uhe);let dhe=class extends qe{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Jit)),this._register(e.documentPasteEditProvider.register("*",new ert)),this._register(e.documentPasteEditProvider.register("*",new NU(t)))}};dhe=M1e([N5(0,wn),N5(1,tk)],dhe);Hr(gk.ID,gk,0);wY(dhe);qt(new class extends oc{constructor(){super({id:Xit,precondition:Zit,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;return(i=gk.get(e))===null||i===void 0?void 0:i.changePasteType()}});Pt(class extends vn{constructor(){super({id:"editor.action.pasteAs",label:T("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:T("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=gk.get(e))===null||i===void 0?void 0:i.pasteAs(r)}});class _yr{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 s3e{constructor(e){this.identifier=e}}const nrt=lr("treeViewsDndService");Cr(nrt,_yr,1);var vyr=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},D7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},GO=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())})},hhe;const irt="editor.experimental.dropIntoEditor.defaultProvider",rrt="editor.changeDropType",ort=new sn("dropWidgetVisible",!1,T("dropWidgetVisible","Whether the drop widget is showing"));let eR=hhe=class extends qe{static get(e){return e.getContribution(hhe.ID)}constructor(e,t,i,r,o){super(),this._configService=i,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=R5.getInstance(),this._dropProgressManager=this._register(t.createInstance(DU,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(RU,"dropIntoEditor",e,ort,{id:rrt,label:T("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 GO(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=Sl(s=>GO(this,void 0,void 0,function*(){const a=new IS(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(f=>l.matches(f)):!0),d=yield this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([J.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,T("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o})}getDropEdits(e,t,i,r,o){return GO(this,void 0,void 0,function*(){const s=yield LK(Promise.all(e.map(l=>GO(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=o0(s??[]);return Yit(a)})}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(irt,{resource:e.uri});for(const[r,o]of Object.entries(i)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&jit(r,[a.handledMimeType]));if(s>=0)return s}return 0}extractDataTransferData(e){return GO(this,void 0,void 0,function*(){if(!e.dataTransfer)return new Uit;const t=Kit(e.dataTransfer);if(this.treeItemsTransfer.hasData(s3e.prototype)){const i=this.treeItemsTransfer.getData(s3e.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})}};eR.ID="editor.contrib.dropIntoEditorController";eR=hhe=vyr([D7(1,pi),D7(2,pr),D7(3,wn),D7(4,nrt)],eR);Hr(eR.ID,eR,2);qt(new class extends oc{constructor(){super({id:rrt,precondition:ort,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=eR.get(e))===null||i===void 0||i.changeDropType()}});wY(uhe);Hs.as(Nv.Configuration).registerConfiguration(Object.assign(Object.assign({},nY),{properties:{[irt]:{type:"object",scope:5,description:T("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class Fu{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===Fu._FIND_MATCH_DECORATION||r===Fu._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,Fu._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Fu._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 J(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,Fu._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let r=Fu._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=Fu._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 f=1,g=e.length;f<g;f++){const m=e[f].range;h+u>=m.startLineNumber?m.endLineNumber>h&&(h=m.endLineNumber):(o.push({range:new J(d,1,h,1),options:Fu._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=m.startLineNumber,h=m.endLineNumber)}o.push({range:new J(d,1,h,1),options:Fu._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,Fu._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}}Fu._CURRENT_FIND_MATCH_DECORATION=Oi.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:Ys(z0e),position:tp.Center},minimap:{color:Ys(pL),position:Uh.Inline}});Fu._FIND_MATCH_DECORATION=Oi.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:Ys(z0e),position:tp.Center},minimap:{color:Ys(pL),position:Uh.Inline}});Fu._FIND_MATCH_NO_OVERVIEW_DECORATION=Oi.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});Fu._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Oi.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Ys(z0e),position:tp.Center}});Fu._RANGE_HIGHLIGHT_DECORATION=Oi.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});Fu._FIND_SCOPE_DECORATION=Oi.register({description:"find-scope",className:"findScope",isWholeLine:!0});class byr{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)=>J.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 srt(n,e){if(n&&n[0]!==""){const t=a3e(n,e,"-"),i=a3e(n,e,"_");return t&&!i?l3e(n,e,"-"):!t&&i?l3e(n,e,"_"):n[0].toUpperCase()===n[0]?e.toUpperCase():n[0].toLowerCase()===n[0]?e.toLowerCase():pXi(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 a3e(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function l3e(n,e,t){const i=e.split(t),r=n[0].split(t);let o="";return i.forEach((s,a)=>{o+=srt([r[a]],s)+t}),o.slice(0,-1)}class c3e{constructor(e){this.staticValue=e,this.kind=0}}class yyr{constructor(e){this.pieces=e,this.kind=1}}class tR{static fromStaticValue(e){return new tR([CT.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new c3e(""):e.length===1&&e[0].staticValue!==null?this._state=new c3e(e[0].staticValue):this._state=new yyr(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?srt(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=tR._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 CT{static staticValue(e){return new CT(e,-1,null)}static caseOps(e,t){return new CT(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 Cyr{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++]=CT.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=CT.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=CT.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new tR(this._result)}}function wyr(n){if(!n||n.length===0)return new tR(null);const e=[],t=new Cyr(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 W1=new sn("findWidgetVisible",!1);W1.toNegated();const YY=new sn("findInputFocussed",!1),$1e=new sn("replaceInputFocussed",!1),A7={primary:545,mac:{primary:2593}},R7={primary:565,mac:{primary:2613}},N7={primary:560,mac:{primary:2608}},O7={primary:554,mac:{primary:2602}},P7={primary:558,mac:{primary:2606}},is={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"},pw=19999,Syr=240;class i4{constructor(e,t){this._toDispose=new yt,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new Jm,this._decorations=new Fu(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new Mo(()=>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,_o(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)},Syr)):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 J(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(i,!1,pw);this._decorations.set(r,i);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&r.length>0){const a=B3(r.map(l=>l.range),l=>J.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 Re(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()<pw){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=i4._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 Re(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 Re(i,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<pw){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=i4._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 Re(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?wyr(this._state.replaceString):tR.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 Hc(t,r);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new Re(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=>i4._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>=pw?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new ox(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 X0e(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 byr(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 kn(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 QY extends e_{constructor(e,t,i){super(),this._hideSoon=this._register(new Mo(()=>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:an(V0e),inputActiveOptionForeground:an(H0e),inputActiveOptionBackground:an(Ux)};this.caseSensitive=this._register(new ntt(Object.assign({appendTitle:this._keybindingLabelFor(is.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 itt(Object.assign({appendTitle:this._keybindingLabelFor(is.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 rtt(Object.assign({appendTitle:this._keybindingLabelFor(is.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(at(this._domNode,Xt.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(at(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 QY.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")}}QY.ID="editor.contrib.findOptionsWidget";function M7(n,e){return n===1?!0:n===2?!1:e}class Eyr extends qe{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return M7(this._isRegexOverride,this._isRegex)}get wholeWord(){return M7(this._wholeWordOverride,this._wholeWord)}get matchCase(){return M7(this._matchCaseOverride,this._matchCase)}get preserveCase(){return M7(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 De),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"&&(J.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(f=>!J.equalsRange(f,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>=pw}}const xyr=T("defaultLabel","input"),Tyr=T("label.preserveCaseToggle","Preserve Case");class kyr extends hN{constructor(e){super({icon:jt.preserveCase,title:Tyr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Iyr extends e_{constructor(e,t,i,r){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new De),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new De),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new De),this._onInput=this._register(new De),this._onKeyUp=this._register(new De),this._onPreserveCaseKeyDown=this._register(new De),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||xyr;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 ott(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 kyr(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 f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),ji.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 art=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},lrt=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const V1e=new sn("suggestWidgetVisible",!1,T("suggestWidgetVisible","Whether suggestion are visible")),H1e="historyNavigationWidgetFocus",crt="historyNavigationForwardsEnabled",urt="historyNavigationBackwardsEnabled";let i1;const F7=[];function drt(n,e){if(F7.includes(e))throw new Error("Cannot register the same widget multiple times");F7.push(e);const t=new yt,i=new sn(H1e,!1).bindTo(n),r=new sn(crt,!0).bindTo(n),o=new sn(urt,!0).bindTo(n),s=()=>{i.set(!0),i1=e},a=()=>{i.set(!1),i1===e&&(i1=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(_i(()=>{F7.splice(F7.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let fhe=class extends stt{constructor(e,t,i,r){super(e,t,i);const o=this._register(r.createScoped(this.inputBox.element));this._register(drt(o,this.inputBox))}};fhe=art([lrt(3,bi)],fhe);let phe=class extends Iyr{constructor(e,t,i,r,o=!1){super(e,t,o,i);const s=this._register(r.createScoped(this.inputBox.element));this._register(drt(s,this.inputBox))}};phe=art([lrt(3,bi)],phe);uh.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ht.and(ht.has(H1e),ht.equals(urt,!0),ht.not("isComposing"),V1e.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{i1==null||i1.showPreviousValue()}});uh.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ht.and(ht.has(H1e),ht.equals(crt,!0),ht.not("isComposing"),V1e.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{i1==null||i1.showNextValue()}});function u3e(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 Lyr=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 Dyr=La("find-selection",jt.selection,T("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),d3e=La("find-collapsed",jt.chevronRight,T("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),h3e=La("find-expanded",jt.chevronDown,T("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Ayr=La("find-replace",jt.replace,T("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Ryr=La("find-replace-all",jt.replaceAll,T("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Nyr=La("find-previous-match",jt.arrowUp,T("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Oyr=La("find-next-match",jt.arrowDown,T("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),Pyr=T("label.findDialog","Find / Replace"),Myr=T("label.find","Find"),Fyr=T("placeholder.find","Find"),Byr=T("label.previousMatchButton","Previous Match"),$yr=T("label.nextMatchButton","Next Match"),Vyr=T("label.toggleSelectionFind","Find in Selection"),Hyr=T("label.closeButton","Close"),Wyr=T("label.replace","Replace"),zyr=T("placeholder.replace","Replace"),Uyr=T("label.replaceButton","Replace"),jyr=T("label.replaceAllButton","Replace All"),qyr=T("label.toggleReplaceButton","Toggle Replace"),Gyr=T("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",pw),Kyr=T("label.matchesLocation","{0} of {1}"),f3e=T("label.noResults","No results"),Uv=419,Yyr=275,Qyr=Yyr-54;let KO=69;const Xyr=33,p3e="ctrlEnterReplaceAll.windows.donotask",g3e=br?256:2048;class xne{constructor(e){this.afterLineNumber=e,this.heightInPx=Xyr,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function m3e(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function _3e(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){n.stopPropagation();return}}class XY extends e_{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(p3e,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new Um(500),this._register(_i(()=>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 xne(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>Lyr(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=YY.bindTo(s),this._findFocusTracker=this._register(l0(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=$1e.bindTo(s),this._replaceFocusTracker=this._register(l0(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 xne(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 XY.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=Jd(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,Pi)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=KO+"px",this._state.matchesCount>=pw?this._matchesCount.title=Gyr: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>=pw&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=GT(Kyr,i,t)}else e=f3e;this._matchesCount.appendChild(document.createTextNode(e)),vu(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),KO=Math.max(KO,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===f3e)return i===""?T("ariaSearchNoResultEmpty","{0} found",e):T("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const r=T("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 T("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=pl(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=uZe(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 xne(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||!w0e(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&&Jd(this._domNode)>Uv){this._domNode.style.maxWidth=`${i-28-r-15}px`,this._replaceInput.width=Jd(this._findInput.domNode);return}if(Uv+28+r>=i&&(s=!0),Uv+28+r-KO>=i&&(a=!0),Uv+28+r-KO>=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=Jd(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&&!J.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(g3e|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 m3e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return _3e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(g3e|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{eu&&uv&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(T("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(p3e,!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 m3e(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return _3e(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 fhe(null,this._contextViewProvider,{width:Qyr,label:Myr,placeholder:Fyr,appendCaseSensitiveLabel:this._keybindingLabelFor(is.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(is.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(is.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:()=>u3e(this._keybindingService),inputBoxStyles:Kz,toggleStyles:Gz},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()})),Xu&&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 h2({label:Byr+this._keybindingLabelFor(is.PreviousMatchFindAction),icon:Nyr,onTrigger:()=>{Hx(this._codeEditor.getAction(is.PreviousMatchFindAction)).run().then(void 0,Pi)}})),this._nextBtn=this._register(new h2({label:$yr+this._keybindingLabelFor(is.NextMatchFindAction),icon:Oyr,onTrigger:()=>{Hx(this._codeEditor.getAction(is.NextMatchFindAction)).run().then(void 0,Pi)}}));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 hN({icon:Dyr,title:Vyr+this._keybindingLabelFor(is.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:an(Ux),inputActiveOptionBorder:an(V0e),inputActiveOptionForeground:an(H0e)})),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 h2({label:Hyr+this._keybindingLabelFor(is.CloseFindWidgetCommand),icon:Ltt,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 phe(null,void 0,{label:Wyr,placeholder:zyr,appendPreserveCaseLabel:this._keybindingLabelFor(is.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>u3e(this._keybindingService),inputBoxStyles:Kz,toggleStyles:Gz},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 h2({label:Uyr+this._keybindingLabelFor(is.ReplaceOneAction),icon:Ayr,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new h2({label:jyr+this._keybindingLabelFor(is.ReplaceAllAction),icon:Ryr,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 h2({label:qyr,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Jd(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=Pyr,this._domNode.role="dialog",this._domNode.style.width=`${Uv}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new cu(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=Uv;this._register(this._resizeSash.onDidStart(()=>{a=Jd(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<Uv)return;const u=parseFloat(TK(this._domNode).maxWidth)||0;c>u||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=Jd(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=Jd(this._domNode);if(l<Uv)return;let c=Uv;if(!this._resized||l===Uv){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=Jd(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}XY.ID="editor.contrib.findWidget";class h2 extends e_{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+ei.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(...ei.asClassNameArray(d3e)),this._domNode.classList.add(...ei.asClassNameArray(h3e))):(this._domNode.classList.remove(...ei.asClassNameArray(h3e)),this._domNode.classList.add(...ei.asClassNameArray(d3e)))}}t_((n,e)=>{const t=(m,v)=>{v&&e.addRule(`.monaco-editor ${m} { background-color: ${v}; }`)};t(".findMatch",n.getColor($b)),t(".currentFindMatch",n.getColor(xnr)),t(".findScope",n.getColor(Tnr));const i=n.getColor(ca);t(".find-widget",i);const r=n.getColor(Ob);r&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${r}; }`);const o=n.getColor($0e);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(sw);s&&e.addRule(`.monaco-editor .findMatch { border: 1px ${pv(n.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const a=n.getColor(knr);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=n.getColor(Inr);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${pv(n.type)?"dashed":"solid"} ${l}; }`);const c=n.getColor(fr);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const u=n.getColor(Fb);u&&e.addRule(`.monaco-editor .find-widget { color: ${u}; }`);const d=n.getColor(Ktr);d&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const h=n.getColor(mnr);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const m=n.getColor(Bb);m&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${m}; }`)}const f=n.getColor(Rce);f&&e.addRule(`
.monaco-editor .find-widget .button:not(.disabled):hover,
.monaco-editor .find-widget .codicon-find-selection:hover {
background-color: ${f} !important;
}
`);const g=n.getColor(Pf);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var hrt=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},N_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mk=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())})},ghe;const Zyr=524288;function mhe(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)<Zyr)return n.getModel().getValueInRange(i)}return null}let Md=ghe=class extends qe{get editor(){return this._editor}static get(e){return e.getContribution(ghe.ID)}constructor(e,t,i,r,o){super(),this._editor=e,this._findWidgetVisible=W1.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=r,this._notificationService=o,this._updateHistoryDelayer=new Um(500),this._state=this._register(new Eyr),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!!YY.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=ep(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return mk(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=mhe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?i.searchString=ep(r):i.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=mhe(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 i4(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(T("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 mk(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)}};Md.ID="editor.contrib.findController";Md=ghe=hrt([N_(1,bi),N_(2,r_),N_(3,H1),N_(4,Wa)],Md);let _he=class extends Md{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 mk(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 XY(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new QY(this._editor,this._state,this._keybindingService))}};_he=hrt([N_(1,B1),N_(2,bi),N_(3,Go),N_(4,Vl),N_(5,Wa),N_(6,r_),N_(7,H1)],_he);const Jyr=vZe(new _Ze({id:is.StartFindAction,label:T("startFindAction","Find"),alias:"Find",precondition:ht.or(de.focus,ht.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"3_find",title:T({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));Jyr.addImplementation(0,(n,e,t)=>{const i=Md.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 e1r={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:T("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:T("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:T("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:T("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 t1r extends vn{constructor(){super({id:is.StartFindWithArgs,label:T("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:e1r})}run(e,t,i){return mk(this,void 0,void 0,function*(){const r=Md.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 n1r extends vn{constructor(){super({id:is.StartFindWithSelection,label:T("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 mk(this,void 0,void 0,function*(){const i=Md.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 frt extends vn{run(e,t){return mk(this,void 0,void 0,function*(){const i=Md.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 i1r extends frt{constructor(){super({id:is.NextMatchFindAction,label:T("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:de.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ht.and(de.focus,YY),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class r1r extends frt{constructor(){super({id:is.PreviousMatchFindAction,label:T("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:de.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ht.and(de.focus,YY),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class o1r extends vn{constructor(){super({id:is.GoToMatchFindAction,label:T("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:W1}),this._highlightDecorations=[]}run(e,t,i){const r=Md.get(t);if(!r)return;const o=r.getState().matchesCount;if(o<1){e.get(Wa).notify({severity:eY.Warning,message:T("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(Ov).createInputBox();a.placeholder=T("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=T("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=T("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:Ys(yJe),position:tp.Full}}}])})}}class prt extends vn{run(e,t){return mk(this,void 0,void 0,function*(){const i=Md.get(t);if(!i)return;const r=mhe(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 s1r extends prt{constructor(){super({id:is.NextSelectionMatchFindAction,label:T("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class a1r extends prt{constructor(){super({id:is.PreviousSelectionMatchFindAction,label:T("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const l1r=vZe(new _Ze({id:is.StartFindReplaceAction,label:T("startReplace","Replace"),alias:"Replace",precondition:ht.or(de.focus,ht.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:ue.MenubarEditMenu,group:"3_find",title:T({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));l1r.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=Md.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})});Hr(Md.ID,_he,0);Pt(t1r);Pt(n1r);Pt(i1r);Pt(r1r);Pt(o1r);Pt(s1r);Pt(a1r);const Pv=oc.bindToContribution(Md.get);qt(new Pv({id:is.CloseFindWidgetCommand,precondition:W1,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:ht.and(de.focus,ht.not("isComposing")),primary:9,secondary:[1033]}}));qt(new Pv({id:is.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:A7.primary,mac:A7.mac,win:A7.win,linux:A7.linux}}));qt(new Pv({id:is.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:R7.primary,mac:R7.mac,win:R7.win,linux:R7.linux}}));qt(new Pv({id:is.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:N7.primary,mac:N7.mac,win:N7.win,linux:N7.linux}}));qt(new Pv({id:is.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:O7.primary,mac:O7.mac,win:O7.win,linux:O7.linux}}));qt(new Pv({id:is.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:P7.primary,mac:P7.mac,win:P7.win,linux:P7.linux}}));qt(new Pv({id:is.ReplaceOneAction,precondition:W1,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:3094}}));qt(new Pv({id:is.ReplaceOneAction,precondition:W1,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:ht.and(de.focus,$1e),primary:3}}));qt(new Pv({id:is.ReplaceAllAction,precondition:W1,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:2563}}));qt(new Pv({id:is.ReplaceAllAction,precondition:W1,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:ht.and(de.focus,$1e),primary:void 0,mac:{primary:2051}}}));qt(new Pv({id:is.SelectAllMatchesAction,precondition:W1,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:de.focus,primary:515}}));const c1r={0:" ",1:"u",2:"r"},v3e=65535,O_=16777215,b3e=4278190080;class Tne{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 Sf{constructor(e,t,i){if(e.length!==t.length||e.length>v3e)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Tne(e.length),this._userDefinedStates=new Tne(e.length),this._recoveredStates=new Tne(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>O_||s>O_)throw new Error("startLineNumber or endLineNumber must not exceed "+O_);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]&O_}getEndLineNumber(e){return this._endIndexes[e]&O_}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 u1r(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&b3e)>>>24)+((this._endIndexes[e]&b3e)>>>16);return t===v3e?-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]=`[${c1r[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&O_,endLineNumber:this._endIndexes[e]&O_,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 Sf(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,v)=>Array.isArray(m)?_=>_<v?m[_]:void 0:_=>_<v?m.toFoldRange(_):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,f=0;const g=[];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 v=l,_=u;for(;;){if(!_||_.startLineNumber>c.endLineNumber){m=c;break}if(_.source===1&&_.endLineNumber>c.endLineNumber)break;_=s(++v)}c=o(++a)}if(m){for(;h&&h.endLineNumber<m.startLineNumber;)h=d.pop();m.endLineNumber>m.startLineNumber&&m.startLineNumber>f&&m.endLineNumber<=i&&(!h||h.endLineNumber>=m.endLineNumber)&&(g.push(m),f=m.startLineNumber,h&&d.push(h),h=m)}}return g}}class u1r{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 d1r{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new De,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Sf(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(Sf.fromFoldRanges(t))}update(e,t=[]){const i=this._currentFoldedOrManualRanges(t),r=Sf.sanitizeAndMerge(e,i,this._textModel.getLineCount());this.updatePost(Sf.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=Sf.sanitizeAndMerge(this._regions,r,o);this.updatePost(Sf.fromFoldRanges(s))}_getLinesChecksum(e,t){return FZe(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 grt(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 mN(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 mrt(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 h1r(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 f1r(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 _rt(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 W1e(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 z1e(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 p1r(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 g1r(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 m1r(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 _1r{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new De,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||ES(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 J(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 y3e(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let r=null;const o=s=>((!r||!v1r(s,r))&&(r=y3e(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 v1r(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function y3e(n,e){const t=B3(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const b1r=5e3,y1r="indent";class U1e{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=y1r}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(S1r(this.editorModel,i,r,this.foldingRangesLimit))}}let C1r=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>O_||t>O_)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 Sf(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=YK(d,o);(h<r||h===r&&i++<t)&&(s[c]=u,a[c]=this._endIndexes[l],c++)}return new Sf(s,a)}}};const w1r={limit:b1r,update:()=>{}};function S1r(n,e,t,i=w1r){const r=n.getOptions().tabSize,o=new C1r(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=YK(u,r);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],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 g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return o.toIndentRanges(n)}const E1r=fe("editor.foldBackground",{light:Bn(ow,.3),dark:Bn(ow,.3),hcDark:null,hcLight:null},T("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);fe("editorGutter.foldingControlForeground",{dark:rw,light:rw,hcDark:rw,hcLight:rw},T("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const ZY=La("folding-expanded",jt.chevronDown,T("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),JY=La("folding-collapsed",jt.chevronRight,T("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),vrt=La("folding-manual-collapsed",JY,T("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),brt=La("folding-manual-expanded",ZY,T("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),j1e={color:Ys(E1r),position:Uh.Inline};class Ga{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ga.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ga.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ga.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ga.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ga.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ga.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ga.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ga.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ga.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ga.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ga.MANUALLY_EXPANDED_VISUAL_DECORATION:Ga.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ga.COLLAPSED_VISUAL_DECORATION=Oi.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ei.asClassName(JY)});Ga.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Oi.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:j1e,isWholeLine:!0,firstLineDecorationClassName:ei.asClassName(JY)});Ga.MANUALLY_COLLAPSED_VISUAL_DECORATION=Oi.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ei.asClassName(vrt)});Ga.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Oi.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:j1e,isWholeLine:!0,firstLineDecorationClassName:ei.asClassName(vrt)});Ga.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Oi.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Ga.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Oi.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:j1e,isWholeLine:!0});Ga.EXPANDED_VISUAL_DECORATION=Oi.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ei.asClassName(ZY)});Ga.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Oi.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:ei.asClassName(ZY)});Ga.MANUALLY_EXPANDED_VISUAL_DECORATION=Oi.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ei.asClassName(brt)});Ga.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Oi.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:ei.asClassName(brt)});Ga.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Oi.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Ga.HIDDEN_RANGE_DECORATION=Oi.register({description:"folding-hidden-range-decoration",stickiness:1});const x1r={},T1r="syntax";class q1e{constructor(e,t,i,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=T1r,this.disposables=new yt,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(i))}compute(e){return k1r(this.providers,this.editorModel,e).then(t=>{var i,r;return t?L1r(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 k1r(n,e,t){let i=null;const r=n.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,x1r,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})}},tl));return Promise.all(r).then(o=>i)}class I1r{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>O_||t>O_)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 Sf(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 Sf(r,o,s)}}}function L1r(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 I1r(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 D1r=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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},A1r=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())})},I2;const Tu=new sn("foldingEnabled",!1);let _0=I2=class extends qe{static get(e){return e.getContribution(I2.ID)}static getFoldingRangeProviders(e,t){var i,r;const o=e.foldingRangeProvider.ordered(t);return(r=(i=I2._foldingRangeSelector)===null||i===void 0?void 0:i.call(I2,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 yt),this.editor=e,this._foldingLimitReporter=new yrt(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 Ga(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Tu.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 d1r(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new _1r(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Um(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Mo(()=>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 U1e(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=I2.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new q1e(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 wu,i=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=Sl(o=>i.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=o.setCollapsedAllOfType(kd.Imports.value,!0);u&&(s=Ev.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=>(Pi(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,Pi)}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)}};_0.ID="editor.contrib.folding";_0=I2=D1r([YO(1,bi),YO(2,es),YO(3,Wa),YO(4,Ag),YO(5,wn)],_0);class yrt{constructor(e){this.editor=e,this._onDidChange=new De,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 Ju extends vn{runEditorCommand(e,t,i){const r=e.get(es),o=_0.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 Crt(n){if(!Fh(n)){if(!xd(n))return!1;const e=n;if(!Fh(e.levels)&&!pS(e.levels)||!Fh(e.direction)&&!Rd(e.direction)||!Fh(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(pS)))return!1}return!0}class R1r extends Ju{constructor(){super({id:"editor.unfold",label:T("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Tu,kbOpts:{kbExpr:de.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:Crt,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"?mrt(t,!1,o,s):mN(t,!1,o,s)}}class N1r extends Ju{constructor(){super({id:"editor.unfoldRecursively",label:T("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2142),weight:100}})}invoke(e,t,i,r){mN(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class O1r extends Ju{constructor(){super({id:"editor.fold",label:T("foldAction.label","Fold"),alias:"Fold",precondition:Tu,kbOpts:{kbExpr:de.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:Crt,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"?h1r(t,!0,o):a==="up"?mrt(t,!0,s||1,o):mN(t,!0,s||1,o)}}class P1r extends Ju{constructor(){super({id:"editor.toggleFold",label:T("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2090),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);grt(t,1,r)}}class M1r extends Ju{constructor(){super({id:"editor.foldRecursively",label:T("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2140),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);mN(t,!0,Number.MAX_VALUE,r)}}class F1r extends Ju{constructor(){super({id:"editor.foldAllBlockComments",label:T("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2138),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())z1e(t,kd.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*"+ep(a.blockCommentStartToken));W1e(t,l,!0)}}}}class B1r extends Ju{constructor(){super({id:"editor.foldAllMarkerRegions",label:T("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2077),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())z1e(t,kd.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);W1e(t,l,!0)}}}}class $1r extends Ju{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:T("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2078),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())z1e(t,kd.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);W1e(t,l,!1)}}}}class V1r extends Ju{constructor(){super({id:"editor.foldAllExcept",label:T("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2136),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);_rt(t,!0,r)}}class H1r extends Ju{constructor(){super({id:"editor.unfoldAllExcept",label:T("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2134),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);_rt(t,!1,r)}}class W1r extends Ju{constructor(){super({id:"editor.foldAll",label:T("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2069),weight:100}})}invoke(e,t,i){mN(t,!0)}}class z1r extends Ju{constructor(){super({id:"editor.unfoldAll",label:T("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2088),weight:100}})}invoke(e,t,i){mN(t,!1)}}class _k extends Ju{getFoldingLevel(){return parseInt(this.id.substr(_k.ID_PREFIX.length))}invoke(e,t,i){f1r(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}_k.ID_PREFIX="editor.foldLevel";_k.ID=n=>_k.ID_PREFIX+n;class U1r extends Ju{constructor(){super({id:"editor.gotoParentFold",label:T("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=p1r(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class j1r extends Ju{constructor(){super({id:"editor.gotoPreviousFold",label:T("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=g1r(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class q1r extends Ju{constructor(){super({id:"editor.gotoNextFold",label:T("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=m1r(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class G1r extends Ju{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:T("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(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=Sf.sanitizeAndMerge(t.regions,o,(r=i.getModel())===null||r===void 0?void 0:r.getLineCount());t.updatePost(Sf.fromFoldRanges(a))}}}}class K1r extends Ju{constructor(){super({id:"editor.removeManualFoldingRanges",label:T("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(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()}}}Hr(_0.ID,_0,0);Pt(R1r);Pt(N1r);Pt(O1r);Pt(M1r);Pt(W1r);Pt(z1r);Pt(F1r);Pt(B1r);Pt($1r);Pt(V1r);Pt(H1r);Pt(P1r);Pt(U1r);Pt(j1r);Pt(q1r);Pt(G1r);Pt(K1r);for(let n=1;n<=7;n++)KZi(new _k({id:_k.ID(n),label:T("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:Tu,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2048|21+n),weight:100}}));yr.registerCommand("_executeFoldingRangeProvider",function(n,...e){return A1r(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Jn))throw ag();const i=n.get(wn),r=n.get(Ls).getModel(t);if(!r)throw ag();const o=n.get(pr);if(!o.getValue("editor.folding",{resource:t}))return[];const s=n.get(es),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new U1e(r,s,l);let u=c;if(a!=="indentation"){const f=_0.getFoldingRangeProviders(i,r);f.length&&(u=new q1e(r,f,()=>{},l,c))}const d=yield u.compute(or.None),h=[];try{if(d)for(let f=0;f<d.length;f++){const g=d.getType(f);h.push({start:d.getStartLineNumber(f),end:d.getEndLineNumber(f),kind:g?kd.fromValue(g):void 0})}return h}finally{u.dispose()}})});class Y1r extends vn{constructor(){super({id:"editor.action.fontZoomIn",label:T("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){Hp.setZoomLevel(Hp.getZoomLevel()+1)}}class Q1r extends vn{constructor(){super({id:"editor.action.fontZoomOut",label:T("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){Hp.setZoomLevel(Hp.getZoomLevel()-1)}}class X1r extends vn{constructor(){super({id:"editor.action.fontZoomReset",label:T("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){Hp.setZoomLevel(0)}}Pt(Y1r);Pt(Q1r);Pt(X1r);var wrt=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},OU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},G1e=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 O5=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new yt,this._sessionDisposables=new yt,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 cz;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 $a,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}});snt(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),r.token).then(s=>{r.token.isCancellationRequested||yu(s)&&(qA.execute(this._editor,s,!0),g1e(s))}).finally(()=>{o.dispose()})}};O5.ID="editor.contrib.autoFormat";O5=wrt([OU(1,wn),OU(2,o_)],O5);let P5=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new yt,this._callOnModel=new yt,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(ont,this.editor,e,2,Jy.None,or.None).catch(Pi))}};P5.ID="editor.contrib.formatOnPaste";P5=wrt([OU(1,wn),OU(2,pi)],P5);class Z1r extends vn{constructor(){super({id:"editor.action.formatDocument",label:T("formatDocument.label","Format Document"),alias:"Format Document",precondition:ht.and(de.notInCompositeEditor,de.writable,de.hasDocumentFormattingProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return G1e(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(pi);yield e.get(fE).showWhile(i.invokeFunction(l_r,t,1,Jy.None,or.None),250)}})}}class J1r extends vn{constructor(){super({id:"editor.action.formatSelection",label:T("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:ht.and(de.writable,de.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2084),weight:100},contextMenuOpts:{when:de.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return G1e(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(pi),r=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new J(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);yield e.get(fE).showWhile(i.invokeFunction(ont,t,o,1,Jy.None,or.None),250)})}}Hr(O5.ID,O5,2);Hr(P5.ID,P5,2);Pt(Z1r);Pt(J1r);yr.registerCommand("editor.action.format",n=>G1e(void 0,void 0,void 0,function*(){const e=n.get(io).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(ga);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var eCr=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},kne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},tCr=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 TL{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 vhe extends TL{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class Srt extends TL{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 TL{static create(e,t,i){const r=new $a(i),o=new by(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=TL.findId(`provider_${u}`,o),f=new Srt(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(g=>{for(const m of g||[])by._makeOutlineElement(m,f);return f},g=>(tl(g),f)).then(g=>{TL.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);ka(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=TL.findId(e,t),r=new vhe(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=rr.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 vhe?e.push(t.symbol):e.push(...rr.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>J.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return by._flattenDocumentSymbols(t,e,""),t.sort((i,r)=>Re.compare(J.getStartPosition(i.range),J.getStartPosition(r.range))||Re.compare(J.getEndPosition(r.range),J.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 eQ=lr("IOutlineModelService");let bhe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new yt,this._cache=new uE(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 tCr(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()||!ka(o.provider,r)){const a=new $a;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()}})}};bhe=eCr([kne(0,wn),kne(1,Ag),kne(2,Ls)],bhe);Cr(eQ,bhe,1);var nCr=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())})};yr.registerCommand("_executeDocumentSymbolProvider",function(n,...e){return nCr(this,void 0,void 0,function*(){const[t]=e;ko(Jn.isUri(t));const i=n.get(eQ),o=yield n.get(vh).createModelReference(t);try{return(yield i.getOrCreate(o.object.textEditorModel,or.None)).getTopLevelSymbols()}finally{o.dispose()}})});class Jl extends qe{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Jl.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Jl.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Jl.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Jl.suppressSuggestions.bindTo(this.contextKeyService),this._register(Zo(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(Zo(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 f=Gu(u);f===-1&&(f=u.length-1),o=f>0;const g=r.textModel.getOptions().tabSize;s=Cl.visibleColumnFromColumn(u,f+1,g)<g}}this.inlineCompletionSuggestsIndentation.set(o),this.inlineCompletionSuggestsIndentationLessThanTabSize.set(s)}))}}Jl.inlineSuggestionVisible=new sn("inlineSuggestionVisible",!1,T("inlineSuggestionVisible","Whether an inline suggestion is visible"));Jl.inlineSuggestionHasIndentation=new sn("inlineSuggestionHasIndentation",!1,T("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace"));Jl.inlineSuggestionHasIndentationLessThanTabSize=new sn("inlineSuggestionHasIndentationLessThanTabSize",!0,T("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"));Jl.suppressSuggestions=new sn("inlineSuggestionSuppressSuggestions",void 0,T("suppressSuggestions","Whether suggestions should be suppressed for the current suggestion"));function iCr(n,e){const t=new rCr(n),i=e.map(r=>{const o=J.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 rCr{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 oCr=[];function sCr(){return oCr}class aCr{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 J(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function lCr(n,e){const t=new yt,i=n.createDecorationsCollection();return t.add(o1e({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function yhe(n,e){return new Re(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function Che(n){let e=1,t=1;for(const i of n)i===`
`?(e++,t=1):t++;return new Re(e,t)}class PU{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 iCr(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 whe{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 She{constructor(e,t,i,r=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=r,this.parts=[new whe(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 C3e(n,e){return n===e?!0:!n||!e?!1:n instanceof PU&&e instanceof PU||n instanceof She&&e instanceof She?n.equals(e):!1}var cCr=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},uCr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const w3e="ghost-text";let Ehe=class extends qe{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=as(this,!1),this.currentTextModel=Ec(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=mr(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 She?s.columnRange:void 0,l=[],c=[];function u(m,v){if(c.length>0){const _=c[c.length-1];v&&_.decorations.push(new $h(_.content.length+1,_.content.length+1+m[0].length,v,0)),_.content+=m[0],m=m.slice(1)}for(const _ of m)c.push({content:_,decorations:v?[new $h(1,_.length+1,v,0)]:[]})}const d=o.getLineContent(s.lineNumber);let h,f=0;for(const m of s.parts){let v=m.lines;h===void 0?(l.push({column:m.column,text:v[0],preview:m.preview}),v=v.slice(1)):u([d.substring(f,m.column-1)],void 0),v.length>0&&(u(v,w3e),h===void 0&&m.column<=d.length&&(h=m.column)),f=m.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new aCr(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:o}}),this.decorations=mr(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:J.fromPositions(new Re(o.lineNumber,a.column)),options:{description:w3e,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:nv.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new dCr(this.editor,this.languageService.languageIdCodec,mr(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(_i(()=>{this.isDisposed.set(!0,void 0)})),this._register(lCr(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Ehe=cCr([uCr(2,Es)],Ehe);class dCr extends qe{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=kf("editorOptionChanged",on.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(Zo(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");hCr(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function hCr(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 oN(1e4);h.appendString('<div class="suggest-preview-text">');for(let m=0,v=t.length;m<v;m++){const _=t[m],b=_.content;h.appendString('<div class="view-line'),h.appendString('" style="top:'),h.appendString(String(m*d)),h.appendString('px;width:1000000px;">');const y=x6(b),C=CA(b),E=Ol.createEmpty(b,r);D6(new dE(u.isMonospace&&!o,u.canUseHalfwidthRightwardsArrow,b,!1,y,C,0,E,_.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==xf.OFF,null),h),h.appendString("</div>")}h.appendString("</div>"),Zc(n,u);const f=h.build(),g=S3e?S3e.createHTML(f):f;n.innerHTML=g}const S3e=M1("editorGhostText",{createHTML:n=>n});function fCr(n,e){const t=new VJe,i=new WJe(t,c=>e.getLanguageConfiguration(c)),r=new HJe(new pCr([n]),i),o=Vce(r,[],void 0,!0);let s="";const a=n.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=Qs(u,c.openingBracket.length),c.child&&(l(c.child,u),u=Qs(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=Qs(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,Qs(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=Qs(u,d.length)}}return l(o,Id),s}class pCr{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 sm{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=sm._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(sm.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(sm.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(sm.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(sm.isVariableCharacter(i)||sm.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 sm._table[i]>"u"&&!sm.isDigitCharacter(i)&&!sm.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}}sm._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class _N{constructor(){this._children=[]}appendChild(e){return e instanceof vd&&this._children[this._children.length-1]instanceof vd?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 aB)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class vd extends _N{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new vd(this.value)}}class Ert extends _N{}class Fp extends Ert{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 vN?this._children[0]:void 0}clone(){const e=new Fp(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class vN extends _N{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof vd&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new vN;return this.options.forEach(e.appendChild,e),e}}class K1e extends _N{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 P_&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const i of this._children)if(i instanceof P_){let r=e[i.index]||"";r=i.resolve(r),t+=r}else t+=i.toString();return t}toString(){return""}clone(){const e=new K1e;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 P_ extends _N{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 P_(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class M5 extends Ert{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 vd(t)],!0):!1}clone(){const e=new M5(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function E3e(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class aB extends _N{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Fp&&(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 E3e([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Fp&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof M5&&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 aB;return this._children=this.children.map(t=>t.clone()),e}walk(e){E3e(this.children,e)}}class nR{constructor(){this._scanner=new sm,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 aB;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 Fp&&(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 Fp(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof Fp&&r.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.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 Fp(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 vd(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 Fp(Number(t)):new M5(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 Fp(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new vd("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new vN;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 vd(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 M5(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new vd("${"+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 K1e;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 vd(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 P_(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new P_(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 P_(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new P_(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new P_(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 P_(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new P_(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new vd(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var Ine=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 gCr(n,e,t,i,r=or.None,o){return Ine(this,void 0,void 0,function*(){const s=vCr(e,t),a=n.all(t),l=new L0e;for(const _ of a)_.groupId&&l.add(_.groupId,_);function c(_){if(!_.yieldsToGroupIds)return[];const b=[];for(const y of _.yieldsToGroupIds||[]){const C=l.get(y);for(const E of C)b.push(E)}return b}const u=new Map,d=new Set;function h(_,b){if(b=[...b,_],d.has(_))return b;d.add(_);try{const y=c(_);for(const C of y){const E=h(C,b);if(E)return E}}finally{d.delete(_)}}function f(_){const b=u.get(_);if(b)return b;const y=h(_,[]);y&&tl(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(E=>E.toString?E.toString():""+E).join(" -> ")}`));const C=new DK;return u.set(_,C.p),(()=>Ine(this,void 0,void 0,function*(){if(!y){const E=c(_);for(const x of E){const k=yield f(x);if(k&&k.items.length>0)return}}try{return yield _.provideInlineCompletions(t,e,i,r)}catch(E){tl(E);return}}))().then(E=>C.complete(E),E=>C.error(E)),C.p}const g=yield Promise.all(a.map(_=>Ine(this,void 0,void 0,function*(){return{provider:_,completions:yield f(_)}}))),m=new Map,v=[];for(const _ of g){const b=_.completions;if(!b)continue;const y=new _Cr(b,_.provider);v.push(y);for(const C of b.items){const E=MU.from(C,y,s,t,o);m.set(E.hash(),E)}}return new mCr(Array.from(m.values()),new Set(m.keys()),v)})}class mCr{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 _Cr{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 MU{static from(e,t,i,r,o){let s,a,l=e.range?J.lift(e.range):i;if(typeof e.insertText=="string"){if(s=e.insertText,o&&e.completeBracketPairs){s=x3e(s,l.getStartPosition(),r,o);const c=s.length-e.insertText.length;c!==0&&(l=new J(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=x3e(e.insertText.snippet,l.getStartPosition(),r,o);const d=e.insertText.snippet.length-c;d!==0&&(l=new J(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new nR().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof vd?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else xK(e.insertText);return new MU(s,e.command,l,s,a,e.additionalTextEdits||sCr(),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 MU(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 vCr(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new J(n.lineNumber,t.startColumn,n.lineNumber,i):J.fromPositions(n,n.with(void 0,i))}function x3e(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?fCr(a,i):n}class iR{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=KT(r,this.text),s=yhe(this.range.getStartPosition(),Che(r.substring(0,o))),a=this.text.substring(o),l=J.fromPositions(s,this.range.getEndPosition());return new iR(l,a)}augments(e){return this.text.startsWith(e.text)&&bCr(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=jo(s).length;if(o.range.startColumn-1<=a){const g=jo(o.text).length,m=s.substring(o.range.startColumn-1,a),[v,_]=[o.range.getStartPosition(),o.range.getEndPosition()],b=v.column+m.length<=_.column?v.delta(0,m.length):_,y=J.fromPositions(b,_),C=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(g);o=new iR(y,C)}const c=e.getValueInRange(o.range),u=yCr(c,o.text);if(!u)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(m=>m.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-r;for(const g of u){const m=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m<i.column||g.originalLength>0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,_=Math.max(g.modifiedStart,Math.min(v,f)),b=o.text.substring(g.modifiedStart,_),y=o.text.substring(_,Math.max(g.modifiedStart,v));if(b.length>0){const C=a0(b);h.push(new whe(m,C,!1))}if(y.length>0){const C=a0(y);h.push(new whe(m,C,!0))}}return new PU(d,h)}}function bCr(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let jv;function yCr(n,e){if((jv==null?void 0:jv.originalValue)===n&&(jv==null?void 0:jv.newValue)===e)return jv==null?void 0:jv.changes;{let t=k3e(n,e,!0);if(t){const i=T3e(t);if(i>0){const r=k3e(n,e,!1);r&&T3e(r)<i&&(t=r)}}return jv={originalValue:n,newValue:e,changes:t},t}}function T3e(n){let e=0;for(const t of n)e+=t.originalLength;return e}function k3e(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 f=c.charCodeAt(d);f>u&&(u=f)}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 f=0,g=c.length;f<g;f++)if(t&&c[f]==="("){const m=d*100+u;h[f]=o(2*m),u++}else if(t&&c[f]===")"){u=Math.max(u-1,0);const m=d*100+u;h[f]=o(2*m+1),u===0&&d++}else h[f]=c.charCodeAt(f);return h}const a=s(n),l=s(e);return new bb({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var CCr=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},I3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wCr=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 xhe=class extends qe{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 Ac),this.inlineCompletions=uU("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=uU("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var r,o;const s=new ECr(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 $a,u=(()=>wCr(this,void 0,void 0,function*(){if((l||t.triggerKind===Qy.Automatic)&&(yield SCr(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=yield gCr(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()-f.getTime());const v=new kCr(g,s,this.textModel,this.versionId);if(i){const _=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!g.has(_)&&v.prepend(i.inlineCompletion,_.range,!0)}return this._updateOperation.clear(),ks(_=>{a.set(v,_)}),!0}))(),d=new TCr(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()}};xhe=CCr([I3e(3,wn),I3e(4,es)],xhe);function SCr(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 ECr{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&xCr(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,i)=>t.equals(i))&&(e.context.triggerKind===Qy.Automatic||this.context.triggerKind===Qy.Explicit)&&this.versionId===e.versionId}}function xCr(n,e,t){return!n||!e?n===e:t(n,e)}class TCr{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class kCr{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=mr(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 L3e(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 L3e(e,r,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class L3e{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 iR(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)&&!!Aet(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 iR(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return D3e(this._getUpdatedRange(e)).isBefore(D3e(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 D3e(n){return n.startLineNumber===n.endLineNumber?new Re(1,1+n.endColumn-n.startColumn):new Re(1+n.endLineNumber-n.startLineNumber,n.endColumn)}var r4=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 Bi={Visible:V1e,HasFocusedSuggestion:new sn("suggestWidgetHasFocusedSuggestion",!1,T("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new sn("suggestWidgetDetailsVisible",!1,T("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new sn("suggestWidgetMultipleSuggestions",!1,T("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new sn("suggestionMakesTextEdit",!0,T("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new sn("acceptSuggestionOnEnter",!0,T("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new sn("suggestionHasInsertAndReplaceRange",!1,T("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new sn("suggestionInsertMode",void 0,{type:"string",description:T("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new sn("suggestionCanResolve",!1,T("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Xw=new ue("suggestWidgetStatusBar");class ICr{constructor(e,t,i,r){var o;this.position=e,this.completion=t,this.container=i,this.provider=r,this.isInvalid=!1,this.score=gv.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,J.isIRange(t.range)?(this.editStart=new Re(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Re(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Re(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||J.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Re(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Re(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Re(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||J.spansMultipleLines(t.range.insert)||J.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 r4(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new wu(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=i.elapsed()},r=>{Av(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class F5{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}}F5.default=new F5;let LCr;function DCr(){return LCr}class ACr{constructor(e,t,i,r){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=r}}function Y1e(n,e,t,i=F5.default,r={triggerKind:0},o=or.None){return r4(this,void 0,void 0,function*(){const s=new wu;t=t.clone();const a=e.getWordAtPosition(t),l=a?new J(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):J.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new yt,h=[];let f=!1;const g=(v,_,b)=>{var y,C,E;let x=!1;if(!_)return x;for(const k of _.suggestions)if(!i.kindFilter.has(k.kind)){if(!i.showDeprecated&&(!((y=k==null?void 0:k.tags)===null||y===void 0)&&y.includes(1)))continue;k.range||(k.range=c),k.sortText||(k.sortText=typeof k.label=="string"?k.label:k.label.label),!f&&k.insertTextRules&&k.insertTextRules&4&&(f=nR.guessNeedsClipboard(k.insertText)),u.push(new ICr(t,k,_,v)),x=!0}return i0e(_)&&d.add(_),h.push({providerName:(C=v._debugDisplayName)!==null&&C!==void 0?C:"unknown_provider",elapsedProvider:(E=_.duration)!==null&&E!==void 0?E:-1,elapsedOverall:b.elapsed()}),x},m=(()=>r4(this,void 0,void 0,function*(){}))();for(const v of n.orderedGroups(e)){let _=!1;if(yield Promise.all(v.map(b=>r4(this,void 0,void 0,function*(){if(i.providerItemsToReuse.has(b)){const y=i.providerItemsToReuse.get(b);y.forEach(C=>u.push(C)),_=_||y.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const y=new wu,C=yield b.provideCompletionItems(e,t,r,o);_=g(b,C,y)||_}catch(y){tl(y)}}))),_||o.isCancellationRequested)break}return yield m,o.isCancellationRequested?(d.dispose(),Promise.reject(new aE)):new ACr(u.sort(OCr(i.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)})}function Q1e(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 RCr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return Q1e(n,e)}function NCr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return Q1e(n,e)}const tQ=new Map;tQ.set(0,RCr);tQ.set(2,NCr);tQ.set(1,Q1e);function OCr(n){return tQ.get(n)}yr.registerCommand("_executeCompletionItemProvider",(n,...e)=>r4(void 0,void 0,void 0,function*(){const[t,i,r,o]=e;ko(Jn.isUri(t)),ko(Re.isIPosition(i)),ko(typeof r=="string"||!r),ko(typeof o=="number"||!o);const{completionProvider:s}=n.get(wn),a=yield n.get(vh).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(i),d=yield Y1e(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(or.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 PCr(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class kL{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 A3e(n,e=eu){return Nsr(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var MCr=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},FCr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class R3e{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 N3e{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=jo(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof vd&&(a=jo(a0(c.value).pop())),!0));const l=KT(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 O3e{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Bw(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Bw(this._model.uri.fsPath),r=i.lastIndexOf(".");return r<=0?i:i.slice(0,r)}else{if(t==="TM_DIRECTORY")return DXe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(XK(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 P3e{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=>!FXe(r));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let FU=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}}};FU=MCr([FCr(2,es)],FU);class iv{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 iv.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return iv.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return iv.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return iv.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}}}iv.dayNames=[T("Sunday","Sunday"),T("Monday","Monday"),T("Tuesday","Tuesday"),T("Wednesday","Wednesday"),T("Thursday","Thursday"),T("Friday","Friday"),T("Saturday","Saturday")];iv.dayNamesShort=[T("SundayShort","Sun"),T("MondayShort","Mon"),T("TuesdayShort","Tue"),T("WednesdayShort","Wed"),T("ThursdayShort","Thu"),T("FridayShort","Fri"),T("SaturdayShort","Sat")];iv.monthNames=[T("January","January"),T("February","February"),T("March","March"),T("April","April"),T("May","May"),T("June","June"),T("July","July"),T("August","August"),T("September","September"),T("October","October"),T("November","November"),T("December","December")];iv.monthNamesShort=[T("JanuaryShort","Jan"),T("FebruaryShort","Feb"),T("MarchShort","Mar"),T("AprilShort","Apr"),T("MayShort","May"),T("JuneShort","Jun"),T("JulyShort","Jul"),T("AugustShort","Aug"),T("SeptemberShort","Sep"),T("OctoberShort","Oct"),T("NovemberShort","Nov"),T("DecemberShort","Dec")];class M3e{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=Ycr(this._workspaceService.getWorkspace());if(!qcr(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(lue(e))return Bw(e.uri.path);let t=Bw(e.configPath.path);return t.endsWith(cue)&&(t=t.substr(0,t.length-cue.length-1)),t}_resoveWorkspacePath(e){if(lue(e))return A3e(e.uri.fsPath);const t=Bw(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?A3e(i):"/"}}class F3e{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 qY()}}var BCr=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},$Cr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},w_;class Rp{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=rNe(t.placeholders,Fp.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=J.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+o)),a=i.isFinalTabstop?Rp._decor.inactiveFinal:Rp._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(Is.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 kn(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?Rp._decor.activeFinal:Rp._decor.active),o.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?Rp._decor.activeFinal:Rp._decor.active),o.add(u)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?Rp._decor.inactiveFinal:Rp._decor.inactive);return s});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Fp){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 vN,!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=J.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+u)),h=i.addDecoration(d,Rp._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=rNe(this._snippet.placeholders,Fp.compareByIndex)})}}Rp._decor={active:Oi.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Oi.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Oi.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Oi.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const B3e={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let BU=w_=class{static adjustWhitespace(e,t,i,r,o){const s=e.getLineContent(t.lineNumber),a=jo(s,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof vd)||c.parent instanceof vN||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 f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;f<u.length;f++)u[f]=e.normalizeIndentation(a+u[f])}const d=u.join(e.getEOL());return d!==c.value&&(c.parent.replace(c,[new vd(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=kn.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(),f=e.invokeWithinContext(C=>C.get(tk)),g=e.invokeWithinContext(C=>new O3e(C.get(BA),h)),m=()=>a,v=h.getValueInRange(w_.adjustSelection(h,e.getSelection(),i,0)),_=h.getValueInRange(w_.adjustSelection(h,e.getSelection(),0,r)),b=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((C,E)=>({selection:C,idx:E})).sort((C,E)=>J.compareRangesUsingStarts(C.selection,E.selection));for(const{selection:C,idx:E}of y){let x=w_.adjustSelection(h,C,i,0),k=w_.adjustSelection(h,C,0,r);v!==h.getValueInRange(x)&&(x=C),_!==h.getValueInRange(k)&&(k=C);const L=C.setStartPosition(x.startLineNumber,x.startColumn).setEndPosition(k.endLineNumber,k.endColumn),D=new nR().parse(t,!0,o),A=L.getStartPosition(),N=w_.adjustWhitespace(h,A,s||E>0&&b!==h.getLineFirstNonWhitespaceColumn(C.positionLineNumber),D);D.resolveVariables(new R3e([g,new P3e(m,E,y.length,e.getOption(78)==="spread"),new N3e(h,C,E,l),new FU(h,C,c),new iv,new M3e(f),new F3e])),u[E]=Is.replace(L,D.toString()),u[E].identifier={major:E,minor:0},u[E]._isTracked=!0,d[E]=new Rp(e,D,N)}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 nR,d=new aB,h=new R3e([e.invokeWithinContext(g=>new O3e(g.get(BA),c)),new P3e(()=>o,0,e.getSelections().length,e.getOption(78)==="spread"),new N3e(c,e.getSelection(),0,s),new FU(c,e.getSelection(),a),new iv,new M3e(e.invokeWithinContext(g=>g.get(tk))),new F3e]);t=t.sort((g,m)=>J.compareRangesUsingStarts(g.range,m.range));let f=0;for(let g=0;g<t.length;g++){const{range:m,template:v}=t[g];if(g>0){const E=t[g-1].range,x=J.fromPositions(E.getEndPosition(),m.getStartPosition()),k=new vd(c.getValueInRange(x));d.appendChild(k),f+=k.value.length}const _=u.parseFragment(v,d);w_.adjustWhitespace(c,m.getStartPosition(),!0,d,new Set(_)),d.resolveVariables(h);const b=d.toString(),y=b.slice(f);f=b.length;const C=Is.replace(m,y);C.identifier={major:g,minor:0},C._isTracked=!0,l.push(C)}return u.ensureFinalTabstop(d,i,!0),{edits:l,snippets:[new Rp(e,d,"")]}}constructor(e,t,i=B3e,r){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){_o(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"?w_.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):w_.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=>kn.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=B3e){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:r}=w_.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=>kn.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(J.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(J.compareRangesUsingStarts);for(const[i,r]of t){if(r.length!==e.length){t.delete(i);continue}r.sort(J.compareRangesUsingStarts);for(let o=0;o<r.length;o++)if(!r[o].containsRange(e[o])){t.delete(i);continue}}return t.size>0}};BU=w_=BCr([$Cr(3,es)],BU);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},B7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},L2;const $3e={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Rc=L2=class{static get(e){return e.getContribution(L2.ID)}constructor(e,t,i,r,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new yt,this._modelVersionId=-1,this._inSnippet=L2.InSnippetMode.bindTo(r),this._hasNextTabstop=L2.HasNextTabstop.bindTo(r),this._hasPrevTabstop=L2.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"?$3e:Object.assign(Object.assign({},$3e),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?(ko(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new BU(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()||!Re.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=!!h.choice.options.find(v=>v.value===f),m=[];for(let v=0;v<h.choice.options.length;v++){const _=h.choice.options[v];m.push({kind:13,label:_.value,insertText:_.value,sortText:"a".repeat(v+1),range:h.range,filterText:g?`${f}_${_.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:T("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(()=>{PCr(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()}};Rc.ID="snippetController2";Rc.InSnippetMode=new sn("inSnippetMode",!1,T("inSnippetMode","Whether the editor in current in snippet mode"));Rc.HasNextTabstop=new sn("hasNextTabstop",!1,T("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));Rc.HasPrevTabstop=new sn("hasPrevTabstop",!1,T("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));Rc=L2=VCr([B7(1,hp),B7(2,wn),B7(3,bi),B7(4,es)],Rc);Hr(Rc.ID,Rc,4);const nQ=oc.bindToContribution(Rc.get);qt(new nQ({id:"jumpToNextSnippetPlaceholder",precondition:ht.and(Rc.InSnippetMode,Rc.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:100+30,kbExpr:de.editorTextFocus,primary:2}}));qt(new nQ({id:"jumpToPrevSnippetPlaceholder",precondition:ht.and(Rc.InSnippetMode,Rc.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:100+30,kbExpr:de.editorTextFocus,primary:1026}}));qt(new nQ({id:"leaveSnippet",precondition:Rc.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:100+30,kbExpr:de.editorTextFocus,primary:9,secondary:[1033]}}));qt(new nQ({id:"acceptSnippet",precondition:Rc.InSnippetMode,handler:n=>n.finish()}));var HCr=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},Lne=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())})},vf;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(vf||(vf={}));let The=class extends qe{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(xhe,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=as(this,!1),this._forceUpdate=Vtt("forceUpdate"),this._selectedInlineCompletionId=as(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([vf.Redo,vf.Undo,vf.AcceptWord]),this._fetchInlineCompletions=Opr({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Qy.Automatic}),handleChange:(g,m)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?m.preserveCurrentCompletion=!0:g.didChange(this._forceUpdate)&&(m.inlineCompletionTriggerKind=g.change),!0)},(g,m)=>{if(this._forceUpdate.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const _=this.selectedInlineCompletion.get(),b=m.preserveCurrentCompletion||_!=null&&_.forwardStable?_:void 0,y=this._source.suggestWidgetInlineCompletions.get(),C=this.selectedSuggestItem.read(g);if(y&&!C){const k=this._source.inlineCompletions.get();ks(L=>{k&&y.request.versionId>k.request.versionId&&this._source.inlineCompletions.set(y.clone(),L),this._source.clearSuggestWidgetInlineCompletions(L)})}const E=this.cursorPosition.read(g),x={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:C==null?void 0:C.toSelectedSuggestionInfo()};return this._source.fetch(E,x,b)}),this._filteredInlineCompletionItems=mr(this,g=>{const m=this._source.inlineCompletions.read(g);if(!m)return[];const v=this.cursorPosition.read(g);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=mr(this,g=>{const m=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),_=this._selectedInlineCompletionId===void 0?-1:v.findIndex(b=>b.semanticId===m);return _===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):_}),this.selectedInlineCompletion=mr(this,g=>{const m=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return m[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=mr(this,g=>{if(this.lastTriggerKind.read(g)===Qy.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=QMe({owner:this,equalityComparer:(g,m)=>!g||!m?g===m:C3e(g.ghostText,m.ghostText)&&g.inlineCompletion===m.inlineCompletion&&g.suggestItem===m.suggestItem},g=>{var m;const v=this.textModel,_=this.selectedSuggestItem.read(g);if(_){const b=_.toSingleTextEdit().removeCommonPrefix(v),y=this._computeAugmentedCompletion(b,g);if(!this._suggestPreviewEnabled.read(g)&&!y)return;const E=(m=y==null?void 0:y.edit)!==null&&m!==void 0?m:b,x=y?y.edit.text.length-b.text.length:0,k=this._suggestPreviewMode.read(g),L=this.cursorPosition.read(g),D=E.computeGhostText(v,k,L,x);return{ghostText:D??new PU(E.range.endLineNumber,[]),inlineCompletion:y==null?void 0:y.completion,suggestItem:_}}else{if(!this._isActive.read(g))return;const b=this.selectedInlineCompletion.read(g);if(!b)return;const y=b.toSingleTextEdit(g),C=this._inlineSuggestMode.read(g),E=this.cursorPosition.read(g),x=y.computeGhostText(v,C,E);return x?{ghostText:x,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostText=QMe({owner:this,equalityComparer:C3e},g=>{const m=this.state.read(g);if(m)return m.ghostText}),this._register(x5(this._fetchInlineCompletions));let f;this._register(Zo(g=>{var m,v;const _=this.state.read(g),b=_==null?void 0:_.inlineCompletion;if((b==null?void 0:b.semanticId)!==(f==null?void 0:f.semanticId)&&(f=b,b)){const y=b.inlineCompletion,C=y.source;(v=(m=C.provider).handleItemDidShow)===null||v===void 0||v.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*(){hde(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Qy.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){hde(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(w3);return Eer(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(i,J.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",[Is.replaceMove(r.range,""),...r.additionalTextEdits]),e.setPosition(r.snippetInfo.range.getStartPosition()),(t=Rc.get(e))===null||t===void 0||t.insert(r.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Is.replaceMove(r.range,r.insertText),...r.additionalTextEdits]),r.command&&r.source.addRef(),ks(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,tl),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 Re(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",[Is.replace(J.fromPositions(a),u)]);const d=Che(u);e.setPosition(yhe(a,d))}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const d=J.fromPositions(o.range.getStartPosition(),yhe(a,Che(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)}};The=HCr([Lne(9,pi),Lne(10,ga),Lne(11,es)],The);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},V3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},FP;class X1e{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 xrt extends X1e{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class zCr extends X1e{constructor(){super("recentlyUsed"),this._cache=new uE(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:T3.fromString(r.type),this._cache.set(i,r);this._seq=this._cache.size}}class UCr extends X1e{constructor(){super("recentlyUsedByPrefix"),this._trie=pD.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:T3.fromString(i.type),this._trie.set(t,i)}}}let B5=FP=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new yt,this._persistSoon=new Mo(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===qz.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=FP._strategyCtors.get(r)||xrt;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${FP._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(`${FP._storagePrefix}/${this._strategy.name}`,i,t,1)}}};B5._strategyCtors=new Map([["recentlyUsedByPrefix",UCr],["recentlyUsed",zCr],["first",xrt]]);B5._storagePrefix="suggest/memories";B5=FP=WCr([V3e(0,r_),V3e(1,pr)],B5);const iQ=lr("ISuggestMemories");Cr(iQ,B5,1);var jCr=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},qCr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},khe;let $5=khe=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=khe.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)}};$5.AtEnd=new sn("atEndOfWord",!1);$5=khe=jCr([qCr(1,bi)],$5);var GCr=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},KCr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},BP;let vk=BP=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=BP.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(BP._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=BP._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};vk.OtherSuggestions=new sn("hasOtherSuggestions",!1);vk=BP=GCr([KCr(1,bi)],vk);class YCr{constructor(e,t,i,r){this._disposables=new yt,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||!yu(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new cz;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 QCr=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 bf{provideSelectionRanges(e,t){return QCr(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=>bf._bracketsRightYield(a,0,e,r,s)),yield new Promise(a=>bf._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>=bf._maxRounds){e();break}if(!r){e();break}const l=i.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>bf._maxDuration){setTimeout(()=>bf._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 Td,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>=bf._maxRounds&&o.size===0){e();break}if(!r){e();break}const c=i.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>bf._maxDuration){setTimeout(()=>bf._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 f=o.get(d);if(f){const g=f.shift();f.size===0&&o.delete(d);const m=J.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=J.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:m}),s.push({range:v}),bf._addBracketLeading(i,v,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:J.fromPositions(new Re(r,o),t.getEndPosition())}),i.push({range:J.fromPositions(new Re(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:J.fromPositions(new Re(s,a),t.getEndPosition())}),i.push({range:J.fromPositions(new Re(s,1),t.getEndPosition())}))}}}bf._maxDuration=30;bf._maxRounds=2;var XCr=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 j_{static create(e,t){return XCr(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return j_.None;const i=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(i.uri))return j_.None;const[o]=yield new bf().provideSelectionRanges(i,[r]);if(o.length===0)return j_.None;const s=yield e.computeWordRanges(i.uri,o[0].range);if(!s)return j_.None;const a=i.getWordUntilPosition(r);return delete s[a.word],new class extends j_{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(rXe(d))return 2<<20;const h=y3(d,J.fromPositions(l),J.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=o.length;for(const m of o){if(!J.containsRange(m.range,f))break;g-=1}return g}}})}}j_.None=new class extends j_{distance(){return 0}};let H3e=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class jC{constructor(e,t,i,r,o,s,a=sY.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=jC._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=jC._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=jC._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?nk:Sur;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,f=h+i-(u.position.column-this._column);if(r.length!==f&&(r=f===0?"":t.slice(-f),o=r.toLowerCase()),u.word=r,f===0)u.score=gv.Default;else{let g=0;for(;g<h;){const m=r.charCodeAt(g);if(m===32||m===9)g+=1;else break}if(g>=f)u.score=gv.Default;else if(typeof u.completion.filterText=="string"){const m=l(r,o,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;tce(u.completion.filterText,u.textLabel)===0?u.score=m:(u.score=bur(r,o,g,u.textLabel,u.labelLow,0),u.score[0]=m[0])}else{const m=l(r,o,g,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?ole(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 jC._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 jC._compareCompletionItems(e,t)}}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},dC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},JCr=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())})},Ihe;class zE{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 ewr(n,e,t){if(!e.getContextKeyValue(Jl.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(Jl.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}function twr(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(Jl.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}let Lhe=Ihe=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 yt,this._triggerCharacterListener=new yt,this._triggerQuickSuggest=new Jm,this._triggerState=void 0,this._completionDisposables=new yt,this._onDidCancel=new De,this._onDidTrigger=new De,this._onDidSuggest=new De,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new kn(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(){_o(this._triggerCharacterListener),_o([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(DCr()),e.set(r,o)),o.add(i)}const t=i=>{var r;if(!twr(this._editor,this._contextKeyService,this._configurationService)||zE.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="";YT(i.charCodeAt(i.length-1))?Rl(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;kL.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(!((e=Rc.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!zE.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(!kL.isAllOff(r)){if(!kL.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(kL.valueFor(r,s)!=="on")return}ewr(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){ko(this._editor.hasModel()),ko(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new zE(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 zE(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 $a;const d=this._editor.getOption(111);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=Ihe._createSuggestFilter(this._editor),m=new F5(h,(o=(r=e.completionOptions)===null||r===void 0?void 0:r.kindFilter)!==null&&o!==void 0?o:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=j_.create(this._editorWorkerService,this._editor),_=Y1e(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),m,u,this._requestToken.token);Promise.all([_,v]).then(([b,y])=>JCr(this,void 0,void 0,function*(){var C;if((C=this._requestToken)===null||C===void 0||C.dispose(),!this._editor.hasModel())return;let E=e==null?void 0:e.clipboardText;if(!E&&b.needsClipboard&&(E=yield this._clipboardService.readText()),this._triggerState===void 0)return;const x=this._editor.getModel(),k=new zE(x,this._editor.getPosition(),e),L=Object.assign(Object.assign({},sY.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new jC(b.items,this._context.column,{leadingLineContent:k.leadingLineContent,characterCountDelta:k.column-this._context.column},y,this._editor.getOption(117),this._editor.getOption(111),L,E),this._completionDisposables.add(b.disposable),this._onNewContext(k),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(Pi)}_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(jo(e.leadingLineContent)!==jo(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(zE.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=zE.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})}}}}};Lhe=Ihe=ZCr([dC(1,o_),dC(2,H1),dC(3,dp),dC(4,hp),dC(5,bi),dC(6,pr),dC(7,wn),dC(8,vye)],Lhe);class rQ{constructor(e,t){this._disposables=new yt,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)>rQ._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()}}rQ._maxSelectionLength=51200;var nwr=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},Dne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Z1e extends ik{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=T({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,Z1e.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let Dhe=class{constructor(e,t,i,r,o){this._menuId=t,this._menuService=r,this._contextKeyService=o,this._menuDisposables=new yt,this.element=ft(e,Rt(".suggest-status-bar"));const s=a=>a instanceof Wm?i.createInstance(Z1e,a,void 0):void 0;this._leftActions=new wg(this.element,{actionViewItemProvider:s}),this._rightActions=new wg(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()}};Dhe=nwr([Dne(2,pi),Dne(3,k0),Dne(4,bi)],Dhe);var iwr=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},rwr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function J1e(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let Ahe=class{constructor(e,t){this._editor=e,this._onDidClose=new De,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new De,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new yt,this._renderDisposeable=new yt,this._borderWidth=1,this._size=new Kr(330,0),this.domNode=Rt(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(x1,{editor:e}),this._body=Rt(".body"),this._scrollbar=new P6(this._body,{alwaysConsumeMouseWheel:!0}),ft(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ft(this._body,Rt(".header")),this._close=ft(this._header,Rt("span"+ei.asCSSSelector(jt.close))),this._close.title=T("details.close","Close"),this._type=ft(this._header,Rt("p.type")),this._docs=ft(this._body,Rt("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=T("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 Kc().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!J1e(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,Ph(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else kc(this._type),this._type.title="",md(this._type),this.domNode.classList.add("no-type");if(kc(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),kc(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 Kr(e,t);Kr.equals(i,this._size)||(this._size=i,NZi(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}};Ahe=iwr([rwr(1,pi)],Ahe);class owr{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new yt,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new D1e,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=iN(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new Kr(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,E=new Kr(y,o.height-e.top-s.borderHeight-s.verticalPadding),x=E.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-t.width,maxSizeTop:E,maxSizeBottom:x,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),E=new Kr(y,o.height-e.top-s.borderHeight-s.verticalPadding),x=E.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-t.width,maxSizeTop:E,maxSizeBottom:x,minSize:a.with(Math.min(y,a.width))}}(),d=function(){const y=e.left,C=-s.borderWidth+e.top+e.height,E=new Kr(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:C,left:y,fit:E.height-t.height,maxSizeBottom:E,maxSizeTop:E,minSize:a.with(E.width)}}(),h=[c,u,d],f=(r=h.find(y=>y.fit>=0))!==null&&r!==void 0?r:h.sort((y,C)=>C.fit-y.fit)[0],g=e.top+e.height-s.borderHeight;let m,v=t.height;const _=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>_&&(v=_);let b;i?v<=f.maxSizeTop.height?(m=!0,b=f.maxSizeTop):(m=!1,b=f.maxSizeBottom):v<=f.maxSizeBottom.height?(m=!1,b=f.maxSizeBottom):(m=!0,b=f.maxSizeTop),this._applyTopLeft({left:f.left,top:m?f.top:g-v}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!m,f===c,m,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=b,this._resizable.layout(v,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 Uy;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(Uy||(Uy={}));const swr=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function $7(n,e,t,i){const r=i===Uy.ROOT_FOLDER?["rootfolder-icon"]:i===Uy.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Qi.data)o=xS.parseMetaData(t).get(xS.META_DATA_LABEL);else{const s=t.path.match(swr);s?(o=V7(s[2].toLowerCase()),s[1]&&r.push(`${V7(s[1].toLowerCase())}-name-dir-icon`)):o=V7(t.authority.toLowerCase())}if(i===Uy.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=awr(n,e,t);s&&r.push(`${V7(s)}-lang-file-icon`)}}return r}function awr(n,e,t){if(!t)return null;let i=null;if(t.scheme===Qi.data){const o=xS.parseMetaData(t).get(xS.META_DATA_MIME);o&&(i=e.getLanguageIdByMimeType(o))}else{const r=n.getModel(t);r&&(i=r.getLanguageId())}return i&&i!==jf?i:e.guessLanguageIdByFilepathOrFirstLine(t)}function V7(n){return n.replace(/[\11\12\14\15\40]/g,"/")}var lwr=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},Ane=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hC;function Trt(n){return`suggest-aria-id:${n}`}const cwr=La("suggest-more-info",jt.chevronRight,T("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),uwr=new(hC=class{extract(e,t){if(e.textLabel.match(hC._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(hC._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=hC._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}},hC._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*\))/,hC._regexStrict=new RegExp(`^${hC._regexRelaxed.source}$`,"i"),hC);let Rhe=class{constructor(e,t,i,r){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=r,this._onDidToggleDetails=new De,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new yt,i=e;i.classList.add("show-file-icons");const r=ft(e,Rt(".icon")),o=ft(r,Rt("span.colorspan")),s=ft(e,Rt(".contents")),a=ft(s,Rt(".main")),l=ft(a,Rt(".icon-label.codicon")),c=ft(a,Rt("span.left")),u=ft(a,Rt("span.right")),d=new sU(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=ft(c,Rt("span.signature-label")),f=ft(c,Rt("span.qualifier-label")),g=ft(u,Rt("span.details-label")),m=ft(u,Rt("span.readMore"+ei.asCSSSelector(cwr)));m.title=T("readMore","Read More");const v=()=>{const _=this._editor.getOptions(),b=_.get(50),y=b.getMassagedFontFamily(),C=b.fontFeatureSettings,E=_.get(118)||b.fontSize,x=_.get(119)||b.lineHeight,k=b.fontWeight,L=b.letterSpacing,D=`${E}px`,A=`${x}px`,N=`${L}px`;i.style.fontSize=D,i.style.fontWeight=k,i.style.letterSpacing=N,a.style.fontFamily=y,a.style.fontFeatureSettings=C,a.style.lineHeight=A,r.style.height=A,r.style.width=A,m.style.height=A,m.style.width=A};return v(),t.add(this._editor.onDidChangeConfiguration(_=>{(_.hasChanged(50)||_.hasChanged(118)||_.hasChanged(119))&&v()})),{root:i,left:c,right:u,icon:r,colorspan:o,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:m,disposables:t}}renderElement(e,t,i){const{completion:r}=e;i.root.id=Trt(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:W6(e.score)},s=[];if(r.kind===19&&uwr.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=$7(this._modelService,this._languageService,Jn.from({scheme:"fake",path:e.textLabel}),Uy.FILE),l=$7(this._modelService,this._languageService,Jn.from({scheme:"fake",path:r.detail}),Uy.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=[$7(this._modelService,this._languageService,Jn.from({scheme:"fake",path:e.textLabel}),Uy.FOLDER),$7(this._modelService,this._languageService,Jn.from({scheme:"fake",path:r.detail}),Uy.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...ei.asClassNameArray(T3.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=Rne(r.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=Rne(r.label.detail||""),i.detailsLabel.textContent=Rne(r.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?Ph(i.detailsLabel):md(i.detailsLabel),J1e(e)?(i.right.classList.add("can-expand-details"),Ph(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"),md(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};Rhe=lwr([Ane(1,Ls),Ane(2,Es),Ane(3,Vl)],Rhe);function Rne(n){return n.replace(/\r\n|\r|\n/g,"")}var dwr=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},H7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hwr=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())})},D2;fe("editorSuggestWidget.background",{dark:ca,light:ca,hcDark:ca,hcLight:ca},T("editorSuggestWidgetBackground","Background color of the suggest widget."));fe("editorSuggestWidget.border",{dark:Bb,light:Bb,hcDark:Bb,hcLight:Bb},T("editorSuggestWidgetBorder","Border color of the suggest widget."));const W7=fe("editorSuggestWidget.foreground",{dark:mm,light:mm,hcDark:mm,hcLight:mm},T("editorSuggestWidgetForeground","Foreground color of the suggest widget."));fe("editorSuggestWidget.selectedForeground",{dark:jx,light:jx,hcDark:jx,hcLight:jx},T("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));fe("editorSuggestWidget.selectedIconForeground",{dark:uL,light:uL,hcDark:uL,hcLight:uL},T("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const fwr=fe("editorSuggestWidget.selectedBackground",{dark:qx,light:qx,hcDark:qx,hcLight:qx},T("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));fe("editorSuggestWidget.highlightForeground",{dark:_m,light:_m,hcDark:_m,hcLight:_m},T("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));fe("editorSuggestWidget.focusHighlightForeground",{dark:$9,light:$9,hcDark:$9,hcLight:$9},T("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));fe("editorSuggestWidgetStatus.foreground",{dark:Bn(W7,.5),light:Bn(W7,.5),hcDark:Bn(W7,.5),hcLight:Bn(W7,.5)},T("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class pwr{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof AS}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(Kr.is(i))return Kr.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let V5=D2=class{constructor(e,t,i,r,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Ac,this._pendingShowDetails=new Ac,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Jm,this._disposables=new yt,this._onDidSelect=new qT,this._onDidFocus=new qT,this._onDidHide=new De,this._onDidShow=new De,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new De,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new D1e,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new gwr(this,e),this._persistedSize=new pwr(t,e);class s{constructor(f,g,m=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=m,this.persistWidth=v}}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 f,g,m,v;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:_,defaultSize:b}=this.getLayoutInfo(),y=Math.round(_/2);let{width:C,height:E}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-E)<=y)&&(E=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:b.height),(!a.persistWidth||Math.abs(a.currentSize.width-C)<=y)&&(C=(v=(m=a.persistedSize)===null||m===void 0?void 0:m.width)!==null&&v!==void 0?v:b.width),this._persistedSize.store(new Kr(C,E))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=ft(this.element.domNode,Rt(".message")),this._listElement=ft(this.element.domNode,Rt(".tree"));const l=this._disposables.add(o.createInstance(Ahe,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new owr(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const u=o.createInstance(Rhe,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new i_("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>T("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:_,description:b}=h.completion.label;_&&b?f=T("label.full","{0} {1}, {2}",f,_,b):_?f=T("label.detail","{0} {1}",f,_):b&&(f=T("label.desc","{0}, {1}",f,b))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:m}=h.completion,v=GT("{0}{1}",m||"",g?typeof g=="string"?g:g.value:"");return T("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(uN({listInactiveFocusBackground:fwr,listInactiveFocusOutline:vs})),this._status=o.createInstance(Dhe,this.element.domNode,Xw);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=Bi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Bi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Bi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Bi.HasFocusedSuggestion.bindTo(i),this._disposables.add(Ba(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=pv(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=Sl(o=>hwr(this,void 0,void 0,function*(){const s=bS(()=>{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:Trt(r)}))}).catch(Pi)),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:md(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=D2.LOADING_MESSAGE,md(this._listElement,this._status.element),Ph(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,wS(D2.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=D2.NO_SUGGESTIONS_MESSAGE,md(this._listElement,this._status.element),Ph(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,wS(D2.NO_SUGGESTIONS_MESSAGE);break;case 3:md(this._messageElement),Ph(this._listElement,this._status.element),this._show();break;case 4:md(this._messageElement),Ph(this._listElement,this._status.element),this._show();break;case 5:md(this._messageElement),Ph(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=bS(()=>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=iz(()=>{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")):(J1e(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=iz(()=>{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=iN(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 Kr(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,f=pl(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=f.top+g.top+g.height,v=Math.min(o.height-m-s.verticalPadding,d),_=f.top+g.top-s.verticalPadding,b=Math.min(_,d);let y=Math.min(Math.max(b,v)+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>v||this._forceRenderingAbove&&_>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=v),this.element.preferredSize=new Kr(u,s.defaultSize.height),this.element.maxSize=new Kr(c,y),this.element.minSize=new Kr(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=Ah(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 Kr(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}};V5.LOADING_MESSAGE=T("suggestWidget.loading","Loading...");V5.NO_SUGGESTIONS_MESSAGE=T("suggestWidget.noSuggestions","No suggestions.");V5=D2=dwr([H7(1,r_),H7(2,bi),H7(3,Vl),H7(4,pi)],V5);class gwr{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 Kr(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 mwr=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},f2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Nhe;class _wr{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:J.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 bm=Nhe=class{static get(e){return e.getContribution(Nhe.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 Ac,this._toDispose=new yt,this._selectors=new vwr(d=>d.priority),this._onWillInsertSuggestItem=new De,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(Lhe,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=Bi.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 Q$(()=>{const d=this._instantiationService.createInstance(V5,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new YCr(this.editor,d,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=Bi.MakesTextEdit.bindTo(this._contextKeyService),g=Bi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Bi.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(_i(()=>{f.reset(),g.reset(),m.reset()})),this._toDispose.add(d.onDidFocus(({item:v})=>{const _=this.editor.getPosition(),b=v.editStart.column,y=_.column;let C=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&y-b===v.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:_.lineNumber,startColumn:b,endLineNumber:_.lineNumber,endColumn:y})!==v.completion.insertText),f.set(C),g.set(!Re.equals(v.editInsertEnd,v.editReplaceEnd)),m.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new S1(!0,!1,!1,!1,33))||br&&v.toKeyCodeChord().equals(new S1(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new Q$(()=>this._toDispose.add(new rQ(this.editor,this.model)))),this._alternatives=this._toDispose.add(new Q$(()=>this._toDispose.add(new vk(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance($5,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new _wr(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;h===-1&&(h=0);let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(117);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),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=Bi.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=Rc.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 $a;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 g=Ev.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(m=>Is.replaceMove(J.lift(m.range),m.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new wu;let m;const v=r.onDidChangeContent(C=>{if(C.isFlush){l.cancel(),v.dispose();return}for(const E of C.changes){const x=J.getEndPosition(E.range);(!m||Re.isBefore(x,m))&&(m=x)}}),_=t;t|=2;let b=!1;const y=this.editor.onWillType(()=>{y.dispose(),b=!0,_&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(E=>Re.isBefore(m,J.getStartPosition(E.range))))return!1;b&&this.editor.pushUndoStop();const C=Ev.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(E=>Is.replaceMove(J.lift(E.range),E.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(_&2))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),C),h=C===!0?1:C===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=nR.escape(f)),this.model.cancel(),i.insert(f,{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===lB.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new wu;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(m=>{s.completion.extensionId?tl(m):Pi(m)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();r.canUndo();){o!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(g,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:FZe(Cg(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Msr(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:o})}getOverwriteInfo(e,t){ko(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(yu(e.completion.additionalTextEdits)){const t=T("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);vu(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};on.once(this.model.onDidTrigger)(o=>{const s=[];on.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{_o(s),i()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(_o(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)}};bm.ID="editor.contrib.suggestController";bm=Nhe=mwr([f2(1,iQ),f2(2,ga),f2(3,bi),f2(4,pi),f2(5,hp),f2(6,dp)],bm);class vwr{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 lB extends vn{constructor(){super({id:lB.id,label:T("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:ht.and(de.writable,de.hasCompletionItemProvider,Bi.Visible.toNegated()),kbOpts:{kbExpr:de.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const r=bm.get(t);if(!r)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),r.triggerSuggest(void 0,o,void 0)}}lB.id="editor.action.triggerSuggest";Hr(bm.ID,bm,2);Pt(lB);const ip=100+90,Vd=oc.bindToContribution(bm.get);qt(new Vd({id:"acceptSelectedSuggestion",precondition:ht.and(Bi.Visible,Bi.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:ht.and(Bi.Visible,de.textInputFocus),weight:ip},{primary:3,kbExpr:ht.and(Bi.Visible,de.textInputFocus,Bi.AcceptSuggestionsOnEnter,Bi.MakesTextEdit),weight:ip}],menuOpts:[{menuId:Xw,title:T("accept.insert","Insert"),group:"left",order:1,when:Bi.HasInsertAndReplaceRange.toNegated()},{menuId:Xw,title:T("accept.insert","Insert"),group:"left",order:1,when:ht.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("insert"))},{menuId:Xw,title:T("accept.replace","Replace"),group:"left",order:1,when:ht.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("replace"))}]}));qt(new Vd({id:"acceptAlternativeSelectedSuggestion",precondition:ht.and(Bi.Visible,de.textInputFocus,Bi.HasFocusedSuggestion),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Xw,group:"left",order:2,when:ht.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("insert")),title:T("accept.replace","Replace")},{menuId:Xw,group:"left",order:2,when:ht.and(Bi.HasInsertAndReplaceRange,Bi.InsertMode.isEqualTo("replace")),title:T("accept.insert","Insert")}]}));yr.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");qt(new Vd({id:"hideSuggestWidget",precondition:Bi.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:9,secondary:[1033]}}));qt(new Vd({id:"selectNextSuggestion",precondition:ht.and(Bi.Visible,ht.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));qt(new Vd({id:"selectNextPageSuggestion",precondition:ht.and(Bi.Visible,ht.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:12,secondary:[2060]}}));qt(new Vd({id:"selectLastSuggestion",precondition:ht.and(Bi.Visible,ht.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));qt(new Vd({id:"selectPrevSuggestion",precondition:ht.and(Bi.Visible,ht.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));qt(new Vd({id:"selectPrevPageSuggestion",precondition:ht.and(Bi.Visible,ht.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:11,secondary:[2059]}}));qt(new Vd({id:"selectFirstSuggestion",precondition:ht.and(Bi.Visible,ht.or(Bi.MultipleSuggestions,Bi.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));qt(new Vd({id:"focusSuggestion",precondition:ht.and(Bi.Visible,Bi.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));qt(new Vd({id:"focusAndAcceptSuggestion",precondition:ht.and(Bi.Visible,Bi.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));qt(new Vd({id:"toggleSuggestionDetails",precondition:ht.and(Bi.Visible,Bi.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Xw,group:"right",order:1,when:ht.and(Bi.DetailsVisible,Bi.CanResolve),title:T("detail.more","show less")},{menuId:Xw,group:"right",order:1,when:ht.and(Bi.DetailsVisible.toNegated(),Bi.CanResolve),title:T("detail.less","show more")}]}));qt(new Vd({id:"toggleExplainMode",precondition:Bi.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));qt(new Vd({id:"toggleSuggestionFocus",precondition:Bi.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:2570,mac:{primary:778}}}));qt(new Vd({id:"insertBestCompletion",precondition:ht.and(de.textInputFocus,ht.equals("config.editor.tabCompletion","on"),$5.AtEnd,Bi.Visible.toNegated(),vk.OtherSuggestions.toNegated(),Rc.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(xd(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:ip,primary:2}}));qt(new Vd({id:"insertNextSuggestion",precondition:ht.and(de.textInputFocus,ht.equals("config.editor.tabCompletion","on"),vk.OtherSuggestions,Bi.Visible.toNegated(),Rc.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:2}}));qt(new Vd({id:"insertPrevSuggestion",precondition:ht.and(de.textInputFocus,ht.equals("config.editor.tabCompletion","on"),vk.OtherSuggestions,Bi.Visible.toNegated(),Rc.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:ip,kbExpr:de.textInputFocus,primary:1026}}));Pt(class extends vn{constructor(){super({id:"editor.action.resetSuggestSize",label:T("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){var t;(t=bm.get(e))===null||t===void 0||t.resetWidgetSize()}});class bwr extends qe{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=as(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=bm.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,u)=>{var d;ks(_=>this.checkModelVersion(_));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=Re.lift(c),m=u.map((_,b)=>{const C=o4.fromSuggestion(o,h,g,_,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),E=f.augments(C);return{index:b,valid:E,prefixLength:C.text.length,suggestItem:_}}).filter(_=>_&&_.valid&&_.prefixLength>0),v=VZe(m,sg(_=>_.prefixLength,Yy));return v?v.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(on.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=o4.fromSuggestion(o,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!ywr(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,ks(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=bm.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 o4.fromSuggestion(e,r,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=bm.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=bm.get(this.editor);e==null||e.forceRenderingAbove()}}class o4{static fromSuggestion(e,t,i,r,o){let{insertText:s}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new nR().parse(s);c.children.length<100&&BU.adjustWhitespace(t,i,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(r,o);return new o4(J.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 PXe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new iR(this.range,this.insertText)}}function ywr(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var Cwr=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},fC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ohe;let rp=Ohe=class extends qe{static get(e){return e.getContribution(Ohe.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=uU("inlineCompletionModel",void 0),this.textModelVersionId=as(this,-1),this.cursorPosition=as(this,new Re(1,1)),this.suggestWidgetAdaptor=this._register(new bwr(this.editor,()=>{var h,f;return(f=(h=this.model.get())===null||h===void 0?void 0:h.selectedInlineCompletion.get())===null||f===void 0?void 0:f.toSingleTextEdit(void 0)},h=>this.updateObservables(h,vf.Other),h=>{ks(f=>{var g;this.updateObservables(f,vf.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=Ec(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(Ehe,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:dU(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 Jl(this.contextKeyService,this.model)),this._register(on.runAndSubscribe(e.onDidChangeModel,()=>ks(h=>{this.model.set(void 0,h),this.updateObservables(h,vf.Other);const f=e.getModel();if(f){const g=t.createInstance(The,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,Ec(e.onDidChangeConfiguration,()=>e.getOption(117).preview),Ec(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),Ec(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const u=h=>{var f;return h.isUndoing?vf.Undo:h.isRedoing?vf.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?vf.AcceptWord:vf.Other};this._register(e.onDidChangeModelContent(h=>ks(f=>this.updateObservables(f,u(h))))),this._register(e.onDidChangeCursorPosition(h=>ks(f=>{var g;this.updateObservables(f,vf.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>ks(h=>{var f;this.updateObservables(h,vf.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([lD.Tab.id,lD.DeleteLeft.id,lD.DeleteRight.id,$it,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&ks(g=>{var m;(m=this.model.get())===null||m===void 0||m.trigger(g)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||PS.dropDownVisible||ks(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(Zo(h=>{var f;const g=(f=this.model.read(h))===null||f===void 0?void 0:f.state.read(h);g!=null&&g.suggestItem?g.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(_i(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let d;this._register(Zo(h=>{const f=this.model.read(h),g=f==null?void 0:f.state.read(h);if(!f||!g||!g.inlineCompletion){d=void 0;return}if(g.inlineCompletion.semanticId!==d){d=g.inlineCompletion.semanticId;const m=f.textModel.getLineContent(g.ghostText.lineNumber);this.audioCueService.playAudioCue(Pr.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(m))})}})),this._register(new the(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=T("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),vu(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 Re(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 Re(i.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};rp.ID="editor.contrib.inlineCompletionsController";rp=Ohe=Cwr([fC(1,pi),fC(2,bi),fC(3,pr),fC(4,ga),fC(5,Ag),fC(6,wn),fC(7,Y6),fC(8,Go)],rp);var gE=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 oQ extends vn{constructor(){super({id:oQ.ID,label:T("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ht.and(de.writable,Jl.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var i;return gE(this,void 0,void 0,function*(){const r=rp.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.next()})}}oQ.ID=Hit;class sQ extends vn{constructor(){super({id:sQ.ID,label:T("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ht.and(de.writable,Jl.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var i;return gE(this,void 0,void 0,function*(){const r=rp.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.previous()})}}sQ.ID=Vit;class wwr extends vn{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:T("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:de.writable})}run(e,t){var i;return gE(this,void 0,void 0,function*(){const r=rp.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.triggerExplicitly()})}}class Swr extends vn{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:T("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:ht.and(de.writable,Jl.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:ht.and(de.writable,Jl.inlineSuggestionVisible)},menuOpts:[{menuId:ue.InlineSuggestionToolbar,title:T("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var i;return gE(this,void 0,void 0,function*(){const r=rp.get(t);yield(i=r==null?void 0:r.model.get())===null||i===void 0?void 0:i.acceptNextWord(r.editor)})}}class Ewr extends vn{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:T("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:ht.and(de.writable,Jl.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:ue.InlineSuggestionToolbar,title:T("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var i;return gE(this,void 0,void 0,function*(){const r=rp.get(t);yield(i=r==null?void 0:r.model.get())===null||i===void 0?void 0:i.acceptNextLine(r.editor)})}}class xwr extends vn{constructor(){super({id:$it,label:T("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Jl.inlineSuggestionVisible,menuOpts:[{menuId:ue.InlineSuggestionToolbar,title:T("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:ht.and(Jl.inlineSuggestionVisible,de.tabMovesFocus.toNegated(),Jl.inlineSuggestionHasIndentationLessThanTabSize,Bi.Visible.toNegated(),de.hoverFocused.toNegated())}})}run(e,t){var i;return gE(this,void 0,void 0,function*(){const r=rp.get(t);r&&((i=r.model.get())===null||i===void 0||i.accept(r.editor),r.editor.focus())})}}class aQ extends vn{constructor(){super({id:aQ.ID,label:T("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Jl.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return gE(this,void 0,void 0,function*(){const i=rp.get(t);ks(r=>{var o;(o=i==null?void 0:i.model.get())===null||o===void 0||o.stop(r)})})}}aQ.ID="editor.action.inlineSuggest.hide";class lQ extends up{constructor(){super({id:lQ.ID,title:T("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:ue.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ht.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return gE(this,void 0,void 0,function*(){const i=e.get(pr),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)})}}lQ.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Twr=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},QO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class kwr{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 Phe=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=rp.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 CV(1e3,this,J.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 CV(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new CV(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=rp.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new kwr(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new yt,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(PS,this._editor,!1,dU(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=Rt,o=r("div.hover-row.markdown-hover"),s=ft(o,r("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new x1({editor:this._editor},this._languageService,this._openerService)),l=c=>{i.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=T("inlineSuggestionFollows","Suggestion:"),d=i.add(a.render(new Kc().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};i.add(Zo(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 Ic(s)})),e.fragment.appendChild(o)}};Phe=Twr([QO(1,Es),QO(2,nf),QO(3,F1),QO(4,pi),QO(5,dp)],Phe);Hr(rp.ID,rp,3);Pt(wwr);Pt(oQ);Pt(sQ);Pt(Swr);Pt(Ewr);Pt(xwr);Pt(aQ);ys(lQ);fI.register(Phe);function Lh(n,e){let t=0;for(let i=0;i<n.length;i++)n.charAt(i)===" "?t+=e:t++;return t}function s4(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 Iwr=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},Lwr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function krt(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 v=n.getLineContent(t);if(!o.unIndentedLinePattern.test(v))break;t++}if(t>i-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=n.getOptions(),c=(v,_)=>(_=_||1,zp.shiftIndent(v,v.length+_,s,a,l)),u=(v,_)=>(_=_||1,zp.unshiftIndent(v,v.length+_,s,a,l)),d=[];let h;const f=n.getLineContent(t);let g=f;if(r!=null){h=r;const v=jo(f);g=h+f.substring(v.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(v.length)),f!==g&&d.push(Is.replaceMove(new kn(t,1,t,v.length+1),Cz(h,a,l)))}else h=jo(f);let m=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(m=c(m),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(m=c(m)),t++;for(let v=t;v<=i;v++){const _=n.getLineContent(v),b=jo(_),y=m+_.substring(b.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(y)&&(m=u(m),h=u(h)),b!==m&&d.push(Is.replaceMove(new kn(v,1,v,b.length+1),Cz(m,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(_))&&(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 cQ extends vn{constructor(){super({id:cQ.ID,label:T("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:de.writable})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),o=t.getSelection();if(!o)return;const s=new Nwr(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}cQ.ID="editor.action.indentationToSpaces";class uQ extends vn{constructor(){super({id:uQ.ID,label:T("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:de.writable})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),o=t.getSelection();if(!o)return;const s=new Owr(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}uQ.ID="editor.action.indentationToTabs";class eCe extends vn{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Ov),r=e.get(Ls),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?T("configuredTabSize","Configured Tab Size"):u===s.tabSize?T("defaultTabSize","Default Tab Size"):u===a.tabSize?T("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:T({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 dQ extends eCe{constructor(){super(!1,!1,{id:dQ.ID,label:T("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}dQ.ID="editor.action.indentUsingTabs";class hQ extends eCe{constructor(){super(!0,!1,{id:hQ.ID,label:T("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}hQ.ID="editor.action.indentUsingSpaces";class fQ extends eCe{constructor(){super(!0,!0,{id:fQ.ID,label:T("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}fQ.ID="editor.action.changeTabDisplaySize";class pQ extends vn{constructor(){super({id:pQ.ID,label:T("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Ls),r=t.getModel();if(!r)return;const o=i.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(o.insertSpaces,o.tabSize)}}pQ.ID="editor.action.detectIndentation";class Dwr extends vn{constructor(){super({id:"editor.action.reindentlines",label:T("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:de.writable})}run(e,t){const i=e.get(es),r=t.getModel();if(!r)return;const o=krt(r,i,1,r.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class Awr extends vn{constructor(){super({id:"editor.action.reindentselectedlines",label:T("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:de.writable})}run(e,t){const i=e.get(es),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=krt(r,i,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Rwr{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(J.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 H5=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new yt,this.callOnModel=new yt,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:f=>zp.shiftIndent(f,f.length+1,o,s,a),unshiftIndent:f=>zp.unshiftIndent(f,f.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 f=BM(r,i,i.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=jo(d),m=Lh(f,o),v=Lh(g,o);if(m!==v){const _=s4(m,o,a);l.push({range:new J(u,1,u,g.length+1),text:_}),d=_+d.substr(g.length)}else{const _=IJe(i,u,this._languageConfigurationService);if(_===0||_===8)return}}}const h=u;for(;u<e.endLineNumber;){if(!/\S/.test(i.getLineContent(u+1))){u++;continue}break}if(u!==e.endLineNumber){const g=BM(r,{tokenization:{getLineTokens:m=>i.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,v)=>i.getLanguageIdAtPosition(m,v)},getLineContent:m=>m===h?d:i.getLineContent(m)},i.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const m=Lh(g,o),v=Lh(jo(i.getLineContent(u+1)),o);if(m!==v){const _=m-v;for(let b=u+1;b<=e.endLineNumber;b++){const y=i.getLineContent(b),C=jo(y),x=Lh(C,o)+_,k=s4(x,o,a);k!==C&&l.push({range:new J(b,1,b,C.length+1),text:k})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new Rwr(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),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()}};H5.ID="editor.contrib.autoIndentOnPaste";H5=Iwr([Lwr(1,es)],H5);function Irt(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 J(s,1,s,l),u=n.getValueInRange(c),d=i?u.replace(/\t/ig,r):u.replace(o," ");e.addEditOperation(c,d)}}class Nwr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Irt(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class Owr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Irt(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}Hr(H5.ID,H5,2);Pt(cQ);Pt(uQ);Pt(dQ);Pt(hQ);Pt(fQ);Pt(pQ);Pt(Dwr);Pt(Awr);var $U=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 Lrt{constructor(e,t){this.range=e,this.direction=t}}class tCe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new tCe(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}resolve(e){return $U(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 $U(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){tl(r),this._isResolved=!1}})}}class W5{static create(e,t,i,r){return $U(this,void 0,void 0,function*(){const o=[],s=e.ordered(t).reverse().map(a=>i.map(l=>$U(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){tl(c)}})));if(yield Promise.all(s.flat()),r.isCancellationRequested||t.isDisposed())throw new aE;return new W5(i,o,t)})}constructor(e,t,i){this._disposables=new yt,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=W5._getRangeAtPosition(i,l);let d;u.getStartPosition().isBefore(l)?(d=J.fromPositions(u.getStartPosition(),l),c="after"):(d=J.fromPositions(l,u.getEndPosition()),c="before"),r.push(new tCe(a,new Lrt(d,c),s))}}this.items=r.sort((o,s)=>Re.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 J(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 J(i,l+1,i,c+1)}}function Pwr(n){return Jn.from({scheme:Qi.command,path:n.id,query:n.arguments&&encodeURIComponent(JSON.stringify(n.arguments))}).toString()}var a4=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 Mwr(n,e,t,i){var r;return a4(this,void 0,void 0,function*(){const o=n.get(vh),s=n.get(n_),a=n.get(ga),l=n.get(pi),c=n.get(Wa);if(yield i.item.resolve(or.None),!i.part.location)return;const u=i.part.location,d=[],h=new Set(Sc.getMenuItems(ue.EditorContext).map(g=>oL(g)?g.command.id:qY()));for(const g of Wu.all())h.has(g.desc.id)&&d.push(new Nd(g.desc.id,Wm.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>a4(this,void 0,void 0,function*(){const m=yield o.createModelReference(u.uri);try{const v=new QA(m.object.textEditorModel,J.getStartPosition(u.range)),_=i.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,v,_)}finally{m.dispose()}})));if(i.part.command){const{command:g}=i.part;d.push(new ic),d.push(new Nd(g.id,g.title,void 0,!0,()=>a4(this,void 0,void 0,function*(){var m;try{yield a.executeCommand(g.id,...(m=g.arguments)!==null&&m!==void 0?m:[])}catch(v){c.notify({severity:eY.Error,source:i.item.provider.displayName,message:v})}})))}const f=e.getOption(126);s.showContextMenu({domForShadowRoot:f&&(r=e.getDomNode())!==null&&r!==void 0?r:void 0,getAnchor:()=>{const g=pl(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function Drt(n,e,t,i){return a4(this,void 0,void 0,function*(){const o=yield n.get(vh).createModelReference(i.uri);yield t.invokeWithinContext(s=>a4(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(bi),c=dh.inPeekEditor.getValue(l),u=!a&&t.getOption(87)&&!c;return new sB({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new QA(o.object.textEditorModel,J.getStartPosition(i.range)),J.lift(i.range))})),o.dispose()})}var Fwr=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},p2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},A2=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())})},xV;class VU{constructor(){this._entries=new uE(50)}get(e){const t=VU._key(e);return this._entries.get(t)}set(e,t){const i=VU._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const Art=lr("IInlayHintsCache");Cr(Art,VU,1);class Mhe{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 Bwr{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let bk=xV=class{static get(e){var t;return(t=e.getContribution(xV.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 yt,this._sessionDisposables=new yt,this._decorationsMetadata=new Map,this._ruleFactory=new R6(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(_i(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const o=new Set,s=new Mo(()=>A2(this,void 0,void 0,function*(){const a=Date.now();r==null||r.dispose(!0),r=new $a;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=yield W5.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){Pi(c)}finally{r.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(_i(()=>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(Py.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 yt,t=e.add(new FY(this._editor)),i=new yt;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 $a;i.add(_i(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Bwr(s,o.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new J(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),i.add(_i(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(r=>A2(this,void 0,void 0,function*(){const o=this._getInlayHintLabelPart(r);if(o){const s=o.part;s.location?this._instaService.invokeFunction(Drt,r,this._editor,s.location):gle.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=>A2(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(or.None),yu(i.item.hint.textEdits))){const r=i.item.hint.textEdits.map(o=>Is.replace(J.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",r),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>A2(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(Mwr,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 kS&&(i==null?void 0:i.attachedData)instanceof Mhe)return i.attachedData}_invokeCommand(e,t){var i;return A2(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:eY.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 Lrt(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(J.compareRangesUsingStarts)){const s=t.validateRange(new J(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));r.length===0||!J.areIntersectingOrTouching(r[r.length-1],s)?r.push(s):r[r.length-1]=J.plusRange(r[r.length-1],s)}return r}_updateHintsDecorators(e,t){var i,r;const o=[],s=(m,v,_,b,y)=>{const C={content:_,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:b,attachedData:y};o.push({item:m,classNameRef:v,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,v)=>{const _=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(m,_,"",v?nv.Right:nv.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 v=typeof m.hint.label=="string"?[{label:m.hint.label}]:m.hint.label;for(let _=0;_<v.length;_++){const b=v[_],y=_===0,C=_===v.length-1,E={fontSize:`${l}px`,fontFamily:`var(${h}), ${zh.fontFamily}`,verticalAlign:d?"baseline":"middle",unicodeBidi:"isolate"};yu(m.hint.textEdits)&&(E.cursor="default"),this._fillInColors(E,m.hint),(b.command||b.location)&&((i=this._activeInlayHintPart)===null||i===void 0?void 0:i.part.item)===m&&this._activeInlayHintPart.part.index===_&&(E.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(E.color=Ys(Dnr),E.cursor="pointer")),u&&(y&&C?(E.padding=`1px ${Math.max(1,l/4)|0}px`,E.borderRadius=`${l/4|0}px`):y?(E.padding=`1px 0 1px ${Math.max(1,l/4)|0}px`,E.borderRadius=`${l/4|0}px 0 0 ${l/4|0}px`):C?(E.padding=`1px ${Math.max(1,l/4)|0}px 1px 0`,E.borderRadius=`0 ${l/4|0}px ${l/4|0}px 0`):E.padding="1px 0 1px 0"),s(m,this._ruleFactory.createClassNameRef(E),$wr(b.label),C&&!m.hint.paddingRight?nv.Right:nv.None,new Mhe(m,_))}if(m.hint.paddingRight&&a(m,!0),o.length>xV._MAX_DECORATORS)break}const f=[];for(const m of e)for(const{id:v}of(r=this._editor.getDecorationsInRange(m))!==null&&r!==void 0?r:[]){const _=this._decorationsMetadata.get(v);_&&(f.push(v),_.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const g=Ev.capture(this._editor);this._editor.changeDecorations(m=>{const v=m.deltaDecorations(f,o.map(_=>_.decoration));for(let _=0;_<v.length;_++){const b=o[_];this._decorationsMetadata.set(v[_],b)}}),g.restore(this._editor)}_fillInColors(e,t){t.kind===ZW.Parameter?(e.backgroundColor=Ys(Onr),e.color=Ys(Nnr)):t.kind===ZW.Type?(e.backgroundColor=Ys(Rnr),e.color=Ys(Anr)):(e.backgroundColor=Ys(Vy),e.color=Ys($y))}_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()}};bk.ID="editor.contrib.InlayHints";bk._MAX_DECORATORS=1500;bk=xV=Fwr([p2(1,wn),p2(2,Ag),p2(3,Art),p2(4,ga),p2(5,Wa),p2(6,pi)],bk);function $wr(n){const e=" ";return n.replace(/[ \t]/g,e)}yr.registerCommand("_executeInlayHintProvider",(n,...e)=>A2(void 0,void 0,void 0,function*(){const[t,i]=e;ko(Jn.isUri(t)),ko(J.isIRange(i));const{inlayHintsProvider:r}=n.get(wn),o=yield n.get(vh).createModelReference(t);try{const s=yield W5.create(r,o.object.textEditorModel,[J.lift(i)],or.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}}));var Vwr=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},XO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},W3e=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())})},Hwr=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 z3e extends CV{constructor(e,t,i,r){super(10,t,e.item.anchor.range,i,r,!0),this.part=e}}let Fhe=class extends TU{constructor(e,t,i,r,o,s){super(e,t,i,r,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!bk.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 kS&&r.attachedData instanceof Mhe?new z3e(r.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof z3e?new Ka(r=>W3e(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 Kc().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(u=c.item.hint.tooltip),u&&r.emitOne(new Y_(this,e.range,[u],!1,0)),yu(c.item.hint.textEdits)&&r.emitOne(new Y_(this,e.range,[new Kc().appendText(T("hint.dbl","Double-click to insert"))],!1,10001));let d;if(typeof c.part.tooltip=="string"?d=new Kc().appendText(c.part.tooltip):c.part.tooltip&&(d=c.part.tooltip),d&&r.emitOne(new Y_(this,e.range,[d],!1,1)),c.part.location||c.part.command){let v;const b=this._editor.getOption(77)==="altKey"?br?T("links.navigate.kb.meta.mac","cmd + click"):T("links.navigate.kb.meta","ctrl + click"):br?T("links.navigate.kb.alt.mac","option + click"):T("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?v=new Kc().appendText(T("hint.defAndCommand","Go to Definition ({0}), right click for more",b)):c.part.location?v=new Kc().appendText(T("hint.def","Go to Definition ({0})",b)):c.part.command&&(v=new Kc(`[${T("hint.cmd","Execute Command")}](${Pwr(c.part.command)} "${c.part.command.title}") (${b})`,{isTrusted:!0})),v&&r.emitOne(new Y_(this,e.range,[v],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,i);try{for(var f=!0,g=Hwr(h),m;m=yield g.next(),o=m.done,!o;f=!0){l=m.value,f=!1;const v=l;r.emitOne(v)}}catch(v){s={error:v}}finally{try{!f&&!o&&(a=g.return)&&(yield a.call(g))}finally{if(s)throw s.error}}})):Ka.EMPTY}_resolveInlayHintLabelPartHover(e,t){return W3e(this,void 0,void 0,function*(){if(!e.part.location)return Ka.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)?R1e(this._languageFeaturesService.hoverProvider,s,new Re(r.startLineNumber,r.startColumn),t).filter(a=>!HA(a.hover.contents)).map(a=>new Y_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Ka.EMPTY}finally{o.dispose()}})}};Fhe=Vwr([XO(1,Es),XO(2,nf),XO(3,pr),XO(4,vh),XO(5,wn)],Fhe);Hr(bk.ID,bk,1);fI.register(Fhe);class Wwr{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 kn(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new kn(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var zwr=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},Uwr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TV;let FS=TV=class{static get(e){return e.getContribution(TV.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 tnt(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Sl(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=J.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new kn(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new Wwr(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:TV.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=vS(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Pi)}).catch(Pi)):Promise.resolve(void 0)}};FS.ID="editor.contrib.inPlaceReplaceController";FS.DECORATION=Oi.register({description:"in-place-replace",className:"valueSetReplacement"});FS=TV=zwr([Uwr(1,o_)],FS);class jwr extends vn{constructor(){super({id:"editor.action.inPlaceReplace.up",label:T("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=FS.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class qwr extends vn{constructor(){super({id:"editor.action.inPlaceReplace.down",label:T("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=FS.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}Hr(FS.ID,FS,4);Pt(jwr);Pt(qwr);class Gwr extends vn{constructor(){super({id:"expandLineSelection",label:T("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:de.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,dc.expandLineSelection(r,r.getCursorStates())),r.revealPrimaryCursor(i.source,!0)}}Pt(Gwr);class Kwr{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=Ywr(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 Ywr(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=hv(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++]=Is.delete(new J(s,h,s,c))}return t}class Rrt{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 J(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?t.addEditOperation(new J(i.startLineNumber,1,i.startLineNumber,1),o+`
`):t.addEditOperation(new J(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=kn.createWithDirection(r,o,s,a,this._selectionDirection)}return i}}var Qwr=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},Xwr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Bhe=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 J(1,1,1,1),null):(t.addEditOperation(new J(u,1,u,1),e.getLineContent(d)),t.addEditOperation(new J(d,1,d,e.getLineMaxColumn(d)),null)),r=new kn(d,1,d,1)}else{let u,d;if(this._isMovingDown){u=r.endLineNumber+1,d=e.getLineContent(u),t.addEditOperation(new J(u-1,e.getLineMaxColumn(u-1),u,e.getLineMaxColumn(u)),null);let h=d;if(this.shouldAutoIndent(e,r)){const f=this.matchEnterRule(e,l,o,u,r.startLineNumber-1);if(f!==null){const m=jo(e.getLineContent(u)),v=f+Lh(m,o);h=s4(v,o,a)+this.trimStart(d)}else{c.getLineContent=v=>v===r.startLineNumber?e.getLineContent(u):e.getLineContent(v);const m=BM(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber,l,this._languageConfigurationService);if(m!==null){const v=jo(e.getLineContent(u)),_=Lh(m,o),b=Lh(v,o);_!==b&&(h=s4(_,o,a)+this.trimStart(d))}}t.addEditOperation(new J(r.startLineNumber,1,r.startLineNumber,1),h+`
`);const g=this.matchEnterRuleMovingDown(e,l,o,r.startLineNumber,u,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,g);else{c.getLineContent=v=>v===r.startLineNumber?h:v>=r.startLineNumber+1&&v<=r.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v);const m=BM(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber+1,l,this._languageConfigurationService);if(m!==null){const v=jo(e.getLineContent(r.startLineNumber)),_=Lh(m,o),b=Lh(v,o);if(_!==b){const y=_-b;this.getIndentEditsOfMovingBlock(e,t,r,o,a,y)}}}}else t.addEditOperation(new J(r.startLineNumber,1,r.startLineNumber,1),h+`
`)}else if(u=r.startLineNumber-1,d=e.getLineContent(u),t.addEditOperation(new J(u,1,u+1,1),null),t.addEditOperation(new J(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),`
`+d),this.shouldAutoIndent(e,r)){c.getLineContent=f=>f===u?e.getLineContent(r.startLineNumber):e.getLineContent(f);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 f=BM(this._autoIndent,c,e.getLanguageIdAtPosition(r.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=jo(e.getLineContent(r.startLineNumber)),m=Lh(f,o),v=Lh(g,o);if(m!==v){const _=m-v;this.getIndentEditsOfMovingBlock(e,t,r,o,a,_)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:r=>zp.shiftIndent(r,r.length+1,e,t,i),unshiftIndent:r=>zp.unshiftIndent(r,r.length+1,e,t,i)}}parseEnterResult(e,t,i,r,o){if(o){let s=o.indentation;o.indentAction===Qa.None||o.indentAction===Qa.Indent?s=o.indentation+o.appendText:o.indentAction===Qa.IndentOutdent?s=o.indentation:o.indentAction===Qa.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=jo(e.getLineContent(r));let c=jo(s);const u=IJe(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=Lh(c,i),h=Lh(l,i);return d-h}}return null}matchEnterRuleMovingDown(e,t,i,r,o,s){if(hv(s)>=0){const a=e.getLineMaxColumn(o),l=aD(this._autoIndent,e,new J(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(hv(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=aD(this._autoIndent,e,new J(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),hv(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=aD(this._autoIndent,e,new J(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=jo(l),d=Lh(c,r)+s,h=s4(d,r,o);h!==c&&(t.addEditOperation(new J(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}};Bhe=Qwr([Xwr(3,es)],Bhe);class Zw{static getCollator(){return Zw._COLLATOR||(Zw._COLLATOR=new Intl.Collator),Zw._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=Zwr(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=Nrt(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}}Zw._COLLATOR=null;function Nrt(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(Zw.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:i,endLineNumber:r,before:o,after:s}}function Zwr(n,e,t){const i=Nrt(n,e,t);return i?Is.replace(new J(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(`
`)):null}class Ort extends vn{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)=>J.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 Rrt(s.selection,this.down,s.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Jwr extends Ort{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:T("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class eSr extends Ort{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:T("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class tSr extends vn{constructor(){super({id:"editor.action.duplicateSelection",label:T("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:de.writable,menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({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 Rrt(a,!0));else{const l=new kn(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);r.push(new tor(l,s.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class Prt extends vn{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(es),r=[],o=t.getSelections()||[],s=t.getOption(12);for(const a of o)r.push(new Bhe(a,this.down,s,i));t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class nSr extends Prt{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:T("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class iSr extends Prt{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:T("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"2_line",title:T({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class Mrt extends vn{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const o of i)if(!Zw.canRun(t.getModel(),o,this.descending))return;const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=new Zw(i[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class rSr extends Mrt{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:T("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:de.writable})}}class oSr extends Mrt{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:T("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:de.writable})}}class sSr extends vn{constructor(){super({id:"editor.action.removeDuplicateLines",label:T("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:de.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 f=a.startLineNumber;f<=a.endLineNumber;f++){const g=i.getLineContent(f);l.has(g)||(c.push(g),l.add(g))}const u=new kn(a.startLineNumber,1,a.endLineNumber,i.getLineMaxColumn(a.endLineNumber)),d=a.startLineNumber-s,h=new kn(d,1,d+c.length-1,c[c.length-1].length);r.push(Is.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 gQ extends vn{constructor(){super({id:gQ.ID,label:T("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:gl(2089,2102),weight:100}})}run(e,t,i){let r=[];i.reason==="auto-save"&&(r=(t.getSelections()||[]).map(a=>new Re(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new Kwr(o,r);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}gQ.ID="editor.action.trimTrailingWhitespace";class aSr extends vn{constructor(){super({id:"editor.action.deleteLines",label:T("lines.delete","Delete Line"),alias:"Delete Line",precondition:de.writable,kbOpts:{kbExpr:de.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,f=1,g=r.getLineMaxColumn(h);h<r.getLineCount()?(h+=1,g=1):d>1&&(d-=1,f=r.getLineMaxColumn(d)),s.push(Is.replace(new kn(d,f,h,g),"")),a.push(new kn(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 lSr extends vn{constructor(){super({id:"editor.action.indentLines",label:T("lines.indent","Indent Line"),alias:"Indent Line",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Os.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class cSr extends vn{constructor(){super({id:"editor.action.outdentLines",label:T("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2140,weight:100}})}run(e,t){lD.Outdent.runEditorCommand(e,t,null)}}class uSr extends vn{constructor(){super({id:"editor.action.insertLineBefore",label:T("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Os.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class dSr extends vn{constructor(){super({id:"editor.action.insertLineAfter",label:T("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:de.writable,kbOpts:{kbExpr:de.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Os.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Frt extends vn{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];J.intersectRanges(u,d)===null?o.push(u):r[l+1]=J.plusRange(u,d)}o.push(r[r.length-1]);const s=this._getEndCursorState(i,o),a=o.map(l=>Is.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class hSr extends Frt{constructor(){super({id:"deleteAllLeft",label:T("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:de.writable,kbOpts:{kbExpr:de.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 kn(l,s.startColumn,l,s.startColumn)}else a=new kn(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(J.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 J(s,a,o.startLineNumber,1)}else return new J(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new J(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class fSr extends Frt{constructor(){super({id:"deleteAllRight",label:T("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:de.writable,kbOpts:{kbExpr:de.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 kn(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 J(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new J(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return r.sort(J.compareRangesUsingStarts),r}}class pSr extends vn{constructor(){super({id:"editor.action.joinLines",label:T("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:de.writable,kbOpts:{kbExpr:de.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(J.compareRangesUsingStarts);const o=[],s=i.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(r.equalsSelection(h)&&(r=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new kn(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new kn(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let h=0,f=o.length;h<f;h++){const g=o[h],m=g.startLineNumber,v=1;let _=0,b,y;const C=a.getLineLength(g.endLineNumber)-g.endColumn;if(g.isEmpty()||g.startLineNumber===g.endLineNumber){const k=g.getStartPosition();k.lineNumber<a.getLineCount()?(b=m+1,y=a.getLineMaxColumn(b)):(b=k.lineNumber,y=a.getLineMaxColumn(k.lineNumber))}else b=g.endLineNumber,y=a.getLineMaxColumn(b);let E=a.getLineContent(m);for(let k=m+1;k<=b;k++){const L=a.getLineContent(k),D=a.getLineFirstNonWhitespaceColumn(k);if(D>=1){let A=!0;E===""&&(A=!1),A&&(E.charAt(E.length-1)===" "||E.charAt(E.length-1)===" ")&&(A=!1,E=E.replace(/[\s\uFEFF\xA0]+$/g," "));const N=L.substr(D-1);E+=(A?" ":"")+N,A?_=N.length+1:_=N.length}else _=0}const x=new J(m,v,b,y);if(!x.isEmpty()){let k;g.isEmpty()?(l.push(Is.replace(x,E)),k=new kn(x.startLineNumber-d,E.length-_+1,m-d,E.length-_+1)):g.startLineNumber===g.endLineNumber?(l.push(Is.replace(x,E)),k=new kn(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Is.replace(x,E)),k=new kn(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,E.length-C)),J.intersectRanges(x,r)!==null?u=k:c.push(k)}d+=x.endLineNumber-x.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class gSr extends vn{constructor(){super({id:"editor.action.transpose",label:T("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:de.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 J(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new Hc(new kn(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new J(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new X0e(d,h,new kn(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class bN extends vn{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 J(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);s.push(Is.replace(u,this._modifyText(d,o)))}else{const l=r.getValueInRange(a);s.push(Is.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class mSr extends bN{constructor(){super({id:"editor.action.transformToUppercase",label:T("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:de.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class _Sr extends bN{constructor(){super({id:"editor.action.transformToLowercase",label:T("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:de.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class pI{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 z5 extends bN{constructor(){super({id:"editor.action.transformToTitlecase",label:T("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:de.writable})}_modifyText(e,t){const i=z5.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,r=>r.toLocaleUpperCase()):e}}z5.titleBoundary=new pI("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class Jw extends bN{constructor(){super({id:"editor.action.transformToSnakecase",label:T("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:de.writable})}_modifyText(e,t){const i=Jw.caseBoundary.get(),r=Jw.singleLetters.get();return!i||!r?e:e.replace(i,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}}Jw.caseBoundary=new pI("(\\p{Ll})(\\p{Lu})","gmu");Jw.singleLetters=new pI("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class U5 extends bN{constructor(){super({id:"editor.action.transformToCamelcase",label:T("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:de.writable})}_modifyText(e,t){const i=U5.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("")}}U5.wordBoundary=new pI("[_\\s-]","gm");class r1 extends bN{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:T("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:de.writable})}_modifyText(e,t){const i=r1.caseBoundary.get(),r=r1.singleLetters.get(),o=r1.underscoreBoundary.get();return!i||!r||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}}r1.caseBoundary=new pI("(\\p{Ll})(\\p{Lu})","gmu");r1.singleLetters=new pI("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");r1.underscoreBoundary=new pI("(\\S)(_)(\\S)","gm");Pt(Jwr);Pt(eSr);Pt(tSr);Pt(nSr);Pt(iSr);Pt(rSr);Pt(oSr);Pt(sSr);Pt(gQ);Pt(aSr);Pt(lSr);Pt(cSr);Pt(uSr);Pt(dSr);Pt(hSr);Pt(fSr);Pt(pSr);Pt(gSr);Pt(mSr);Pt(_Sr);Jw.caseBoundary.isSupported()&&Jw.singleLetters.isSupported()&&Pt(Jw);U5.wordBoundary.isSupported()&&Pt(U5);z5.titleBoundary.isSupported()&&Pt(z5);r1.isSupported()&&Pt(r1);var vSr=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},z7=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())})},kV;const Brt=new sn("LinkedEditingInputVisible",!1),bSr="linked-editing-decoration";let BS=kV=class extends qe{static get(e){return e.getContribution(kV.ID)}constructor(e,t,i,r,o){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new yt),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=Brt.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 yt),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(on.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new Um(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 Um(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 f=KT(c,u);d+=f,c=c.substr(f),u=u.substr(f);const g=ez(c,u);h-=g,c=c.substr(0,c.length-g),u=u.substr(0,u.length-g),(d!==h||u.length!==0)&&o.push({range:new J(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 $he(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=Sl(s=>$he(this,void 0,void 0,function*(){try{const a=new wu(!1),l=yield $rt(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,f=c.length;h<f;h++)if(J.containsPosition(c[h],t)){if(u=!0,h!==0){const g=c[h];c.splice(h,1),c.unshift(g)}break}if(!u){this.clearRanges();return}const d=c.map(h=>({range:h,options:kV.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(a){Av(a)||Pi(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};BS.ID="editor.contrib.linkedEditing";BS.DECORATION=Oi.register({description:"linked-editing",stickiness:0,className:bSr});BS=kV=vSr([z7(1,bi),z7(2,wn),z7(3,es),z7(4,Ag)],BS);class ySr extends vn{constructor(){super({id:"editor.action.linkedEditing",label:T("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:ht.and(de.writable,de.hasRenameProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(io),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Jn.isUri(r)&&Re.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))))},Pi):super.runCommand(e,t)}run(e,t){const i=BS.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const CSr=oc.bindToContribution(BS.get);qt(new CSr({id:"cancelLinkedEditingInput",precondition:Brt,handler:n=>n.clearRanges(),kbOpts:{kbExpr:de.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function $rt(n,e,t,i){const r=n.ordered(e);return SZe(r.map(o=>()=>$he(this,void 0,void 0,function*(){try{return yield o.provideLinkedEditingRanges(e,t,i)}catch(s){tl(s);return}})),o=>!!o&&yu(o==null?void 0:o.ranges))}fe("editor.linkedEditingBackground",{dark:je.fromHex("#f00").transparent(.3),light:je.fromHex("#f00").transparent(.3),hcDark:je.fromHex("#f00").transparent(.3),hcLight:je.white},T("editorLinkedEditingBackground","Background color when the editor auto renames on type."));L0("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(wn);return $rt(i,e,t,or.None)});Hr(BS.ID,BS,1);Pt(ySr);var Vrt=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 wSr=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 Vrt(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 HU{constructor(e){this._disposables=new yt;let t=[];for(const[i,r]of e){const o=i.links.map(s=>new wSr(s,r));t=HU._union(t,o),i0e(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(J.areIntersectingOrTouching(l.range,c.range)){r++;continue}J.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 Hrt(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])},tl));return Promise.all(r).then(()=>{const o=new HU(o0(i));return t.isCancellationRequested?(o.dispose(),new HU([])):o})}yr.registerCommand("_executeLinkProvider",(n,...e)=>Vrt(void 0,void 0,void 0,function*(){let[t,i]=e;ko(t instanceof Jn),typeof i!="number"&&(i=0);const{linkProvider:r}=n.get(wn),o=n.get(Ls).getModel(t);if(!o)return[];const s=yield Hrt(r,o,or.None);if(!s)return[];for(let l=0;l<Math.min(i,s.links.length);l++)yield s.links[l].resolve(or.None);const a=s.links.slice(0);return s.dispose(),a}));var SSr=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},U7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ESr=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())})},Vhe;let rR=Vhe=class extends qe{static get(e){return e.getContribution(Vhe.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 Mo(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new FY(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 ESr(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=Sl(t=>Hrt(this.providers,e,t));try{const t=new wu(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Pi(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(CD.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 CD(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(or.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===Qi.file&&o.startsWith(`${Qi.file}:`)){const a=Jn.parse(o);if(a.scheme===Qi.file){const l=Gv(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=Fsr(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(T("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):s==="missing"?this.notificationService.warn(T("missing.url","Failed to open this link because its target is missing.")):Pi(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()}};rR.ID="editor.linkDetector";rR=Vhe=SSr([U7(1,nf),U7(2,Wa),U7(3,wn),U7(4,Ag)],rR);const U3e={general:Oi.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Oi.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class CD{static decoration(e,t){return{range:e.range,options:CD._getOptions(e,t,!1)}}static _getOptions(e,t,i){const r=Object.assign({},i?U3e.active:U3e.general);return r.hoverMessage=xSr(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,CD._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,CD._getOptions(this.link,t,!1))}}function xSr(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?T("links.navigate.executeCmd","Execute command"):T("links.navigate.follow","Follow link"),r=e?br?T("links.navigate.kb.meta.mac","cmd + click"):T("links.navigate.kb.meta","ctrl + click"):br?T("links.navigate.kb.alt.mac","option + click"):T("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=T("tooltip.explanation","Execute command {0}",l)}}return new Kc("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${r})`)}else return new Kc().appendText(`${i} (${r})`)}class TSr extends vn{constructor(){super({id:"editor.action.openLink",label:T("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=rR.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)}}}Hr(rR.ID,rR,1);Pt(TSr);class Hhe extends qe{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})}))}}Hhe.ID="editor.contrib.longLinesHelper";Hr(Hhe.ID,Hhe,2);const j7=fe("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},T("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);fe("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},T("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);fe("editor.wordHighlightTextBackground",{light:j7,dark:j7,hcDark:j7,hcLight:j7},T("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 q7=fe("editor.wordHighlightBorder",{light:null,dark:null,hcDark:vs,hcLight:vs},T("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));fe("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:vs,hcLight:vs},T("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));fe("editor.wordHighlightTextBorder",{light:q7,dark:q7,hcDark:q7,hcLight:q7},T("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const kSr=fe("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},T("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ISr=fe("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},T("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),LSr=fe("editorOverviewRuler.wordHighlightTextForeground",{dark:TP,light:TP,hcDark:TP,hcLight:TP},T("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),DSr=Oi.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Ys(ISr),position:tp.Center},minimap:{color:Ys(WK),position:Uh.Inline}}),ASr=Oi.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Ys(LSr),position:tp.Center},minimap:{color:Ys(WK),position:Uh.Inline}}),RSr=Oi.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Ys(TP),position:tp.Center},minimap:{color:Ys(WK),position:Uh.Inline}}),NSr=Oi.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),OSr=Oi.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Ys(kSr),position:tp.Center},minimap:{color:Ys(WK),position:Uh.Inline}});function PSr(n){return n===k3.Write?DSr:n===k3.Text?ASr:OSr}function MSr(n){return n?NSr:RSr}t_((n,e)=>{const t=n.getColor(W0e);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var FSr=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},BSr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Whe;function mE(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?T("cursorAdded","Cursor added: {0}",i):T("cursorsAdded","Cursors added: {0}",i);wS(r)}}class $Sr extends vn{constructor(){super({id:"editor.action.insertCursorAbove",label:T("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({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,dc.addCursorUp(o,s,r)),o.revealTopMostCursor(i.source),mE(s,o.getCursorStates())}}class VSr extends vn{constructor(){super({id:"editor.action.insertCursorBelow",label:T("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({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,dc.addCursorDown(o,s,r)),o.revealBottomMostCursor(i.source),mE(s,o.getCursorStates())}}class HSr extends vn{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:T("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({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 kn(r,o,r,o))}e.endColumn>1&&i.push(new kn(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),mE(s,o.getCursorStates())}}class WSr extends vn{constructor(){super({id:"editor.action.addCursorsToBottom",label:T("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 kn(l,i[0].startColumn,l,i[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),mE(a,s.getCursorStates())}}class zSr extends vn{constructor(){super({id:"editor.action.addCursorsToTop",label:T("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 kn(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();r.length>0&&t.setSelections(r),mE(s,o.getCursorStates())}}class G7{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class j5{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new j5(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 kn(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,`
`);return new j5(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 G7(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 G7(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 kn(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 G7(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 G7(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 kn(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 yk extends qe{static get(e){return e.getContribution(yk.ID)}constructor(e){super(),this._sessionDispose=this._register(new yt),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=j5.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 kn(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(!Wrt(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 kn(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}yk.ID="editor.contrib.multiCursorController";class yN extends vn{run(e,t){const i=yk.get(t);if(!i)return;const r=t._getViewModel();if(r){const o=r.getCursorStates(),s=Md.get(t);if(s)this._run(i,s);else{const a=e.get(pi).createInstance(Md,t);this._run(i,a),a.dispose()}mE(o,r.getCursorStates())}}}class USr extends yN{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:T("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:2082,weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class jSr extends yN{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:T("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class qSr extends yN{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:T("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:gl(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class GSr extends yN{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:T("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 KSr extends yN{constructor(){super({id:"editor.action.selectHighlights",label:T("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:3114,weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"3_multi",title:T({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class YSr extends yN{constructor(){super({id:"editor.action.changeAll",label:T("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:ht.and(de.writable,de.editorTextFocus),kbOpts:{kbExpr:de.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class QSr{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(J.compareRangesUsingStarts)),this._cachedFindMatches}}let q5=Whe=class extends qe{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Mo(()=>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=Md.get(e);i&&this._register(i.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(Whe._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=yk.get(i);if(!o)return null;const s=Md.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(!Wrt(i.getModel(),u,h))return null}a=j5.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 QSr(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(J.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 f=J.compareRangesUsingStarts(h,r[c]);f<0?((r[c].isEmpty()||!J.areIntersecting(h,r[c]))&&o.push(h),l++):(f>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=o.map(l=>({range:l,options:MSr(s)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};q5.ID="editor.contrib.selectionHighlighter";q5=Whe=FSr([BSr(1,wn)],q5);function Wrt(n,e,t){const i=j3e(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=j3e(n,s,!t);if(i!==a)return!1}return!0}function j3e(n,e,t){const i=n.getValueInRange(e);return t?i.toLowerCase():i}class XSr extends vn{constructor(){super({id:"editor.action.focusNextCursor",label:T("mutlicursor.focusNextCursor","Focus Next Cursor"),description:{description:T("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),mE(o,r.getCursorStates()))}}class ZSr extends vn{constructor(){super({id:"editor.action.focusPreviousCursor",label:T("mutlicursor.focusPreviousCursor","Focus Previous Cursor"),description:{description:T("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),mE(o,r.getCursorStates()))}}Hr(yk.ID,yk,4);Hr(q5.ID,q5,1);Pt($Sr);Pt(VSr);Pt(HSr);Pt(USr);Pt(jSr);Pt(qSr);Pt(GSr);Pt(KSr);Pt(YSr);Pt(WSr);Pt(zSr);Pt(XSr);Pt(ZSr);var zrt=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 Ck={Visible:new sn("parameterHintsVisible",!1),MultipleSignatures:new sn("parameterHintsMultipleSignatures",!1)};function Urt(n,e,t,i,r){return zrt(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){tl(a)}})}yr.registerCommand("_executeSignatureHelpProvider",(n,...e)=>zrt(void 0,void 0,void 0,function*(){const[t,i,r]=e;ko(Jn.isUri(t)),ko(Re.isIPosition(i)),ko(typeof r=="string"||!r);const o=n.get(wn),s=yield n.get(vh).createModelReference(t);try{const a=yield Urt(o.signatureHelpProvider,s.object.textEditorModel,Re.lift(i),{triggerKind:Qb.Invoke,isRetrigger:!1,triggerCharacter:r},or.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var JSr=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())})},OC;(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})(OC||(OC={}));class mQ extends qe{constructor(e,t,i=mQ.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new De),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=OC.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Ac),this.triggerChars=new cz,this.retriggerChars=new cz,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Um(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=OC.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(Pi)}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 OC.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return JSr(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(eEr);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 OC.Pending(Sl(l=>Urt(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 OC.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=OC.Default),Pi(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:Qb.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Qb.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Qb.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}mQ.DEFAULT_DELAY=120;function eEr(n,e){switch(e.triggerKind){case Qb.Invoke:return e;case Qb.ContentChange:return n;case Qb.TriggerCharacter:default:return e}}var tEr=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},Nne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},zhe;const ff=Rt,nEr=La("parameter-hints-next",jt.chevronDown,T("parameterHintsNextIcon","Icon for show next parameter hint.")),iEr=La("parameter-hints-previous",jt.chevronUp,T("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let WU=zhe=class extends qe{constructor(e,t,i,r,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new yt),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new x1({editor:e},o,r)),this.keyVisible=Ck.Visible.bindTo(i),this.keyMultipleSignatures=Ck.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=ff(".editor-widget.parameter-hints-widget"),t=ft(e,ff(".phwrapper"));t.tabIndex=-1;const i=ft(t,ff(".controls")),r=ft(i,ff(".button"+ei.asCSSSelector(iEr))),o=ft(i,ff(".overloads")),s=ft(i,ff(".button"+ei.asCSSSelector(nEr)));this._register(at(r,"click",h=>{ji.stop(h),this.previous()})),this._register(at(s,"click",h=>{ji.stop(h),this.next()}));const a=ff(".body"),l=new P6(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=ft(a,ff(".signature")),u=ft(a,ff(".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(on.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.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=ft(this.domNodes.signature,ff(".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=ft(o,ff("span"));d.textContent=r.label}const c=r.parameters[l];if(c!=null&&c.documentation){const d=ff("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}ft(this.domNodes.docs,ff("p",{},d))}if(r.documentation!==void 0)if(typeof r.documentation=="string")ft(this.domNodes.docs,ff("p",{},r.documentation));else{const d=this.renderMarkdownDocs(r.documentation);ft(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&&(vu(T("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"&&Hx(t.documentation).length>0||t&&typeof t.documentation=="object"&&Hx(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Hx(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Hx(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),ft(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|^)${ep(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 zhe.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)}};WU.ID="editor.widget.parameterHintsWidget";WU=zhe=tEr([Nne(2,bi),Nne(3,nf),Nne(4,Es)],WU);fe("editorHoverWidget.highlightForeground",{dark:_m,light:_m,hcDark:_m,hcLight:_m},T("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var rEr=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},q3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Uhe;let wk=Uhe=class extends qe{static get(e){return e.getContribution(Uhe.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new mQ(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 cE(()=>this._register(t.createInstance(WU,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)}};wk.ID="editor.controller.parameterHints";wk=Uhe=rEr([q3e(1,pi),q3e(2,wn)],wk);class oEr extends vn{constructor(){super({id:"editor.action.triggerParameterHints",label:T("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:de.hasSignatureHelpProvider,kbOpts:{kbExpr:de.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=wk.get(t);i==null||i.trigger({triggerKind:Qb.Invoke})}}Hr(wk.ID,wk,2);Pt(oEr);const nCe=100+75,iCe=oc.bindToContribution(wk.get);qt(new iCe({id:"closeParameterHints",precondition:Ck.Visible,handler:n=>n.cancel(),kbOpts:{weight:nCe,kbExpr:de.focus,primary:9,secondary:[1033]}}));qt(new iCe({id:"showPrevParameterHint",precondition:ht.and(Ck.Visible,Ck.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:nCe,kbExpr:de.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));qt(new iCe({id:"showNextParameterHint",precondition:ht.and(Ck.Visible,Ck.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:nCe,kbExpr:de.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var sEr=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},One=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const _Q=new sn("renameInputVisible",!1,T("renameInputVisible","Whether the rename input widget is visible"));let jhe=class{constructor(e,t,i,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=r,this._disposables=new yt,this.allowEditorOverflow=!0,this._visibleContextKey=_Q.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",T("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(Ob),a=e.getColor($0e);this._domNode.style.backgroundColor=String((t=e.getColor(ca))!==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(tJe))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((r=e.getColor(eJe))!==null&&r!==void 0?r:"");const l=e.getColor(nJe);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=T({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 Re(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 yt;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)}};jhe=sEr([One(2,Vl),One(3,Go),One(4,bi)],jhe);var aEr=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},UE=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wT=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())})},qhe;class rCe{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 wT(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 J(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
`):void 0}:{range:J.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
`):void 0}})}provideRenameEdits(e,t){return wT(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,r){return wT(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(T("no result","No result.")),r);return s})}}function lEr(n,e,t,i){return wT(this,void 0,void 0,function*(){const r=new rCe(e,t,n),o=yield r.resolveRenameLocation(or.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:r.provideRenameEdits(i,or.None)})}let Sk=qhe=class{static get(e){return e.getContribution(qhe.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 yt,this._cts=new $a,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(jhe,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return wT(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new $a,!this.editor.hasModel())return;const i=this.editor.getPosition(),r=new rCe(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!r.hasProvider())return;const o=new IS(this.editor,5,void 0,this._cts.token);let s;try{const g=r.resolveRenameLocation(o.token);this._progressService.showWhile(g,250),s=yield g}catch(g){(e=jh.get(this.editor))===null||e===void 0||e.showMessage(g||T("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{o.dispose()}if(!s)return;if(s.rejectReason){(t=jh.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,i);return}if(o.token.isCancellationRequested)return;const a=new IS(this.editor,5,s.range,this._cts.token),l=this.editor.getSelection();let c=0,u=s.text.length;!J.isEmpty(l)&&!J.spansMultipleLines(l)&&J.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 f=LK(r.provideRenameEdits(h.newName,a.token),a.token).then(g=>wT(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(J.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:T("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:T("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(m=>{m.ariaSummary&&vu(T("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,m.ariaSummary))}).catch(m=>{this._notificationService.error(T("rename.failedApply","Rename failed to apply edits")),this._logService.error(m)})}}),g=>{this._notificationService.error(T("rename.failed","Rename failed to compute edits")),this._logService.error(g)}).finally(()=>{a.dispose()});return this._progressService.showWhile(f,250),f})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Sk.ID="editor.contrib.renameController";Sk=qhe=aEr([UE(1,pi),UE(2,Wa),UE(3,H6),UE(4,fE),UE(5,hp),UE(6,A0e),UE(7,wn)],Sk);class cEr extends vn{constructor(){super({id:"editor.action.rename",label:T("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ht.and(de.writable,de.hasRenameProvider),kbOpts:{kbExpr:de.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(io),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Jn.isUri(r)&&Re.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))))},Pi):super.runCommand(e,t)}run(e,t){const i=Sk.get(t);return i?i.run():Promise.resolve()}}Hr(Sk.ID,Sk,4);Pt(cEr);const oCe=oc.bindToContribution(Sk.get);qt(new oCe({id:"acceptRenameInput",precondition:_Q,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:ht.and(de.focus,ht.not("isComposing")),primary:3}}));qt(new oCe({id:"acceptRenameInputWithPreview",precondition:ht.and(_Q,ht.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:ht.and(de.focus,ht.not("isComposing")),primary:1024+3}}));qt(new oCe({id:"cancelRenameInput",precondition:_Q,handler:n=>n.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:de.focus,primary:9,secondary:[1033]}}));L0("_executeDocumentRenameProvider",function(n,e,t,...i){const[r]=i;ko(typeof r=="string");const{renameProvider:o}=n.get(wn);return lEr(o,e,t,r)});L0("_executePrepareRename",function(n,e,t){return wT(this,void 0,void 0,function*(){const{renameProvider:i}=n.get(wn),o=yield new rCe(e,t,i).resolveRenameLocation(or.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o})});Hs.as(Nv.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:T("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function uEr(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 dEr(n){const e=new Uint8Array(n.buffer,n.byteOffset,n.length*4);return pXe()||uEr(e),NK.wrap(e)}function jrt(n){const e=new Uint32Array(hEr(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 dEr(e)}function hEr(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 $S=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 vQ(n){return n&&!!n.data}function qrt(n){return n&&Array.isArray(n.edits)}class fEr{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Grt(n,e){return n.has(e)}function pEr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function Krt(n,e,t,i,r){return $S(this,void 0,void 0,function*(){const o=pEr(n,e),s=yield Promise.all(o.map(a=>$S(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||!vQ(l)&&!qrt(l))&&(l=null),new fEr(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 gEr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class mEr{constructor(e,t){this.provider=e,this.tokens=t}}function _Er(n,e){return n.has(e)}function Yrt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function sCe(n,e,t,i){return $S(this,void 0,void 0,function*(){const r=Yrt(n,e),o=yield Promise.all(r.map(s=>$S(this,void 0,void 0,function*(){let a;try{a=yield s.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){tl(l),a=null}return(!a||!vQ(a))&&(a=null),new mEr(s,a)})));for(const s of o)if(s.tokens)return s;return o.length>0?o[0]:null})}yr.registerCommand("_provideDocumentSemanticTokensLegend",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t]=e;ko(t instanceof Jn);const i=n.get(Ls).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(wn),o=gEr(r,i);return o?o[0].getLegend():n.get(ga).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));yr.registerCommand("_provideDocumentSemanticTokens",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t]=e;ko(t instanceof Jn);const i=n.get(Ls).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(wn);if(!Grt(r,i))return n.get(ga).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=yield Krt(r,i,null,null,or.None);if(!o)return;const{provider:s,tokens:a}=o;if(!a||!vQ(a))return;const l=jrt({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}));yr.registerCommand("_provideDocumentRangeSemanticTokensLegend",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t,i]=e;ko(t instanceof Jn);const r=n.get(Ls).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=n.get(wn),s=Yrt(o,r);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!i||!J.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 sCe(o,r,J.lift(i),or.None);if(a)return a.provider.getLegend()}));yr.registerCommand("_provideDocumentRangeSemanticTokens",(n,...e)=>$S(void 0,void 0,void 0,function*(){const[t,i]=e;ko(t instanceof Jn),ko(J.isIRange(i));const r=n.get(Ls).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=n.get(wn),s=yield sCe(o,r,J.lift(i),or.None);if(!(!s||!s.tokens))return jrt({id:0,type:"full",data:s.tokens.data})}));const aCe="editor.semanticHighlighting";function Ghe(n,e,t){var i;const r=(i=t.getValue(aCe,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))===null||i===void 0?void 0:i.enabled;return typeof r=="boolean"?r:e.getColorTheme().semanticHighlighting}var Qrt=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},ub=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},EC;let Khe=class extends qe{constructor(e,t,i,r,o,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new G5(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()];Ghe(u,i,r)?d||a(u):d&&l(u,d)}};this._register(t.onModelAdded(u=>{Ghe(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(aCe)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Khe=Qrt([ub(0,tY),ub(1,Ls),ub(2,Vl),ub(3,pr),ub(4,Ag),ub(5,wn)],Khe);let G5=EC=class extends qe{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:EC.REQUEST_MIN_DELAY,max:EC.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Mo(()=>this._fetchDocumentSemanticTokensNow(),EC.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=()=>{_o(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),_o(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Grt(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new $a,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=Krt(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 wu(!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&&(Av(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Pi(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(qrt(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 f=t.edits[h];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(EC._copy(l,u-g,c,d-g,g),d-=g),f.data&&(EC._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&EC._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(vQ(t)){this._currentDocumentResponse=new vEr(e,t.resultId,t.data);const a=_et(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()}};G5.REQUEST_MIN_DELAY=300;G5.REQUEST_MAX_DELAY=2e3;G5=EC=Qrt([ub(1,tY),ub(2,Vl),ub(3,Ag),ub(4,wn)],G5);class vEr{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}wY(Khe);var bEr=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},ZO=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let K5=class extends qe{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 Mo(()=>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(aCe)&&(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(!Ghe(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!_Er(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=Sl(s=>Promise.resolve(sCe(this._provider,e,t,s))),o=new wu(!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,_et(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};K5.ID="editor.contrib.viewportSemanticTokens";K5=bEr([ZO(1,tY),ZO(2,Vl),ZO(3,pr),ZO(4,Ag),ZO(5,wn)],K5);Hr(K5.ID,K5,1);class yEr{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(nw(d)&&ab(u))break;u=d}for(l+=1;c<o.length;c++){const d=o.charCodeAt(c);if(ab(d)&&nw(u))break;if(d===95||d===45)break;u=d}l<c&&e.push({range:new J(i.lineNumber,s+l,i.lineNumber,s+c)})}_addWordRanges(e,t,i){const r=t.getWordAtPosition(i);r&&e.push({range:new J(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 J(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var CEr=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},wEr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},bQ=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())})},Yhe;class lCe{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 lCe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let oR=Yhe=class{static get(e){return e.getContribution(Yhe.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 bQ(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield Zrt(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(112),or.None).then(o=>{var s;if(!(!yu(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!ka(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 lCe(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=>kn.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}})}};oR.ID="editor.contrib.smartSelectController";oR=Yhe=CEr([wEr(1,wn)],oR);class Xrt extends vn{constructor(e,t){super(t),this._forward=e}run(e,t){return bQ(this,void 0,void 0,function*(){const i=oR.get(t);i&&(yield i.run(this._forward))})}}class SEr extends Xrt{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:T("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"1_basic",title:T({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}yr.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class EEr extends Xrt{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:T("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:de.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:ue.MenubarSelectionMenu,group:"1_basic",title:T({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}Hr(oR.ID,oR,4);Pt(SEr);Pt(EEr);function Zrt(n,e,t,i,r){return bQ(this,void 0,void 0,function*(){const o=n.all(e).concat(new yEr(i.selectSubwords));o.length===1&&o.unshift(new bf);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(yu(c)&&c.length===t.length)for(let u=0;u<t.length;u++){a[u]||(a[u]=[]);for(const d of c[u])J.isIRange(d.range)&&J.containsPosition(d.range,t[u])&&a[u].push(J.lift(d.range))}},tl));return yield Promise.all(s),a.map(l=>{if(l.length===0)return[];l.sort((h,f)=>Re.isBefore(h.getStartPosition(),f.getStartPosition())?1:Re.isBefore(f.getStartPosition(),h.getStartPosition())||Re.isBefore(h.getEndPosition(),f.getEndPosition())?-1:Re.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||J.containsRange(h,u)&&!J.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 f=c[h-1],g=c[h];if(g.startLineNumber!==f.startLineNumber||g.endLineNumber!==f.endLineNumber){const m=new J(f.startLineNumber,e.getLineFirstNonWhitespaceColumn(f.startLineNumber),f.endLineNumber,e.getLineLastNonWhitespaceColumn(f.endLineNumber));m.containsRange(f)&&!m.equalsRange(f)&&g.containsRange(m)&&!g.equalsRange(m)&&d.push(m);const v=new J(f.startLineNumber,1,f.endLineNumber,e.getLineMaxColumn(f.endLineNumber));v.containsRange(f)&&!v.equalsRange(m)&&g.containsRange(v)&&!g.equalsRange(v)&&d.push(v)}d.push(g)}return d})})}yr.registerCommand("_executeSelectionRangeProvider",function(n,...e){return bQ(this,void 0,void 0,function*(){const[t,i]=e;ko(Jn.isUri(t));const r=n.get(wn).selectionRangeProvider,o=yield n.get(vh).createModelReference(t);try{return Zrt(r,o.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},or.None)}finally{o.dispose()}})});const xEr=Object.freeze({View:{value:T("view","View"),original:"View"},Help:{value:T("help","Help"),original:"Help"},Test:{value:T("test","Test"),original:"Test"},File:{value:T("file","File"),original:"File"},Preferences:{value:T("preferences","Preferences"),original:"Preferences"},Developer:{value:T({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer"),original:"Developer"}});var TEr=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 G3e{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&&ka(this.startLineNumbers,e.startLineNumbers)&&ka(this.endLineNumbers,e.endLineNumbers)}}const K3e=M1("stickyScrollViewLayer",{createHTML:n=>n}),Pne="data-sticky-line-index",Y3e="data-sticky-is-line",kEr="data-sticky-is-line-number",Q3e="data-sticky-is-folding-icon";class IEr extends qe{constructor(e){super(),this._editor=e,this._foldingIconStore=new yt,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 AS),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(),kc(this._lineNumbersDomNode),kc(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 TEr(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(at(this._lineNumbersDomNode,Xt.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(at(this._lineNumbersDomNode,Xt.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 Re(t,1)).lineNumber,a=o.getViewLineRenderingData(s),l=this._editor.getOption(67);let c;try{c=$h.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new dE(!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 oN(2e3),h=D6(u,d);let f;K3e?f=K3e.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(Pne,String(e)),g.setAttribute(Y3e,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const m=document.createElement("span");m.setAttribute(Pne,String(e)),m.setAttribute(kEr,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=r.contentLeft;m.style.width=`${v}px`;const _=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?_.innerText=t.toString():l.renderType===2&&(_.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),_.className="sticky-line-number-inner",_.style.lineHeight=`${this._lineHeight}px`,_.style.width=`${r.lineNumbersWidth}px`,_.style.paddingLeft=`${r.lineNumbersLeft}px`,m.appendChild(_);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(_),m.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new LEr(e,t,g,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 DEr(l,s,r.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(Q3e,""),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=q0e(t.characterMapping,e,0);return new Re(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,Pne);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Y3e)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Q3e)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class LEr{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 DEr{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=ei.asClassName(e?JY:ZY)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class l4{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class zU{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Jrt{constructor(e,t,i,r){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=r}}var yQ=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},Y5=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},X3e=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())})},c4;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(c4||(c4={}));var gw;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(gw||(gw={}));let Qhe=class extends qe{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 Um(300)),this._updateOperation=this._register(new yt);const o=new Xhe(i),s=new Jhe(this._editor,i),a=new Zhe(this._editor,t);switch(r){case c4.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(a);break;case c4.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case c4.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,i){return X3e(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(()=>X3e(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 gw.CANCELED:return this._updateOperation.clear(),null;case gw.VALID:return r.stickyModel}}return null})).catch(r=>(Pi(r),null))})}};Qhe=yQ([Y5(1,es),Y5(2,wn)],Qhe);class eot{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,gw.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const r=Sl(o=>this.createModelFromProvider(e,t,o));return{statusPromise:r.then(o=>this.isModelValid(o)?i.isCancellationRequested?gw.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,o),gw.VALID):this._invalid()).then(void 0,o=>(Pi(o),gw.CANCELED)),modelPromise:r}}isModelValid(e){return!0}isProviderValid(e){return!0}}let Xhe=class extends eot{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 Jrt(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(rr.first(e.children.values())instanceof Srt){const a=rr.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 f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,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 l4(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new l4(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 zU(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 l4(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new zU(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 vhe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};Xhe=yQ([Y5(0,wn)],Xhe);class tot extends eot{constructor(e){super(),this._foldingLimitReporter=new yrt(e)}createStickyModel(e,t,i,r){const o=this._fromFoldingRegions(r);return new Jrt(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],r=new zU(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 zU(new l4(e.getStartLineNumber(o),e.getEndLineNumber(o)+1),[],a);a.children.push(l),i.push(l)}return r}}let Zhe=class extends tot{constructor(e,t){super(e),this._languageConfigurationService=t}createModelFromProvider(e,t,i){return new U1e(e,this._languageConfigurationService,this._foldingLimitReporter).compute(i)}};Zhe=yQ([Y5(1,es)],Zhe);let Jhe=class extends tot{constructor(e,t){super(e),this._languageFeaturesService=t}isProviderValid(e){return _0.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,t,i){const r=_0.getFoldingRangeProviders(this._languageFeaturesService,e);return new q1e(e,r,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};Jhe=yQ([Y5(1,wn)],Jhe);var AEr=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},Z3e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},J3e=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 REr{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let efe=class extends qe{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new De),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 yt),this._updateSoon=this._register(new Mo(()=>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 Qhe(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 J3e(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new $a,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return J3e(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(y3(a,e.startLineNumber,(u,d)=>u-d)),c=this.updateIndex(y3(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,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,i.push(new REr(h,f-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}};efe=AEr([Z3e(1,wn),Z3e(2,es)],efe);var NEr=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},g2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Mne=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())})},tfe;let v0=tfe=class extends qe{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 yt,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 IEr(this._editor),this._stickyLineCandidateProvider=new efe(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new G3e([],[],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(at(l,Xt.CONTEXT_MENU,u=>Mne(this,void 0,void 0,function*(){this._onContextMenu(u)}))),this._stickyScrollFocusedContextKey=de.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=de.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(l0(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(at(l,Xt.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(tfe.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 yt,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(J.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new yt),t=this._register(new FY(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 J(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},r=this._stickyScrollWidget.getDomNode();this._register(Ba(r,Xt.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 Re(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 Re(c,1)}this._revealPosition(l)})),this._register(Ba(r,Xt.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(at(r,Xt.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 $a;e.add(_i(()=>u.dispose(!0)));let d;zY(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new Re(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(_i(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(_i(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(o=>Mne(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(Drt,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new Zp(e);this._contextMenuService.showContextMenu({menuId:ue.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;grt(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 Mne(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=_0.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 l4(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,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,m=f*e,v=this._editor.getBottomForLineNumber(d)-i,_=this._editor.getTopForLineNumber(h)-i,b=this._editor.getBottomForLineNumber(h)-i;if(g>_&&g<=b){o.push(d),s.push(h+1),r=b-m;break}else m>v&&m<=b&&(o.push(d),s.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=s,new G3e(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};v0.ID="store.contrib.stickyScrollController";v0=tfe=NEr([g2(1,n_),g2(2,wn),g2(3,pi),g2(4,es),g2(5,Ag),g2(6,bi)],v0);var OEr=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 PEr extends up{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:T("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:T({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:xEr.View,toggled:{condition:ht.equals("config.editor.stickyScroll.enabled",!0),title:T("stickyScroll","Sticky Scroll"),mnemonicTitle:T({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:ue.CommandPalette},{id:ue.MenubarAppearanceMenu,group:"4_editor",order:3},{id:ue.StickyScrollContext}]})}run(e){return OEr(this,void 0,void 0,function*(){const t=e.get(pr),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)})}}const CQ=100;class MEr extends Rv{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:T("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:T({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:ht.and(ht.has("config.editor.stickyScroll.enabled"),de.stickyScrollVisible),menu:[{id:ue.CommandPalette}]})}runEditorCommand(e,t){var i;(i=v0.get(t))===null||i===void 0||i.focus()}}class FEr extends Rv{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:T("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:CQ,primary:18}})}runEditorCommand(e,t){var i;(i=v0.get(t))===null||i===void 0||i.focusNext()}}class BEr extends Rv{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:T("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:CQ,primary:16}})}runEditorCommand(e,t){var i;(i=v0.get(t))===null||i===void 0||i.focusPrevious()}}class $Er extends Rv{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:T("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:CQ,primary:3}})}runEditorCommand(e,t){var i;(i=v0.get(t))===null||i===void 0||i.goToFocused()}}class VEr extends Rv{constructor(){super({id:"editor.action.selectEditor",title:{value:T("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:de.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:CQ,primary:9}})}runEditorCommand(e,t){var i;(i=v0.get(t))===null||i===void 0||i.selectEditor()}}Hr(v0.ID,v0,1);ys(PEr);ys(MEr);ys(BEr);ys(FEr);ys($Er);ys(VEr);var cCe=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},ST=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HEr=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())})},ux;class WEr{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 nfe=class extends CQi{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=rr.slice(i,r),s=rr.slice(i,0,r);let a=5;for(const l of rr.concat(o,s)){if(l.score===gv.Default)continue;const c=new J(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 WEr(c,u,(e=l.filterTextLow)!==null&&e!==void 0?e:l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(or.None)}return t}};nfe=cCe([ST(5,iQ)],nfe);let ife=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 HEr(this,void 0,void 0,function*(){if(i.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(kL.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(kL.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 J(t.lineNumber,1,t.lineNumber,t.column));if(!u&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,c))){const f=new H3e(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),d=this._lastResult}else{const f=yield Y1e(this._languageFeatureService.completionProvider,e,t,new F5(void 0,void 0,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},r);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const m=new jC(f.items,t.column,new H3e(h,0),j_.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);d=new nfe(e,t.lineNumber,c,m,f,this._suggestMemoryService)}return this._lastResult=d,d})}handleItemDidShow(e,t){t.completion.resolve(or.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const r=e.getValueInRange(J.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}}};ife=cCe([ST(1,wn),ST(2,H1),ST(3,iQ)],ife);let UU=ux=class{constructor(e,t,i,r){if(++ux._counter===1){const o=r.createInstance(ife,(s,a)=>{var l;return((l=i.listCodeEditors().find(u=>u.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});ux._disposable=t.inlineCompletionsProvider.register("*",o)}}dispose(){var e;--ux._counter===0&&((e=ux._disposable)===null||e===void 0||e.dispose(),ux._disposable=void 0)}};UU._counter=0;UU=ux=cCe([ST(1,wn),ST(2,io),ST(3,pi)],UU);Hr("suggest.inlineCompletionsProvider",UU,0);class zEr extends vn{constructor(){super({id:"editor.action.forceRetokenize",label:T("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 wu;i.tokenization.forceTokenization(i.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}Pt(zEr);class wQ extends up{constructor(){super({id:wQ.ID,title:{value:T({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=!LA.getTabFocusMode();LA.setTabFocusMode(t),vu(t?T("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):T("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}wQ.ID="editor.action.toggleTabFocusMode";ys(wQ);var UEr=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},jEr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let rfe=class extends qe{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=ft(e,Rt("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 cr(this.el,"click")),a=this._register(new cr(this.el,"keypress")),l=on.chain(a.event,d=>d.map(h=>new ls(h)).filter(h=>h.keyCode===3)),c=this._register(new cr(this.el,Qo.Tap)).event;this._register(Yo.addTarget(this.el));const u=on.any(s.event,l,c);this._register(u(d=>{this.enabled&&(ji.stop(d,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};rfe=UEr([jEr(3,nf)],rfe);var not=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},iot=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const qEr=26;let ofe=class extends qe{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(sfe))}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,qEr)}};ofe=not([iot(1,pi)],ofe);let sfe=class extends qe{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(x1,{}),this.element=Rt("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=Rt("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){kc(this.element)}show(e){kc(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ft(this.element,Rt("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Rt(`div${ei.asCSSSelector(e.icon)}`));const r=ft(this.element,Rt("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ft(this.element,Rt("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(rfe,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const o=ft(this.element,Rt("div.action-container"));this.actionBar=this._register(new wg(o)),this.actionBar.push(this._register(new Nd("banner.close","Close Banner",ei.asClassName(Ltt),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};sfe=not([iot(0,pi)],sfe);var uCe=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},wD=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},fu=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 GEr=La("extensions-warning-message",jt.warning,T("warningIcon","Icon shown with a warning message in the extensions editor."));let sR=class extends qe{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:T("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new wN};else if(o.ambiguousCharacterCount>=s)a={message:T("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new _E};else if(o.invisibleCharacterCount>=s)a={message:T("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new CN};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:GEr,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(ofe,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=KEr(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"?SYi:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new afe(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new YEr(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};sR.ID="editor.contrib.unicodeHighlighter";sR=uCe([wD(1,o_),wD(2,ket),wD(3,pi)],sR);function KEr(n,e){return{nonBasicASCII:e.nonBasicASCII===_f?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===_f?!n:e.includeComments,includeStrings:e.includeStrings===_f?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let afe=class extends qe{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 Mo(()=>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:jU.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!hye(t,e))return null;const i=t.getValueInRange(e.range);return{reason:rot(i,this._options),inComment:fye(t,e),inString:pye(t,e)}}};afe=uCe([wD(3,o_)],afe);class YEr extends qe{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 Mo(()=>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=k0e.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:jU.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 hye(t,e)?{reason:rot(i,this._options),inComment:fye(t,e),inString:pye(t,e)}:null}}let lfe=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(sR.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=Fne(d);let f;switch(c.reason.kind){case 0:{x6(c.reason.confusableWith)?f=T("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,Fne(c.reason.confusableWith.codePointAt(0))):f=T("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,Fne(c.reason.confusableWith.codePointAt(0)));break}case 1:f=T("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=T("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},m=T("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${cB.ID}?${encodeURIComponent(JSON.stringify(g))}`,_=new Kc("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m);o.push(new Y_(this,l.range,[_],!1,a++))}return o}renderHoverParts(e,t){return Oit(e,t,this._editor,this._languageService,this._openerService)}};lfe=uCe([wD(1,Es),wD(2,nf)],lfe);function cfe(n){return`U+${n.toString(16).padStart(4,"0")}`}function Fne(n){let e=`\`${cfe(n)}\``;return Xb.isInvisibleCharacter(n)||(e+=` "${`${QEr(n)}`}"`),e}function QEr(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function rot(n,e){return k0e.computeUnicodeHighlightReason(n,e)}class jU{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=Oi.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}}jU.instance=new jU;class XEr extends vn{constructor(){super({id:_E.ID,label:T("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,i){return fu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(pr);r&&this.runAction(r)})}runAction(e){return fu(this,void 0,void 0,function*(){yield e.updateValue(th.includeComments,!1,2)})}}class ZEr extends vn{constructor(){super({id:_E.ID,label:T("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,i){return fu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(pr);r&&this.runAction(r)})}runAction(e){return fu(this,void 0,void 0,function*(){yield e.updateValue(th.includeStrings,!1,2)})}}class _E extends vn{constructor(){super({id:_E.ID,label:T("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,i){return fu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(pr);r&&this.runAction(r)})}runAction(e){return fu(this,void 0,void 0,function*(){yield e.updateValue(th.ambiguousCharacters,!1,2)})}}_E.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class CN extends vn{constructor(){super({id:CN.ID,label:T("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,i){return fu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(pr);r&&this.runAction(r)})}runAction(e){return fu(this,void 0,void 0,function*(){yield e.updateValue(th.invisibleCharacters,!1,2)})}}CN.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class wN extends vn{constructor(){super({id:wN.ID,label:T("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=T("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,i){return fu(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(pr);r&&this.runAction(r)})}runAction(e){return fu(this,void 0,void 0,function*(){yield e.updateValue(th.nonBasicASCII,!1,2)})}}wN.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class cB extends vn{constructor(){super({id:cB.ID,label:T("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return fu(this,void 0,void 0,function*(){const{codePoint:r,reason:o,inString:s,inComment:a}=i,l=String.fromCodePoint(r),c=e.get(Ov),u=e.get(pr);function d(g){return Xb.isInvisibleCharacter(g)?T("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",cfe(g)):T("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${cfe(g)} "${l}"`)}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:T("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>fu(this,void 0,void 0,function*(){exr(u,[g])})});if(h.push({label:d(r),run:()=>JEr(u,[r])}),a){const g=new XEr;h.push({label:g.label,run:()=>fu(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(s){const g=new ZEr;h.push({label:g.label,run:()=>fu(this,void 0,void 0,function*(){return g.runAction(u)})})}if(o.kind===0){const g=new _E;h.push({label:g.label,run:()=>fu(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(o.kind===1){const g=new CN;h.push({label:g.label,run:()=>fu(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(o.kind===2){const g=new wN;h.push({label:g.label,run:()=>fu(this,void 0,void 0,function*(){return g.runAction(u)})})}else txr(o);const f=yield c.pick(h,{title:T("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}cB.ID="editor.action.unicodeHighlight.showExcludeOptions";function JEr(n,e){return fu(this,void 0,void 0,function*(){const t=n.getValue(th.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const r of e)i[String.fromCodePoint(r)]=!0;yield n.updateValue(th.allowedCharacters,i,2)})}function exr(n,e){var t;return fu(this,void 0,void 0,function*(){const i=(t=n.inspect(th.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(th.allowedLocales,r,2)})}function txr(n){throw new Error(`Unexpected value: ${n}`)}Pt(_E);Pt(CN);Pt(wN);Pt(cB);Hr(sR.ID,sR,1);fI.register(lfe);var nxr=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},e5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ixr=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 oot="ignoreUnusualLineTerminators";function rxr(n,e,t){n.setModelProperty(e.uri,oot,t)}function oxr(n,e){return n.getModelProperty(e.uri,oot)}let Q5=class extends qe{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 ixr(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||oxr(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:T("unusualLineTerminators.title","Unusual Line Terminators"),message:T("unusualLineTerminators.message","Detected unusual line terminators"),detail:T("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`.",Cg(e.uri)),primaryButton:T({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:T("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){rxr(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};Q5.ID="editor.contrib.unusualLineTerminatorsDetector";Q5=nxr([e5e(1,V6),e5e(2,io)],Q5);Hr(Q5.ID,Q5,1);var sxr=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},t5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ufe;const SQ=new sn("hasWordHighlights",!1);function sot(n,e,t,i){const r=n.ordered(e);return SZe(r.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,tl)),yu)}class aot{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=Sl(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new J(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 axr extends aot{constructor(e,t,i,r){super(e,t,i),this._providers=r}_compute(e,t,i,r){return sot(this._providers,e,t.getPosition(),r).then(o=>o||[])}}class lxr extends aot{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,r){return vS(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:k3.Text}))})}isValid(e,t,i){const r=t.isEmpty();return this._selectionIsEmpty!==r?!1:super.isValid(e,t,i)}}function cxr(n,e,t,i){return n.has(e)?new axr(e,t,i,n):new lxr(e,t,i)}L0("_executeDocumentHighlights",(n,e,t)=>{const i=n.get(wn);return sot(i.documentHighlightProvider,e,t,or.None)});class uxr{constructor(e,t,i,r){this.toUnhook=new yt,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=SQ.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(J.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);vu(`${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);vu(`${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=cxr(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())},Pi)}}_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:PSr(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 Ek=ufe=class extends qe{static get(e){return e.getContribution(ufe.ID)}constructor(e,t,i){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new uxr(e,i.documentHighlightProvider,()=>rr.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()}};Ek.ID="editor.contrib.wordHighlighter";Ek=ufe=sxr([t5e(1,bi),t5e(2,wn)],Ek);class lot extends vn{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Ek.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class dxr extends lot{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:T("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:SQ,kbOpts:{kbExpr:de.editorTextFocus,primary:65,weight:100}})}}class hxr extends lot{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:T("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:SQ,kbOpts:{kbExpr:de.editorTextFocus,primary:1089,weight:100}})}}class fxr extends vn{constructor(){super({id:"editor.action.wordHighlight.trigger",label:T("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:SQ.toNegated(),kbOpts:{kbExpr:de.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const r=Ek.get(t);r&&r.restoreViewState(!0)}}Hr(Ek.ID,Ek,0);Pt(dxr);Pt(hxr);Pt(fxr);class EQ extends oc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const r=bg(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new Re(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=>Nr.fromModelSelection(l))),a.length===1){const l=new Re(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new kn(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new kn(t.lineNumber,t.column,t.lineNumber,t.column)}}class vE extends EQ{_move(e,t,i,r){return to.moveWordLeft(e,t,i,r)}}class bE extends EQ{_move(e,t,i,r){return to.moveWordRight(e,t,i,r)}}class pxr extends vE{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class gxr extends vE{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class mxr extends vE{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ht.and(de.textInputFocus,(e=ht.and(A6,hY))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class _xr extends vE{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class vxr extends vE{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class bxr extends vE{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ht.and(de.textInputFocus,(e=ht.and(A6,hY))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class yxr extends vE{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Dv.wordSeparators.defaultValue),t,i,r)}}class Cxr extends vE{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Dv.wordSeparators.defaultValue),t,i,r)}}class wxr extends bE{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Sxr extends bE{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ht.and(de.textInputFocus,(e=ht.and(A6,hY))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Exr extends bE{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class xxr extends bE{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Txr extends bE{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ht.and(de.textInputFocus,(e=ht.and(A6,hY))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class kxr extends bE{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Ixr extends bE{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Dv.wordSeparators.defaultValue),t,i,r)}}class Lxr extends bE{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,r){return super._move(bg(Dv.wordSeparators.defaultValue),t,i,r)}}class xQ extends oc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const r=e.get(es);if(!t.hasModel())return;const o=bg(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(f=>{const g=this._delete({wordSeparators:o,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Hc(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class dCe extends xQ{_delete(e,t){const i=to.deleteWordLeft(e,t);return i||new J(1,1,1,1)}}class hCe extends xQ{_delete(e,t){const i=to.deleteWordRight(e,t);if(i)return i;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new J(r,o,r,o)}}class Dxr extends dCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:de.writable})}}class Axr extends dCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:de.writable})}}class Rxr extends dCe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Nxr extends hCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:de.writable})}}class Oxr extends hCe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:de.writable})}}class Pxr extends hCe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Mxr extends vn{constructor(){super({id:"deleteInsideWord",precondition:de.writable,label:T("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const r=bg(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=to.deleteInsideWord(r,o,l);return new Hc(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}qt(new pxr);qt(new gxr);qt(new mxr);qt(new _xr);qt(new vxr);qt(new bxr);qt(new wxr);qt(new Sxr);qt(new Exr);qt(new xxr);qt(new Txr);qt(new kxr);qt(new yxr);qt(new Cxr);qt(new Ixr);qt(new Lxr);qt(new Dxr);qt(new Axr);qt(new Rxr);qt(new Nxr);qt(new Oxr);qt(new Pxr);Pt(Mxr);class Fxr extends xQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=qK.deleteWordPartLeft(e);return i||new J(1,1,1,1)}}class Bxr extends xQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:de.writable,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=qK.deleteWordPartRight(e);if(i)return i;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new J(r,o,r,o)}}class cot extends EQ{_move(e,t,i,r){return qK.moveWordPartLeft(e,t,i)}}class $xr extends cot{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}yr.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Vxr extends cot{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}yr.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class uot extends EQ{_move(e,t,i,r){return qK.moveWordPartRight(e,t,i)}}class Hxr extends uot{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class Wxr extends uot{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:de.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}qt(new Fxr);qt(new Bxr);qt(new $xr);qt(new Vxr);qt(new Hxr);qt(new Wxr);class dfe extends qe{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=jh.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new Kc(T("editor.simple.readonly","Cannot edit in read-only input")):t=new Kc(T("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}dfe.ID="editor.contrib.readOnlyMessageController";Hr(dfe.ID,dfe,2);class hfe extends qe{constructor(e){super(),this.editor=e,this.widget=null,bv&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new TQ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}hfe.ID="editor.contrib.iPadShowKeyboard";class TQ extends qe{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(at(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(at(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return TQ.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}TQ.ID="editor.contrib.ShowKeyboardWidget";Hr(hfe.ID,hfe,3);var zxr=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},n5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ffe;let aR=ffe=class extends qe{static get(e){return e.getContribution(ffe.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(Ks.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 kQ(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};aR.ID="editor.contrib.inspectTokens";aR=ffe=zxr([n5e(1,fp),n5e(2,Es)],aR);class Uxr extends vn{constructor(){super({id:"editor.action.inspectTokens",label:uue.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=aR.get(t);i==null||i.launch()}}function jxr(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 qxr(n,e){const t=Ks.get(e);if(t)return t;const i=n.encodeLanguageId(e);return{getInitialState:()=>IA,tokenize:(r,o,s)=>N0e(e,s),tokenizeEncoded:(r,o,s)=>$K(i,s)}}class kQ extends qe{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=qxr(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 kQ._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)}Ic(this._domNode,Rt("h2.tm-token",void 0,jxr(s),Rt("span.tm-token-length",void 0,`${s.length} ${s.length===1?"char":"chars"}`))),ft(this._domNode,Rt("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(r<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(r<<1)+1]):null;ft(this._domNode,Rt("table.tm-metadata-table",void 0,Rt("tbody",void 0,Rt("tr",void 0,Rt("td.tm-metadata-key",void 0,"language"),Rt("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Rt("tr",void 0,Rt("td.tm-metadata-key",void 0,"token type"),Rt("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Rt("tr",void 0,Rt("td.tm-metadata-key",void 0,"font style"),Rt("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Rt("tr",void 0,Rt("td.tm-metadata-key",void 0,"foreground"),Rt("td.tm-metadata-value",void 0,`${a?je.Format.CSS.formatHex(a.foreground):"-?-"}`)),Rt("tr",void 0,Rt("td.tm-metadata-key",void 0,"background"),Rt("td.tm-metadata-value",void 0,`${a?je.Format.CSS.formatHex(a.background):"-?-"}`))))),ft(this._domNode,Rt("hr.tokens-inspect-separator")),i<t.tokens1.length&&ft(this._domNode,Rt("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=Ks.getColorMap(),i=Gc.getLanguageId(e),r=Gc.getTokenType(e),o=Gc.getFontStyle(e),s=Gc.getForeground(e),a=Gc.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]}}}kQ._ID="editor.contrib.inspectTokensWidget";Hr(aR.ID,aR,4);Pt(Uxr);var Gxr=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},i5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$P;let qU=$P=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Hs.as(sI.Quickaccess)}provide(e){const t=new yt;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($P.PREFIX.length));r&&r.prefix&&r.prefix!==$P.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==$P.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:T("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}};qU.PREFIX="?";qU=$P=Gxr([i5e(0,Ov),i5e(1,Go)],qU);Hs.as(sI.Quickaccess).registerQuickAccessProvider({ctor:qU,prefix:"",helpEntries:[{description:due.helpQuickAccessActionLabel}]});class dot{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const r=new yt;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 Ac);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 yt,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},a=int(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(gS(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}r.add(_i(()=>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&&wS(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return nnt(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:Ys(yJe),position:tp.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 IQ extends dot{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=T("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,qe.None}provideWithTextEditor(e,t,i){const r=e.editor,o=new yt;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(IQ.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=int(r);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(_i(()=>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)?T("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):T("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?T("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,o):T("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}}IQ.PREFIX=":";var Kxr=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},Yxr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let X5=class extends IQ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=on.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};X5=Kxr([Yxr(0,io)],X5);let fCe=class hot extends vn{constructor(){super({id:hot.ID,label:Vz.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ov).quickAccess.show(X5.PREFIX)}};fCe.ID="editor.action.gotoLine";Pt(fCe);Hs.as(sI.Quickaccess).registerQuickAccessProvider({ctor:X5,prefix:X5.PREFIX,helpEntries:[{description:Vz.gotoLineActionLabel,commandId:fCe.ID}]});const fot=[void 0,[]];function Bne(n,e,t=0,i=0){const r=e;return r.values&&r.values.length>1?Qxr(n,r.values,t,i):pot(n,e,t,i)}function Qxr(n,e,t,i){let r=0;const o=[];for(const s of e){const[a,l]=pot(n,s,t,i);if(typeof a!="number")return fot;r+=a,o.push(...l)}return[r,Xxr(o)]}function pot(n,e,t,i){const r=nk(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],W6(r)]:fot}function Xxr(n){const e=n.sort((r,o)=>r.start-o.start),t=[];let i;for(const r of e)!i||!Zxr(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 Zxr(n,e){return!(n.end<e.start||e.end<n.start)}function r5e(n){return n.startsWith('"')&&n.endsWith('"')}const got=" ";function pfe(n){typeof n!="string"&&(n="");const e=n.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:r}=o5e(n),o=t.indexOf(dv)>=0,s=r5e(n);let a;const l=n.split(got);if(l.length>1)for(const c of l){const u=r5e(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=o5e(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:r,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function o5e(n){let e;eu?e=n.replace(/\//g,dv):e=n.replace(/\\/g,dv);const t=aXi(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function s5e(n){return Array.isArray(n)?pfe(n.map(e=>e.original).join(got)):pfe(n.original)}var Jxr=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},a5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},JO=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())})},SD;let Jb=SD=class extends dot{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,T("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),qe.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):qe.None}doProvideWithoutEditorSymbols(e,t,i,r){const o=new yt;return this.provideLabelPick(i,T("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),JO(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 JO(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new DK,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),i.complete(!0))}));return t.add(_i(()=>i.complete(!1))),i.p})}doProvideWithEditorSymbols(e,t,i,r){var o;const s=e.editor,a=new yt;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=>JO(this,void 0,void 0,function*(){c==null||c.dispose(!0),i.busy=!1,c=new $a(r),i.busy=!0;try{const h=pfe(i.value.substr(SD.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(r.isCancellationRequested)return;if(f.length>0){if(i.items=f,d&&h.original.length===0){const g=dz(f,m=>!!(m.type!=="separator"&&m.range&&J.containsPosition(m.range.decoration,d)));g&&(i.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(i,T("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,T("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 JO(this,void 0,void 0,function*(){const a=yield e;if(r.isCancellationRequested)return[];const l=t.original.indexOf(SD.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=s5e(t.values[0]),d=s5e(t.values.slice(1))):u=t;let h;const f=(s=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||s===void 0?void 0:s.call(o);f&&(h=[{iconClass:f==="right"?ei.asClassName(jt.splitHorizontal):ei.asClassName(jt.splitVertical),tooltip:f==="right"?T("openToSide","Open to the Side"):T("openToBottom","Open to the Bottom")}]);const g=[];for(let _=0;_<a.length;_++){const b=a[_],y=oXi(b.name),C=`$(${XW.toIcon(b.kind).id}) ${y}`,E=C.length-y.length;let x=b.containerName;i!=null&&i.extraContainerLabel&&(x?x=`${i.extraContainerLabel} • ${x}`:x=i.extraContainerLabel);let k,L,D,A;if(t.original.length>c){let P=!1;if(u!==t&&([k,L]=Bne(C,Object.assign(Object.assign({},t),{values:void 0}),c,E),typeof k=="number"&&(P=!0)),typeof k!="number"&&([k,L]=Bne(C,u,c,E),typeof k!="number"))continue;if(!P&&d){if(x&&d.original.length>0&&([D,A]=Bne(x,d)),typeof D!="number")continue;typeof k=="number"&&(k+=D)}}const N=b.tags&&b.tags.indexOf(1)>=0;g.push({index:_,kind:b.kind,score:k,label:C,ariaLabel:tXi(b.name,b.kind),description:x,highlights:N?void 0:{label:L,description:A},range:{selection:J.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:N,buttons:h})}const m=g.sort((_,b)=>l?this.compareByKindAndScore(_,b):this.compareByScore(_,b));let v=[];if(l){let C=function(){b&&typeof _=="number"&&y>0&&(b.label=GT(Vne[_]||$ne,y))},_,b,y=0;for(const E of m)_!==E.kind?(C(),_=E.kind,y=1,b={type:"separator"},v.push(b)):y++,v.push(E);C()}else m.length>0&&(v=[{label:T("symbols","symbols ({0})",g.length),type:"separator"},...m]);return v})}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=Vne[e.kind]||$ne,r=Vne[t.kind]||$ne,o=i.localeCompare(r);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return JO(this,void 0,void 0,function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}};Jb.PREFIX="@";Jb.SCOPE_PREFIX=":";Jb.PREFIX_BY_CATEGORY=`${SD.PREFIX}${SD.SCOPE_PREFIX}`;Jb=SD=Jxr([a5e(0,wn),a5e(1,eQ)],Jb);const $ne=T("property","properties ({0})"),Vne={5:T("method","methods ({0})"),11:T("function","functions ({0})"),8:T("_constructor","constructors ({0})"),12:T("variable","variables ({0})"),4:T("class","classes ({0})"),22:T("struct","structs ({0})"),23:T("event","events ({0})"),24:T("operator","operators ({0})"),10:T("interface","interfaces ({0})"),2:T("namespace","namespaces ({0})"),3:T("package","packages ({0})"),25:T("typeParameter","type parameters ({0})"),1:T("modules","modules ({0})"),6:T("property","properties ({0})"),9:T("enum","enumerations ({0})"),21:T("enumMember","enumeration members ({0})"),14:T("string","strings ({0})"),0:T("file","files ({0})"),17:T("array","arrays ({0})"),15:T("number","numbers ({0})"),16:T("boolean","booleans ({0})"),18:T("object","objects ({0})"),19:T("key","keys ({0})"),7:T("field","fields ({0})"),13:T("constant","constants ({0})")};var eTr=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},Hne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let gfe=class extends Jb{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=on.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};gfe=eTr([Hne(0,io),Hne(1,wn),Hne(2,eQ)],gfe);class uB extends vn{constructor(){super({id:uB.ID,label:a5.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:de.hasDocumentSymbolProvider,kbOpts:{kbExpr:de.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ov).quickAccess.show(Jb.PREFIX,{itemActivation:R_.NONE})}}uB.ID="editor.action.quickOutline";Pt(uB);Hs.as(sI.Quickaccess).registerQuickAccessProvider({ctor:gfe,prefix:Jb.PREFIX,helpEntries:[{description:a5.quickOutlineActionLabel,prefix:Jb.PREFIX,commandId:uB.ID},{description:a5.quickOutlineByCategoryActionLabel,prefix:Jb.PREFIX_BY_CATEGORY}]});function Wne(n,e){return e&&(n.stack||n.stacktrace)?T("stackTrace.format","{0}: {1}",c5e(n),l5e(n.stack)||l5e(n.stacktrace)):c5e(n)}function l5e(n){return Array.isArray(n)?n.join(`
`):n}function c5e(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"?T("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||T("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function mot(n=null,e=!1){if(!n)return T("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=o0(n),i=mot(t[0],e);return t.length>1?T("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Rd(n))return n;if(n.detail){const t=n.detail;if(t.error)return Wne(t.error,e);if(t.exception)return Wne(t.exception,e)}return n.stack?Wne(n,e):n.message?n.message:T("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function tTr(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 u4{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 tTr(u4.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=u4.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=u4.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 nTr(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 eP=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())})},IL;(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"})(IL||(IL={}));function zne(n){const e=n;return Array.isArray(e.items)}function u5e(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class iTr extends qe{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var r;const o=new yt;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 Ac),l=()=>eP(this,void 0,void 0,function*(){const c=a.value=new yt;s==null||s.dispose(!0),e.busy=!1,s=new $a(t);const u=s.token,d=e.value.substr(this.prefix.length).trim(),h=this._getPicks(d,c,u,i),f=(m,v)=>{var _;let b,y;if(zne(m)?(b=m.items,y=m.active):b=m,b.length===0){if(v)return!1;(d.length>0||e.hideInput)&&(!((_=this.options)===null||_===void 0)&&_.noResultsPick)&&(S3(this.options.noResultsPick)?b=[this.options.noResultsPick(d)]:b=[this.options.noResultsPick])}return e.items=b,y&&(e.activeItems=[y]),!0},g=m=>eP(this,void 0,void 0,function*(){let v=!1,_=!1;yield Promise.all([(()=>eP(this,void 0,void 0,function*(){typeof m.mergeDelay=="number"&&(yield vS(m.mergeDelay),u.isCancellationRequested)||_||(v=f(m.picks,!0))}))(),(()=>eP(this,void 0,void 0,function*(){e.busy=!0;try{const b=yield m.additionalPicks;if(u.isCancellationRequested)return;let y,C;zne(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let E,x;if(zne(b)?(E=b.items,x=b.active):E=b,E.length>0||!v){let k;if(!C&&!x){const L=e.activeItems[0];L&&y.indexOf(L)!==-1&&(k=L)}f({items:[...y,...E],active:C||x||k})}}finally{u.isCancellationRequested||(e.busy=!1),_=!0}}))()])});if(h!==null)if(u5e(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const m=yield h;if(u.isCancellationRequested)return;u5e(m)?yield g(m):f(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})=>eP(this,void 0,void 0,function*(){var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),m=typeof g=="number"?g:yield g;if(t.isCancellationRequested)return;switch(m){case IL.NO_ACTION:break;case IL.CLOSE_PICKER:e.hide();break;case IL.REFRESH_PICKER:l();break;case IL.REMOVE_ITEM:{const v=e.items.indexOf(u);if(v!==-1){const _=e.items.slice(),b=_.splice(v,1),y=e.activeItems.filter(E=>E!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=_,y&&(e.activeItems=y),e.keepScrollPosition=C}break}}}}}))),o}}var _ot=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},Lx=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Une=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())})},dx,Ll;let xk=dx=class extends iTr{constructor(e,t,i,r,o,s){super(dx.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=r,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(Tk)),this.options=e}_getPicks(e,t,i,r){var o,s,a,l;return Une(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(i);if(i.isCancellationRequested)return[];const u=gS(()=>{const _=new u4;_.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[y.label+(y.commandAlias?` ${y.commandAlias}`:"")]})));const b=_.calculateScores(e,i);return nTr(b).filter(y=>y.score>dx.TFIDF_THRESHOLD).slice(0,dx.TFIDF_MAX_RESULTS)}),d=[];for(const _ of c){const b=(o=dx.WORD_FILTER(e,_.label))!==null&&o!==void 0?o:void 0,y=_.commandAlias&&(s=dx.WORD_FILTER(e,_.commandAlias))!==null&&s!==void 0?s:void 0;if(b||y)_.highlights={label:b,detail:this.options.showAlias?y:void 0},d.push(_);else if(e===_.commandId)d.push(_);else if(e.length>=3){const C=u();if(i.isCancellationRequested)return[];const E=C.find(x=>x.key===_.commandId);E&&(_.tfIdfScore=E.score,d.push(_))}}const h=new Map;for(const _ of d){const b=h.get(_.label);b?(_.description=_.commandId,b.description=b.commandId):h.set(_.label,_)}d.sort((_,b)=>{if(_.tfIdfScore&&b.tfIdfScore)return _.tfIdfScore===b.tfIdfScore?_.label.localeCompare(b.label):b.tfIdfScore-_.tfIdfScore;if(_.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const y=this.commandsHistory.peek(_.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 E=this.options.suggestedCommandIds.has(_.commandId),x=this.options.suggestedCommandIds.has(b.commandId);if(E&&x)return 0;if(E)return-1;if(x)return 1}return _.label.localeCompare(b.label)});const f=[];let g=!1,m=!0,v=!!this.options.suggestedCommandIds;for(let _=0;_<d.length;_++){const b=d[_];_===0&&this.commandsHistory.peek(b.commandId)&&(f.push({type:"separator",label:T("recentlyUsed","recently used")}),g=!0),m&&b.tfIdfScore!==void 0&&(f.push({type:"separator",label:T("suggested","similar commands")}),m=!1),v&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&(!((a=this.options.suggestedCommandIds)===null||a===void 0)&&a.has(b.commandId))&&(f.push({type:"separator",label:T("commonlyUsed","commonly used")}),g=!0,v=!1),g&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&!(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(b.commandId))&&(f.push({type:"separator",label:T("morecCommands","other commands")}),g=!1),f.push(this.toCommandPick(b,r))}return this.hasAdditionalCommandPicks(e,i)?{picks:f,additionalPicks:(()=>Une(this,void 0,void 0,function*(){var _;const b=yield this.getAdditionalCommandPicks(c,d,e,i);if(i.isCancellationRequested)return[];const y=b.map(C=>this.toCommandPick(C,r));return m&&((_=y[0])===null||_===void 0?void 0:_.type)!=="separator"&&y.unshift({type:"separator",label:T("suggested","similar commands")}),y}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),r=i?T("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:()=>Une(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){Av(a)||this.dialogService.error(T("canNotRun","Command '{0}' resulted in an error",e.label),mot(a))}})})}};xk.PREFIX=">";xk.TFIDF_THRESHOLD=.5;xk.TFIDF_MAX_RESULTS=5;xk.WORD_FILTER=Eye(d5,gur,Det);xk=dx=_ot([Lx(1,pi),Lx(2,Go),Lx(3,ga),Lx(4,dp),Lx(5,V6)],xk);let Tk=Ll=class extends qe{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=Ll.getConfiguredCommandHistoryLength(this.configurationService),Ll.cache&&Ll.cache.limit!==this.configuredCommandsHistoryLength&&(Ll.cache.limit=this.configuredCommandsHistoryLength,Ll.saveState(this.storageService)))}load(){const e=this.storageService.get(Ll.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=Ll.cache=new uE(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))}Ll.counter=this.storageService.getNumber(Ll.PREF_KEY_COUNTER,0,Ll.counter)}push(e){Ll.cache&&(Ll.cache.set(e,Ll.counter++),Ll.saveState(this.storageService))}peek(e){var t;return(t=Ll.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!Ll.cache)return;const t={usesLRU:!0,entries:[]};Ll.cache.forEach((i,r)=>t.entries.push({key:r,value:i})),e.store(Ll.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(Ll.PREF_KEY_COUNTER,Ll.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:Ll.DEFAULT_COMMANDS_HISTORY_LENGTH}};Tk.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Tk.PREF_KEY_CACHE="commandPalette.mru.cache";Tk.PREF_KEY_COUNTER="commandPalette.mru.counter";Tk.counter=1;Tk=Ll=_ot([Lx(0,r_),Lx(1,pr)],Tk);class rTr extends xk{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:Dye(i.label)||i.id});return t}}var oTr=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},m2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},d5e=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 Z5=class extends rTr{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 d5e(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return d5e(this,void 0,void 0,function*(){return[]})}};Z5=oTr([m2(0,pi),m2(1,io),m2(2,Go),m2(3,ga),m2(4,dp),m2(5,V6)],Z5);class dB extends vn{constructor(){super({id:dB.ID,label:Hz.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:de.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ov).quickAccess.show(Z5.PREFIX)}}dB.ID="editor.action.quickCommand";Pt(dB);Hs.as(sI.Quickaccess).registerQuickAccessProvider({ctor:Z5,prefix:Z5.PREFIX,helpEntries:[{description:Hz.quickCommandHelp,commandId:dB.ID}]});var sTr=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},_2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let mfe=class extends NS{constructor(e,t,i,r,o,s,a){super(!0,e,t,i,r,o,s,a)}};mfe=sTr([_2(1,bi),_2(2,io),_2(3,Wa),_2(4,pi),_2(5,r_),_2(6,pr)],mfe);Hr(NS.ID,mfe,4);class aTr extends vn{constructor(){super({id:"editor.action.toggleHighContrast",label:hue.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(fp),r=i.getColorTheme();pv(r.type)?(i.setTheme(this._originalThemeName||(RA(r.type)?vD:Ty)),this._originalThemeName=null):(i.setTheme(RA(r.type)?vT:bT),this._originalThemeName=r.themeName)}}Pt(aTr);const lTr=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:ant,Emitter:lnt,KeyCode:cnt,KeyMod:unt,MarkerSeverity:gnt,MarkerTag:mnt,Position:dnt,Range:hnt,Selection:fnt,SelectionDirection:pnt,Token:vnt,Uri:_nt,editor:bnt,languages:ynt},Symbol.toStringTag,{value:"Module"}));function cTr(){return new Worker("/editor.worker-94ffd778.js")}function uTr(){return new Worker("/json.worker-8dd963f3.js")}function dTr(){return new Worker("/css.worker-c3850ceb.js")}function hTr(){return new Worker("/html.worker-88b237e1.js")}function fTr(){return new Worker("/ts.worker-72c9fe54.js")}dxn({dsn:{}.VITE_SENTRY_URL,integrations:[new uxn],tracesSampleRate:1});fh.use(Pbt).init({resources:{en:{translation:YGi}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const pTr=F0t,gTr=new ubt({defaultOptions:{queries:{retry:1}}});self.MonacoEnvironment={getWorker(n,e){return e==="json"?new uTr:e==="css"||e==="scss"||e==="less"?new dTr:e==="html"||e==="handlebars"||e==="razor"?new hTr:e==="typescript"||e==="javascript"?new fTr:new cTr}};dK.config({monaco:lTr});dK.init().then();const mTr=document.getElementById("root");KQe(mTr).render(p(ce.StrictMode,{children:p(gbt,{client:gTr,children:p(j6e,{store:VH,children:p(QGi,{children:p(pTr,{children:p(hxn,{children:p(sCn,{})})})})})})}));const _fe=XGi();export{In as $,_l as A,_r as B,tn as C,Rf as D,QS as E,Va as F,Ja as G,St as H,En as I,un as J,ekr as K,sA as L,ean as M,BUt as N,Mi as O,et as P,LWe as Q,ce as R,ds as S,vTr as T,MR as U,wi as V,lyn as W,imt as X,X6 as Y,Fnt as Z,hs as _,Ii as a,$m as a$,us as a0,lkr as a1,oon as a2,qR as a3,zn as a4,Ai as a5,en as a6,bkr as a7,ki as a8,Wi as a9,oq as aA,Tr as aB,nr as aC,P9e as aD,cme as aE,sS as aF,OG as aG,rq as aH,M9e as aI,TTr as aJ,qTr as aK,qp as aL,Zqe as aM,hme as aN,HTr as aO,SR as aP,Dc as aQ,Lc as aR,el as aS,FTr as aT,O1 as aU,cp as aV,UR as aW,$R as aX,Gk as aY,Qve as aZ,Oc as a_,tbe as aa,tE as ab,TR as ac,Yu as ad,nt as ae,gt as af,dme as ag,Or as ah,RG as ai,LG as aj,NG as ak,Zi as al,t0 as am,pm as an,SH as ao,Sge as ap,oS as aq,$me as ar,Fo as as,ckr as at,Xqe as au,aGe as av,nGe as aw,tGe as ax,wF as ay,vi as az,ykr as b,Fs as b$,Xc as b0,i0 as b1,Nc as b2,zi as b3,I1 as b4,bG as b5,CG as b6,p1 as b7,B9e as b8,yG as b9,kg as bA,Dy as bB,eM as bC,rl as bD,Nk as bE,bR as bF,X8e as bG,Gi as bH,Eu as bI,lF as bJ,xu as bK,nbe as bL,iE as bM,A1 as bN,VEt as bO,il as bP,O_e as bQ,U$t as bR,KS as bS,sp as bT,gxe as bU,XS as bV,ukr as bW,uGe as bX,lGe as bY,P1 as bZ,Mh as b_,Q4 as ba,An as bb,he as bc,qy as bd,Hve as be,k1 as bf,Ca as bg,Qq as bh,YWe as bi,skr as bj,qi as bk,Bkr as bl,Ro as bm,uan as bn,EG as bo,xG as bp,Co as bq,R1 as br,kv as bs,G as bt,Nl as bu,zon as bv,V9e as bw,kTe as bx,kt as by,NF as bz,p as c,fme as c$,Ss as c0,vGe as c1,jqe as c2,Jon as c3,F9e as c4,dsn as c5,vv as c6,RGe as c7,Rbe as c8,Tge as c9,Wqe as cA,Yve as cB,frn as cC,qkr as cD,fdn as cE,mdn as cF,gdn as cG,wdn as cH,pdn as cI,Lrn as cJ,Gjt as cK,eon as cL,Urn as cM,qrn as cN,Hrn as cO,rkr as cP,Grn as cQ,QTr as cR,EWe as cS,kTr as cT,BTr as cU,Fae as cV,xTr as cW,c3t as cX,kkr as cY,Ikr as cZ,cGe as c_,jYe as ca,IG as cb,DG as cc,UBe as cd,Jve as ce,Z8e as cf,_kr as cg,TG as ch,Oh as ci,jrn as cj,Ze as ck,mo as cl,rs as cm,dd as cn,Bm as co,xc as cp,yTr as cq,Qon as cr,_sn as cs,Ly as ct,Aw as cu,Won as cv,oGe as cw,qo as cx,Uin as cy,Zve as cz,ef as d,Csn as d$,wTr as d0,sme as d1,Bsn as d2,wf as d3,Hsn as d4,u3 as d5,aon as d6,LTr as d7,Nkr as d8,Pkr as d9,QWe as dA,LT as dB,ikr as dC,mkr as dD,dKe as dE,rsn as dF,ssn as dG,gkr as dH,osn as dI,asn as dJ,csn as dK,Zon as dL,Crn as dM,DT as dN,ibe as dO,qsn as dP,Gsn as dQ,tw as dR,Lkr as dS,ran as dT,nan as dU,WT as dV,zsn as dW,Rkr as dX,Akr as dY,Dkr as dZ,Okr as d_,ian as da,vkr as db,NTr as dc,STr as dd,Hkr as de,Wkr as df,Tan as dg,Ukr as dh,jkr as di,hkr as dj,Hon as dk,dkr as dl,von as dm,con as dn,lon as dp,ame as dq,ume as dr,d3 as ds,kG as dt,Fm as du,ap as dv,Tg as dw,ITr as dx,kH as dy,IH as dz,Ae as e,zEt as e$,oan as e0,vfe as e1,qm as e2,ph as e3,WTr as e4,Gm as e5,KTr as e6,D$t as e7,Wsn as e8,Vsn as e9,yan as eA,mGe as eB,Vkr as eC,JTr as eD,DTr as eE,man as eF,ZS as eG,eE as eH,Ma as eI,JS as eJ,wc as eK,To as eL,cwt as eM,QCt as eN,gGe as eO,pg as eP,jk as eQ,san as eR,pan as eS,VAt as eT,nkr as eU,tkr as eV,yve as eW,wkr as eX,Asn as eY,Skr as eZ,nsn as e_,Msn as ea,Ykr as eb,Tkr as ec,Ekr as ed,ysn as ee,xkr as ef,son as eg,Gkr as eh,xan as ei,Ean as ej,lan as ek,jR as el,yGe as em,van as en,dan as eo,_an as ep,Oy as eq,Fkr as er,GTr as es,ZTr as et,Hm as eu,Mkr as ev,zkr as ew,$kr as ex,_Ge as ey,Can as ez,sc as f,ew as f0,urn as f1,lrn as f2,Pc as f3,vBe as f4,US as f5,pon as f6,MTr as f7,don as f8,Von as f9,ATr as fA,UEt as fB,TWe as fC,srn as fD,Ltn as fE,R$t as fF,RTr as fG,aln as fH,$s as fI,ml as fJ,pa as fK,Ht as fL,Wt as fM,t9e as fN,Bs as fO,go as fP,qD as fQ,nYi as fR,$Ct as fS,AT as fT,z$t as fU,YD as fV,Qkr as fW,l9 as fX,$on as fa,zR as fb,RT as fc,okr as fd,fkr as fe,uon as ff,arn as fg,A7e as fh,$Tr as fi,OTr as fj,PTr as fk,VTr as fl,Hqe as fm,gon as fn,Lm as fo,Dsn as fp,Lsn as fq,Uon as fr,pkr as fs,esn as ft,Ckr as fu,akr as fv,ETr as fw,$qe as fx,crn as fy,jve as fz,nE as g,At as h,Un as i,O as j,Lg as k,CTr as l,xo as m,nl as n,Po as o,w as p,xgt as q,$e as r,zt as s,op as t,ve as u,vQt as v,Xsn as w,Ti as x,bTr as y,si as z};